ChangeLog-2018-09-11   [plain text]


2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Polish AuthenticatorManager and rename it to AuthenticatorCoordinator
        https://bugs.webkit.org/show_bug.cgi?id=189277
        <rdar://problem/44115936>

        Reviewed by Chris Dumez.

        * DerivedSources.make:
        * SourcesCocoa.txt:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Removed.
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: Added.
        (WebKit::WebAuthenticatorCoordinatorProxy::WebAuthenticatorCoordinatorProxy):
        (WebKit::WebAuthenticatorCoordinatorProxy::~WebAuthenticatorCoordinatorProxy):
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable):
        (WebKit::WebAuthenticatorCoordinatorProxy::requestReply):
        (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h.
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::reattachToWebProcess):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Removed.
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: Added.
        (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator):
        (WebKit::WebAuthenticatorCoordinator::~WebAuthenticatorCoordinator):
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):
        (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: Renamed from Source/WebKit/WebProcess/CredentialManagement/WebCredentialsMessenger.h.
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in: Renamed from Source/WebKit/WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_cpuLimit):
        (WebKit::m_credentialsMessenger): Deleted.
        * WebProcess/WebPage/WebPage.h:

2018-09-10  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix ProcessSwap API tests after r235867.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::exitAcceleratedCompositingMode):
        Add null-check for drawing area.

2018-09-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Unable to change the value of select elements while preserving focus state
        https://bugs.webkit.org/show_bug.cgi?id=189475
        <rdar://problem/41125764>

        Reviewed by Tim Horton.

        With UITextInputMultiDocument support in WebKit (r226911), WKContentView may enter a state where the user is
        able to interact with web content, but focus state is being preserved on WKWebView. This prevents keyboard and
        input view dismissal from blurring the focused element (which, in turn, means that the value of certain form
        controls, such as select elements, cannot be changed). This can happen in the following scenario:

        1. Suppose we have a web view embedded inside of a view controller (let's call it `A`).
        2. Another view controller (let's call this one `B`) is modally presented over `A`.
        3. The web view is removed from `A`'s view hierarchy and reparented under `B`'s view.
        4. The user taps a form control in the web view, interacts with the keyboard, and taps the Done button.

        After step 2, WKContentView gets a call to `-_preserveFocusWithToken:destructively:`, which increments its focus
        retain count to 1. Thus, in step 3, resigning first responder using the Done button fails to blur the element.
        To fix this, we split the existing `_activeFocusedStateRetainCount` into two values: `_focusPreservationCount`,
        which is safe to reset and resets to 0 when changing the focused element, and `_activeFocusedStateRetainCount`,
        which always increments and decrements, and only does so when using `-_retainActiveFocusedState`.

        This also fixes a bug wherein `-_restoreFocusWithToken:` is implemented as returning `void` in WebKit, even
        though its declaration in UIKit returns a `BOOL`. UIKit currently calls this selector on WKContentView and
        stores the result within a `BOOL`; this results in the return value of `-_restoreFocusWithToken:` effectively
        becoming the last byte of the most recent value stored in `$rax` when exiting `-_restoreFocusWithToken:`. From
        debugging a release build of WebKit, this turns out to just be 0x0, becoming NO, which is correct given that
        WKContentView does not attempt to become first responder within `_restoreFocusWithToken:`.

        Tests:  FocusPreservationTests.PreserveAndRestoreFocus
                FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _incrementFocusPreservationCount]):
        (-[WKWebView _decrementFocusPreservationCount]):
        (-[WKWebView _resetFocusPreservationCount]):
        (-[WKWebView _isRetainingActiveFocusedState]):

        Active focus state is retained if either the focus preservation count or active focus state count is non-zero.
        Splitting this into two variables ensures that SPI clients of `-_retainActiveFocusedState` won't have active
        focus state reset from underneath them, and additionally prevents WKContentView from retaining active focus due
        to UITextInputMultiDocument protocol methods while the user is still interacting with it.

        * UIProcess/API/Cocoa/WKWebViewInternal.h:

        Move _activeFocusedStateRetainCount to the implementation of WKContentView; instead of directly manipulating the
        variable, add helper methods to increment, decrement, or reset the focus preservation count.

        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::isViewWindowActive):
        (WebKit::PageClientImpl::isViewFocused):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView resignFirstResponderForWebView]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

        Reset the focus preservation count.

        (-[WKContentView addFocusedFormControlOverlay]):
        (-[WKContentView removeFocusedFormControlOverlay]):

        Use `-_retainActiveFocusedState` instead of incrementing and decrementing the counter directly.

        (-[WKContentView _restoreFocusWithToken:]):
        (-[WKContentView _preserveFocusWithToken:destructively:]):

        Use `_incrementFocusPreservationCount` and `_decrementFocusPreservationCount` instead of manipulating counter
        variables directly.

2018-09-10  James Savage  <james.savage@apple.com>

        Long press on picture/link show menu obscured by keyboard.
        https://bugs.webkit.org/show_bug.cgi?id=189114.

        Reviewed by Megan Gardner.

        Use the visible bounds of the window, not the full bounds, when deciding if
        an element's rect takes up too much screen space to present from. This factors
        in occlusion of the window by the keyboard, bars, and other overlapping content.

        If possible, it would be nice to only account for overlapping geometry which a
        popover would avoid, but that information is not available. This approach will
        produce some false positives in favor of the "from touch" style, but those are
        still better than getting an unusably small action sheet.

        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant showImageSheet]): Use new helper method for style.
        (-[WKActionSheetAssistant showLinkSheet]): Ditto.
        (-[WKActionSheetAssistant _presentationStyleForPositionInfo:elementInfo:]):
        Query new delegate method to figure out the unobscured rect of the window. This
        information only exists on WKScrollView, so we have to ask for it. If this method
        is not implemented, fall back to the current approach of assuming the full window
        bounds are available.
        (presentationStyleForView): Deleted. Replaced by instance method.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView unoccludedWindowBoundsForActionSheetAssistant:]):
        Calculate the unoccluded rect using -[UIScrollView adjustedContentInset], which
        factors in client specified insets and system insets (such as the keyboard).

2018-09-10  Chris Dumez  <cdumez@apple.com>

        Regression(PSON): WebView is blank when navigating back cross-process on iOS
        https://bugs.webkit.org/show_bug.cgi?id=189481
        <rdar://problem/44315010>

        Reviewed by Tim Horton.

        When process swapping on navigation, the WebPageProxy would detach from the old WebProcess and destroy
        its RemoteLayerTreeDrawingAreaProxy. It would then create a new process and a new RemoteLayerTreeDrawingAreaProxy
        to listen for IPC from this new process. When navigating back to the original process, we would do the
        same in the opposite direction. However, the issue was that the old WebProcess's WebPage would not destroy its
        drawing area and some state would persist and cause issues. For example, the DrawingArea would send a
        CommitLayerTree IPC to the UIProcess and set m_waitingForBackingStoreSwap to true. It normally resets
        m_waitingForBackingStoreSwap to false when getting the DidUpdate IPC from the UIProcess. However, when the
        WebPage is detached from its WebPageProxy (i.e. suspended due to PSON), the UIProcess would not respond to
        IPC from the old WebProcess and m_waitingForBackingStoreSwap would never get reset.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
        Make sure we send the SetIsSuspended IPC to the WebProcess with false value when
        the SuspendedPageProxy gets destroyed, so that the WebProcess can update its
        m_isSuspended flag. Previous, it was set to true when constructing the
        SuspendedPageProxy but never reset to false.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::invalidateContentsAndRootView):
        (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
        Add null checks for the drawing area now that it can be null while suspended.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reinitializeWebPage):
        When a WebPage gets reattached to a WebPageProxy, this method is called. Since we now
        destroy the drawing area upon suspension (WebPage gets detached from WebPageProxy), we
        need to make sure we recreate the drawing area when reattaching.

        (WebKit::WebPage::setIsSuspended):
        Destroy the drawing area when the WebPage is suspended, meaning that this WebPage
        is no longer associated with a WebPageProxy.

2018-09-10  Daniel Bates  <dabates@apple.com>

        [iOS] Arrow keys do not dispatch DOM events to non-editable elements
        https://bugs.webkit.org/show_bug.cgi?id=189389

        Reviewed by Simon Fraser.

        Use WebCore::keyCodeForEvent() to retrieve the key code for a WebEvent instead of querying
        the key code from the WebEvent directly. The function WebCore::keyCodeForEvent() knows how
        to compute the key code for an event that represents an arrow key.

        * Shared/ios/WebIOSEventFactory.mm:
        (WebIOSEventFactory::createWebKeyboardEvent):

2018-09-10  Tim Horton  <timothy_horton@apple.com>

        Try to fix the iOSMac build
        https://bugs.webkit.org/show_bug.cgi?id=189469

        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextSetPluginLoadClientPolicy):
        (WKContextClearPluginClientPolicies):
        (WKContextCopyPlugInInfoForBundleIdentifier):
        (WKContextGetInfoForInstalledPlugIns):
        (WKContextResetHSTSHosts):
        (WKContextResetHSTSHostsAddedAfterDate):
        (WKContextRegisterSchemeForCustomProtocol):
        (WKContextUnregisterSchemeForCustomProtocol):
        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
        (-[WKObservablePageState initWithPage:]):
        (WKPageCreateObservableState):
        (WKPageGetObjectRegistry):
        (WKPageIsURLKnownHSTSHost):
        (WKPageLoadURLRequestReturningNavigation):
        (WKPageLoadFileReturningNavigation):
        (WKPageIsPlayingVideoInEnhancedFullscreen):
        (WKPageSetFullscreenDelegate):
        (WKPageGetFullscreenDelegate):
        * UIProcess/API/C/mac/WKProtectionSpaceNS.mm:
        (WKProtectionSpaceCopyNSURLProtectionSpace):

2018-09-10  Tim Horton  <timothy_horton@apple.com>

        Try to fix the build after r235850

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:

2018-09-10  Simon Fraser  <simon.fraser@apple.com>

        Before tracking Document leaks, clear all caches
        https://bugs.webkit.org/show_bug.cgi?id=189459

        Reviewed by Sam Weinig.
        
        It's not enough to clear the page and memory caches; font caches can reference Documents (for SVG fonts),
        so just call WebCore::releaseMemory(), which empties caches including the page and memory caches, and
        does the GC that we need to happen.

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleReleaseMemory):
        (WKBundleClearPageCache): Deleted.
        (WKBundleClearMemoryCache): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

2018-09-07  Matt Rajca  <mrajca@apple.com>

        Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)
        https://bugs.webkit.org/show_bug.cgi?id=189433
        <rdar://problem/44186498> Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)

        Reviewed by Eric Carlson.

        When playing an audio element, the media Touch Bar displays an active PIP button even though only
        videos are PIP-able. Pressing it does not do anything. The issue is canTogglePictureInPicture is set
        to YES unconditionally on the WebPlaybackControlsManager. It is then only updated based on whether or
        not external playback is enabled.

        This patch extends that logic such that the picture-in-picture Touch Bar button will be disabled for
        audio elements. Since PlaybackSessionModelMediaElement today does not know whether we're dealing
        with an audio or video element, a new isPictureInPictureSupported flag has been added (as well as
        the plumbing necessary to get the state over from the web process).

        An API test has been added that checks the value of the canTogglePictureInPicture and ensures it
        is NO when audio elements are playing. To expose it to tests, a _canTogglePictureInPictureForTesting
        property has been added to the WKTesting category.

        Source/WebKit:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _canTogglePictureInPictureForTesting]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionModelContext::pictureInPictureSupportedChanged):
        (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateMediaTouchBar):
        (WebKit::WebViewImpl::canTogglePictureInPictureForTesting):
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        * WebProcess/cocoa/PlaybackSessionManager.h:
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionInterfaceContext::isPictureInPictureSupportedChanged):
        (WebKit::PlaybackSessionManager::isPictureInPictureSupportedChanged):

2018-09-10  Fujii Hironori  <Hironori.Fujii@sony.com>

        [MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have similar conversions
        https://bugs.webkit.org/show_bug.cgi?id=189467

        Unreviewed build fix for WinCairo port.

        MSVC reports compilation errors if certain JSC header files are
        included after "using namespace" statements.

        * Sources.txt: Added @no-unify to InjectedBundleNodeHandle.cpp and InjectedBundleRangeHandle.cpp temporarily.
        * WebKit.xcodeproj/project.pbxproj: Compile InjectedBundleNodeHandle.cpp and InjectedBundleRangeHandle.cpp.

2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed, rolling out r235839.

        Which breaks all Xcode based ports

        Reverted changeset:

        "[MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator
        -': 7 overloads have similar conversions"
        https://bugs.webkit.org/show_bug.cgi?id=189467
        https://trac.webkit.org/changeset/235839

2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        Add specialized template declarations of HashTraits and DefaultHash to detect misuse
        https://bugs.webkit.org/show_bug.cgi?id=189044

        Reviewed by Yusuke Suzuki.

        * WebProcess/WebPage/WebPage.h: Added #include <WebCore/IntPointHash.h> to instantiate HashMap<std::pair<IntSize, double>, IntPoint>.

2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        [MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have similar conversions
        https://bugs.webkit.org/show_bug.cgi?id=189467

        Unreviewed build fix for WinCairo port.

        MSVC reports compilation errors if certain JSC header files are
        included after "using namespace" statements.

        * Sources.txt: Added @no-unify to InjectedBundleNodeHandle.cpp and InjectedBundleRangeHandle.cpp temporarily.

2018-09-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r235153): [iOS] Can't move selection start grabber when selecting text in a subframe
        https://bugs.webkit.org/show_bug.cgi?id=189454
        <rdar://problem/44265956>

        Reviewed by Darin Adler.

        rangeForPointInRootViewCoordinates is responsible for taking a user gesture location representing the location
        of the selection start or end handle (given in root view coordinates) and computing a Range representing an
        updated selection. r235153 introduced a mechanism here to clamp the y offset of this user gesture location to
        a max or min value determined by computing the bounds of the other selection handle, which more closely matches
        platform behavior elsewhere in iOS.

        However, this clamping logic would cause the user gesture location in root view coordinates to incorrectly clamp
        in cases where the user selects text within an iframe that is offset from the top of the main document, since it
        compares content coordinates (i.e. the caret bounds) against root view coordinates (i.e. the gesture location).
        This makes it impossible to use selection handles to select text in some iframes.

        We fix this by first converting the gesture location to document coordinates, and then clamping.

        Test: editing/selection/ios/selection-handle-clamping-in-iframe.html

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeForPointInRootViewCoordinates):

        Also reuse `selectionStart` and `selectionEnd` when computing absolute caret bounds, instead of creating new
        VisiblePositions.

2018-09-08  Tim Horton  <timothy_horton@apple.com>

        Unify most of the WebKit Objective-C API sources
        https://bugs.webkit.org/show_bug.cgi?id=189447

        Reviewed by Andy Estes.

        Unify and fix errors.

        * Shared/API/Cocoa/_WKFrameHandle.mm:
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
        * UIProcess/API/Cocoa/WKBackForwardList.mm:
        * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
        * UIProcess/API/Cocoa/WKConnection.mm:
        * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
        * UIProcess/API/Cocoa/WKNavigationData.mm:
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        * UIProcess/API/Cocoa/_WKAttachment.mm:
        * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        * UIProcess/API/mac/WKView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:

2018-09-07  Tim Horton  <timothy_horton@apple.com>

        Try to fix the build

        * Shared/mac/SandboxExtensionMac.mm:

2018-09-07  Tim Horton  <timothy_horton@apple.com>

        Unify most of the WebKit C API sources
        https://bugs.webkit.org/show_bug.cgi?id=189400

        Reviewed by Alex Christensen.

        Unify and fix errors (mostly API:String vs. WTF::String mismatches).

        * Shared/APIWebArchiveResource.h:
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::constructedPathPrefix):
        (API::constructedPathFilter):
        (API::constructedPath):
        (API::encodeContentRuleListMetaData):
        (API::decodeContentRuleListMetaData):
        (API::openAndMapContentRuleList):
        (API::writeDataToFile):
        (API::compiledToFile):
        (API::createExtension):
        (API::ContentRuleListStore::lookupContentRuleList):
        (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
        (API::ContentRuleListStore::compileContentRuleList):
        (API::ContentRuleListStore::getContentRuleListSource):
        * UIProcess/API/APINavigation.cpp:
        (API::Navigation::loggingString const):
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::defaultMediaCacheDirectory):
        (API::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::defaultApplicationCacheDirectory):
        (API::WebsiteDataStore::defaultCacheStorageDirectory):
        (API::WebsiteDataStore::defaultNetworkCacheDirectory):
        (API::WebsiteDataStore::defaultMediaCacheDirectory):
        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (API::WebsiteDataStore::defaultLocalStorageDirectory):
        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (API::WebsiteDataStore::defaultJavaScriptConfigurationDirectory):
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation):
        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
        (API::WebsiteDataStore::defaultApplicationCacheDirectory):
        (API::WebsiteDataStore::defaultNetworkCacheDirectory):
        (API::WebsiteDataStore::defaultCacheStorageDirectory):
        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (API::WebsiteDataStore::defaultLocalStorageDirectory):
        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * WebKit.xcodeproj/project.pbxproj:

2018-09-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Stop sending request with credential if no authorization requested.
        https://bugs.webkit.org/show_bug.cgi?id=189057

        Reviewed by Alex Christensen.

        When 401 response returns without 'www-authenticate' header, suppress another request with credential.
        Same fix for proxy authentication.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):

2018-09-07  Brent Fulgham  <bfulgham@apple.com>

        Allow WebContent access to AVCSupported IOKit property in sandbox
        https://bugs.webkit.org/show_bug.cgi?id=189429
        <rdar://problem/43612229>

        Reviewed by Eric Carlson.

        Allow access to the IOKit properties AVCSupported and HEVCSupported to allow the WebContent process
        to check for efficient video codecs.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2018-09-07  Frederic Wang  <fwang@igalia.com>

        [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
        https://bugs.webkit.org/show_bug.cgi?id=182230

        Reviewed by Simon Fraser.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        (webkit_dom_document_get_scrolling_element): Use the new name.

2018-09-07  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Remove unused XPC service from sandbox
        https://bugs.webkit.org/show_bug.cgi?id=189406
        <rdar://problem/43015423>

        Reviewed by Youenn Fablet.

        The API surface exposed by "com.apple.systemstats.analysis" is no longer used by the
        WebContent process. Since there is no need for this sandbox opening, we should remove it.

        * WebProcess/com.apple.WebProcess.sb.in:

2018-09-07  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed syntax fix after r235781

        Don't use hash-quote syntax for these non-regex inputs.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2018-09-07  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Move default mach-lookup deny to after common.sb is imported
        https://bugs.webkit.org/show_bug.cgi?id=189385
        <rdar://problem/43624193>

        Reviewed by Eric Carlson.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Move the 'deny mach-lookup' call later in the file.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Ditto.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Ditto.

2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Refactor WebCore::EditAction to be an 8-bit enum class
        https://bugs.webkit.org/show_bug.cgi?id=189383

        Reviewed by Dan Bernstein.

        * UIProcess/WebEditCommandProxy.cpp:
        (WebKit::WebEditCommandProxy::nameForEditAction):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::changeFontAttributes):
        (WebKit::WebPage::changeFont):

2018-09-06  Megan Gardner  <megan_gardner@apple.com>

        Add Support for Conic Gradients
        https://bugs.webkit.org/show_bug.cgi?id=189329
        <rdar://problem/21444701>

        Reviewed by Simon Fraser.

        Connect up web preferences to allow conic gradients to be turned on in the
        experimental features menu.

        * Shared/WebPreferences.yaml:

2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through)
        https://bugs.webkit.org/show_bug.cgi?id=189356
        <rdar://problem/44185674>

        Reviewed by Tim Horton.

        Implement -[WKWebView changeAttributes:], so that WKWebView can carry out more types of font style changes via
        NSFontPanel. This patch makes it possible to (1) change text shadow, (2) add or remove strike-through, and (3)
        add or remove underlines from selected text using the font panel.

        This builds on the mechanisms introduced in r235748 to compute font attribute changes in the UI process and
        propagate this information to the web process, where we're able to create and apply an EditingStyle to the
        current selection.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView changeAttributes:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::changeFontAttributesFromSender):
        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::changeFontAttributes):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        Add boilerplate IPC support.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::changeFontAttributes):

2018-09-06  Antti Koivisto  <antti@apple.com>

        Actively prewarm processes created for prewarm pool
        https://bugs.webkit.org/show_bug.cgi?id=189364

        Reviewed by Chris Dumez.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createNewWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::prewarm):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-09-06  Jer Noble  <jer.noble@apple.com>

        Don't pause playback when locking screen if video is being displayed on second screen.
        https://bugs.webkit.org/show_bug.cgi?id=189321

        Reviewed by Eric Carlson.

        Pass the "isPlayingOnSecondScreen" value across the process boundary.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionModelContext::setPlayingOnSecondScreen):
        (WebKit::PlaybackSessionManagerProxy::setPlayingOnSecondScreen):
        * WebProcess/cocoa/PlaybackSessionManager.h:
        * WebProcess/cocoa/PlaybackSessionManager.messages.in:
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::setPlayingOnSecondScreen):

2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Cannot change font size at selection until font panel is shown
        https://bugs.webkit.org/show_bug.cgi?id=189295
        <rdar://problem/35593389>

        Reviewed by Ryosuke Niwa.

        Refactors NSFontManager support in WebKit2. See WebCore ChangeLog for more details.

        * Scripts/webkit/messages.py:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView changeFont:]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView changeFont:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::changeFontFromFontManager):
        (WebKit::WebViewImpl::changeFontFromFontPanel): Deleted.

        Renamed this from changeFontFromFontPanel to changeFontFromFontManager. This new name is more accurate in the
        case where a menu item is used to alter the font, which doesn't involve NSFontPanel at all.

        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::changeFont):
        (WebKit::WebPageProxy::setFont): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::changeFont):
        (WebKit::WebPage::setFont): Deleted.

2018-09-06  Frederic Wang  <fwang@igalia.com>

        Use more generic names than "overflow" for functions that can be used for subframes
        https://bugs.webkit.org/show_bug.cgi?id=179125

        Reviewed by Simon Fraser..

        Some functions will be used by subframes when iframe scrolling is implemented on iOS (see
        bug 149264). Currently they are only used for "overflow" nodes. This patch renames them to
        use a more generic "scrolling node" name.

        * UIProcess/PageClient.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::scrollingNodeScrollViewWillStartPanGesture):
        (WebKit::PageClientImpl::scrollingNodeScrollViewDidScroll):
        (WebKit::PageClientImpl::scrollingNodeScrollWillStartScroll):
        (WebKit::PageClientImpl::scrollingNodeScrollDidEndScroll):
        (WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture): Deleted.
        (WebKit::PageClientImpl::overflowScrollViewDidScroll): Deleted.
        (WebKit::PageClientImpl::overflowScrollWillStartScroll): Deleted.
        (WebKit::PageClientImpl::overflowScrollDidEndScroll): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _scrollingNodeScrollingWillBegin]):
        (-[WKContentView _scrollingNodeScrollingDidEnd]):
        (-[WKContentView _overflowScrollingWillBegin]): Deleted.
        (-[WKContentView _overflowScrollingDidEnd]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::scrollingNodeScrollViewWillStartPanGesture):
        (WebKit::WebPageProxy::scrollingNodeScrollViewDidScroll):
        (WebKit::WebPageProxy::scrollingNodeScrollWillStartScroll):
        (WebKit::WebPageProxy::scrollingNodeScrollDidEndScroll):
        (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture): Deleted.
        (WebKit::WebPageProxy::overflowScrollViewDidScroll): Deleted.
        (WebKit::WebPageProxy::overflowScrollWillStartScroll): Deleted.
        (WebKit::WebPageProxy::overflowScrollDidEndScroll): Deleted.
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::didStartOverflowScroll):
        (WebKit::WebChromeClient::didEndOverflowScroll):

2018-09-06  Chris Dumez  <cdumez@apple.com>

        WebKit/Platform/IPC/mac/ConnectionMac.mm:222: _dispatch_bug_kevent_vanished
        https://bugs.webkit.org/show_bug.cgi?id=189314
        <rdar://problem/41248286>

        Reviewed by Anders Carlsson.

        There is a short period in time when m_isServer is true, after open() has been
        called, but before we've receive the InitializeConnection IPC, where m_receiveSource
        has been initialized but m_isConnected is still false. If platformInvalidate() gets
        called during this period of time, we would fail to cancel / release m_receiveSource
        and we would forcefully deallocate m_receivePort, leading to the libdispatch simulated
        crashes.

        To address the issue, platformInvalidate() now properly cancels / releases
        m_receiveSource if present, and only deallocates m_receivePort manually if m_receiveSource
        has not been initialized (i.e. open() has not been called yet).

        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::platformInvalidate):
        (IPC::Connection::clearReceiveSource):

2018-09-05  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r235489): WKSharingServicePickerDelegate.mm accidentally added back to Sources in WebKit project

        * WebKit.xcodeproj/project.pbxproj:
        (WKSharingServicePickerDelegate.mm): Let Xcode have its way with
        the WebKit project file by removing this file from Sources.
        It's already included in a UnifedSource file, so it should not
        have been added back to Sources during merge conflict resolution
        for r235489.

2018-09-05  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r204222): UIProces/Gamepad/mac is missing in WebKit Xcode project

        Found using `tidy-Xcode-project-file --missing` (see Bug
        188754). Fixes applied manually.

        * WebKit.xcodeproj/project.pbxproj:
        (UIProces/Gamepad/mac): Fix path to "mac" directory, then remove
        its now-redundant name.
        (UIGamepadProviderMac.mm): Change path to be relative to its
        group after the above change.

2018-09-05  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r143543): PluginProcess/EntryPoint/XPCService/PluginService is missing in WebKit Xcode project

        Found using `tidy-Xcode-project-file --missing` (see Bug
        188754). Fixes applied manually.

        * WebKit.xcodeproj/project.pbxproj:
        (PluginProcess/EntryPoint/XPCService/PluginService): Remove path
        to PluginService.64 directory, which was removed in r143543, so
        that this becomes a virtual folder that inherits its path from
        its parent.
        (PluginService.32-64.Info.plist): Change path to be relative to
        its group after the above change.  Delete redundant name value.

2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>

        Add infrastructure to dump resource load statistics
        https://bugs.webkit.org/show_bug.cgi?id=189213

        Reviewed by Daniel Bates.

        The dumping functionality is not currently used, but will be included in tests for
        <https://bugs.webkit.org/show_bug.cgi?id=187773>.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreDumpResourceLoadStatistics):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics const):
        * UIProcess/ResourceLoadStatisticsMemoryStore.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-09-05  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r235006): Let Xcode have its way with the WebKit project

        * WebKit.xcodeproj/project.pbxproj: Let Xcode remove empty
        settings.

2018-09-05  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r110214): Remove deleted WebProcess/Fullscreen/mac folder from WebKit Xcode project

        Found using `tidy-Xcode-project-file --missing` (see Bug
        188754). Folder removed via Xcode.

        * WebKit.xcodeproj/project.pbxproj:
        (WebProcess/Fullscreen/mac): Remove empty folder.  Directory no
        longer exists.  WebFullScreenManagerMac.{h,mm} files were
        removed in r110214.

2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>

        Added runtime feature flag for web API statistics
        https://bugs.webkit.org/show_bug.cgi?id=189211

        Reviewed by Daniel Bates.

        Added functionality to set the runtime flag with a JavaScript exposed function
        for testing.

        * Shared/WebPreferences.yaml:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2018-09-05  Jer Noble  <jer.noble@apple.com>

        Add MediaCapabilities as an Experimental Feature
        https://bugs.webkit.org/show_bug.cgi?id=189209

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2018-09-05  Jeremy Jones  <jeremyj@apple.com>

        Cancelled fullscreen exit gesture leaves bad state for next exit request.
        https://bugs.webkit.org/show_bug.cgi?id=189278

        Reviewed by Jer Noble.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController _dismissFullscreenViewController]):

2018-09-05  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Simplify logic when changing RealtimeMediaSource settings
        https://bugs.webkit.org/show_bug.cgi?id=189284
        <rdar://problem/44117948>

        Reviewed by Youenn Fablet.

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::Source::setSettings):

2018-09-04  Frederic Wang  <fwang@igalia.com>

        Add basic support for ScrollIntoViewOptions
        https://bugs.webkit.org/show_bug.cgi?id=189258

        Reviewed by Simon Fraser.

        * DOM/DOMElement.mm: Add ScrollIntoViewOptions
        header so that this file can build despite the new scrollIntoView function.

2018-09-04  Chris Dumez  <cdumez@apple.com>

        Rename experimental feature for process swap on navigation
        https://bugs.webkit.org/show_bug.cgi?id=189280

        Reviewed by Antti Koivisto.

        The "process swap on navigation" experimental feature on macOS Mojave does not work due to missing
        browser changes, resulting in frequent load hangs. When enabling the experimental feature in WebKit
        ToT or Safari Technology Preview for testing, it enables it as well for Mojave's system Safari which
        is annoying.

        This patch renames the experimental feature so that the feature stays disabled in Mojave's system
        Safari even when enabled in WebKit ToT / STP.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetProcessSwapOnNavigationEnabled):
        (WKPreferencesGetProcessSwapOnNavigationEnabled):
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2018-09-04  Dean Jackson  <dino@apple.com>

        Post review Weinig fix-ups
        https://bugs.webkit.org/show_bug.cgi?id=189288

        Reviewed by Sam Weinig.

        Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
        (getUTIForMIMEType): Deleted.
        * UIProcess/ios/WKSystemPreviewView.mm:
        (getUTIForSystemPreviewMIMEType):
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
        (getUTIForMIMEType): Deleted.

2018-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
        https://bugs.webkit.org/show_bug.cgi?id=188890
        <rdar://problem/43648605>

        Reviewed by Tim Horton.

        Add some plumbing through pasteboard classes to support `Pasteboard::readAllStrings`. See WebCore ChangeLog for
        more detail.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::allStringsForType):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-09-04  Youenn Fablet  <youenn@apple.com>

        Disable WebRTC unified plan runtime flag by default
        https://bugs.webkit.org/show_bug.cgi?id=189264

        Reviewed by Jer Noble.

        * Shared/WebPreferences.yaml:
        Disable unified plan flag by default.

2018-09-04  Chris Dumez  <cdumez@apple.com>

        Add process pool configuration flag to turn on automatic process pre-warming
        https://bugs.webkit.org/show_bug.cgi?id=189263
        <rdar://problem/44101941>

        Reviewed by Antti Koivisto.

        Add process pool configuration flag to turn on automatic process pre-warming and disassociate
        it from the warmInitialProcess() SPI.

        For now, turning on "process swap on navigation" via experimental features also turns on
        automatic process pre-warming.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetPrewarmsProcessesAutomatically):
        (WKContextWarmInitialProcess):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _warmInitialProcess]):
        (-[WKProcessPool _hasPrewarmedWebProcess]):
        (-[WKProcessPool _webProcessCountIgnoringPrewarmed]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setPrewarmsProcessesAutomatically:]):
        (-[_WKProcessPoolConfiguration prewarmsProcessesAutomatically]):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setMaximumNumberOfProcesses):
        (WebKit::WebProcessPool::createNewWebProcess):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::prewarmProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        * UIProcess/WebProcessPool.h:
        (WebKit::WebProcessPool::sendToOneProcess):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::create):
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::m_isInPrewarmedPool):
        * UIProcess/WebProcessProxy.h:

2018-09-03  Dean Jackson  <dino@apple.com>

        Move SystemPreview code from WebKitAdditions to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=189252
        <rdar://problem/44080245>

        Reviewed by Wenson Hsieh.

        Move the WebKitAdditions code into WebKit/WebCore.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (getUTIForMIMEType): Helper to get the system UTI for USDZ files.
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):

        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Use the new methods
        in MIMETypeRegistry.
        (-[WKWebViewContentProviderRegistry initWithConfiguration:]):

        * UIProcess/SystemPreviewController.cpp: Ditto.
        (WebKit::SystemPreviewController::canPreview const):

        * UIProcess/ios/WKSystemPreviewView.mm:
        (getUTIForMIMEType): Similar helper to above.
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):

2018-09-04  Frederic Wang  <fwang@igalia.com>

        Bug 189190 - REGRESSION(r235398) ASSERTION failure !m_client.didFinishDocumentLoadForFrame
        https://bugs.webkit.org/show_bug.cgi?id=189190

        Reviewed by Alex Christensen.

        Assertions to prevent use of the deprecated WKPageSetPageLoaderClient class are hit when
        running system Safari with the current macOS/iOS releases, making impossible to launch it.
        This patch conditionally skips these assertions so that they are only verified for
        macOS > 10.14 or other platforms.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient): Only assert on future OS releases.

2018-09-04  Alex Christensen  <achristensen@webkit.org>

        Clean up WebGL policy getting code path
        https://bugs.webkit.org/show_bug.cgi?id=189003

        Reviewed by Darin Adler.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::webGLLoadPolicy const):
        (API::NavigationClient::resolveWebGLLoadPolicy const):
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
        (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::webGLPolicyForURL): Deleted.
        (WebKit::WebPage::resolveWebGLPolicyForURL): Deleted.

2018-09-04  Zan Dobersek  <zdobersek@igalia.com>

        REGRESSION(r235165): [GStreamer] Major video performance regression
        https://bugs.webkit.org/show_bug.cgi?id=189224

        Reviewed by Michael Catanzaro.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::updateSceneState): Drop the early
        return used when the scene state wasn't updated through a layer flush,
        and instead always run through layer changes and backings. This way we
        won't miss proxy objects that need swapping even if none of the layer
        states were changed. Reducing the amount of work done here when scene
        hasn't been updated might be possible, but it's not a huge bottleneck.

2018-09-01  Darin Adler  <darin@apple.com>

        [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
        https://bugs.webkit.org/show_bug.cgi?id=189072

        Reviewed by Dan Bernstein.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Removed NSURLSessionTask
        method declarations from this file, they are in CFNetworkSPI.h.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm: Removed NSURLSessionConfiguration
        method declarations from this file, they are in CFNetworkSPI.h.

2018-09-01  Dan Bernstein  <mitz@apple.com>

        [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust"
        https://bugs.webkit.org/show_bug.cgi?id=189222
        <rdar://problem/33283179>

        Reviewed by Sam Weinig.

        Test: TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView valueForUndefinedKey:]): Override to handle the "serverTrust" key, which is not
          handled automatically by the KVC machinery since the getter’s return type is not an
          Objective-C type.

2018-08-31  John Wilander  <wilander@apple.com>

        Storage Access API: Maintain access through same-site navigations
        https://bugs.webkit.org/show_bug.cgi?id=188564
        <rdar://problem/43445160>

        Reviewed by Alex Christensen.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
            Now takes the current URL and the new URL as parameters
            and only clears out storage access if the navigation is
            cross-site, i.e. with differing eTLD+1s.
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2018-08-31  Chris Dumez  <cdumez@apple.com>

        Assertion hit in ~CompletionHandler() from ~WebFrame()
        https://bugs.webkit.org/show_bug.cgi?id=189199
        <rdar://problem/42657233>

        Reviewed by Youenn Fablet.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::~WebFrame):
        (WebKit::WebFrame::setUpWillSubmitFormListener):
        (WebKit::WebFrame::invalidatePolicyListener):
        * WebProcess/WebPage/WebFrame.h:

2018-08-31  Antti Koivisto  <antti@apple.com>

        Replace OptionSet |= and -= operators with add() and remove() functions
        https://bugs.webkit.org/show_bug.cgi?id=189169

        Reviewed by Anders Carlsson.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
        * Shared/WebEventConversion.cpp:
        (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
        (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
        (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
        (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageReload):
        * UIProcess/API/C/WKResourceCacheManager.cpp:
        (toWebsiteDataTypes):
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        (WKWebsitePoliciesSetAllowedAutoplayQuirks):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView reload]):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
        (WebKit::toWebsiteDataTypes):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::viewDidMoveToWindow):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateActivityState):
        (WebKit::WebPageProxy::activityStateDidChange):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::add):
        (WebKit::WebsiteDataRecord::addCookieHostName):
        (WebKit::WebsiteDataRecord::addPluginDataHostName):
        (WebKit::WebsiteDataRecord::addHSTSCacheHostname):
        (WebKit::WebsiteDataRecord::addOriginWithCredential):
        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController inspectorWKWebViewReload:]):
        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::imageForRect):
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::core):
        (WebKit::FindController::findString):

2018-08-31  Chris Dumez  <cdumez@apple.com>

        Rename ShouldProcessSwapIfPossible to ProcessSwapRequestedByClient for clarity
        https://bugs.webkit.org/show_bug.cgi?id=189195

        Reviewed by Alex Christensen.

        Rename ShouldProcessSwapIfPossible to ProcessSwapRequestedByClient for clarity, since it indicates the client
        requested a process swap via its navigation policy decision.

        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (WKFramePolicyListenerUseInNewProcess):
        (useWithPolicies):
        (WKFramePolicyListenerUseWithPolicies):
        (WKFramePolicyListenerUseInNewProcessWithPolicies):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        * UIProcess/WebFramePolicyListenerProxy.h:
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        (WebKit::WebProcessPool::processForNavigationInternal):
        * UIProcess/WebProcessPool.h:

2018-08-31  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
        https://bugs.webkit.org/show_bug.cgi?id=186714

        Reviewed by Wenson Hsieh.

        On iOS, we have less space to display suggestions from a datalist element compared
        to macOS. Furthermore, iPhones and iPads have different form factors, leading to a
        different approach on each device. The commonalities of the two implementations
        can be found in WKDataListSuggestionsControl. This class is subclassed by the
        device specific implementations.

        On iPhone, we display the suggestions in a UIPickerView. This view is accessible
        only after tapping on the datalist button element to the side of the input field.
        This approach was chosen in order to avoid tricking the user into thinking that
        the values displayed in the picker are the only accepted values.
        WKDataListSuggestionsPicker is responsible for managing the interface shown on
        iPhones.

        On iPad, we display the suggestions in a popover, that is visible alongside the
        keyboard. The suggestions in the popover update as the user types.
        WKDataListSuggestionsPopover is responsible for managing the interface shown on
        iPads.

        Both devices display predictive text suggestions, taking the first three values
        from the filtered suggestions list. In order to prevent other clients from
        overwriting the suggestions provided by the datalist element, we prevent writing
        to the predictive text bar if an input with the list attribute is the currently
        assisted node.

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:
        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * SourcesCocoa.txt:
        * UIProcess/WebDataListSuggestionsDropdownIOS.h: Added.
        * UIProcess/WebDataListSuggestionsDropdownIOS.mm: Added.
        (WebKit::WebDataListSuggestionsDropdownIOS::create):
        (WebKit::WebDataListSuggestionsDropdownIOS::WebDataListSuggestionsDropdownIOS):
        (WebKit::WebDataListSuggestionsDropdownIOS::show):
        (WebKit::WebDataListSuggestionsDropdownIOS::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionsDropdownIOS::close):
        (WebKit::WebDataListSuggestionsDropdownIOS::didSelectOption):
        (-[WKDataListSuggestionsControl initWithInformation:inView:]):
        (-[WKDataListSuggestionsControl updateWithInformation:]):
        (-[WKDataListSuggestionsControl showSuggestionsDropdown:activationType:]):
        (-[WKDataListSuggestionsControl didSelectOptionAtIndex:]):
        (-[WKDataListSuggestionsControl invalidate]):
        (-[WKDataListSuggestionsControl textSuggestions]):
        (-[WKDataListSuggestionsControl suggestionsCount]):
        (-[WKDataListSuggestionsControl suggestionAtIndex:]):
        (-[WKDataListSuggestionsControl textAlignment]):
        (-[WKDataListSuggestionsPicker initWithInformation:inView:]):
        (-[WKDataListSuggestionsPicker updateWithInformation:]):
        (-[WKDataListSuggestionsPicker showSuggestionsDropdown:activationType:]):
        (-[WKDataListSuggestionsPicker numberOfComponentsInPickerView:]):
        (-[WKDataListSuggestionsPicker pickerView:numberOfRowsInComponent:]):
        (-[WKDataListSuggestionsPicker pickerView:titleForRow:forComponent:]):
        (-[WKDataListSuggestionsPicker invalidate]):
        (-[WKDataListSuggestionsPickerView controlView]):
        (-[WKDataListSuggestionsPickerView controlBeginEditing]):
        (-[WKDataListSuggestionsPickerView controlEndEditing]):
        (-[WKDataListSuggestionsPopover initWithInformation:inView:]):
        (-[WKDataListSuggestionsPopover updateWithInformation:]):
        (-[WKDataListSuggestionsPopover showSuggestionsDropdown:activationType:]):
        (-[WKDataListSuggestionsPopover invalidate]):
        (-[WKDataListSuggestionsPopover didSelectOptionAtIndex:]):
        (-[WKDataListSuggestionsViewController reloadData]):
        (-[WKDataListSuggestionsViewController tableView:numberOfRowsInSection:]):
        (-[WKDataListSuggestionsViewController tableView:cellForRowAtIndexPath:]):
        (-[WKDataListSuggestionsViewController tableView:didSelectRowAtIndexPath:]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::pageDidScroll):
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFormInputSession endEditing]):
        (-[WKFormInputSession setSuggestions:]):
        (-[WKContentView _formInputSession]):
        (-[WKContentView resignFirstResponderForWebView]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        (-[WKContentView accessoryTab:]):
        (-[WKContentView insertTextSuggestion:]):
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.h:
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCloseSuggestions):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPositionInformation):
        (WebKit::WebPage::getAssistedNodeInformation):

2018-08-31  Frederic Wang  <fwang@igalia.com>

        REGRESSION(r235484) _WKPreferencesGetWebRTCLegacyAPIEnabled symbol not found when running Safari with external SDK build
        https://bugs.webkit.org/show_bug.cgi?id=189188

        Reviewed by Youenn Fablet.

        WebRTCLegacyAPI preference has been removed in r235484. However, the API is still used by
        Safari when running external SDK builds. Hence we restore some dummy getter/setter for now.

        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebRTCLegacyAPIEnabled): no-op.
        (WKPreferencesGetWebRTCLegacyAPIEnabled): Always return false.
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _webRTCLegacyAPIEnabled]): Always return false.
        (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): no-op.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-08-31  Frederic Wang  <fwang@igalia.com>

        Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
        https://bugs.webkit.org/show_bug.cgi?id=182053

        Reviewed by Simon Fraser.

        Add developer flag to use standard behavior for scrolling* attributes.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCSSOMViewScrollingAPIEnabled):
        (WKPreferencesGetCSSOMViewScrollingAPIEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2018-08-30  Tim Horton  <timothy_horton@apple.com>

        One more build fix

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView shareSheetDidDismiss:]):
        Actually tested this time.

2018-08-30  Chris Dumez  <cdumez@apple.com>

        Add WKPageLoadFile SPI variant which returns a navigation object
        https://bugs.webkit.org/show_bug.cgi?id=189168
        <rdar://problem/43899330>

        Reviewed by Alex Christensen.

        Add WKPageLoadFile SPI variant which returns a navigation object, similarly to WKPageLoadURLRequestReturningNavigation().
        This is needed in order to implement <rdar://problem/40309266>.

        * UIProcess/API/C/mac/WKPagePrivateMac.h:
        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
        (WKPageLoadFileReturningNavigation):

2018-08-30  Tim Horton  <timothy_horton@apple.com>

        Try to fix the watchOS and tvOS build

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showShareSheet:completionHandler:]):
        (-[WKContentView shareSheetDidDismiss:]):

2018-08-30  Justin Michaud  <justin@justinmichaud.com>

        [GTK] Touchscreen pinch to zoom should scale the page like other platforms
        https://bugs.webkit.org/show_bug.cgi?id=188746

        Changes the pinch-to-zoom gesture to magnify/scale the page, rather than zooming in. Also resets this magnification when the zoom level is changed.

        Reviewed by Michael Catanzaro.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_set_zoom_level):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::zoom): Deleted.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::ZoomGesture::handleZoom):
        (WebKit::GestureController::ZoomGesture::scaleChanged):
        * UIProcess/gtk/GestureController.h:

2018-08-30  Tim Horton  <timothy_horton@apple.com>

        Bundle unified sources more tightly in projects with deep directory structures
        https://bugs.webkit.org/show_bug.cgi?id=189009

        Reviewed by Simon Fraser.

        Fix a variety of unification errors due to reshuffling the bundles.

        * Shared/APIWebArchive.mm:
        * Shared/APIWebArchiveResource.mm:
        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
        * Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
        * SourcesCocoa.txt:
        * SourcesGTK.txt:
        * UIProcess/API/APIAutomationSessionClient.h:
        (API::AutomationSessionClient::sessionIdentifier const):
        (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
        (API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
        * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
        (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
        (-[WKCustomProtocolLoader connection:didFailWithError:]):
        (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::generatePluginProcessCallbackID):
        (WebKit::PluginProcessProxy::fetchWebsiteData):
        (WebKit::PluginProcessProxy::deleteWebsiteData):
        (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
        (WebKit::generateCallbackID): Deleted.
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::generateStorageProcessCallbackID):
        (WebKit::StorageProcessProxy::fetchWebsiteData):
        (WebKit::StorageProcessProxy::deleteWebsiteData):
        (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
        (WebKit::generateCallbackID): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (-[WKPDFPluginAccessibilityObject accessibilityPerformAction:]):
        (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
        (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
        (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
        (-[WKPDFLayerControllerDelegate updateScrollPosition:]):
        (WebKit::PDFPlugin::updateCursor):
        (WebKit::coreCursor):
        (appendValuesInPDFNameSubtreeToVector): Deleted.
        (getAllValuesInPDFNameTree): Deleted.
        (getAllScriptsInPDFDocument): Deleted.

2018-08-30  Tim Horton  <timothy_horton@apple.com>

        Fix the watchOS and tvOS build

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView invokeShareSheetWithResolution:]):

2018-08-30  Eric Carlson  <eric.carlson@apple.com>

        Mock video devices should only support discrete sizes
        https://bugs.webkit.org/show_bug.cgi?id=189000
        <rdar://problem/43766551>

        Reviewed by Youenn Fablet.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::resetMockMediaDevices):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::resetMockMediaDevices):

2018-08-30  Olivia Barnett  <obarnett@apple.com>

        Web Share API compatible with AppleTV and WatchOS
        https://bugs.webkit.org/show_bug.cgi?id=189157

        Reviewed by Tim Horton.

        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView fileUploadPanelDidDismiss:]):
        * UIProcess/ios/forms/WKShareSheet.h:
        * UIProcess/ios/forms/WKShareSheet.mm:
        (-[WKShareSheet invokeShareSheetWithResolution:]):
        Added platform checks.

2018-08-30  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r235413 and r235444.
        https://bugs.webkit.org/show_bug.cgi?id=189163

        Causes crashes when running layout tests under GuardMalloc
        (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "NetworkLoad::didReceiveResponse should pass its completion
        handler to its client"
        https://bugs.webkit.org/show_bug.cgi?id=188701
        https://trac.webkit.org/changeset/235413

        "Remove assertion introduced in r235413"
        https://bugs.webkit.org/show_bug.cgi?id=188701
        https://trac.webkit.org/changeset/235444

2018-08-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl][WebKit] Bugfix on redirect.
        https://bugs.webkit.org/show_bug.cgi?id=189056

        Reviewed by Alex Christensen.

        Forget to call updateFromDelegatePreservingOldProperties in continueWillSendRequest like other ports do.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::continueWillSendRequest):

2018-08-30  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Color picker layout is broken if suggested colors are specified
        https://bugs.webkit.org/show_bug.cgi?id=189117

        Reviewed by Tim Horton.

        NSPopoverColorWell recently changed the size of its swatches. We need to update
        the width of the swatches we provide to match the width of the other swatches,
        in order to avoid breaking the layout.

        While such a solution is not a good precedent, we do not have fully-functional SPI
        to customize the suggested colors. A FIXME has been added for this reason.
        However, even once we obtain SPI, we will need to find a way to support older
        clients, making conditional compilation a potential necessity.

        * UIProcess/mac/WebColorPickerMac.mm:

2018-08-30  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Whitelist Network process features for VPN
        https://bugs.webkit.org/show_bug.cgi?id=189023
        <rdar://problem/43310000>

        Reviewed by Eric Carlson.

        CFNetwork needs access to some VPN preference files to configure networking, and
        need to be allowed to communicate with the VPN process from the Network Process
        sandbox.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

2018-08-30  Yoshiaki Jitsukawa  <yoshiaki.jitsukawa@sony.com>

        [ConnectionUnix] Shrink sizeof AttachmentInfo by reordering members
        https://bugs.webkit.org/show_bug.cgi?id=189149

        Reviewed by Michael Catanzaro.

        Reorder members to shrink the size of AttachmentInfo so that
        we can attach more attachments. 

        * Platform/IPC/unix/ConnectionUnix.cpp:

2018-08-29  Chris Dumez  <cdumez@apple.com>

        Avoid code duplication in ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords()
        https://bugs.webkit.org/show_bug.cgi?id=189130

        Reviewed by Youenn Fablet.

        Move if check inside the lambda instead of outside to avoid code duplication.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):

2018-08-29  Alex Christensen  <achristensen@webkit.org>

        Revert some of r235398
        https://bugs.webkit.org/show_bug.cgi?id=189133

        Reviewed by Tim Horton.

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::processDidCrash):
        (API::LoaderClient::didChangeBackForwardList):
        (API::LoaderClient::didCommitLoadForFrame):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChangeBackForwardList):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):

2018-08-29  Olivia Barnett  <obarnett@apple.com>

        Implement the Web Share API
        https://bugs.webkit.org/show_bug.cgi?id=171100
        <rdar://problem/31751734>

        Reviewed by Tim Horton.

        * Platform/spi/ios/UIKitSPI.h:
        Added NSURL _title property as in the WebCore UIKitSPI.

        * Scripts/webkit/messages.py:
        ShareDataWithParsedURL special case for header for type.
        
        * Shared/ShareSheetCallbackID.h:
        Added a typedef for a share sheet callback id.       

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ShareData>::encode):
        (IPC::ArgumentCoder<ShareData>::decode):
        (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode):
        (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode):
        * Shared/WebCoreArgumentCoders.h:
        Added encoding and decoding functionality for new structs.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebShareEnabled):
        (WKPreferencesGetWebShareEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        Added switch for RuntimeEnabledFeature.

        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        Added hook for share sheet testing.

        * UIProcess/PageClient.h:
        (WebKit::PageClient::showShareSheet):
        Page client call to invoke share sheet.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showShareSheet):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        Web page proxy handling of call to invoke share sheet.
        Creates completion handler to send to WKShareSheet.mm
        Completion handler sends message to WebPage with message id.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::showShareSheet):
        Page client implementation call to invoke share sheet. 

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _showShareSheet:completionHandler:]):
        (-[WKContentView shareSheetDidDismiss:]):
        (-[WKContentView invokeShareSheetWithResolution:resolved):
        Call to WKShareSheet to invoke the share sheet and callback.
        Hook for share sheet resolution testing.

        * UIProcess/ios/forms/WKShareSheet.h: Added.
        * UIProcess/ios/forms/WKShareSheet.mm: Added.
        (-[WKShareSheet initWithView:]):
        (-[WKShareSheet presentWithParameters:completionHandler:]):
        (-[WKShareSheet _dispatchDidDismiss]):
        (-[WKShareSheet _cancel]):
        (-[WKShareSheet dismiss]):
        (-[WKShareSheet _dismissDisplayAnimated:]):
        (-[WKShareSheet _presentFullscreenViewController:animated:]):
        (-[WKShareSheet invokeShareSheetWithResolution:resolved:]):
        Completion handler call and creation of share sheet with parameters.
        Hook that force resolves the share sheet completion handler for testing. 

        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::showShareSheet):
        Call to page to invoke share sheet.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::nextShareSheetContextId):
        (WebKit::WebPage::showShareSheet):
        (WebKit::WebPage::showShareSheetResponse):
        WebPage calls proxy and saves context id for promise.        

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        Callback for completed response.

2018-08-29  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit: WTF::Function<void ()>::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords(WTF::CompletionHandler<void ()>&&)::$_1>::call()
        https://bugs.webkit.org/show_bug.cgi?id=189098
        <rdar://problem/43179891>

        Reviewed by Youenn Fablet.

        The crash was caused by implicitly using |this| on the main thread by accessing member variables, even though
        |this| gets destroyed on the statistics queue. To address the issue, capture what we need on the statistics
        queue, *before* dispatching to the main thread.

        Also stop capturing |this| in the lambdas to make this less error prone.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):

2018-08-29  Youenn Fablet  <youenn@apple.com>

        Remove WebRTC legacy API implementation
        https://bugs.webkit.org/show_bug.cgi?id=189040

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebRTCLegacyAPIEnabled): Deleted.
        (WKPreferencesGetWebRTCLegacyAPIEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _webRTCLegacyAPIEnabled]): Deleted.
        (-[WKPreferences _setWebRTCLegacyAPIEnabled:]): Deleted.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2018-08-29  Chris Dumez  <cdumez@apple.com>

        [PSON] We should only process-swap when eTLD+1 changes on navigation
        https://bugs.webkit.org/show_bug.cgi?id=189090
        <rdar://problem/43799225>

        Reviewed by Geoffrey Garen.

        When navigating cross-origin, only process swap when the eTLD+1 (aka "Registrable
        domain") changes, instead of considering the full security origin.

        This has performance benefits and is also needed to keep document.domain origin
        relaxation working.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addProcessToOriginCacheSet):
        (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
        (WebKit::WebProcessPool::processForNavigation):
        (WebKit::WebProcessPool::processForNavigationInternal):
        * UIProcess/WebProcessPool.h:

2018-08-29  Youenn Fablet  <youenn@apple.com>

        Add a runtime flag for WebRTC unified plan
        https://bugs.webkit.org/show_bug.cgi?id=189068

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

2018-08-29  Aditya Keerthi  <akeerthi@apple.com>

        Followup (r235427): Use the null string instead of std::nullopt when no suggestion is selected
        https://bugs.webkit.org/show_bug.cgi?id=189095

        Reviewed by Tim Horton.

        Followup to r235427 as per Darin's comment.

        We can avoid unnecessary use of std::optional by taking advantage of the fact that
        WTF::String already has a null value distinct from the empty value.

        No change in behavior.

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
        (-[WKDataListSuggestionsView currentSelectedString]):

2018-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        Use the null string instead of std::nullopt for missing attachment file names and content types
        https://bugs.webkit.org/show_bug.cgi?id=189080

        Reviewed by Tim Horton.

        Replace instances of std::optional<String> with just String instead, and use the null string to represent a
        missing value instead of std::nullopt. No change in behavior.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateAttachmentAttributes):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateAttachmentAttributes):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-08-28  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use CMake's FindFreetype
        https://bugs.webkit.org/show_bug.cgi?id=189071

        Reviewed by Michael Catanzaro.

        * PlatformWPE.cmake:

2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
        https://bugs.webkit.org/show_bug.cgi?id=189054

        Reviewed by Andy Estes.

        Remove the pasteboard type argument from readURLFromPasteboard.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::readURLFromPasteboard):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-08-28  Alex Christensen  <achristensen@webkit.org>

        Remove assertion introduced in r235413
        https://bugs.webkit.org/show_bug.cgi?id=188701

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
        r235413 did not change behavior. The assertion was invalid.

2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove references to "APIAttachmentCocoa.h" in WebKit.xcodeproj
        Follow-up to https://bugs.webkit.org/show_bug.cgi?id=188933

        Rubber-stamped by David Kilzer.

        This header was not removed from the Xcode project file after being deleted.

        * WebKit.xcodeproj/project.pbxproj:

2018-08-28  Sihui Liu  <sihui_liu@apple.com>

        Add error information to help debug test failure in WKNavigation.ProcessCrashDuringCallback
        https://bugs.webkit.org/show_bug.cgi?id=189037

        Reviewed by Chris Dumez.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _getMainResourceDataWithCompletionHandler:]):
        (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
        (-[WKWebView _getContentsAsStringWithCompletionHandler:]):

2018-08-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Fix issue that extra cookie is added when redirect happens.
        https://bugs.webkit.org/show_bug.cgi?id=187874

        Reviewed by Alex Christensen.

        When initial request has cookie set and redirect happens, it add extra Cookie header to that
        abd request was broken. Just stop modifying the original request by passing a value.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCurl::restartWithCredential):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:

2018-08-28  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Color wells should appear rounded and textured
        https://bugs.webkit.org/show_bug.cgi?id=189039

        Reviewed by Tim Horton.

        * UIProcess/mac/WebColorPickerMac.mm: Build fix.

2018-08-28  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist] Pressing enter without a selected option shouldn't change the input
        https://bugs.webkit.org/show_bug.cgi?id=189010

        Reviewed by Tim Horton.

        Currently, the value of an input field gets cleared if there is no selected
        datalist suggestion when the enter key is pressed. The correct behavior is to
        leave the value of the input as-is.

        The incorrect behavior is a consequence of the fact that an empty string is
        returned by [WKDataListSuggestionsView currentSelectedString] if there is no
        selection. To fix the behavior, the method now returns an std::optional instead
        of an empty string. If std::nullopt is returned, we do not make any modification
        to the value of the input. This ensures that we can still change the value of
        an input field to an empty string in the case that an empty string is part of
        the suggestions.

        Augmented test: fast/forms/datalist/datalist-textinput-keydown.html

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
        (-[WKDataListSuggestionCell drawRect:]): Quick fix. The mouseover color was incorrect.
        (-[WKDataListSuggestionsView currentSelectedString]):

2018-08-28  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Support inputmode=none
        https://bugs.webkit.org/show_bug.cgi?id=188896

        Reviewed by Tim Horton.

        inputmode=none is used by content that renders its own keyboard control.
        Consequently, we should not display the virtual keyboard when a user interacts
        with an element that has the inputmode attribute set to the "none" value.

        In order to achieve this behavior, we return a UIView with a bounds of CGRectZero
        as the inputView of the WKContentView when inputmode=none is present. Furthermore,
        we do not provide an accessory view in this case.

        Updated the logic that zooms and scrolls to a control when it gains focus, as that
        behavior currently relies on an accessory view being present.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _displayFormNodeInputView]):
        (-[WKContentView inputView]):
        (-[WKContentView requiresAccessoryView]):
        (-[WKContentView textInputTraits]):

2018-08-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Enable Proxy Authentication on WebKit.
        https://bugs.webkit.org/show_bug.cgi?id=188998

        Reviewed by Alex Christensen.

        Add support for proxy authentication to curl backend running on WebKit.
        This is follow up implementation of legacy implementation:
        - https://bugs.webkit.org/show_bug.cgi?id=185266

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
        (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        * PlatformWin.cmake:

2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends
        https://bugs.webkit.org/show_bug.cgi?id=189004

        Reviewed by Dan Bernstein.

        Removes all usage of WebCore::AttachmentDisplayOptions, and deletes an SPI method that isn't being used by any
        internal clients. Removal of _WKAttachmentDisplayOptions itself is still blocked on the submission of
        <rdar://problem/43357281>.

        * Scripts/webkit/messages.py:
        * Shared/WebCoreArgumentCoders.cpp:
        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::setDisplayOptions): Deleted.
        * UIProcess/API/APIAttachment.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        Deprecate -_insertAttachmentWithFileWrapper:contentType:options:completion:, in favor of
        -_insertAttachmentWithFileWrapper:contentType:completion:.

        * UIProcess/API/Cocoa/_WKAttachment.h:

        Remove -setDisplayOptions:completion:, since it is a now a noop, and also isn't used by any internal clients.

        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Deleted.
        (-[_WKAttachment setDisplayOptions:completion:]): Deleted.
        * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::insertAttachment):
        (WebKit::WebPageProxy::setAttachmentDisplayOptions): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::insertAttachment):
        (WebKit::WebPage::setAttachmentDisplayOptions): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        NetworkLoad::didReceiveResponse should pass its completion handler to its client
        https://bugs.webkit.org/show_bug.cgi?id=188701

        Reviewed by Michael Catanzaro.

        Right now we have a confusing enum ShouldContinueDidReceiveResponse and a complicated flow
        that involves many objects and implicitly using NetworkLoad's destructor as part of the
        loading flow.  This makes the responsibilities of the objects clear.

        * NetworkProcess/Downloads/PendingDownload.cpp:
        (WebKit::PendingDownload::didReceiveResponse):
        * NetworkProcess/Downloads/PendingDownload.h:
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveResponse):
        (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession): Deleted.
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::didReceiveResponse):
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::~NetworkLoad):
        (WebKit::NetworkLoad::convertTaskToDownload):
        (WebKit::NetworkLoad::didReceiveResponse):
        (WebKit::NetworkLoad::notifyDidReceiveResponse):
        (WebKit::NetworkLoad::continueDidReceiveResponse): Deleted.
        (WebKit::NetworkLoad::didReceiveResponseNetworkSession): Deleted.
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkLoadClient.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::~NetworkResourceLoader):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse):
        (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveResponse):
        (WebKit::PingLoad::didReceiveResponseNetworkSession): Deleted.
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::didReceiveResponse):
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
        * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
        (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):

2018-08-27  Keith Rollin  <krollin@apple.com>

        Unreviewed build fix -- disable LTO for production builds

        * Configurations/Base.xcconfig:

2018-08-27  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Block CoreServices in sandbox.
        https://bugs.webkit.org/show_bug.cgi?id=189005
        <rdar://problem/35369091>

        Reviewed by Brent Fulgham.

        The sandbox for the WebContent process should block CoreServices.

        * WebProcess/com.apple.WebProcess.sb.in:

2018-08-27  Simon Fraser  <simon.fraser@apple.com>

        Teach WebKitTestRunner and DumpRenderTree about detecting world leaks
        https://bugs.webkit.org/show_bug.cgi?id=188994

        Reviewed by Tim Horton.

        This patch adds the notion of a "control command" in the protocol between webkitpy and 
        WebKitTestRunner/DumpRenderTree. A command is simply an input string starting with a #
        that is checked for before trying to parse the input as test URL. For now, just one
        commmand is supported, which is "#CHECK FOR WORLD LEAKS".
        
        In response to the command, the tool dumps an output block in the usual pseudo-MIME-style,
        with a trailing "#EOF". Future patches will add support to webkitpy to parse this output.
        
        DumpRenderTree stubs out the command, returning an empty block.
        
        WebKitTestRunner responds to the command by dumping the list of live documents, if it was
        run with the --check-for-world-leaks option.
        
        When run with --check-for-world-leaks, WebKitTestRunner gets the list of live documents via
        WKBundleGetLiveDocumentURLs() after every test (this allows it to detect the first test
        that leaked a document), and keeps them in a map of document identifier to test and live document URL.
        Then when it receives the "#CHECK FOR WORLD LEAKS" command, it calls into the bundle to
        clear the page and memory caches, runs a GC, then posts a task (in the Document::postTaks() sense)
        after which it requests the list of live documents for a final time, excluding any that are loaded
        in live Frames (thus omitting the about:blank that will be loaded at this point). Documents in this
        list are therefore leaked (or abandoned).
        
        Future patches will hook up webkitpy reporting for leaked documents.

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleGetLiveDocumentURLs):
        (WKBundleClearPageCache):
        (WKBundleClearMemoryCache):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePagePostTask):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::liveDocumentURLs):
        * WebProcess/InjectedBundle/InjectedBundle.h:

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        Fix plug-ins after r235398
        https://bugs.webkit.org/show_bug.cgi?id=188997

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findPlugin):

2018-08-27  Aditya Keerthi  <akeerthi@apple.com>

        Consolidate ENABLE_INPUT_TYPE_COLOR and ENABLE_INPUT_TYPE_COLOR_POPOVER
        https://bugs.webkit.org/show_bug.cgi?id=188931

        Reviewed by Wenson Hsieh.

        A popover is the preferred interface for <input type=color> on macOS. The color
        panel is still accessible through a button on the popover, for fine-grained
        color selection. We can consolidate the two build flags, so that a popover is
        always displayed in the ENABLE(INPUT_TYPE_COLOR) build.

        * Configurations/FeatureDefines.xcconfig: Removed ENABLE_INPUT_TYPE_COLOR_POPOVER.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showColorPicker):
        (WebKit::WebPageProxy::closeOverlayedViews):
        * UIProcess/mac/WebColorPickerMac.mm:
        (WebKit::WebColorPickerMac::WebColorPickerMac):
        (WebKit::WebColorPickerMac::showColorPicker):

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        Pass webPageID and webFrameID to NetworkLoad for speculative loads
        https://bugs.webkit.org/show_bug.cgi?id=188682

        Reviewed by Youenn Fablet.

        This also removes an authentication shortcut I introduced in r234941

        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        Remove most of LoaderClient
        https://bugs.webkit.org/show_bug.cgi?id=188997

        Reviewed by Tim Horton.

        We still have a few clients using basic functionality that are transitioning to WKPageNavigationClient,
        but most of it can be removed.

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::~LoaderClient):
        (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
        (API::LoaderClient::didFailLoadWithErrorForFrame):
        (API::LoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
        (API::LoaderClient::didReachLayoutMilestone):
        (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
        (API::LoaderClient::didCommitLoadForFrame): Deleted.
        (API::LoaderClient::didFinishDocumentLoadForFrame): Deleted.
        (API::LoaderClient::didSameDocumentNavigationForFrame): Deleted.
        (API::LoaderClient::didReceiveTitleForFrame): Deleted.
        (API::LoaderClient::didFirstLayoutForFrame): Deleted.
        (API::LoaderClient::didDisplayInsecureContentForFrame): Deleted.
        (API::LoaderClient::didRunInsecureContentForFrame): Deleted.
        (API::LoaderClient::didDetectXSSForFrame): Deleted.
        (API::LoaderClient::didReceiveAuthenticationChallengeInFrame): Deleted.
        (API::LoaderClient::didStartProgress): Deleted.
        (API::LoaderClient::didChangeProgress): Deleted.
        (API::LoaderClient::didFinishProgress): Deleted.
        (API::LoaderClient::processDidBecomeUnresponsive): Deleted.
        (API::LoaderClient::processDidBecomeResponsive): Deleted.
        (API::LoaderClient::processDidCrash): Deleted.
        (API::LoaderClient::didChangeBackForwardList): Deleted.
        (API::LoaderClient::willGoToBackForwardListItem): Deleted.
        (API::LoaderClient::didNavigateWithNavigationData): Deleted.
        (API::LoaderClient::didPerformClientRedirect): Deleted.
        (API::LoaderClient::didPerformServerRedirect): Deleted.
        (API::LoaderClient::didUpdateHistoryTitle): Deleted.
        (API::LoaderClient::navigationGestureDidBegin): Deleted.
        (API::LoaderClient::navigationGestureWillEnd): Deleted.
        (API::LoaderClient::navigationGestureDidEnd): Deleted.
        (API::LoaderClient::pluginLoadPolicy): Deleted.
        (API::LoaderClient::didFailToInitializePlugin): Deleted.
        (API::LoaderClient::didBlockInsecurePluginVersion): Deleted.
        (API::LoaderClient::webGLLoadPolicy const): Deleted.
        (API::LoaderClient::resolveWebGLLoadPolicy const): Deleted.
        (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): Deleted.
        (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): Deleted.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChangeBackForwardList):
        (WebKit::WebPageProxy::willGoToBackForwardListItem):
        (WebKit::WebPageProxy::didStartProgress):
        (WebKit::WebPageProxy::didChangeProgress):
        (WebKit::WebPageProxy::didFinishProgress):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
        (WebKit::WebPageProxy::didReceiveTitleForFrame):
        (WebKit::WebPageProxy::didFirstLayoutForFrame):
        (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
        (WebKit::WebPageProxy::didRunInsecureContentForFrame):
        (WebKit::WebPageProxy::didDetectXSSForFrame):
        (WebKit::WebPageProxy::didNavigateWithNavigationData):
        (WebKit::WebPageProxy::didPerformClientRedirect):
        (WebKit::WebPageProxy::didPerformServerRedirect):
        (WebKit::WebPageProxy::didUpdateHistoryTitle):
        (WebKit::WebPageProxy::webGLPolicyForURL):
        (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
        (WebKit::WebPageProxy::processDidBecomeUnresponsive):
        (WebKit::WebPageProxy::processDidBecomeResponsive):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):
        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
        (WebKit::WebPageProxy::navigationGestureDidBegin):
        (WebKit::WebPageProxy::navigationGestureWillEnd):
        (WebKit::WebPageProxy::navigationGestureDidEnd):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame):
        (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r234985/r234989) WKPageLoadHTMLString with a 16-bit String has the wrong encoding
        https://bugs.webkit.org/show_bug.cgi?id=189002

        Reviewed by Tim Horton.

        * UIProcess/API/C/WKPage.cpp:
        (encodingOf):

2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory
        https://bugs.webkit.org/show_bug.cgi?id=188903
        <rdar://problem/43702993>

        Reviewed by Tim Horton.

        Fixes the bug by supporting NSFileWrappers of type directory, as well as NSFileWrappers with file that do not
        map to concrete type identifiers. Among other things, this patch ensures that:
        -       Inserting a directory file wrapper (or using -setFileWrapper:…: to change an existing _WKAttachment's
                file wrapper to a directory) does not cause the attachment element to show "0 bytes" as the subtitle.
        -       In the above scenario, we also won't end up with a missing "type" attribute for the attachment element,
                as well as a corresponding API::Attachment::contentType() that's an empty string.
        -       Dropping or pasting attachments backed by paths on disk also doesn't trigger these problems, if the path
                is a directory or of unknown file type.

        Changes are verified by 2 new API tests.

        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::updateAttributes):
        (API::Attachment::fileSizeForDisplay const):
        * UIProcess/API/APIAttachment.h:
        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
        (API::Attachment::setFileWrapperAndUpdateContentType):

        Add a helper that sets the file wrapper to the given NSFileWrapper, and either sets the content type to the
        given content type if it's specified, or infers it from the file extension of the new NSFileWrapper. Invoked
        whenever an NSFileWrapper and content type combination is set on an API attachment via WebKit SPI.

        (API::Attachment::fileSizeForDisplay const):

        Returns a file size to be displayed in the attachment element's subtitle. This returns an optional file size,
        where `std::nullopt` indicates that there should not be a file size shown. For now, this returns `std::nullopt`
        for directory file wrappers, though in the future, this should be done only in cases where we don't immediately
        have a size estimate for the file wrapper.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):

        Use API::Attachment::setFileWrapperAndUpdateContentType() instead of trying to come up with a fallback UTI.

        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachment setFileWrapper:contentType:completion:]):

        Use API::Attachment::setFileWrapperAndUpdateContentType() instead of trying to come up with a fallback UTI.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::insertAttachment):

        Remove the separate arguments for file size, content type, and file name, and instead get them from the given
        API Attachment object.

        (WebKit::WebPageProxy::updateAttachmentAttributes):

        Remove separate arguments for file size, content type and file name and just take an API::Attachment instead.
        These separate pieces of information can simply be asked from the Attachment itself.

        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::insertAttachment):
        (WebKit::WebPage::updateAttachmentAttributes):

        Adjust some interfaces here to allow the displayed file size to be optional.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        Fix internal builds after r235368

        * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
        At least the ios macros need an introductory version.

2018-08-27  Keith Rollin  <krollin@apple.com>

        Build system support for LTO
        https://bugs.webkit.org/show_bug.cgi?id=187785
        <rdar://problem/42353132>

        Reviewed by Dan Bernstein.

        Update Base.xcconfig and DebugRelease.xcconfig to optionally enable
        LTO.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:

2018-08-27  Daniel Bates  <dabates@apple.com>

        Remove extern variable and simplify state initialization in TextCheckerMac.mm
        https://bugs.webkit.org/show_bug.cgi?id=188820

        Reviewed by Simon Fraser.

        Use the same approach to initializing the TextCheckerState in TextCheckerMac.mm as we did in
        TextCheckerIOS.mm. Make use of a static, non-member, file-local function and NeverDestroyed
        to initialize a TextCheckerState object once and provide access to it from other implementation
        functions.

        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::mutableState):
        (WebKit::TextChecker::state):
        (WebKit::TextChecker::setTestingMode):
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::setGrammarCheckingEnabled):
        (WebKit::TextChecker::setAutomaticSpellingCorrectionEnabled):
        (WebKit::TextChecker::setAutomaticQuoteSubstitutionEnabled):
        (WebKit::TextChecker::setAutomaticDashSubstitutionEnabled):
        (WebKit::TextChecker::setAutomaticLinkDetectionEnabled):
        (WebKit::TextChecker::setAutomaticTextReplacementEnabled):
        (WebKit::TextChecker::didChangeAutomaticTextReplacementEnabled):
        (WebKit::TextChecker::didChangeAutomaticSpellingCorrectionEnabled):
        (WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
        (WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
        (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
        (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
        (WebKit::initializeState): Deleted.

2018-08-27  Sihui Liu  <sihui_liu@apple.com>

        Don't launch network process in WebCookieManagerProxy::setHTTPCookieAcceptPolicy
        https://bugs.webkit.org/show_bug.cgi?id=188906
        <rdar://problem/42875795>

        Reviewed by Ryosuke Niwa.

        Add callback in early return.

        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        Transition WKBrowsingContextController from WKPageLoaderClient to WKPageNavigationClient
        https://bugs.webkit.org/show_bug.cgi?id=188942

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (didStartProvisionalNavigation):
        (didReceiveServerRedirectForProvisionalNavigation):
        (didFailProvisionalNavigation):
        (didCommitNavigation):
        (didFinishNavigation):
        (didFailNavigation):
        (canAuthenticateAgainstProtectionSpace):
        (didReceiveAuthenticationChallenge):
        (setUpPageLoaderClient):
        (-[WKBrowsingContextController setLoadDelegate:]):
        (didStartProvisionalLoadForFrame): Deleted.
        (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
        (didFailProvisionalLoadWithErrorForFrame): Deleted.
        (didCommitLoadForFrame): Deleted.
        (didFinishLoadForFrame): Deleted.
        (didFailLoadWithErrorForFrame): Deleted.
        (canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
        (didReceiveAuthenticationChallengeInFrame): Deleted.
        (didStartProgress): Deleted.
        (didChangeProgress): Deleted.
        (didFinishProgress): Deleted.
        (didChangeBackForwardList): Deleted.
        * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:

2018-08-26  Darin Adler  <darin@apple.com>

        [Cocoa] Adapt more WebKit code to be ARC-compatible
        https://bugs.webkit.org/show_bug.cgi?id=188955

        Reviewed by Anders Carlsson.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Use __strong for an in/out argument.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
        Use __strong for a in/out argument.
        (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy): Call a NSURLSessionTask
        method using an explicit category declaration rather than by using performSelector:
        since ARC is unable to correctly compile a call when it doesn't know argument and
        result types.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::initializeCocoaOverrides): Add some __bridge casts.

        * Shared/API/Cocoa/WKRemoteObjectCoder.mm: Use HashSet<CFTypeRef> instead of
        HashSet<Class> since Class ia an ARC-managed type and WTF hash tables can't
        currently handle those as key types.
        (-[WKRemoteObjectDecoder decodeValueOfObjCType:at:]): Changed types and added casts
        to adapt to the above.
        (decodeObjectFromObjectStream): Ditto.
        (checkIfClassIsAllowed): Ditto.
        (decodeInvocationArguments): Ditto.
        (decodeObject): Ditto.
        (-[WKRemoteObjectDecoder decodeObjectOfClasses:forKey:]): Ditto.
        (-[WKRemoteObjectDecoder allowedClasses]): Ditto.
        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
        (propertyListClasses): Ditto.
        (initializeMethod): Ditto.
        (-[_WKRemoteObjectInterface debugDescription]): Ditto.
        (classesForSelectorArgument): Ditto.
        (-[_WKRemoteObjectInterface classesForSelector:argumentIndex:ofReply:]): Ditto.
        (-[_WKRemoteObjectInterface setClasses:forSelector:argumentIndex:ofReply:]): Ditto.
        (-[_WKRemoteObjectInterface _allowedArgumentClassesForSelector:]): Ditto.
        (-[_WKRemoteObjectInterface _allowedArgumentClassesForReplyBlockOfSelector:]): Ditto.
        * Shared/API/Cocoa/_WKRemoteObjectInterfaceInternal.h: Ditto.

        * Shared/API/c/cf/WKStringCF.mm:
        (WKStringCreateWithCFString): Use CFRetain instead of -[NSObject retain]. Also use
        a __bridge cast.
        * Shared/API/c/cf/WKURLCF.mm:
        (WKURLCreateWithCFURL): Ditto.

        * Shared/Cocoa/APIObject.mm:
        (API::Object::ref): Added a __bridge cast.
        (API::Object::deref): Ditto.
        (API::allocateWKObject): Use class_createInstance instead of NSAllocateObject.
        (API::Object::wrap): Use a __bridge cast.
        (API::Object::unwrap): Ditto.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Use CFTypeRef for layers
        or views in the RelatedLayerMap since we don't want the items retained, and can't
        use __unsafe_uretained because the header is used in non-Objective-C contexts.
        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::RemoteLayerTreePropertyApplier::applyProperties): Added __bridge casts,
        needed because of the above change.

        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (WebKit::browsingContextControllerMap): Use __unsafe_unretained.

        * UIProcess/API/Cocoa/WKConnection.mm:
        (didReceiveMessage): Use a __bridge cast.

        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
        Use a retain here so we don't have to have a "releasesArgument:" boolean. The cost of a single
        retain/release pair should be infinitesmal compared to the entire process of compiling.
        (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
        Moved the code for the "releases argument" version here since the private method is now the
        actual method that does the work. The public method now simply calls this private one after
        doing a retain. The optimization of releasing the argument at the correct moment should be intact.

        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: Use CFTypeRef for the key to the _observers
        HashMap since the WTF collections can't yet handle ARC types for keys.
        (-[WKHTTPCookieStore addObserver:]): Added __bridge cast for compatibility with the above.
        (-[WKHTTPCookieStore removeObserver:]): Ditto.

        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (setUpConnectionClient): Added a __bridge cast.
        (setUpHistoryClient): Ditto.

        * UIProcess/API/Cocoa/WKViewPrivate.h: Added a declaration of the
        -[WKView _shouldLoadIconWithParameters:completionHandler:] method. This peculiar idiom
        should be removed, but I didn't bother doing that since the entire WKView class is already
        deprecated and so will eventually be removed.

        * UIProcess/API/Cocoa/WKWebView.mm: Use __unsafe_unretained for the keys in the page to
        view map.
        (accessibilityEventsEnabledChangedCallback): Use a __bridge cast.
        (-[WKWebView _certificateChain]): Ditto.
        (-[WKWebView certificateChain]): Ditto.

        * UIProcess/API/mac/WKView.mm:
        (-[WKView maybeInstallIconLoadingClient]): Call the method
        _shouldLoadIconWithParameters:completionHandler: in a normal way rather than using
        performSelector:withObject:withObject: since ARC is unable to correctly compile a call
        when it doesn't know argument and result types.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): Use the overload
        of API::Data::createWithoutCopying that knows how to work with an NSData rather than
        re-implementing it here.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto. Also removed unneeded
        use of RetainPtr.

        * UIProcess/Cocoa/WebViewImpl.h: Use NSObject * as the result type of
        immediateActionAnimationControllerForHitTestResult. Our techniques for defining such
        functions in headers while remaining compatible with non-Objective-C will still work
        fine given how we use this, and converting to and from void* rather than NSObject *
        would be difficult to do correctly under ARC.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::acceptsFirstMouse): Use CFRetain/CFAutorelease instead of
        retain/autorelease.
        (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent): Ditto.
        (WebKit::WebViewImpl::immediateActionAnimationControllerForHitTestResult):
        Updated return type to NSObject *.
        (WebKit::WebViewImpl::performKeyEquivalent): Use CFRetain/CFAutorelease.

        * UIProcess/PageClient.h: Use NSObject * as the result type, as above.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::updateLayerTree): Use __bridge casts to be compatible
        with the changes to the RelatedLayerMap types.
        (WebKit::recursivelyMapIOSurfaceBackingStore): Use __bridge cast.

        * Source/WebKit/UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
        Use NSObject * as the result type, as above.
        * Source/WebKit/UIProcess/WebPageProxy.h: Ditto.

        * UIProcess/mac/PageClientImplMac.h: Use NSObject * as the result type, as above.
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::immediateActionAnimationControllerForHitTestResult):
        Ditto.
        (WebKit::PageClientImpl::refView): Use __bridge cast.
        (WebKit::PageClientImpl::derefView): Ditto.

        * UIProcess/mac/ServicesController.mm:
        (WebKit::ServicesController::refreshExistingServices): Removed unnecessary use
        of NeverDestroyed for Objective-C object pointers. Simpler and more efficient
        both with and without ARC.

        * UIProcess/mac/WKImmediateActionController.mm:
        (-[WKImmediateActionController _updateImmediateActionItem]): Removed unneeded
        cast now that immediateActionAnimationControllerForHitTestResult has a more
        accurate return type.

        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView dealloc]): Use a more direct approach to making sure we do the
        non-thread-safe actions on the main thread with a call to callOnMainThread.
        The old solution, WebCoreObjCScheduleDeallocateOnMainThread, may not be possible
        in an ARC-compatible way, but this one should work fine.
        (linkDestinationName): Changed to return an NSString * to make sure we get the
        object lifetimes correct under ARC.
        (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Added __bridge casts.

        * WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: Use __unsafe_unretained
        for the value types in DOM caches.
        * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
        (WebKit::toWKDOMNode): Updated for the above.
        (WebKit::toWKDOMRange): Ditto.

        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::NetscapePlugin::platformPreInitialize): Rewrote the class_replaceMethod
        call to sidestep the rules about not using @selector(release) under ARC.
        (WebKit::NetscapePlugin::updatePluginLayer): Use __bridge casts.

        * WebProcess/Plugins/PDF/PDFPlugin.mm: Added an include of
        WebAccessibilityObjectWrapperMac.h, without which this code doesn't compile
        under ARC.

        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        (WebKit::changeWordCase): Use a function rather than a selector, since ARC is unable
        to correctly compile a method call when it doesn't know argument and result types.
        (WebKit::WebEditorClient::uppercaseWord): Updated to use a function rather than a selector.
        (WebKit::WebEditorClient::lowercaseWord): Ditto.
        (WebKit::WebEditorClient::capitalizeWord): Ditto.

        * WebProcess/cocoa/WebProcessCocoa.mm: Added an include of
        WebAccessibilityObjectWrapperIOS/Mac.h, without which this code doesn't compile
        under ARC.

2018-08-27  Alex Christensen  <achristensen@webkit.org>

        Fix authentication for clients of WKPageLoaderClient after r234941
        https://bugs.webkit.org/show_bug.cgi?id=188939

        Reviewed by Youenn Fablet.

        I simplified the authentication code path elegantly for clients of WKPageNavigationClient/WKNavigationDelegate,
        but clients of WKPageLoaderClient that do not implement didReceiveAuthenticationChallengeInFrame would hang.
        This fixes that.  I've also made the performDefaultHandling (when delegates are not implemented) and rejectProtectionSpaceAndContinue
        (when canAuthenticationAgainstProtectionSpace returns false) behave correctly.

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::didReachLayoutMilestone):
        (API::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):

2018-08-26  Sam Weinig  <sam@webkit.org>

        Using _WKRemoteObjectInterface with a protocol that inherits from a non-NSObject protocol crashes
        https://bugs.webkit.org/show_bug.cgi?id=188958

        Reviewed by Anders Carlsson.

        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
        (initializeMethods):
        Fix infinite recursion by using the passed in protocol rather
        than always using the one from the initial interface. 

2018-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments
        https://bugs.webkit.org/show_bug.cgi?id=188933
        <rdar://problem/43699724>

        Reviewed by Darin Adler.

        Support the ability to drop and paste images as image elements, with attachment elements, only if attachment
        elements are enabled. See changes below for more detail.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PromisedAttachmentInfo>::encode):
        (IPC::ArgumentCoder<PromisedAttachmentInfo>::decode):

        Rename "filename" to "fileName", for consistency with WKContentView and WebViewImpl.

        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::mimeType const):
        (API::Attachment::fileName const):
        * UIProcess/API/APIAttachment.h:

        Push getters for MIME type, UTI, and the file name down from _WKAttachment to API::Attachment. This allows
        WKContentView and WebViewImpl to ask an API::Attachment questions about its UTI and file name without
        additionally creating a wrapper object.

        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm: Added.
        (API::mimeTypeInferredFromFileExtension):
        (API::isDeclaredOrDynamicTypeIdentifier):
        (API::Attachment::mimeType const):
        (API::Attachment::utiType const):
        (API::Attachment::fileName const):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

        Add a private delegate hook to notify the UI delegate when a drop has been performed. This is used by tests to
        know when a drop with file promises has been processed by the page.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _web_didPerformDragOperation:]):
        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachmentInfo initWithFileWrapper:filePath:mimeType:utiType:]):
        (-[_WKAttachmentInfo fileWrapper]):
        (-[_WKAttachmentInfo contentType]):
        (-[_WKAttachment info]):
        (-[_WKAttachmentInfo initWithFileWrapper:filePath:contentType:]): Deleted.
        (isDeclaredOrDynamicTypeIdentifier): Deleted.
        (-[_WKAttachmentInfo _typeIdentifierFromPathExtension]): Deleted.
        (-[_WKAttachmentInfo mimeType]): Deleted.
        (-[_WKAttachmentInfo utiType]): Deleted.

        Moved to APIAttachmentCocoa.mm.

        * UIProcess/API/mac/WKView.mm:
        (-[WKView _web_didPerformDragOperation:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKPromisedAttachmentContext initWithIdentifier:blobURL:fileName:]):

        Adjust this constructor to take each piece of data separately. This is because, in the case where our
        PromisedAttachmentInfo contains an attachment identifier, we determine the UTI and file name from the associated
        file wrapper.

        (-[WKPromisedAttachmentContext fileName]):
        (WebKit::WebViewImpl::fileNameForFilePromiseProvider):
        (WebKit::WebViewImpl::didPerformDragOperation):
        (WebKit::WebViewImpl::startDrag):

        Determine UTI and file name from the attachment element corresponding to the attachment identifier when
        dragging. This is because the attachment element in the web process shouldn't need to have type and title
        attributes set when starting a drag if it already has an identifier that maps to attachment data in the UI
        process. An example of this is in inline images backed by attachments, for which we don't need to bother keeping
        specifying display attributes, since they are never visible.

        (-[WKPromisedAttachmentContext initWithAttachmentInfo:]): Deleted.
        (-[WKPromisedAttachmentContext filename]): Deleted.
        * UIProcess/PageClient.h:
        (WebKit::PageClient::didPerformDragOperation):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didPerformDragOperation):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        Rename DidPerformDataInteractionControllerOperation to DidPerformDragOperation, and make it cross-platform (this
        was previously only sent on iOS). Add plumbing through PageClient and friends on macOS to notify the UI
        delegate when a drop is handled by the web process.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didPerformDragOperation):
        (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didPerformDragOperation:]):
        (-[WKContentView _prepareToDragPromisedAttachment:]):

        Just like in WebViewImpl::startDrag, infer content type and file name from the API attachment object.

        (-[WKContentView _didPerformDataInteractionControllerOperation:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation): Deleted.
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didPerformDragOperation):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::performDragControllerAction):

2018-08-23  Jeff Miller  <jeffm@apple.com>

        Remove -[WKNavigationDelegate _webView:decidePolicyForPluginLoadWithCurrentPolicy:pluginInfo:unavailabilityDescription:]
        https://bugs.webkit.org/show_bug.cgi?id=188889

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        Remove obsolete method.

        * UIProcess/Cocoa/NavigationState.h:
        Remove obsolete flag.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        Remove obsolete flag.

        (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
        Remove support for obsolete delegate method.

2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>

        Pass in IsComposed flag to Event constructors
        https://bugs.webkit.org/show_bug.cgi?id=188720
        <rdar://problem/43580387>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): A trusted click event is composed regardless of
        whether it's simulated or not.

2018-08-24  Alex Christensen  <achristensen@webkit.org>

        Add WKWebView._mainFrame SPI
        https://bugs.webkit.org/show_bug.cgi?id=188925

        Reviewed by Brian Burg.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _mainFrame]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2018-08-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Match the interface used in NetworkDataTask and ResourceHandle.
        https://bugs.webkit.org/show_bug.cgi?id=188922

        Reviewed by Alex Christensen.

        The interfaces for NetworkDataTask and ResourceHandle are diverged.
        It should be same for the same purpose because they do same thing.

        No change in behavior.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCurl::restartWithCredential):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:

2018-08-24  Alex Christensen  <achristensen@webkit.org>

        Follow up to r235323
        https://bugs.webkit.org/show_bug.cgi?id=188923
        <rdar://problem/34657861>

        * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (-[WKWebInspectorProxyObjCAdapter inspector]):
        A _WKInspector * accessor in the WKWebInspectorProxyObjCAdapter is nice, too.

2018-08-24  Alex Christensen  <achristensen@webkit.org>

        Introduce _WKInspector
        https://bugs.webkit.org/show_bug.cgi?id=188923
        <rdar://problem/34657861>

        Reviewed by Brian Burg.

        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _inspector]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKInspector.h: Added.
        * UIProcess/API/Cocoa/_WKInspector.mm: Added.
        (-[_WKInspector webView]):
        (-[_WKInspector isConnected]):
        (-[_WKInspector isVisible]):
        (-[_WKInspector isFront]):
        (-[_WKInspector isProfilingPage]):
        (-[_WKInspector isElementSelectionActive]):
        (-[_WKInspector connect]):
        (-[_WKInspector show]):
        (-[_WKInspector hide]):
        (-[_WKInspector close]):
        (-[_WKInspector showConsole]):
        (-[_WKInspector showResources]):
        (-[_WKInspector showMainResourceForFrame:]):
        (-[_WKInspector attach]):
        (-[_WKInspector detach]):
        (-[_WKInspector showTimelines]):
        (-[_WKInspector togglePageProfiling]):
        (-[_WKInspector toggleElementSelection]):
        (-[_WKInspector printErrorToConsole:]):
        (-[_WKInspector _apiObject]):
        * UIProcess/API/Cocoa/_WKInspectorInternal.h: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-08-24  Sihui Liu  <sihui_liu@apple.com>

        Don't launch network process in WebCookieManagerProxy::setHTTPCookieAcceptPolicy
        https://bugs.webkit.org/show_bug.cgi?id=188906
        <rdar://problem/43539661>

        Reviewed by Geoffrey Garen.

        In WebCookieManagerProxy::setHTTPCookieAcceptPolicy, we persist the cookieAcceptPolicy of 
        sharedCookieStorage. When we launch the network process later, we pass the 
        identifier of sharedCookieStorage to network process, so network process has the correct 
        cookieAcceptPolicy. Therefore, we don't have to launch the network process and send the 
        setting message if the network process is not launched.

        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):

2018-08-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to inject/register user content in isolated worlds
        https://bugs.webkit.org/show_bug.cgi?id=188883

        Reviewed by Michael Catanzaro.

        Add new API to create user scripts/stylesheets for a given script world and to register/unregister user script
        messages in a given script world.

        * UIProcess/API/glib/WebKitUserContent.cpp:
        (webkitUserContentWorld):
        (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
        (webkit_user_style_sheet_new):
        (webkit_user_style_sheet_new_for_world):
        (_WebKitUserScript::_WebKitUserScript):
        (webkit_user_script_new):
        (webkit_user_script_new_for_world):
        * UIProcess/API/glib/WebKitUserContentManager.cpp:
        (webkit_user_content_manager_register_script_message_handler_in_world):
        (webkit_user_content_manager_unregister_script_message_handler_in_world):
        * UIProcess/API/glib/WebKitUserContentPrivate.h:
        * UIProcess/API/gtk/WebKitUserContent.h:
        * UIProcess/API/gtk/WebKitUserContentManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitUserContent.h:
        * UIProcess/API/wpe/WebKitUserContentManager.h:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserContentWorlds):

2018-08-23  Tim Horton  <timothy_horton@apple.com>

        Use unified build for UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=185014

        Reviewed by Alex Christensen.

        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
        * UIProcess/API/glib/IconDatabase.cpp:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        * UIProcess/API/gtk/WebKitColorChooser.cpp:
        * UIProcess/API/gtk/WebKitPopupMenu.cpp:
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
        * UIProcess/ApplicationStateTracker.mm:
        * UIProcess/Authentication/mac/WebCredentialMac.mm:
        * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        * UIProcess/Cocoa/NavigationState.mm:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/Cocoa/ViewGestureController.cpp:
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
        (-[WKWebViewContentProviderRegistry addPage:]):
        (-[WKWebViewContentProviderRegistry removePage:]):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKTextTouchBarItemController itemForIdentifier:]):
        (WebKit::WebViewImpl::performDragOperation):
        * UIProcess/Downloads/DownloadProxy.cpp:
        * UIProcess/DrawingAreaProxy.cpp:
        * UIProcess/Gamepad/UIGamepad.cpp:
        * UIProcess/Gamepad/UIGamepadProvider.cpp:
        * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
        * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
        * UIProcess/PerActivityStateCPUUsageSampler.cpp:
        * UIProcess/Plugins/PluginInfoStore.cpp:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        * UIProcess/SuspendedPageProxy.cpp:
        * UIProcess/TextCheckerCompletion.cpp:
        * UIProcess/UIMessagePortChannelProvider.cpp:
        * UIProcess/UserMediaPermissionCheckProxy.cpp:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        * UIProcess/UserMediaPermissionRequestProxy.cpp:
        * UIProcess/VisitedLinkStore.cpp:
        * UIProcess/WKInspectorHighlightView.mm:
        (findIntersectionOnLineBetweenPoints):
        (quadIntersection):
        (layerPathWithHole):
        (layerPath):
        (-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
        (-[WKInspectorHighlightView _layoutForNodeListHighlight:]):
        (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
        (-[WKInspectorHighlightView update:]):
        * UIProcess/WebBackForwardList.cpp:
        * UIProcess/WebContextMenuListenerProxy.cpp:
        * UIProcess/WebCookieManagerProxy.cpp:
        * UIProcess/WebEditCommandProxy.cpp:
        * UIProcess/WebFrameProxy.cpp:
        * UIProcess/WebFullScreenManagerProxy.cpp:
        * UIProcess/WebInspectorProxy.cpp:
        * UIProcess/WebNavigationState.cpp:
        * UIProcess/WebOpenPanelResultListenerProxy.cpp:
        * UIProcess/WebPageInjectedBundleClient.cpp:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        * UIProcess/WebURLSchemeHandler.cpp:
        * UIProcess/WebURLSchemeTask.cpp:
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
        * UIProcess/ios/DragDropInteractionState.mm:
        * UIProcess/ios/InputViewUpdateDeferrer.mm:
        * UIProcess/ios/PageClientImplIOS.mm:
        (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
        (-[WKEditCommandObjC command]):
        * UIProcess/ios/SmartMagnificationController.mm:
        * UIProcess/ios/TextCheckerIOS.mm:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::beginSwipeGesture):
        (WebKit::ViewGestureController::removeSwipeSnapshot):
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (presentationStyleForView):
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView initWithFrame:webView:]):
        (-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
        (-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
        (-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
        * UIProcess/ios/WKGeolocationProviderIOS.mm:
        (-[WKGeolocationProviderIOS _startUpdating]):
        (-[WKGeolocationProviderIOS _stopUpdating]):
        (-[WKGeolocationProviderIOS _setEnableHighAccuracy:]):
        (-[WKGeolocationProviderIOS init]):
        (-[WKGeolocationProviderIOS initWithProcessPool:]):
        (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
        (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
        (-[WKLegacyCoreLocationProvider positionChanged:]):
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator _scrollOffsetForEvent:]):
        (-[WKKeyboardScrollingAnimator beginWithEvent:]):
        (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
        (-[WKKeyboardScrollingAnimator startAnimatedScroll]):
        (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
        * UIProcess/ios/WKLegacyPDFView.mm:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView _systemContentInset]):
        * UIProcess/ios/WKSystemPreviewView.mm:
        * UIProcess/ios/WebPageProxyIOS.mm:
        * UIProcess/mac/CorrectionPanel.mm:
        (correctionIndicatorType):
        * UIProcess/mac/PageClientImplMac.mm:
        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
        (-[WKRemoteWebInspectorProxyObjCAdapter initWithRemoteWebInspectorProxy:]):
        * UIProcess/mac/TextCheckerMac.mm:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        * UIProcess/mac/ViewGestureControllerMac.mm:
        * UIProcess/mac/ViewSnapshotStore.mm:
        * UIProcess/mac/WKFullKeyboardAccessWatcher.mm:
        (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]):
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
        (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
        (-[WKFullScreenWindowController initWithWindow:webView:page:]):
        (-[WKFullScreenWindowController enterFullScreen:]):
        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
        (-[WKFullScreenWindowController windowDidEnterFullScreen:]):
        (-[WKFullScreenWindowController windowDidExitFullScreen:]):
        (-[WKFullScreenWindowController _manager]):
        (-[WKFullScreenWindowController _replaceView:with:]):
        (zoomAnimation):
        (createMask):
        (maskAnimation):
        * UIProcess/mac/WKImmediateActionController.mm:
        (-[WKImmediateActionController initWithPage:view:viewImpl:recognizer:]):
        (-[WKImmediateActionController willDestroyView:]):
        (-[WKImmediateActionController _clearImmediateActionState]):
        (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
        (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
        (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
        (-[WKImmediateActionController _webHitTestResult]):
        (-[WKImmediateActionController _defaultAnimationController]):
        (-[WKImmediateActionController menuItem:maxSizeForPoint:]):
        (-[WKImmediateActionController _animationControllerForDataDetectedText]):
        (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
        (-[WKImmediateActionController _animationControllerForText]):
        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController initWithInspectedPage:]):
        (-[WKInspectorViewController webView]):
        (-[WKInspectorViewController configuration]):
        (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
        (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
        (-[WKInspectorViewController inspectorWKWebViewReload:]):
        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView _expectedPreviewCallbackForRect:]):
        (pageDidDrawToImage):
        (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
        (pageDidComputePageRects):
        (-[WKPrintingView _askPageToComputePageRects]):
        (-[WKPrintingView _pageForRect:]):
        (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
        (-[WKPrintingView _drawPreview:]):
        (-[WKPrintingView drawRect:]):
        (-[WKPrintingView rectForPage:]):
        * UIProcess/mac/WKTextFinderClient.mm:
        (-[WKTextFinderClient initWithPage:view:]):
        (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
        (-[WKTextFinderClient getSelectedText:]):
        (arrayFromRects):
        (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
        (-[WKTextFinderClient didGetImageForMatchResult:]):
        * UIProcess/mac/WKTextInputWindowController.mm:
        * UIProcess/mac/WKViewLayoutStrategy.mm:
        (+[WKViewLayoutStrategy layoutStrategyWithPage:view:viewImpl:mode:]):
        (-[WKViewLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewViewSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewFixedSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:viewImpl:mode:]):
        (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:viewImpl:mode:]):
        * UIProcess/mac/WebColorPickerMac.mm:
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (-[WKMenuTarget forwardContextMenuAction:]):
        (WebKit::menuItemIdentifier):
        (WebKit::WebContextMenuProxyMac::createContextMenuItem):
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
        * UIProcess/mac/WebPageProxyMac.mm:
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        * UIProcess/win/PageClientImpl.cpp:
        * UIProcess/win/TextCheckerWin.cpp:
        * UIProcess/win/WebContextMenuProxyWin.cpp:
        * UIProcess/win/WebPopupMenuProxyWin.cpp:
        * UIProcess/win/WebView.cpp:
        * UIProcess/wpe/TextCheckerWPE.cpp:
        * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
        * WebKit.xcodeproj/project.pbxproj:

2018-08-23  Sihui Liu  <sihui_liu@apple.com>

        Move legacy directory configuration from WebProcessPool to API::WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=188765
        <rdar://problem/43633183>

        Reviewed by Geoffrey Garen.

        Diretories are parameters of websiteDataStore instead of webProcessPool, so we should move
        legacy default paths to API::WebsiteDataStore, which already stores default paths for 
        non-legacy cases.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::createWithLegacyOptions):
        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/win/WebProcessPoolWin.cpp:
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/wpe/WebProcessPoolWPE.cpp:
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.

2018-08-23  Alex Christensen  <achristensen@webkit.org>

        Add new _webViewRequestPointerLock SPI with a completionHandler
        https://bugs.webkit.org/show_bug.cgi?id=188907
        <rdar://problem/35871109>

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::requestPointerLock):

2018-08-23  Andy Estes  <aestes@apple.com>

        [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
        https://bugs.webkit.org/show_bug.cgi?id=188829

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::supportsVersion):

2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234942.

        Caused page loading issues in iTunes

        Reverted changeset:

        "Transition more WKWebViewConfiguration ivars to
        API::PageConfiguration values"
        https://bugs.webkit.org/show_bug.cgi?id=188663
        https://trac.webkit.org/changeset/234942

2018-08-23  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Support the inputmode attribute on contenteditable elements
        https://bugs.webkit.org/show_bug.cgi?id=188878

        Reviewed by Ryosuke Niwa.

        Ensured that the assistedNodeInformation for a contenteditable element reflects
        the value of the element's inputmode attribute.

        Moved logic to obtain the InputMode from the attribute value into WebCore.

        * Shared/AssistedNodeInformation.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

2018-08-22  Ryosuke Niwa  <rniwa@webkit.org>

        Assert in NetworkBlobRegistry::unregisterBlobURL after network process had terminated
        https://bugs.webkit.org/show_bug.cgi?id=188880

        Reviewed by Saam Barati.

        Removed the debug assertion. WebContent process might be asking this network process
        to unregister a blob registered from another network processs which had since crashed.

        We could keep track of which blob had been registered with which network process
        in WebContent process and avoid sending IPC to the network process but that's a lot of
        house-keeping for virtually no benefit other than not hitting this assertion.

        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
        (WebKit::NetworkBlobRegistry::unregisterBlobURL):

2018-08-23  Sihui Liu  <sihui_liu@apple.com>

        Remove keys of defaults that are no longer used in webProcessPool
        https://bugs.webkit.org/show_bug.cgi?id=188855

        Reviewed by Alex Christensen.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::registerUserDefaultsIfNeeded):

2018-08-23  Dan Bernstein  <mitz@apple.com>

        [Cocoa] First scroll gesture in pinned, non-rubber-banding WKWebView may fail to initiate back/forward swipe
        https://bugs.webkit.org/show_bug.cgi?id=188894
        <rdar://problem/43651434>

        Reviewed by Tim Horton.

        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent): Set the rubber-band state on the ScrollingTree
          synchronously rather than dispatching doing that to the scrolling thread. This is safe to
          do because ScrollingTree synchrnoizes access to the rubber-band state with an internal
          mutex.

2018-08-23  Youenn Fablet  <youenn@apple.com>

        self.isSecureContext undefined in Service Worker
        https://bugs.webkit.org/show_bug.cgi?id=188842

        Reviewed by Alex Christensen.

        Enable isSecureContext runtime flag.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::updatePreferencesStore):

2018-08-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r235216.
        https://bugs.webkit.org/show_bug.cgi?id=188887

        Caused 50+ Layout Tests to Crash and 173 api Failures on Debug
        builds (Requested by Truitt on #webkit).

        Reverted changeset:

        "Move legacy directory configuration from WebProcessPool to
        API::WebsiteDataStore"
        https://bugs.webkit.org/show_bug.cgi?id=188765
        https://trac.webkit.org/changeset/235216

2018-08-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
        https://bugs.webkit.org/show_bug.cgi?id=188881

        Reviewed by Carlos Garcia Campos.

        Rid CompositingCoordinator class of code that manages now-deleted state
        tracking of layer creation, update and removal on the
        CoordinatedGraphicsState class. The syncLayerState() method is changed
        accordingly, now only enforcing a frame synchronization when called.

        Use of Nicosia::PlatformLayer::LayerID is adopted since the
        CoordinatedLayerID type has been removed.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::purgeGLResources):
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::flushPendingLayerChanges):
        (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
        (WebKit::CompositingCoordinator::syncLayerState):
        (WebKit::CompositingCoordinator::createGraphicsLayer):
        (WebKit::CompositingCoordinator::detachLayer):
        (WebKit::CompositingCoordinator::attachLayer):
        (WebKit::CompositingCoordinator::clearPendingStateChanges): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

2018-08-22  Antti Koivisto  <antti@apple.com>

        NetworkCache::Storage::lastStableVersion should be a developer-only feature
        https://bugs.webkit.org/show_bug.cgi?id=188843
        <rdar://problem/43574100>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::deleteOldVersions):

        Delete old cache versions unconditionally if we are system WebKit.

        * Shared/ChildProcess.h:
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::isSystemWebKit):

        Find out if WebKit is installed under '/System/'.

2018-08-22  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove CoordinatedImageBacking and related functionality
        https://bugs.webkit.org/show_bug.cgi?id=188847

        Reviewed by Michael Catanzaro.

        Remove the CoordinatedImageBacking class and its intertwining use in the
        CoordinatedGraphics system.

        Drop the CoordinatedImageBacking object management from the
        CompositingCoordinator class, along with the
        CoordinatedImageBacking::Client inheritance. The corresponding image
        backing state management on the CoordinatedGraphicsState class can be
        removed accordingly.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::flushPendingLayerChanges):
        (WebKit::CompositingCoordinator::clearPendingStateChanges):
        (WebKit::CompositingCoordinator::purgeBackingStores):
        (WebKit::CompositingCoordinator::createImageBackingIfNeeded): Deleted.
        (WebKit::CompositingCoordinator::createImageBacking): Deleted.
        (WebKit::CompositingCoordinator::updateImageBacking): Deleted.
        (WebKit::CompositingCoordinator::clearImageBackingContents): Deleted.
        (WebKit::CompositingCoordinator::removeImageBacking): Deleted.
        (WebKit::CompositingCoordinator::flushPendingImageBackingChanges): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

2018-08-22  Sihui Liu  <sihui_liu@apple.com>

        Move legacy directory configuration from WebProcessPool to API::WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=188765

        Reviewed by Geoffrey Garen.

        Diretories are parameters of websiteDataStore instead of webProcessPool, so we should move
        legacy default paths to API::WebsiteDataStore, which already stores default paths for 
        non-legacy cases.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::createWithLegacyOptions):
        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
        (API::WebsiteDataStore::legacyDefaultApplicationCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultNetworkCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::legacyDefaultLocalStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaCacheDirectory):
        (API::WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/win/WebProcessPoolWin.cpp:
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.
        * UIProcess/wpe/WebProcessPoolWPE.cpp:
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory): Deleted.
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory): Deleted.

2018-08-22  John Wilander  <wilander@apple.com>

        The Storage Access API prompt should show the eTLD+1s, not the full host names
        https://bugs.webkit.org/show_bug.cgi?id=188830
        <rdar://problem/43380645>

        Reviewed by Brent Fulgham.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestStorageAccess):

2018-08-22  Tim Horton  <timothy_horton@apple.com>

        De-unify WebPage
        https://bugs.webkit.org/show_bug.cgi?id=188865

        Reviewed by Wenson Hsieh.

        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        WebPage being unified is causing mysterious build issues inside Carbon headers
        on High Sierra only. Also, WebPage by itself takes longer to build than
        most full unified source files, so it might not make sense to unify it
        with others (to maximize parallelism).

2018-08-22  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r235204.

        reverting previous rollout

        Reverted changeset:

        "Unreviewed, rolling out r235176."
        https://bugs.webkit.org/show_bug.cgi?id=185015
        https://trac.webkit.org/changeset/235204

2018-08-22  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r235176.

        broke internal builds

        Reverted changeset:

        "Use unified build for WebProcess"
        https://bugs.webkit.org/show_bug.cgi?id=185015
        https://trac.webkit.org/changeset/235176

2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Support dragging attachment elements out as files on macOS
        https://bugs.webkit.org/show_bug.cgi?id=181294
        <rdar://problem/36298801>

        Reviewed by Tim Horton.

        Add support for dragging attachment elements on macOS by writing promised files to drag pasteboard. See changes
        below for more details.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView filePromiseProvider:fileNameForType:]):
        (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]):
        (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]):
        (-[WKWebView draggingSession:endedAtPoint:operation:]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView filePromiseProvider:fileNameForType:]):
        (-[WKView filePromiseProvider:writePromiseToURL:completionHandler:]):
        (-[WKView draggingSession:sourceOperationMaskForDraggingContext:]):
        (-[WKView draggingSession:endedAtPoint:operation:]):

        Plumb NSFilePromiseProviderDelegate and NSDraggingSource method implementations to WebViewImpl.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKPromisedAttachmentContext initWithAttachmentInfo:]):
        (-[WKPromisedAttachmentContext blobURL]):
        (-[WKPromisedAttachmentContext filename]):
        (-[WKPromisedAttachmentContext attachmentIdentifier]):

        Add an object that contains the information needed to deliver a dragged attachment element's data via
        NSFilePromiseProvider. This is stored as the userInfo of the NSFilePromiseProvider created upon drag start.

        (WebKit::WebViewImpl::draggedImage):
        (WebKit::WebViewImpl::sendDragEndToPage):

        Add a helper method to handle cleanup after the dragging has finished, and call it from -draggedImage:… and
        -draggingSessionEnded:…. The latter is only triggered in the where -beginDraggingSessionWithItems:… is used,
        which currently only happens when dragging attachment elements.

        (WebKit::WebViewImpl::fileNameForFilePromiseProvider):
        (WebKit::webKitUnknownError):
        (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):

        Deliver either NSFileWrapper data to the destination URL (in the case where an attachment identifier is known
        and the corresponding API::Attachment is backed by a file wrapper), or save the contents of the blob URL to the
        destination.

        (WebKit::WebViewImpl::dragSourceOperationMask):
        (WebKit::WebViewImpl::draggingSessionEnded):
        (WebKit::WebViewImpl::startDrag):

2018-08-22  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Add support for the inputmode attribute
        https://bugs.webkit.org/show_bug.cgi?id=183621

        Reviewed by Tim Horton.

        The inputmode attribute specifies which input mechanism would be most helpful for
        users entering content in textfield inputs and textareas. This patch adds support
        for seven values: text, tel, url, email, numeric, decimal and search.

        On iOS, we can specify UIKeyboardTypes that best match the supplied inputmode.
        - text: UIKeyboardTypeDefault
        - tel: UIKeyboardTypePhonePad
        - url: UIKeyboardTypeURL
        - email: UIKeyboardTypeEmailAddress
        - numeric: UIKeyboardTypeNumbersAndPunctuation
        - decimal: UIKeyboardTypeDecimalPad
        - search: UIKeyboardTypeWebSearch

        In the case that the inputmode attribute is not specified, we fall back to using
        our existing heuristic to determine what kind of keyboard to show for textfields.

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h: Added inputMode field.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInputTraits]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::inputModeForElement):
        (WebKit::WebPage::getAssistedNodeInformation):

2018-08-22  Jeff Miller  <jeffm@apple.com>

        WKNavigationDelegate needs to allow clients to specify a custom blocked plug-in message
        https://bugs.webkit.org/show_bug.cgi?id=188764

        Reviewed by Alex Christensen.

        Add a new private WKNavigationDelegate method that takes a completion handler so clients can return
        a custom unavailability description in addition to the policy. Change WebPageProxy::findPlugin() to
        send a delayed reply and API::LoaderClient::pluginLoadPolicy()/API::NavigationClient::decidePolicyForPluginLoad()
        to take a completion handler to support this.
    
        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::pluginLoadPolicy):
        Changed to take a completion handler. The default implementation doesn't return a custom
        unavailability description.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::decidePolicyForPluginLoad):
        Ditto.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        Changed pluginLoadPolicy() to take a completion handler.

        (WKPageSetPageNavigationClient):
        Changed decidePolicyForPluginLoad() to take a completion handler.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        Add alternate version of -decidePolicyForPluginLoadWithCurrentPolicy: that allows clients to return
        the unavailibility description.
    
        * UIProcess/Cocoa/NavigationState.h:
        Add flag for new delegate method.
        Changed decidePolicyForPluginLoad() to take a completion handler.
    
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        Calculate flag for new delegate method.
    
        (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
        Changed to take a completion handler.
        Prefer new delegate method, if available.
    
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findPlugin):
        Changed to send a delayed reply.
        Refactored some code into a lambda so it can be shared when using m_navigationClient->decidePolicyForPluginLoad().
        Removed unneeded UNUSED_PARAM() macros.
    
        * UIProcess/WebPageProxy.h:
        Changed findPlugin() to send a delayed reply.
    
        * UIProcess/WebPageProxy.messages.in:
        Ditto.

2018-08-22  Sihui Liu  <sihui_liu@apple.com>

        Try removing defaultSessionParameters from NetworkProcessCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=188831

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-08-22  Tim Horton  <timothy_horton@apple.com>

        Use unified build for WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=185015

        Reviewed by Alex Christensen.

        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        * WebProcess/Databases/WebDatabaseProvider.cpp:
        * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        * WebProcess/Gamepad/WebGamepadProvider.cpp:
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        * WebProcess/Geolocation/WebGeolocationManager.cpp:
        * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
        * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
        * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
        * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp:
        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
        * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
        * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
        * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        * WebProcess/Network/WebResourceLoader.cpp:
        * WebProcess/Network/WebSocketProvider.cpp:
        * WebProcess/Network/WebSocketStream.cpp:
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
        * WebProcess/Network/webrtc/LibWebRTCResolver.h:
        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
        * WebProcess/Network/webrtc/LibWebRTCSocket.h:
        * WebProcess/Network/webrtc/WebMDNSRegister.cpp:
        * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
        * WebProcess/Network/webrtc/WebRTCMonitor.h:
        * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
        * WebProcess/Notifications/WebNotificationManager.cpp:
        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        * WebProcess/Plugins/Netscape/NetscapePluginNone.cpp:
        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
        * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
        * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
        * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
        * WebProcess/Plugins/Plugin.cpp:
        * WebProcess/Plugins/PluginProcessConnection.cpp:
        * WebProcess/Plugins/PluginProxy.cpp:
        * WebProcess/Plugins/PluginView.cpp:
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        * WebProcess/Storage/WebSWOriginTable.cpp:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
        * WebProcess/UserContent/WebUserContentController.cpp:
        * WebProcess/WebConnectionToUIProcess.cpp:
        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        * WebProcess/WebCoreSupport/WebColorChooser.cpp:
        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
        * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
        * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
        * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
        * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
        * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
        * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
        * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp:
        * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        * WebProcess/WebPage/DrawingArea.cpp:
        * WebProcess/WebPage/EventDispatcher.cpp:
        * WebProcess/WebPage/FindController.cpp:
        * WebProcess/WebPage/LayerTreeHost.cpp:
        * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        * WebProcess/WebPage/VisitedLinkTableController.cpp:
        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        * WebProcess/WebPage/WebContextMenu.cpp:
        * WebProcess/WebPage/WebDocumentLoader.cpp:
        * WebProcess/WebPage/WebFrame.cpp:
        * WebProcess/WebPage/WebInspector.cpp:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPageOverlay.cpp:
        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
        * WebProcess/WebPage/mac/PageBannerMac.mm:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        * WebProcess/WebPage/win/WebPageWin.cpp:
        * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:
        * WebProcess/WebProcess.cpp:
        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        * WebProcess/win/WebProcessMainWin.cpp:
        * WebProcess/win/WebProcessWin.cpp:
        * WebProcess/wpe/WebProcessMainWPE.cpp:

2018-08-22  Daniel Bates  <dabates@apple.com>

        Cleanup: Add type alias for spell document tag
        https://bugs.webkit.org/show_bug.cgi?id=188817

        Reviewed by Simon Fraser.

        * UIProcess/TextChecker.h:
        * UIProcess/TextCheckerCompletion.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::~WebPageProxy):
        (WebKit::WebPageProxy::spellDocumentTag):
        * UIProcess/WebPageProxy.h: Also addressed FIXME comment and modernized the code to use a std::optional
        while I am here.
        * UIProcess/gtk/TextCheckerGtk.cpp:
        (WebKit::TextChecker::uniqueSpellDocumentTag):
        (WebKit::TextChecker::closeSpellDocumentWithTag):
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::checkGrammarOfString):
        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        (WebKit::TextChecker::checkTextOfParagraph):
        * UIProcess/ios/TextCheckerIOS.mm:
        (WebKit::spellDocumentTagMap):
        (WebKit::TextChecker::uniqueSpellDocumentTag):
        (WebKit::TextChecker::closeSpellDocumentWithTag):
        (WebKit::textCheckerFor):
        (WebKit::TextChecker::checkTextOfParagraph):
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::checkGrammarOfString):
        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::uniqueSpellDocumentTag):
        (WebKit::TextChecker::closeSpellDocumentWithTag):
        (WebKit::TextChecker::checkTextOfParagraph):
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::checkGrammarOfString):
        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        * UIProcess/win/TextCheckerWin.cpp:
        (WebKit::TextChecker::uniqueSpellDocumentTag):
        (WebKit::TextChecker::closeSpellDocumentWithTag):
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::checkGrammarOfString):
        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        (WebKit::TextChecker::checkTextOfParagraph):
        * UIProcess/wpe/TextCheckerWPE.cpp:
        (WebKit::TextChecker::uniqueSpellDocumentTag):
        (WebKit::TextChecker::closeSpellDocumentWithTag):
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::checkGrammarOfString):
        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):

2018-08-22  Antti Koivisto  <antti@apple.com>

        Use OptionSet for NetworkCache::Storage::TraverseFlags
        https://bugs.webkit.org/show_bug.cgi?id=188837

        Reviewed by Anders Carlsson.

        Type safe flags.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::initializeSize):
        (WebKit::CacheStorage::Caches::readRecordsList):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::traverse):
        (WebKit::NetworkCache::Cache::dumpContentsToFile):
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
        (WebKit::NetworkCache::Storage::traverse):
        * NetworkProcess/cache/NetworkCacheStorage.h:
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::captureDevicesChanged):
        (WebKit::UserMediaPermissionRequestManager::activityStateDidChange):

        Also use OptionSet<>::containsAll() in a few places.

2018-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] pkg-config files should require libwpe
        https://bugs.webkit.org/show_bug.cgi?id=188835

        Reviewed by Žan Doberšek.

        * wpe/wpe-web-extension.pc.in:
        * wpe/wpe-webkit.pc.in:

2018-08-22  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
        https://bugs.webkit.org/show_bug.cgi?id=188693

        Reviewed by Carlos Garcia Campos.

        Switch CoordinatedGraphicsScene to utilizing Nicosia::CompositionLayer
        objects for state updates of the TextureMapper layer tree.

        CoordinatedGraphicsScene::paintToCurrentGLContext() now calls
        updateSceneState() at the beginning. This is a new method that manages
        all updates for a given Nicosia::Scene instance. Any removed layers
        have their composition-side state cleaned up, and the current set of
        layers is then iterated to ensure and update the corresponding
        TextureMapperLayer objects.

        Layers with any backing (painted backing store, platform-layer or image
        content) are temporarly stored for updating outside of mutex-controlled
        scene update. Performing all other state updates outside of this mutex
        area will be investigated at a later point.

        We then iterate over vectors for each layer backing, gathering any
        affected CoordinatedBackingStore or TextureMapperPlatformLayerProxy
        objects that we have to update.

        This drops a bunch of member variables and helper methods off the
        CoordinatedGraphicsScene class. The applyStateChanges() method will be
        further simplified in the future. coordinateUpdateCompletionWithClient
        logic in ThreadedCompositor should be checked to see whether it still
        addresses any real-life problem, because at the moment it imposes a few
        additional operations in terms of scene updates that we could really do
        without. This will be checked later and removed if possible.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::applyStateChanges):
        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
        (WebKit::compositionLayerImpl):
        (WebKit::contentLayerImpl):
        (WebKit::backingStoreImpl):
        (WebKit::imageBackingImpl):
        (WebKit::texmapLayer):
        (WebKit::updateBackingStore):
        (WebKit::updateImageBacking):
        (WebKit::removeLayer):
        (WebKit::CoordinatedGraphicsScene::commitSceneState):
        (WebKit::CoordinatedGraphicsScene::updateSceneState):
        (WebKit::CoordinatedGraphicsScene::purgeGLResources):
        (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::setLayerChildrenIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::setLayerFiltersIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::setLayerState): Deleted.
        (WebKit::CoordinatedGraphicsScene::getLayerByIDIfExists): Deleted.
        (WebKit::CoordinatedGraphicsScene::createLayers): Deleted.
        (WebKit::CoordinatedGraphicsScene::createLayer): Deleted.
        (WebKit::CoordinatedGraphicsScene::deleteLayers): Deleted.
        (WebKit::CoordinatedGraphicsScene::deleteLayer): Deleted.
        (WebKit::CoordinatedGraphicsScene::setRootLayerID): Deleted.
        (WebKit::CoordinatedGraphicsScene::prepareContentBackingStore): Deleted.
        (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize): Deleted.
        (WebKit::CoordinatedGraphicsScene::createTilesIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::removeTilesIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::syncImageBackings): Deleted.
        (WebKit::CoordinatedGraphicsScene::createImageBacking): Deleted.
        (WebKit::CoordinatedGraphicsScene::updateImageBacking): Deleted.
        (WebKit::CoordinatedGraphicsScene::clearImageBackingContents): Deleted.
        (WebKit::CoordinatedGraphicsScene::removeImageBacking): Deleted.
        (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer): Deleted.
        (WebKit::CoordinatedGraphicsScene::setLayerAnimationsIfNeeded): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        (WebKit::CoordinatedGraphicsScene::layerByID): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::renderLayerTree):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::flushPendingLayerChanges):

2018-08-21  Ryosuke Niwa  <rniwa@webkit.org>

        Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
        https://bugs.webkit.org/show_bug.cgi?id=188777

        Reviewed by Simon Fraser.

        Added two FIXMEs.

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

2018-08-21  Alex Christensen  <achristensen@webkit.org>

        Roll out r235139 and r235146
        https://bugs.webkit.org/show_bug.cgi?id=188805

        It turns out shouldKeepCurrentBackForwardListItemInList has one use left.

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::addItem):
        (WebKit::WebBackForwardList::goToItem):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
        * UIProcess/WebPageProxy.h:

2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation
        https://bugs.webkit.org/show_bug.cgi?id=188715
        <rdar://problem/43541790>

        Reviewed by Tim Horton.

        Adds logic for invalidating Attachment objects upon mainframe navigation, or upon web content process
        termination. An invalid Attachment's wrapper may still be retained by a UI client; however, calls to -info and
        other SPI methods will either return nil or immediately invoke their completion handlers with a nil result and
        an NSError. See changes below for more detail.

        This patch also takes some extra measures to avoid sending redundant or unexpected removal updates to the UI
        client upon invalidating all Attachments.

        See Tools changes for new API tests.

        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::invalidate):
        * UIProcess/API/APIAttachment.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didInsertAttachment:withSource:]):
        (-[WKWebView _didRemoveAttachment:]):

        Refactor these methods to take references to the API::Attachment that is being inserted or removed, rather than
        take attachment identifiers. This allows us to keep logic for setting the InsertionState of Attachment objects
        in WebPageProxy, rather than in platform code.

        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachment info]):

        If the attachment object is invalid, return nil.

        (-[_WKAttachment setDisplayOptions:completion:]):
        (-[_WKAttachment setFileWrapper:contentType:completion:]):

        If the attachment object is invalid, immediately invoke the completion block with an error.

        (-[_WKAttachment isConnected]):

        Add a new readonly property for a client to easily determine whether a _WKAttachment is connected to the
        document, without having to maintain the current set of connected attachment objects by observing insertion and
        removal callbacks.

        * UIProcess/Cocoa/PageClientImplCocoa.h:
        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        (WebKit::PageClientImplCocoa::didInsertAttachment):
        (WebKit::PageClientImplCocoa::didRemoveAttachment):

        Make these take API::Attachment&s rather than identifier strings.

        * UIProcess/PageClient.h:
        (WebKit::PageClient::didInsertAttachment):
        (WebKit::PageClient::didRemoveAttachment):

        Also make these take API::Attachment&s rather than identifier strings.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        (WebKit::WebPageProxy::invalidateAllAttachments):

        Introduce a helper function that invalidates all Attachments and notifies the UI client if needed. This is
        invoked upon mainframe navigation, and when the web content process terminates.

        (WebKit::WebPageProxy::platformRegisterAttachment):
        (WebKit::WebPageProxy::didInsertAttachmentWithIdentifier):
        (WebKit::WebPageProxy::didRemoveAttachmentWithIdentifier):
        (WebKit::WebPageProxy::didInsertAttachment):
        (WebKit::WebPageProxy::didRemoveAttachment):

        Keep track of whether we've notified the UI client that an Attachment has been inserted into the document. This
        allows us to send removal updates to the UI client only for Attachments that are currently in the document, from
        the perspective of the UI client, and allows us to avoid sending extra removal updates in
        invalidateAllAttachments for Attachments that either have already been removed, or Attachments which we haven't
        inserted yet.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::didInsertAttachmentWithIdentifier):
        (WebKit::WebEditorClient::didRemoveAttachmentWithIdentifier):
        (WebKit::WebEditorClient::didInsertAttachment): Deleted.
        (WebKit::WebEditorClient::didRemoveAttachment): Deleted.
        * WebProcess/WebCoreSupport/WebEditorClient.h:

        Rename did{Insert|Remove}Attachment to did{Insert|Remove}AttachmentWithIdentifier.

2018-08-21  Megan Gardner  <megan_gardner@apple.com>

        Change Selection modification to not snap the grabber when selecting above or below the selection anchor
        https://bugs.webkit.org/show_bug.cgi?id=188826

        Reviewed by Tim Horton.

        Selecting single lines is sometimes difficult because we currently snap selections to single
        characters if we move past the position of the other anchor in our selection. This patch changes
        this behaviour to reflect the behaviour in the rest of this system, which snaps the selection
        to the position on the line of the other anchor, rather than snapping it all the way a single
        character.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeForPointInRootViewCoordinates):

2018-08-21  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove unused file-local static variable from TextCheckerIOS.mm
        https://bugs.webkit.org/show_bug.cgi?id=188818

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/TextCheckerIOS.mm:
        (WebKit::TextChecker::isSmartInsertDeleteEnabled):

2018-08-21  Daniel Bates  <dabates@apple.com>

        [iOS][WK2] Misspelled words are not underlined
        https://bugs.webkit.org/show_bug.cgi?id=188800
        <rdar://problem/34811332>

        Reviewed by Wenson Hsieh.

        Implement enough of TextChecker for iOS to compute the list of misspelled words in a
        paragraph and advertise support for continuous spell checking. The WebCore editing
        machinery queries TextChecker for the list of the misspelled words, creating document
        markers that demarcate the misspelled words. When we paint a line of text we paint
        the spelling correction dots under each misspelled word.

        On iOS we make use of UITextChecker to perform spell checking of a string. We maintain
        a side table that maps a "spell document tag" to a UITextChecker* to conform to the
        shape of the TextChecker interface.

        * Platform/spi/ios/UIKitSPI.h: Forward declare some SPI.
        * UIProcess/ios/TextCheckerIOS.mm:
        (WebKit::mutableState): Added.
        (WebKit::TextChecker::state): Turns around and returns mutableState().
        (WebKit::TextChecker::isContinuousSpellCheckingAllowed): Returns true if we are building
        with USE(UNIFIED_TEXT_CHECKING). Otherwise, do what we do now.
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Update state.
        (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged): Ditto.
        (WebKit::spellDocumentTagMap): Returns HashMap that maps a "spell document tag" (int64_t) to
        a RetainPtr<UITextChecker>>.
        (WebKit::TextChecker::uniqueSpellDocumentTag): Generates a unique identifier for the page
        this text checker is associated with.
        (WebKit::TextChecker::closeSpellDocumentWithTag): Removes the entry for the specified identifier
        from the HashMap.
        (WebKit::textCheckerFor): Query the HashMap for the UITextChecker for the specified spell
        document tag, if it exists. Otherwise, create a new UITextChecker and add a new map entry
        that associates it with the specified spell document tag. 
        (WebKit::TextChecker::checkTextOfParagraph): Spell check the specified string and return a list
        that represents the misspelled words.
        (WebKit::TextChecker::checkSpellingOfString): Added a comment to explain that iOS does not implement
        this function and instead implements checkTextOfParagraph().
        (WebKit::TextChecker::checkGrammarOfString): Ditto.

2018-08-21  Alex Christensen  <achristensen@webkit.org>

        Transition ResizeReversePaginatedWebView API test from WKPageLoaderClient to WKPageNavigationClient
        https://bugs.webkit.org/show_bug.cgi?id=188821

        Reviewed by Simon Fraser.

        Add some more values to WKPageRenderingProgressEvents which were already supported by _WKRenderingProgressEvents and WKLayoutMilestones.

        * UIProcess/API/C/WKPageRenderingProgressEvents.h:
        * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h:
        (pageRenderingProgressEvents):

2018-08-21  Alex Christensen  <achristensen@webkit.org>

        Fix API tests after r235139
        https://bugs.webkit.org/show_bug.cgi?id=188805

        Apparently the call to didChangeBackForwardList with no changes was observable.  We should rename, but I'm restoring existing behavior for now.

        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::goToItem):

2018-08-21  John Wilander  <wilander@apple.com>

        Storage Access API: The call to ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal() should send eTLD+1s, not full host names
        https://bugs.webkit.org/show_bug.cgi?id=188783
        <rdar://problem/43559215>

        Reviewed by Alex Christensen.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
            Now sends the eTLD+1 for the top frame and sub frame.

2018-08-21  Megan Gardner  <megan_gardner@apple.com>

        Use VisiblePosition to calculate selection ranges
        https://bugs.webkit.org/show_bug.cgi?id=188767
        <rdar://problem/43577166>

        Reviewed by Ryosuke Niwa.

        Switches to using VisiblePosition, instead of Position. This code used to use VisiblePosiiton,
        but it has been changed a lot lately, and using Position causes issues with next and previous
        when trying to snap a selection. VisiblePosition gives us the correct information, and does not 
        result in collapsed ranges.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeForPointInRootViewCoordinates):

2018-08-21  Alex Christensen  <achristensen@webkit.org>

        Remove unused shouldKeepCurrentBackForwardListItemInList check
        https://bugs.webkit.org/show_bug.cgi?id=188805

        Reviewed by Andy Estes.

        The check was only done in WKPageLoaderClient, and nobody implements the check.
        It was not needed to put in WKPageNavigationClient or WKNavigationDelegate, so let's remove it!
        This removes the unused ability to go back and remove the current back/forward list item.

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::didChangeBackForwardList):
        (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): Deleted.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::addItem):
        (WebKit::WebBackForwardList::goToItem):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): Deleted.
        * UIProcess/WebPageProxy.h:

2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
        https://bugs.webkit.org/show_bug.cgi?id=188496
        <rdar://problem/43216836>

        Reviewed by Tim Horton.

        Adjusts WebKit's attachment editing SPI with the following modifications:
        •   Deprecate `-_insertAttachmentWithFilename:contentType:data:options:completion:` in favor of
            `-_insertAttachmentWithFileWrapper:contentType:options:completion:`.
        •   Deprecate `-requestInfo:` and in favor of just `-info`.
        •   Add a `-fileWrapper` property to `_WKAttachmentInfo` that returns an `NSFileWrapper`.
        •   Remove some SPI methods that would otherwise be deprecated, but are not even necessary, since they're no
            longer even used by Mail.

        To make this possible, we refactor where and how attachment data is tracked. Currently, the data is stored in
        the network process, and made accessible to the web process via blob URLs stored in the File object in the
        attachment element. As such, requests from the UI process for attachment data would first be routed through the
        web process to network process and back.

        Instead, we now keep the relevant attachment data (in the form of NSFileWrapper on Cocoa platforms) in the UI
        process, on API::Attachment. We additionally keep a map of attachment identifiers to API::Attachments, which
        allows us to propagate the same _WKAttachment wrapper object to the SPI client for each uniquely identified
        attachment element. This also has the benefit of allowing us to remove the asynchronous version of `-requestInfo:`
        and replace it with just an `info` property.

        Changes are covered by new and existing API tests.

        * PlatformMac.cmake:

        Remove APIAttachment.cpp, now that APIAttachment.cpp is listed in Sources.txt.

        * Scripts/webkit/messages.py:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):

        Guard _WKAttachment creation with ENABLE_ATTACHMENT_ELEMENT.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PromisedAttachmentInfo>::encode):
        (IPC::ArgumentCoder<PromisedAttachmentInfo>::decode):
        (IPC::ArgumentCoder<PromisedBlobInfo>::encode): Deleted.
        (IPC::ArgumentCoder<PromisedBlobInfo>::decode): Deleted.
        (IPC::ArgumentCoder<AttachmentInfo>::encode): Deleted.
        (IPC::ArgumentCoder<AttachmentInfo>::decode): Deleted.
        * Shared/WebCoreArgumentCoders.h:

        Continue removing encoding support for WebCore::AttachmentInfo. Additionally, rename PromisedBlobInfo to
        PromisedAttachmentInfo.

        * Sources.txt:
        * SourcesCocoa.txt:

        Move APIAttachment.cpp from the SourcesCocoa.txt to the platform-agnostic Sources.txt.

        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::updateAttributes):

        Rename setDataAndContentType to just updateAttributes; instead of sending data, only send the information needed
        to update the presentational attributes of the attachment element.

        (API::Attachment::requestInfo): Deleted.

        Just call the completion handler with the result of `self.info`.

        (API::Attachment::setDataAndContentType): Deleted.
        * UIProcess/API/APIAttachment.h:

        Add additional attributes: a content type, a file path, and (on Cocoa platforms) an NSFileWrapper.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

        Remove -_webView:didInsertAttachment:, since this is unused by any client currently, and is superceded by
        -_webView:didInsertAttachment:withSource:.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didInsertAttachment:withSource:]):
        (-[WKWebView _didRemoveAttachment:]):

        Look up the API::Attachment corresponding to the identifier, and send its wrapper object to the client.

        (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]):

        Add a way to insert an attachment using NSFileWrapper, and reimplement _insertAttachmentWithFilename: using it.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachmentInfo initWithFileWrapper:filePath:contentType:]):
        (-[_WKAttachmentInfo data]):
        (-[_WKAttachmentInfo name]):
        (isDeclaredOrDynamicTypeIdentifier):
        (-[_WKAttachmentInfo _typeIdentifierFromPathExtension]):
        (-[_WKAttachmentInfo contentType]):
        (-[_WKAttachmentInfo mimeType]):
        (-[_WKAttachmentInfo utiType]):
        (-[_WKAttachmentInfo fileWrapper]):
        (-[_WKAttachment info]):
        (-[_WKAttachment requestInfo:]):

        Add a property on _WKAttachment to retrieve a _WKAttachmentInfo (a snapshot of the current state of the
        attachment, along with the NSFileWrapper). Reimplement requestInfo using this property.

        (-[_WKAttachment setFileWrapper:contentType:completion:]):
        (-[_WKAttachment setData:newContentType:newFilename:completion:]):

        Reimplemented by calling -setFileWrapper:contentType:completion: with an NSFileWrapper created using the given
        data. Additionally, create and associate the unique identifier with an API::Attachment right away.

        (-[_WKAttachment uniqueIdentifier]):
        (-[_WKAttachment description]):
        (-[_WKAttachmentInfo initWithInfo:]): Deleted.
        (-[_WKAttachmentInfo fileLoadingError]): Deleted.
        (-[_WKAttachment isEqual:]): Deleted.
        (-[_WKAttachment hash]): Deleted.

        There's no longer any point to implementing these methods, since the SPI client is now guaranteed a unique
        mapping of _WKAttachments to attachment elements in the document.

        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        (WebKit::PageClientImplCocoa::didInsertAttachment):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::platformRegisterAttachment):
        (WebKit::WebPageProxy::platformCloneAttachment):

        Extend the behavior of registering new attachment data on Cocoa platforms by additionally creating and setting
        NSFileWrappers on the API::Attachment.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetStateAfterProcessExited):

        Clear out the map of attachment identifiers to API::Attachments when the web content process is terminated.

        (WebKit::WebPageProxy::attachmentForIdentifier const):

        Helper function to look up an API::Attachment for the given attachment identifier. Returns null if the
        attachment is not found, or the attachment identifier is invalid.

        (WebKit::WebPageProxy::insertAttachment):
        (WebKit::WebPageProxy::updateAttachmentAttributes):
        (WebKit::WebPageProxy::registerAttachmentIdentifierFromData):
        (WebKit::WebPageProxy::registerAttachmentIdentifierFromFilePath):
        (WebKit::WebPageProxy::cloneAttachmentData):
        (WebKit::WebPageProxy::platformRegisterAttachment):
        (WebKit::WebPageProxy::platformCloneAttachment):
        (WebKit::WebPageProxy::didInsertAttachment):

        Create an entry in the attachment identifier to API::Attachment map when an attachment is inserted, if one does
        not already exist. An attachment mapping would not exist only in the case where an attachment element was
        created via bindings; in this case, the client wouldn't have access to an NSFileWrapper containing the contents
        of the file; in the future, this can be improved by adding a mechanism to register an attachment element with
        this data, but for now, this is unnecessary for Mail's purposes.

        (WebKit::WebPageProxy::didRemoveAttachment):
        (WebKit::WebPageProxy::ensureAttachment):

        Ensures an attachment identifier to API::Attachment mapping.

        (WebKit::WebPageProxy::attachmentInfoCallback): Deleted.
        (WebKit::WebPageProxy::requestAttachmentInfo): Deleted.
        (WebKit::WebPageProxy::setAttachmentDataAndContentType): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startDrag:item:]):
        (-[WKContentView _prepareToDragPromisedAttachment:]):
        (-[WKContentView _prepareToDragPromisedBlob:]): Deleted.

        Reimplement the way promised attachment data is delivered to the destination when an attachment element is
        dragged. Instead of relying on the blob URL of the File on the attachment element, first try to find an API
        Attachment object corresponding to the unique identifier of the dragged attachment, and use its NSFileWrapper to
        deliver promised data to the destination file URL. The blob URL codepath still exists in the case where script
        specifies the dragged attachment's File.

        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::registerAttachmentIdentifier):
        (WebKit::WebEditorClient::cloneAttachmentData):
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::insertAttachment):
        (WebKit::WebPage::updateAttachmentAttributes):
        (WebKit::WebPage::requestAttachmentInfo): Deleted.
        (WebKit::WebPage::setAttachmentDataAndContentType): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        More renaming and IPC message plumbing.

2018-08-21  Alex Christensen  <achristensen@webkit.org>

        Increment NetworkCache::Storage::lastStableVersion after r233742
        https://bugs.webkit.org/show_bug.cgi?id=188798
        <rdar://43561761>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/cache/NetworkCacheStorage.h:

2018-08-21  Brent Fulgham  <bfulgham@apple.com>

        Remove experimental affiliated domain code now that StorageAccess API is available
        https://bugs.webkit.org/show_bug.cgi?id=188756
        <rdar://problem/43527848>

        Reviewed by Alex Christensen.

        In Bug 174661 we added a compatibility quirk to support wsj.com authentication. This quirk is no longer needed,
        since the StorageAccess API provides the necessary tools to do this type of interaction without needing global
        cross-site access.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
        * UIProcess/ResourceLoadStatisticsMemoryStore.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        (WebKit::areDomainsAssociated): Deleted.

2018-08-21  Alex Christensen  <achristensen@webkit.org>

        Add _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=188748

        Reviewed by Ryosuke Niwa.

        * NetworkProcess/NetworkSessionCreationParameters.h:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
        (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
        (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
        (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-08-21  Per Arne Vollan  <pvollan@apple.com>

        [WebGL] Contexts are not updated when display configuration changed.
        https://bugs.webkit.org/show_bug.cgi?id=188750

        Reviewed by Brent Fulgham.

        Calling CGDisplayRegisterReconfigurationCallback in GraphicsContext3DManager::addContext
        returns kCGErrorSuccess when WindowServer access is blocked in the WebContent process,
        but the callback function is never called. We should register the callback function in
        the UI process, and send a message to the WebContent process when the display
        configuration changed.

        * Sources.txt:
        * UIProcess/API/C/WKMockDisplay.cpp: Added.
        (WKSendDisplayConfigurationChangedMessageForTesting):
        * UIProcess/API/C/WKMockDisplay.h: Added.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::displayReconfigurationCallBack):
        (WebKit::WebProcessPool::sendDisplayConfigurationChangedMessageForTesting):
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::displayConfigurationChanged):

2018-08-21  John Wilander  <wilander@apple.com>

        Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
        https://bugs.webkit.org/show_bug.cgi?id=188757
        <rdar://problem/38713390>

        Reviewed by Alex Christensen.

        These changes are test infrastructure to support the new WebKitTestRunner
        function isStatisticsRegisteredAsSubresourceUnder().

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
        * UIProcess/ResourceLoadStatisticsMemoryStore.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-08-21  Daniel Bates  <dabates@apple.com>

        Replace TextCheckingTypeMask with OptionSet
        https://bugs.webkit.org/show_bug.cgi?id=188678

        Reviewed by Antti Koivisto.

        * Scripts/webkit/messages.py: Add WebCore::TextCheckingType to the special case map so that
        the generator knows what header has the definition for this type.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<TextCheckingRequestData>::encode):
        (IPC::ArgumentCoder<TextCheckingRequestData>::decode):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::coreTextCheckingType):
        (WebKit::textCheckingResultFromNSTextCheckingResult):
        * UIProcess/TextChecker.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::checkTextOfParagraph):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/gtk/TextCheckerGtk.cpp:
        (WebKit::TextChecker::requestCheckingOfString):
        (WebKit::TextChecker::checkTextOfParagraph): Also simplified return expressions.
        * UIProcess/ios/TextCheckerIOS.mm:
        (WebKit::TextChecker::checkTextOfParagraph):
        * UIProcess/mac/TextCheckerMac.mm:
        (WebKit::TextChecker::checkTextOfParagraph):
        * UIProcess/win/TextCheckerWin.cpp:
        (WebKit::TextChecker::checkTextOfParagraph):
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection const):
        (WebKit::WebEditorClient::checkTextOfParagraph):
        * WebProcess/WebCoreSupport/WebEditorClient.h:

2018-08-21  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for 2.21.91 release.

        * wpe/NEWS: Add release notes for the 2.21.91 release.

2018-08-21  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234981.
        https://bugs.webkit.org/show_bug.cgi?id=188793

        It was not the main cause of the high CPU usage in the end
        (Requested by KaL on #webkit).

        Reverted changeset:

        "Unreviewed, rolling out r234259."
        https://bugs.webkit.org/show_bug.cgi?id=188005
        https://trac.webkit.org/changeset/234981

2018-08-20  Michael Catanzaro  <mcatanzaro@igalia.com>

        Use unified build for NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=185011

        Reviewed by Alex Christensen.

        * NetworkProcess/Cookies/WebCookieManager.cpp:
        * NetworkProcess/Downloads/Download.cpp:
        * NetworkProcess/Downloads/DownloadManager.cpp:
        * NetworkProcess/Downloads/PendingDownload.cpp:
        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        * NetworkProcess/NetworkContentRuleListManager.cpp:
        * NetworkProcess/NetworkDataTask.cpp:
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        * NetworkProcess/NetworkLoadChecker.cpp:
        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/NetworkSession.cpp:
        * NetworkProcess/NetworkSocketStream.cpp:
        * NetworkProcess/PingLoad.cpp:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        * NetworkProcess/cache/NetworkCache.cpp:
        * NetworkProcess/capture/NetworkCaptureEvent.cpp:
        * NetworkProcess/capture/NetworkCaptureManager.cpp:
        * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
        * NetworkProcess/capture/NetworkCaptureReplayer.cpp:
        * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::platformCancelNetworkLoad):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
        (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
        Fix the build with unified sources.

        * Sources.txt: Un-@no-unify NetworkProcess/*.
        * SourcesCocoa.txt: Un-@no-unify NetworkProcess/*.

2018-08-20  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Sync unified build with Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=188732

        Reviewed by Tim Horton.

        Sync unified build with Cocoa ports. This enables unified build for WebKit/Platform and
        WebKit/Shared.

        Lots of files need to be moved around since the existing Sources.txt was not copied from
        CMakeLists.txt. This replaces the Sources.txt with the sources list from CMakeList.txt.
        Files that are not built for Cocoa are moved to SourcesGTK.txt, SourcesWPE.txt, and
        PlatformWin.cmake. Files that are built only on Cocoa are moved to SourcesCocoa.txt. There's
        plenty of room to determine if many of these files really need to be platform-specific in
        the future, but let's not change that now.

        Unfortunately, several files under Shared and PluginProcess need to be un-unified to be
        usable for GTK's WebKitPluginProcess2. I've never managed to understand why, but it won't
        link otherwise. Fortunately, this only affects a few files (listed in
        PluginProcessGTK2_SOURCES), only a couple dozen of which are cross-platform.

        * CMakeLists.txt:
        * PlatformWin.cmake:
        * Sources.txt:
        * SourcesCocoa.txt:
        * SourcesGTK.txt:
        * SourcesWPE.txt:

2018-08-20  Tim Horton  <timothy_horton@apple.com>

        Fix the iOSMac build with unified sources

        * Shared/mac/ArgumentCodersMac.mm:
        * Shared/mac/ChildProcessMac.mm:
        * Shared/mac/NativeWebKeyboardEventMac.mm:

2018-08-20  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Move capture device monitoring to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=188521
        <rdar://problem/43251787>

        Reviewed by Youenn Fablet.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Notify as appropriate.
        (WebKit::UserMediaPermissionRequestManagerProxy::viewIsBecomingVisible): Change name from
        viewIsBecomingVisible. Call captureDevicesChanged if a change happened when not visible.
        (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_pendingDeviceChangeEvent.
        (WebKit::UserMediaPermissionRequestManagerProxy::processPregrantedRequests): Deleted.
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::UserMediaProcessManager): Initialize timer.
        (WebKit::UserMediaProcessManager::captureDevicesChanged): New, notify each manager.
        (WebKit::UserMediaProcessManager::beginMonitoringCaptureDevices): Cache the device list and 
        register device change listener the first time it is called.
        * UIProcess/UserMediaProcessManager.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::viewIsBecomingVisible):
        (WebKit::WebPageProxy::beginMonitoringCaptureDevices):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver): Add listener, tell page
        to start monitoring device changes.
        (WebKit::UserMediaPermissionRequestManager::removeDeviceChangeObserver): Remove listener.
        (WebKit::UserMediaPermissionRequestManager::captureDevicesChanged): Call listeners.
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

        * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
        (WebKit::WebUserMediaClient::addDeviceChangeObserver):
        (WebKit::WebUserMediaClient::removeDeviceChangeObserver):
        * WebProcess/WebCoreSupport/WebUserMediaClient.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::captureDevicesChanged):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::addMockMediaDevice):
        (WebKit::WebProcess::clearMockMediaDevices):
        (WebKit::WebProcess::removeMockMediaDevice):
        (WebKit::WebProcess::resetMockMediaDevices):
        (WebKit::WebProcess::captureDevicesChanged):
        * WebProcess/WebProcess.h:

2018-08-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK/WPE cookie API tests after r234396.

        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Bring back the check to handle localhost as an
        special case for non cocoa ports.

2018-08-19  Darin Adler  <darin@apple.com>

        [Cocoa] Update uses of wrapper template functions in WebKit for clarity, simplicity, better ARC readiness
        https://bugs.webkit.org/show_bug.cgi?id=188735

        Reviewed by Dan Bernstein.

        Because of argument-dependent lookup, there should never be a reason to call
        the wrapper function as WebKit::wrapper or API::wrapper unless there is a need
        to resolve a name conflict, so removed the explicit namespacing.

        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
        (WKPageLoadURLRequestReturningNavigation): Removed explicit null check and
        leakRef/autorelease pair, both done by the wrapper template function now.

        * UIProcess/API/Cocoa/WKBackForwardList.mm:
        (toWKBackForwardListItem): Deleted.
        (-[WKBackForwardList currentItem]): Use wrapper instead of toWKBackForwardListItem.
        (-[WKBackForwardList backItem]): Ditto.
        (-[WKBackForwardList forwardItem]): Ditto.
        (-[WKBackForwardList itemAtIndex:]): Ditto.
        (-[WKBackForwardList backList]): Removed leakRef/autorelease pair.
        (-[WKBackForwardList forwardList]): Ditto.

        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        (+[WKContentRuleListStore defaultStore]): Removed explicit WebKit namespace.
        (+[WKContentRuleListStore storeWithURL:]): Fixed a storage leak by removing leakRef,
        which was not balanced. This is not a copy or create function, so it should not
        return an object that requires a release to balance it.
        (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:releasesArgument:]):
        Removed explicit WebKit namespace and unneeded get().
        (-[WKContentRuleListStore lookUpContentRuleListForIdentifier:completionHandler:]):
        Removed explicit WebKit namespace.
        (+[WKContentRuleListStore defaultStoreWithLegacyFilename]): Ditto.
        (+[WKContentRuleListStore storeWithURLAndLegacyFilename:]): Fixed storage leak,
        as above in storeWithURL.

        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo _handle]): Removed explicit WebKit namespace.
        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
        (WKHTTPCookieStoreObserver::cookiesDidChange): Ditto.

        * UIProcess/API/Cocoa/WKNavigationAction.mm:
        (-[WKNavigationAction sourceFrame]): Removed explicit null check, now done by
        the wrapper template function.
        (-[WKNavigationAction targetFrame]): Ditto.
        (-[WKNavigationAction _userInitiatedAction]): Ditto.
        (-[WKNavigationAction _mainFrameNavigation]): Ditto.

        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _acceptedMIMETypes]): Removed leakRef/autorelease pair,
        now done by the wrapper template function.
        (-[WKOpenPanelParameters _acceptedFileExtensions]): Ditto.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences copyWithZone:]): Use retain instead of leakRef; slightly clearer
        for when we convert to ARC.
        (+[WKPreferences _experimentalFeatures]): Removed leakRef/autorelease pair,
        now done by the wrapper template function.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _configuration]): Fixed a storage leak by removing leakRef,
        which was not balanced. This is not a copy or create function, so it should not
        return an object that requires a release to balance it.

        * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h:
        Replaced inline wrapper function with WrapperTraits structure template specialization.

        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript _userContentWorld]): Removed explicit API namespace.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView loadRequest:]): Removed explicit null check and
        leakRef/autorelease pair, both done by the wrapper template function now.
        (-[WKWebView loadFileURL:allowingReadAccessToURL:]): Ditto.
        (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]): Ditto.
        (-[WKWebView goToBackForwardListItem:]): Ditto.
        (-[WKWebView goBack]): Ditto.
        (-[WKWebView goForward]): Ditto.
        (-[WKWebView reload]): Ditto.
        (-[WKWebView reloadFromOrigin]): Ditto.
        (-[WKWebView _didInsertAttachment:withSource:]): Removed leakRef/autorelease pairs,
        now done by the wrapper template function.
        (-[WKWebView _didRemoveAttachment:]): Ditto.
        (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): Removed
        explicit null check and leakRef/autorelease pair, both done by the wrapper template
        function now.
        (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): Ditto.
        (-[WKWebView _reloadWithoutContentBlockers]): Ditto.
        (-[WKWebView _reloadExpiredOnly]): Ditto.
        (-[WKWebView _sessionStateData]): Removed explicit leakRef/autorelease pair, done
        by the wrapper template function now. Also, the old version explicitly dereferenced
        and would not work when the result of encodeLegacySessionState was null. Decided
        not to add a call to releaseNonNull to preserve that possibly-incorrect optimization,
        instead allowing the wrapper function to generate code to handle the null case.
        (-[WKWebView _sessionState]): Use the Objective-C autorelease instead of adoptNS
        and RetainPtr's autorelease.
        (-[WKWebView _sessionStateWithFilter:]): Ditto.
        (-[WKWebView _restoreSessionState:andNavigate:]): Removed explicit null check and
        leakRef/autorelease pair, both done by the wrapper template function now.
        (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
        Removed explicit leakRef/autorelease pair, done by the wrapper template function now.
        (-[WKWebView _diagnosticLoggingDelegate]): Replaced a leakRef/autorelease pair with
        use of RetainPtr's autorelease.
        (-[WKWebView _findDelegate]): Ditto.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _applicationManifest]): Removed explicit null check,
        done by the wrapper template function now.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (+[WKWebsiteDataStore defaultDataStore]): Removed explicit WebKit namespace
        and unneeded call to get().
        (+[WKWebsiteDataStore nonPersistentDataStore]): Removed explicit WebKit namespace
        and leakRef/autorelease pair, done by the wrapper template function now.
        (-[WKWebsiteDataStore httpCookieStore]): Removed explicit WebKit namespace.

        * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
        (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
        Removed explicit leakRef/autorelease pair, done by the wrapper template function now.
        * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
        (WebKit::wrapper): Ditto.

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration copyWithZone:]): Use retain instead of leakRef;
        slightly clearer for when we convert to ARC.

        * UIProcess/API/Cocoa/_WKUserContentWorld.mm:
        (+[_WKUserContentWorld worldWithName:]): Removed explicit leakRef/autorelease pair,
        done by the wrapper template function now.

        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies websiteDataStore]): Removed explicit null check, done by
        the wrapper template function now.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::didChangeBackForwardList): Removed
        explicit null check, done by the wrapper template function now.
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto.
        (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation): Ditto.
        (WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation): Ditto.
        (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError): Ditto.
        (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError): Ditto.
        (WebKit::NavigationState::NavigationClient::didCommitNavigation): Ditto.
        (WebKit::NavigationState::NavigationClient::didFinishDocumentLoad): Ditto.
        (WebKit::NavigationState::NavigationClient::didFinishNavigation): Ditto.
        (WebKit::NavigationState::NavigationClient::didFailNavigationWithError): Ditto.
        (WebKit::NavigationState::NavigationClient::didSameDocumentNavigation): Ditto.

        * UIProcess/Cocoa/SessionStateCoding.mm:
        (WebKit::encodeSessionState): Removed explicit leakRef/autorelease pair, done
        by the wrapper template function now. Also, the old version explicitly dereferenced
        and would not work when the result of encodeLegacySessionState was null. Decided
        not to add a call to releaseNonNull to preserve that possibly-incorrect optimization,
        instead allowing the wrapper function to generate code to handle the null case.

        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController configuration]): Removed explicit WebKit namespace.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        (+[WKWebProcessPlugInFrame lookUpFrameFromHandle:]): Removed explicit null check,
        done by the wrapper template function now.
        (-[WKWebProcessPlugInFrame hitTest:]): Removed explicit leakRef/autorelease pair, done
        by the wrapper template function now. Also, the old version explicitly dereferenced
        and would not work when the result of hitTest was null. Decided not to add a call to
        releaseNonNull to preserve that possibly-incorrect optimization, instead allowing the
        wrapper function to generate code to handle the null case.
        (-[WKWebProcessPlugInFrame childFrames]): Removed explicit leakRef/autorelease pair,
        done by the wrapper template function now.
        (-[WKWebProcessPlugInFrame handle]): Ditto.
        (-[WKWebProcessPlugInFrame _parentFrame]): Removed explicit null check, done by the
        wrapper template function now.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
        (-[WKWebProcessPlugInHitTestResult nodeHandle]): Removed explicit null check and
        leakRef/autorelease pair, both done by the wrapper template function now.
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
        (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]): Ditto.
        (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]): Ditto.
        (-[WKWebProcessPlugInNodeHandle HTMLTableCellElementCellAbove]): Ditto.
        (-[WKWebProcessPlugInNodeHandle frame]): Ditto.
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
        (+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Ditto.
        (-[WKWebProcessPlugInRangeHandle frame]): Ditto.
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
        (+[WKWebProcessPlugInScriptWorld world]): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController mainFrame]): Ditto.
        (+[WKWebProcessPlugInBrowserContextController lookUpBrowsingContextFromHandle:]): Ditto.

2018-08-19  Darin Adler  <darin@apple.com>

        [Cocoa] Consolidate inline "wrapper" functions in WebKit API into function templates and WrapperTraits
        https://bugs.webkit.org/show_bug.cgi?id=188733

        Reviewed by Sam Weinig.

        Replaced all the different functions named "wrapper" that were all boilerplate doing Objective-C
        casts with WrapperTraits specializations. The only thing about this that was at all tricky was
        the loose mixing of the WebKit namespace, the API namespace, and the global namespace. My choice
        for this first step was to put WrapperTraits into the WebKit namespace and to put the wrapper
        function into both the WebKit and API namespaces with "using". This turned out pretty clean: did
        not have to touch any of the code calling wrapper just to make things work, although we can now
        clean up by changing call sites to get rid of unnecessary explicit use of leakRef and autorelease.
        Doing this will make ARC conversion practical and easy, which is the motivation behind pursuing
        this set of changes.

        * Shared/Cocoa/WKObject.h: Tweaked style of the ObjectStorage structure template,
        using a class name instead of "T". Added WrapperTraits structure template, checkedObjCCast
        function template, and multiple wrapper functions templates that take a variety of pointer,
        reference, smart pointer, and smart reference types, and return the wrapper for each one,
        handling object lifetime appropriately.

        * Shared/API/Cocoa/_WKFrameHandleInternal.h:
        * Shared/API/Cocoa/_WKHitTestResultInternal.h:
        * Shared/Cocoa/WKNSArray.h:
        * Shared/Cocoa/WKNSData.h:
        * Shared/Cocoa/WKNSDictionary.h:
        * Shared/Cocoa/WKNSError.h:
        * Shared/Cocoa/WKNSNumber.h:
        * Shared/Cocoa/WKNSString.h:
        * Shared/Cocoa/WKNSURL.h:
        * Shared/Cocoa/WKNSURLRequest.h:
        * UIProcess/API/Cocoa/WKBackForwardListInternal.h:
        * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
        * UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h:
        * UIProcess/API/Cocoa/WKConnectionInternal.h:
        * UIProcess/API/Cocoa/WKContentRuleListInternal.h:
        * UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h:
        * UIProcess/API/Cocoa/WKFrameInfoInternal.h:
        * UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h:
        * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h:
        * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
        * UIProcess/API/Cocoa/WKNavigationDataInternal.h:
        * UIProcess/API/Cocoa/WKNavigationInternal.h:
        * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
        * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
        * UIProcess/API/Cocoa/WKPreferencesInternal.h:
        * UIProcess/API/Cocoa/WKProcessPoolInternal.h:
        * UIProcess/API/Cocoa/WKSecurityOriginInternal.h:
        * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
        * UIProcess/API/Cocoa/WKUserScriptInternal.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h:
        * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h:
        * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h:
        * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionInternal.h:
        * UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h:
        * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h:
        * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h:
        * UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h:
        * UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h:
        * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
        * UIProcess/Cocoa/DownloadClient.mm:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrameInternal.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResultInternal.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h:
        Replaced inline wrapper functions with WrapperTraits structure template
        specializations. This is always in the WebKit namespace, unlike the functions,
        which were in a mix of namespaces. Also deleted some unneeded "#pragma once".

2018-08-19  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r234396): Leak of CFURLRef in WebKit::NetworkProcess::deleteHSTSCacheForHostNames()
        <https://webkit.org/b/188725>

        Reviewed by Dan Bernstein.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames): Use
        adoptCF() to prevent a leak.

2018-08-18  Andy Estes  <aestes@apple.com>

        [watchOS] NetworkProximityManager should use WTF_MAKE_FAST_ALLOCATED
        https://bugs.webkit.org/show_bug.cgi?id=188723

        Reviewed by Sam Weinig.

        * NetworkProcess/watchos/NetworkProximityManager.h:

2018-08-18  Andy Estes  <aestes@apple.com>

        [watchOS] Add more assertions to NetworkProximityAssertion
        https://bugs.webkit.org/show_bug.cgi?id=188721

        Reviewed by Wenson Hsieh.

        * NetworkProcess/watchos/NetworkProximityAssertion.mm:
        (WebKit::NetworkProximityAssertion::hold):
        (WebKit::NetworkProximityAssertion::release):
        (WebKit::NetworkProximityAssertion::releaseTimerFired):

2018-08-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Paste is missing from callout bar when pasteboard only contains custom data
        https://bugs.webkit.org/show_bug.cgi?id=184271
        <rdar://problem/39256708>

        Reviewed by Ryosuke Niwa.

        Currently, the "paste:" selector action cannot be performed during editing if the pasteboard only contains
        custom pasteboard data. This is because logic in -[WKContentView canPerformActionForWebView:withSender:] only
        checks against a list of pasteboard types which does not include the type identifier for custom pasteboard data.
        To fix this, we allow pasting only in the case where none of the other type identifiers exist in the pasteboard,
        as long as the custom pasteboard data type identifier is present, and the custom pasteboard data's origin
        matches the origin of the focused frame's document.

        Test: PasteMixedContent.CopyAndPasteWithCustomPasteboardDataOnly

        * Shared/EditorState.cpp:
        (WebKit::EditorState::encode const):
        (WebKit::EditorState::decode):
        * Shared/EditorState.h:

        Add a originIdentifierForPasteboard field, and add support for encoding it when propagating EditorState via IPC.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):

        If none of the conventional pasteboard type identifiers for rich or plain text editing are present, check to see
        if we have custom pasteboard data; if so, only allow pasting if the custom pasteboard data's origin matches that
        of the focused frame's document origin.

        Additionally refactor a bit of logic by pulling out `_page->editorState()` into a separate local variable, used
        throughout the rest of the method.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::editorState const):

        Send the focused frame's document origin to the UI process via EditorState.

2018-08-17  Tim Horton  <timothy_horton@apple.com>

        Start bringing up Unified Sources in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=188703

        Reviewed by Simon Fraser.

        * Configurations/BaseTarget.xcconfig:
        Add SRCROOT to the include path, so unified sources can find the source files.

        * Shared/APIWebArchive.mm:
        (API::releaseWebArchiveData):
        (API::WebArchive::data):
        (API::releaseCFData): Deleted.
        * Shared/APIWebArchiveResource.mm:
        (API::releaseWebArchiveResourceData):
        (API::WebArchiveResource::data):
        (API::releaseCFData): Deleted.
        Disambiguate two static methods by renaming them.

        * Shared/cf/ArgumentCodersCF.cpp:
        Leave a comment about the bizarreness of this file.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::decode):
        * Shared/WebPlatformTouchPoint.cpp:
        * Shared/WebPopupItem.cpp:
        (WebKit::WebPopupItem::WebPopupItem):
        (WebKit::WebPopupItem::decode):
        * Shared/WebPreferencesStore.cpp:
        * Shared/WebRenderLayer.cpp:
        (WebKit::WebRenderLayer::create):
        (WebKit::WebRenderLayer::createArrayFromLayerList):
        (WebKit::WebRenderLayer::WebRenderLayer):
        * Shared/gtk/WebEventFactory.cpp:
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        * Shared/mac/WebEventFactory.mm:
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebWheelEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):
        * Shared/mac/WebMemorySampler.mac.mm:
        (WebKit::WebMemorySampler::sampleWebKit const):
        * UIProcess/API/APIAutomationSessionClient.h:
        (API::AutomationSessionClient::sessionIdentifier const):
        (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::ensureBackingStore):
        (WebKit::RemoteLayerBackingStore::setNeedsDisplay):
        (WebKit::RemoteLayerBackingStore::backingStoreSize const):
        (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
        (WebKit::RemoteLayerBackingStore::display):
        (WebKit::RemoteLayerBackingStore::drawInContext):
        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        (WebKit::RemoteLayerTreeTransaction::decode):
        (WebKit::RemoteLayerTreeTransaction::setRootLayerID):
        (WebKit::RemoteLayerTreeTransaction::setDestroyedLayerIDs):
        (WebKit::RemoteLayerTreeTransaction::setLayerIDsWithNewlyUnreachableBackingStore):
        (WebKit::dumpChangedLayers):
        (WebKit::RemoteLayerTreeTransaction::description const):
        * Shared/WebPlatformTouchPoint.cpp:
        (WebKit::WebPlatformTouchPoint::WebPlatformTouchPoint):
        Get rid of lots of `using namespace`.

        * Sources.txt: Added.
        * SourcesCocoa.txt: Added.
        * WebKit.xcodeproj/project.pbxproj:
        Set up unified sources.
        Right now, we only unify Platform/ and Shared/[^API].

2018-08-17  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][iOS] Display suggestions for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=188669

        Reviewed by Tim Horton.

        An input[type=color] element that has an associated datalist element should
        display the color values provided on iOS. Similar to macOS, we now support 1-12
        suggested colors, that will be displayed at the top of the color picker.

        Also ensured that we get rounded corners on both sides of a color swatch if it is
        the only one in its row.

        * Shared/AssistedNodeInformation.cpp: Added suggestedColors field.
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (+[WKColorPicker defaultTopColorMatrix]):
        (-[WKColorPicker initWithView:]): Use the list of suggestedColors if it exists.
        (-[WKColorPicker drawSelectionIndicatorForColorButton:]):
        * WebProcess/WebCoreSupport/WebColorChooser.cpp:
        (WebKit::WebColorChooser::WebColorChooser):
        (WebKit::WebColorChooser::reattachColorChooser):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

2018-08-17  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234991.

        Caused an assertion failure on the bots.

        Reverted changeset:

        "Pass webPageID and webFrameID to NetworkLoad for speculative
        loads"
        https://bugs.webkit.org/show_bug.cgi?id=188682
        https://trac.webkit.org/changeset/234991

2018-08-17  Alex Christensen  <achristensen@webkit.org>

        Add some plumbing for safe browsing
        https://bugs.webkit.org/show_bug.cgi?id=188709

        Reviewed by Tim Horton.

        Also adding a URL to SafeBrowsingResult because we'll need it.
        Also adding a bool to LoadParameters because we will need to do special things
        when loading the safe browsing warning, like adding a way to skip the safe browsing check.

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:
        * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
        (WebKit::SafeBrowsingResult::SafeBrowsingResult):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::beginSafeBrowsingCheck):
        * UIProcess/SafeBrowsingResult.h:
        (WebKit::SafeBrowsingResult::url const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        Replace canBubble and cancelable booleans in Event by enum classes
        https://bugs.webkit.org/show_bug.cgi?id=188692

        Reviewed by Alex Christensen.

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

2018-08-17  Andy Estes  <aestes@apple.com>

        [Xcode] Fix up file reference paths in Source/WebKit/NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=188700

        Rubber-stamped by Dan Bernstein.

        * WebKit.xcodeproj/project.pbxproj:

2018-08-17  Alex Christensen  <achristensen@webkit.org>

        Pass webPageID and webFrameID to NetworkLoad for speculative loads
        https://bugs.webkit.org/show_bug.cgi?id=188682

        Reviewed by Youenn Fablet.

        This also removes an authentication shortcut I introduced in r234941

        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):

2018-08-17  Alex Christensen  <achristensen@webkit.org>

        Simplify server trust authentication flow
        https://bugs.webkit.org/show_bug.cgi?id=188684

        Reviewed by Youenn Fablet.

        We unnecessarily had the allowsSpecificHTTPSCertificateForHost check at two different abstraction levels.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost): Deleted.
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

2018-08-17  Alex Christensen  <achristensen@webkit.org>

        Fix API tests after r234985
        https://bugs.webkit.org/show_bug.cgi?id=188679

        * UIProcess/API/C/WKPage.cpp:
        (encodingOf):
        (dataFrom):
        The encoding of null strings had changed, which is no big deal because there's no data in that encoding,
        but switching it back fixes the tests.

2018-08-17  Alex Christensen  <achristensen@webkit.org>

        Replace WebPageProxy::loadAlternateHTMLString with loadAlternateHTML
        https://bugs.webkit.org/show_bug.cgi?id=188679

        Reviewed by Carlos Garcia Campos.

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:
        * UIProcess/API/C/WKPage.cpp:
        (encodingOf):
        (dataFrom):
        (loadString):
        (WKPageLoadAlternateHTMLString):
        (WKPageLoadAlternateHTMLStringWithUserData):
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadAlternateHTMLString): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadAlternateHTMLString):

2018-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r234259.

        Caused excessive CPU usage

        Reverted changeset:

        "[GTK][WPE] Improve the way request displayRefresh
        notifications"
        https://bugs.webkit.org/show_bug.cgi?id=188005
        https://trac.webkit.org/changeset/234259

2018-08-16  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234958.
        https://bugs.webkit.org/show_bug.cgi?id=188683

        Breaking builds due to copy failure (Requested by brichards on
        #webkit).

        Reverted changeset:

        "Add script to generate WebContent service resource files"
        https://bugs.webkit.org/show_bug.cgi?id=188601
        https://trac.webkit.org/changeset/234958

2018-08-16  Sihui Liu  <sihui_liu@apple.com>

        Remove unused parentProcessName from NetworkProcessCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=188618

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-08-16  Andy Estes  <aestes@apple.com>

        [watchOS] Upstream Proximity Networking (nee Wi-Fi Assertions)
        https://bugs.webkit.org/show_bug.cgi?id=188664

        Reviewed by Tim Horton.

        Proximity Networking provides two features for speeding up page loads on watchOS:

        1. Binding requests to the Apple Watch's Wi-Fi interface even when the iPhone is in proximity.
        2. When Wi-Fi isn't available, preemptively upgrading the Bluetooth link to its fastest data
        rate prior to starting page loads.

        * Configurations/WebKit.xcconfig:

        Added LDFLAGS for Proximity Networking.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        (WebKit::NetworkProcess::proximityManager):
        * NetworkProcess/NetworkProcess.h:

        Added NetworkProximityManager as a supplement.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:

        Renamed ENABLE(WIFI_ASSERTIONS) to ENABLE(PROXIMITY_NETWORKING).

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:

        Renamed m_wiFiAssertionHolder to m_proximityAssertionToken and changed its type from an
        optional WiFiAssertionHolder to an optional NetworkProximityAssertion::Token.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidResume):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):

        Changed to use NetworkProximityManager.

        * NetworkProcess/cocoa/WiFiAssertionHolder.h: Removed.
        * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Removed.
        * NetworkProcess/watchos/NetworkProximityAssertion.h: Added.
        (WebKit::NetworkProximityAssertion::Token::Token):
        (WebKit::NetworkProximityAssertion::Token::~Token):

        Added. NetworkDataTasks hold these tokens to keep Bluetooth or Wi-Fi assertions active
        during loading. When the last token is destroyed, its associated assertion will be
        deactivated.

        * NetworkProcess/watchos/NetworkProximityAssertion.mm: Added.
        (WebKit::NetworkProximityAssertion::NetworkProximityAssertion):
        (WebKit::NetworkProximityAssertion::hold):
        (WebKit::NetworkProximityAssertion::release):
        (WebKit::NetworkProximityAssertion::resume):
        (WebKit::NetworkProximityAssertion::suspend):
        (WebKit::NetworkProximityAssertion::suspendNow):
        (WebKit::NetworkProximityAssertion::releaseTimerFired):
        (WebKit::NetworkProximityAssertion::suspendAfterBackgroundingTimerFired):

        Added. NetworkProximityAssertion is the base class for Bluetooth and Wi-Fi assertions. It
        manages the logic for holding and releasing assertions as well as responding to network
        process backgrounding and suspension.

        (WebKit::BluetoothProximityAssertion::BluetoothProximityAssertion):
        (WebKit::BluetoothProximityAssertion::suspend):
        (WebKit::BluetoothProximityAssertion::holdNow):
        (WebKit::BluetoothProximityAssertion::releaseNow):

        Added. Holds a Bluetooth assertion by calling -[IDSService setLinkPreferences:].

        (WebKit::WiFiProximityAssertion::WiFiProximityAssertion):
        (WebKit::WiFiProximityAssertion::holdNow):
        (WebKit::WiFiProximityAssertion::releaseNow):

        Added. Holds a Wi-Fi assertion by using WiFiManagerClient.

        * NetworkProcess/watchos/NetworkProximityManager.h: Added.
        * NetworkProcess/watchos/NetworkProximityManager.mm: Added.
        (-[WKProximityServiceDelegate setClient:]):
        (-[WKProximityServiceDelegate service:devicesChanged:]):
        (-[WKProximityServiceDelegate service:nearbyDevicesChanged:]):
        (WebKit::NetworkProximityManager::NetworkProximityManager):
        (WebKit::NetworkProximityManager::~NetworkProximityManager):
        (WebKit::NetworkProximityManager::supplementName):
        (WebKit::bindRequestToWiFi):
        (WebKit::NetworkProximityManager::applyProperties):
        (WebKit::NetworkProximityManager::resume):
        (WebKit::NetworkProximityManager::suspend):
        (WebKit::NetworkProximityManager::recommendation const):
        (WebKit::NetworkProximityManager::processRecommendations):
        (WebKit::toProcessID):
        (WebKit::NetworkProximityManager::resumeRecommendations):
        (WebKit::NetworkProximityManager::suspendRecommendations):
        (WebKit::NetworkProximityManager::updateCompanionProximity):
        (WebKit::NetworkProximityManager::updateRecommendation):
        (WebKit::NetworkProximityManager::initialize):
        (WebKit::NetworkProximityManager::devicesChanged):

        Added. NetworkProximityManager is a network process supplement that can bind
        NetworkDataTasks to Wi-Fi, associate assertions with NetworkDataTasks, check for companion
        proximity, ask for proximity network recommendations, and respond to network process
        backgrounding and suspending.

        * Platform/Logging.h:

        Renamed the WiFiAssertions log channel to ProximityNetworking.

        * Platform/spi/ios/MobileWiFiSPI.h:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

        Renamed ENABLE(WIFI_ASSERTIONS) to ENABLE(PROXIMITY_NETWORKING).

        * WebKit.xcodeproj/project.pbxproj:
        * config.h:

        Removed unused definition of HAVE_MOBILE_WIFI.

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Remove unused and deprecated _WKProcessPoolConfiguration.allowsCellularAccess
        https://bugs.webkit.org/show_bug.cgi?id=188681

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration allowsCellularAccess]): Deleted.
        (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]): Deleted.

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Deprecate SPI that is or ought to be unused
        https://bugs.webkit.org/show_bug.cgi?id=188616

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Add temporary SPI WKContextHandlesSafeBrowsing
        https://bugs.webkit.org/show_bug.cgi?id=188676

        Reviewed by Joseph Pecoraro.

        WebKit showing the safe browsing warning doesn't play well with Safari showing the safe browsing warning.
        I plan to adopt this SPI in Safari to disable Safari's safe browsing check if it's true.
        Then when I implement safe browsing in WebKit, I can switch this value to true in the same change and
        not have a broken Safari.

        * UIProcess/API/C/mac/WKContextPrivateMac.h:
        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextHandlesSafeBrowsing):

2018-08-16  Ben Richards  <benton_richards@apple.com>

        Add script to generate WebContent service resource files
        https://bugs.webkit.org/show_bug.cgi?id=188601

        Reviewed by Dan Bernstein.

        Added new build phase to WebContent service to copy resource files to WebKit.framework/PrivateHeaders/CustomWebContentResource.
        These resources are intended to be used by a client to create a custom WebContent service.

        * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Consolidate data/string API loading paths
        https://bugs.webkit.org/show_bug.cgi?id=188417

        Reviewed by Michael Catanzaro.

        loadHTMLString and loadData are basically duplicate code.
        loadPlainTextString was also basically the same except it didn't set up a navigation, which
        was almost certainly a bug, but nobody uses it in all of Apple and Debian.  We should probably deprecate
        and remove it, but for now I make it use the same data loading path.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageLoadData):
        (WKPageLoadDataWithUserData):
        (loadString):
        (WKPageLoadHTMLString):
        (WKPageLoadHTMLStringWithUserData):
        (WKPageLoadPlainTextString):
        (WKPageLoadPlainTextStringWithUserData):
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]):
        (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
        (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_load_html):
        (webkit_web_view_load_plain_text):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadHTMLString): Deleted.
        (WebKit::WebPageProxy::loadPlainTextString): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadData):
        (WebKit::WebPage::loadString): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Transition more WKWebViewConfiguration ivars to API::PageConfiguration values
        https://bugs.webkit.org/show_bug.cgi?id=188665

        Reviewed by Joseph Pecoraro.

        APPLICATION_MANIFEST is enabled on all Cocoa platforms, so I removed some guards, too!

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::applicationManifest const):
        * UIProcess/API/APIPageConfiguration.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _applicationManifest]):
        (-[WKWebViewConfiguration _setApplicationManifest:]):
        (-[WKWebViewConfiguration _setCPULimit:]):
        (-[WKWebViewConfiguration _cpuLimit]):

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Transition more WKWebViewConfiguration ivars to API::PageConfiguration values
        https://bugs.webkit.org/show_bug.cgi?id=188663

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _drawsBackground]):
        (-[WKWebViewConfiguration _setDrawsBackground:]):
        (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
        (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
        (-[WKWebViewConfiguration _isControlledByAutomation]):
        (-[WKWebViewConfiguration _setControlledByAutomation:]):

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Stop using canAuthenticateAgainstProtectionSpace in modern WebKit
        https://bugs.webkit.org/show_bug.cgi?id=188639

        Reviewed by Youenn Fablet.

        canAuthenticateAgainstProtectionSpace is an unnecessary step in the authentication process.
        It is leftover from when it was necessary when we used NSURLConnection, which is only used in WebKitLegacy now.
        Now it's just an extra IPC roundtrip asking if we should use NSURLSessionAuthChallengeRejectProtectionSpace
        or if we are going to ask the API client.  We can move this step into the C API for compatibility
        with the 1 client that still uses it (not for long, see rdar://problem/43358403) and simplify and optimize
        authentication.

        * NetworkProcess/Downloads/PendingDownload.cpp:
        (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        * NetworkProcess/Downloads/PendingDownload.h:
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::~NetworkLoad):
        (WebKit::NetworkLoad::didReceiveChallenge):
        (WebKit::NetworkLoad::completeAuthenticationChallenge): Deleted.
        (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Deleted.
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkLoadClient.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::cancelDownload):
        (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): Deleted.
        (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
        (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): Deleted.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace): Deleted.
        * UIProcess/WebPageProxy.h:

2018-08-15  Jer Noble  <jer.noble@apple.com>

        Add Experimental Feature support for SourceBuffer.changeType()
        https://bugs.webkit.org/show_bug.cgi?id=188626

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetSourceBufferChangeTypeEnabled):
        (WKPreferencesGetSourceBufferChangeTypeEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2018-08-16  Alex Christensen  <achristensen@webkit.org>

        Transition more WKWebViewConfiguration ivars to API::PageConfiguration values
        https://bugs.webkit.org/show_bug.cgi?id=188661

        Reviewed by Anders Carlsson.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
        (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
        (-[WKWebViewConfiguration _initialCapitalizationEnabled]):
        (-[WKWebViewConfiguration _setInitialCapitalizationEnabled:]):
        (-[WKWebViewConfiguration _overrideContentSecurityPolicy]):
        (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]):

2018-08-16  Aditya Keerthi  <akeerthi@apple.com>

        Support drag-and-drop for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=188464

        Reviewed by Wenson Hsieh.

        On iOS, the drag preview for the color input is a rounded rectangle. In order to
        ensure that the corners appear transparent, the visiblePath property of the
        UIDragPreviewParameters was set to match the preview's shape. This also required
        the creation of an additional ArgumentCoder for Path.

        When beginning the drag session, the preview should appear centered about the
        color input. This is managed in createTargetedDragPreview. However, once the
        preview is dragged, the preview should be at the center of the touch location.
        Consequently, DragSourceActionColor was added to the list of sources that could
        update the drag preview after lifting.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Path>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardColor):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/ios/DragDropInteractionState.h:
        * UIProcess/ios/DragDropInteractionState.mm:
        (WebKit::createTargetedDragPreview):
        (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
        (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource):
        (WebKit::canUpdatePreviewForActiveDragSource):
        (WebKit::DragDropInteractionState::previewForDragItem const):
        (WebKit::DragDropInteractionState::stageDragItem):
        (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorPicker initWithView:]):
        * UIProcess/mac/WebColorPickerMac.h:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::setColor):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-08-16  Per Arne Vollan  <pvollan@apple.com>

        Assert that calling CGSSetDenyWindowServerConnections(true) succeeds
        https://bugs.webkit.org/show_bug.cgi?id=188615

        Reviewed by Brent Fulgham.

        If the call to CGSSetDenyWindowServerConnections(true) fails, it means there are open WindowServer connections
        at this point, and future WindowServer connections will not be denied. We should assert that this call succeeds.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2018-08-16  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, WPE build fix after r234920.

        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::isViewWindowActive):
        (WebKit::PageClientImpl::isViewFocused):
        (WebKit::PageClientImpl::isViewVisible):
        (WebKit::PageClientImpl::isViewInWindow):
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::setViewState):
        * UIProcess/API/wpe/WPEView.h:

2018-08-16  Antti Koivisto  <antti@apple.com>

        Use OptionSet for ActivityState::Flags
        https://bugs.webkit.org/show_bug.cgi?id=188554

        Reviewed by Brent Fulgham.

        * Shared/WebPageCreationParameters.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::windowDidOrderOffScreen):
        (WebKit::WebViewImpl::windowDidOrderOnScreen):
        (WebKit::WebViewImpl::viewDidMoveToWindow):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateActivityState):
        (WebKit::WebPageProxy::activityStateDidChange):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::setMuted):
        (WebKit::WebPageProxy::isPlayingMediaDidChange):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isInWindow const):
        (WebKit::WebPageProxy::isViewVisible const):
        (WebKit::WebPageProxy::isViewFocused const):
        (WebKit::WebPageProxy::isViewWindowActive const):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::activityStateDidChange):
        * WebProcess/Plugins/PluginView.h:
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::activityStateDidChange):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateThrottleState):
        (WebKit::WebPage::updateIsInWindow):
        (WebKit::WebPage::visibilityDidChange):
        (WebKit::WebPage::setActivityState):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::isVisible const):
        (WebKit::WebPage::isVisibleOrOccluded const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::pageActivityStateDidChange):
        * WebProcess/WebProcess.h:

2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>

        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
        https://bugs.webkit.org/show_bug.cgi?id=186870
        <rdar://problem/41314410>

        Reviewed by Alex Christensen.

        Correctly expose the OAuth protection space type in API.

        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toAPI):
        * UIProcess/API/C/WKProtectionSpaceTypes.h:

2018-08-15  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
        (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
            in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
        (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
            compile a sandbox, and cache it.
        (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
            file which contains an entitlement with a process specific "storage class" which ensures that each process
            can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
        (4) The sandbox entitlements file for the Network and WebContent services are loaded dynamically
            through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
            The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
            The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
            are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.

        * Configurations/Network-OSX-sandbox.entitlements: Added.
        * Configurations/Storage-OSX-sandbox.entitlements: Added.
        * Configurations/StorageService.xcconfig:
        * Configurations/WebContent-OSX-sandbox.entitlements: Added.
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/NetworkProcess.h:
        * PluginProcess/PluginProcess.h:
        * Scripts/process-network-sandbox-entitlements.sh: Added.
        * Scripts/process-webcontent-sandbox-entitlements.sh: Added.
        * Shared/ChildProcess.h:
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/SandboxInitializationParameters.h:
        (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
        (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
        (WebKit::SandboxInitializationParameters::setSandboxProfile):
        (WebKit::SandboxInitializationParameters::sandboxProfile const):
        (): Deleted.
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::SandboxProfileDeleter::operator()):
        (WebKit::SandboxParametersDeleter::operator()):
        (WebKit::SandboxInfo::SandboxInfo):
        (WebKit::fileContents):
        (WebKit::processStorageClass):
        (WebKit::setAndSerializeSandboxParameters):
        (WebKit::sandboxDataVaultParentDirectory):
        (WebKit::sandboxDirectory):
        (WebKit::sandboxFilePath):
        (WebKit::ensureSandboxCacheDirectory):
        (WebKit::writeSandboxDataToCacheFile):
        (WebKit::compileAndCacheSandboxProfile):
        (WebKit::tryApplyCachedSandbox):
        (WebKit::webKit2Bundle):
        (WebKit::getSandboxProfileOrProfilePath):
        (WebKit::compileAndApplySandboxSlowCase):
        (WebKit::applySandbox):
        (WebKit::initializeSandboxParameters):
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/mac/SandboxInitialiationParametersMac.mm:
        (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
        * StorageProcess/StorageProcess.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.h:

2018-08-15  Ross Kirsling  <ross.kirsling@sony.com>

        [WinCairo] Unreviewed build fix after r234896.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):

2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>

        Can't share an app on AppStore to WeChat due to a release assert
        https://bugs.webkit.org/show_bug.cgi?id=188621
        <rdar://problem/43343976>

        Reviewed by Geoffrey Garen.

        Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
        is getting hit by third party applications on iOS in UI process.

        * UIProcess/Cocoa/VersionChecks.h:
        (WebKit::SDKVersion::FirstWithMainThreadReleaseAssertionInWebPageProxy): Added. It's iOS 12 or macOS 10.14 Mojave.
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::isMainThreadOrCheckDisabled): Added. Returns true whether when we're in the main thread or if the app
        is not linked on or after iOS 12 or macOS 10.14 Mojave.
        (WebKit::globalPageMap):
        (WebKit::m_isInPrewarmedPool):
        (WebKit::WebProcessProxy::~WebProcessProxy):
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
        (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
        (WebKit::WebProcessProxy::didFinishLaunching):

2018-08-15  Alex Christensen  <achristensen@webkit.org>

        Remove WKNavigationDelegatePrivate's canAuthenticateAgainstProtectionSpace
        https://bugs.webkit.org/show_bug.cgi?id=188622

        Reviewed by Timothy Hatcher.

        It's been deprecated for a release now, nobody uses it, and it's a concept from NSURLConnection, which we don't use any more in WebKit2.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):

2018-08-15  Tim Horton  <timothy_horton@apple.com>

        Crashes in Quip under _dictionaryPopupInfoForRange, in setObject:forKey:
        https://bugs.webkit.org/show_bug.cgi?id=188569
        <rdar://problem/34201095>

        Reviewed by Megan Gardner.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::dictionaryPopupInfoForRange):
        Speculative fix; the crashes indicate font is null, but we just checked it,
        so it must be getting made null by convertFont:toSize:. Check again!

2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234870.

        The test introduced with this change is a flaky failure.

        Reverted changeset:

        "NSURLAuthenticationMethodOAuth challenges are surfaced to
        clients in -didReceiveAuthenticationChallenge as
        NSURLAuthenticationMethodDefault"
        https://bugs.webkit.org/show_bug.cgi?id=186870
        https://trac.webkit.org/changeset/234870

2018-08-15  Alex Christensen  <achristensen@webkit.org>

        NetworkCORSPreflightChecker should proceed in case of ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested even though the WebKit app is not implementing the didReceiveAuthenticationChallenge/didReceiveAuthenticationChallengeInFrame callback
        https://bugs.webkit.org/show_bug.cgi?id=188592
        <rdar://problem/43210331>

        Reviewed by Youenn Fablet.

        Do a canAuthenticateAgainstProtectionSpace check in NetworkCORSPreflightChecker like we do in NetworkLoad.
        Use CompletionHandlers to make the now 3 different canAuthenticateAgainstProtectionSpace checks look the same from the NetworkProcess.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::didReceiveChallenge):
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
        (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
        (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace): Deleted.
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveChallenge):
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
        (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace): Deleted.
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):

2018-08-15  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] WaylandCompositor fails to properly remove surface from its page map
        https://bugs.webkit.org/show_bug.cgi?id=188520

        Reviewed by Alex Christensen.

        willDestroySurface overwrites the surface pointer in the map's iterator in an attempt to
        change the value of the surface pointer in the map, but it doesn't work because changing
        the iterator does not change the map itself. There's no need to fix this function: it's
        better to use WeakPtr instead.

        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::getTexture):
        (WebKit::WaylandCompositor::bindSurfaceToWebPage):
        (WebKit::WaylandCompositor::unregisterWebPage):
        (WebKit::WaylandCompositor::willDestroySurface): Deleted.
        * UIProcess/gtk/WaylandCompositor.h:

2018-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment SPI] Remove attachment display mode options
        https://bugs.webkit.org/show_bug.cgi?id=188596

        Reviewed by Dan Bernstein.

        Remove attachment display mode from WebKit. Note that _WKAttachmentDisplayOptions needs to remain in the private
        header for source compatibility with Mail.

        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setAttachmentDisplayOptions):

2018-08-14 Sihui Liu <sihui_liu@apple.com>

        Crash in WebKit::filterPreloadHSTSEntry via NetworkProcess::getHostNamesWithHSTSCache
        https://bugs.webkit.org/show_bug.cgi?id=188576
        <rdar://problem/43148977>

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):

2018-08-14  Alex Christensen  <achristensen@webkit.org>

        isValidCSSSelector is unsafe to be called from a non-main thread
        https://bugs.webkit.org/show_bug.cgi?id=188581
        <rdar://problem/40517358>

        Reviewed by Sam Weinig.

        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::compiledToFile):
        (API::ContentRuleListStore::lookupContentRuleList):
        (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
        (API::ContentRuleListStore::compileContentRuleList):
        (API::ContentRuleListStore::removeContentRuleList):
        (API::ContentRuleListStore::getContentRuleListSource):
        * UIProcess/API/APIContentRuleListStore.h:
        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:

2018-08-14  Ansh Shukla  <ansh_shukla@apple.com>

        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
        https://bugs.webkit.org/show_bug.cgi?id=186870
        <rdar://problem/41314410>

        Reviewed by Alex Christensen.

        Correctly expose the OAuth protection space type in API.

        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toAPI):
        * UIProcess/API/C/WKProtectionSpaceTypes.h:

2018-08-14  Ben Richards  <benton_richards@apple.com>

        Remove api misuse check so that custom webcontent service identifier can be set at runtime
        https://bugs.webkit.org/show_bug.cgi?id=188579

        Reviewed by Ryosuke Niwa.

        Changed API misuse check so that a custom bundle identifier can be set at runtime with a debug flag

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setCustomWebContentServiceBundleIdentifier):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getLaunchOptions):

2018-08-14  Antti Koivisto  <antti@apple.com>

        RemoteLayerTreeTransaction should use OptionSet for change flags
        https://bugs.webkit.org/show_bug.cgi?id=188547

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::resetChangedProperties):

        Also remove unused everChangedProperties.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):

2018-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] [macOS] Implement a mechanism to test drag and drop
        https://bugs.webkit.org/show_bug.cgi?id=181898
        <rdar://problem/39181698>

        Reviewed by Simon Fraser.

        Adds a new SPI method, `-_doAfterProcessingAllPendingMouseEvents:`, to WKWebView. This invokes the given
        callback after all queued mouse events have been handled by the web process. See Tools/ChangeLog for more
        detail.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::processDidExit):

        Invoke any outstanding callbacks for processing pending mouse events when the web process is terminated.

        (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents):

        Either invoke the callback immediately if there are no mouse events to be processed, or insert the callback in
        a queue that will be flushed once all mouse events have been handled.

        (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents):
        (WebKit::WebViewImpl::flushPendingMouseEventCallbacks):
        * UIProcess/PageClient.h:
        (WebKit::PageClient::pinnedStateWillChange):
        (WebKit::PageClient::pinnedStateDidChange):
        (WebKit::PageClient::videoControlsManagerDidChange):

        Drive-by tweaks: remove unnecessary semicolons after empty implementation stubs.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didReceiveEvent):

        Notify the page client when there are no remaining mouse events left in the queue.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents):

        Add some plumbing through PageClient, so that WebPageProxy can tell WebViewImpl when it is finished processing
        all mouse events.

        * UIProcess/win/PageClientImpl.h:

2018-08-13  Alex Christensen  <achristensen@webkit.org>

        Fix linux build after r234811
        https://bugs.webkit.org/show_bug.cgi?id=188501

        * UIProcess/API/glib/WebKitWebsiteData.cpp:
        (recordContainsSupportedDataTypes):

2018-08-13  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234747.
        https://bugs.webkit.org/show_bug.cgi?id=188524

        plugin processes crash on launch (Requested by smfr on
        #webkit).

        Reverted changeset:

        "We should cache the compiled sandbox profile in a data vault"
        https://bugs.webkit.org/show_bug.cgi?id=184991
        https://trac.webkit.org/changeset/234747

2018-08-13  Alex Christensen  <achristensen@webkit.org>

        Use a 1-byte enum class for TextDirection
        https://bugs.webkit.org/show_bug.cgi?id=188350

        Reviewed by Simon Fraser.

        * Shared/WebPopupItem.cpp:
        (WebKit::WebPopupItem::WebPopupItem):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView webSelectionRectsForSelectionRects:]):
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::populate):
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::show):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

2018-08-13  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, silence "enumeral and non-enumeral type in conditional expression" warning

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):

2018-08-12  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Color wells should appear pressed when presenting a color picker
        https://bugs.webkit.org/show_bug.cgi?id=188477

        Reviewed by Tim Horton.

        In order for the color well to accurately reflect the state of the picker, it is
        necessary to ensure that the picker is destroyed at the appropriate time.

        Added windowWillClose and didClosePopover delegate methods to destroy the picker
        it has been closed. Also added a call to WebColorPicker::endPicker in
        WebColorPickerMac's implementation of endPicker to ensure that the object is
        destroyed. Removed redundant calls to endPicker in the WebPageProxy.

        The hitTest method was overridden in WKPopoverColorWell to ensure that AppKit's
        view does not block our drawn color well from receiving click events.

        * UIProcess/WebColorPicker.cpp:
        (WebKit::WebColorPicker::endPicker):
        * UIProcess/WebColorPicker.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::endColorPicker):
        (WebKit::WebPageProxy::didEndColorPicker):
        (WebKit::WebPageProxy::resetState):
        (WebKit::WebPageProxy::closeOverlayedViews):
        * UIProcess/mac/WebColorPickerMac.mm:
        (WebKit::WebColorPickerMac::~WebColorPickerMac):
        (WebKit::WebColorPickerMac::endPicker):
        (-[WKPopoverColorWell popoverDidClose:]):
        (-[WKPopoverColorWell hitTest:]):
        (-[WKColorPopoverMac setAndShowPicker:withColor:suggestions:]):
        (-[WKColorPopoverMac invalidate]):
        (-[WKColorPopoverMac windowWillClose:]):
        (-[WKColorPopoverMac didClosePopover]):

2018-08-10  David Kilzer  <ddkilzer@apple.com>

        [Cocoa] WebKit::PlatformPopupMenuData should use member initialization
        <https://webkit.org/b/188478>
        <rdar://problem/43154363>

        Reviewed by Joseph Pecoraro.

        * Shared/PlatformPopupMenuData.cpp:
        (WebKit::PlatformPopupMenuData::PlatformPopupMenuData): Delete
        implementation.  This constructor caused the warning by never
        initializing its member variables.
        * Shared/PlatformPopupMenuData.h:
        (WebKit::PlatformPopupMenuData::PlatformPopupMenuData):
        - Use default constructor.
        (WebKit::PlatformPopupMenuData::shouldPopOver):
        (WebKit::PlatformPopupMenuData::hideArrows):
        (WebKit::PlatformPopupMenuData::menuSize):
        - Add struct member initialization.

2018-08-10  Chris Dumez  <cdumez@apple.com>

        Crash under NetworkResourceLoader::convertToDownload()
        https://bugs.webkit.org/show_bug.cgi?id=188479
        <rdar://problem/42201724>

        Reviewed by Alex Christensen.

        In NetworkResourceLoader::convertToDownload(), if m_networkLoad is null then we're trying
        to convert a load that came from the disk cache. Since we do not currently support converting
        such a load, cancel the current load and start a fresh download.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::convertToDownload):

2018-08-10  Sihui Liu  <sihui_liu@apple.com>

        Incorrect log message in NetworkSession when creating NetworkDataTask
        https://bugs.webkit.org/show_bug.cgi?id=188463

        Reviewed by Chris Dumez.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):

2018-08-09  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
        (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
            in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
        (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
            compile a sandbox, and cache it.
        (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
            file which contains an entitlement with a process specific "storage class" which ensures that each process
            can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
        (4) The sandbox entitlements file for the Network, WebContent and Plugin services are loaded dynamically
            through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
            The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
            The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
            are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.

        * Configurations/Network-OSX-sandbox.entitlements: Added.
        * Configurations/Storage-OSX-sandbox.entitlements: Added.
        * Configurations/StorageService.xcconfig:
        * Configurations/WebContent-OSX-sandbox.entitlements: Added.
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/NetworkProcess.h:
        * PluginProcess/PluginProcess.h:
        * Scripts/process-network-sandbox-entitlements.sh: Added.
        * Scripts/process-webcontent-sandbox-entitlements.sh: Added.
        * Shared/ChildProcess.h:
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/SandboxInitializationParameters.h:
        (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
        (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
        (WebKit::SandboxInitializationParameters::setSandboxProfile):
        (WebKit::SandboxInitializationParameters::sandboxProfile const):
        (): Deleted.
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::SandboxProfileDeleter::operator()):
        (WebKit::SandboxParametersDeleter::operator()):
        (WebKit::SandboxInfo::SandboxInfo):
        (WebKit::fileContents):
        (WebKit::processStorageClass):
        (WebKit::setAndSerializeSandboxParameters):
        (WebKit::sandboxDataVaultParentDirectory):
        (WebKit::sandboxDirectory):
        (WebKit::sandboxFilePath):
        (WebKit::ensureSandboxCacheDirectory):
        (WebKit::writeSandboxDataToCacheFile):
        (WebKit::compileAndCacheSandboxProfile):
        (WebKit::tryApplyCachedSandbox):
        (WebKit::webKit2Bundle):
        (WebKit::sandboxProfilePath):
        (WebKit::compileAndApplySandboxSlowCase):
        (WebKit::applySandbox):
        (WebKit::initializeSandboxParameters):
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/mac/SandboxInitialiationParametersMac.mm:
        (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
        * StorageProcess/StorageProcess.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.h:

2018-08-09  Jer Noble  <jer.noble@apple.com>

        Video playback is using more power
        https://bugs.webkit.org/show_bug.cgi?id=188452

        Reviewed by Eric Carlson.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setLowPowerVideoAudioBufferSizeEnabled:]):
        (-[WKPreferences _lowPowerVideoAudioBufferSizeEnabled]):

2018-08-09  Alex Christensen  <achristensen@webkit.org>

        Fix URLSchemeHandler.SyncXHR API test after r234735.
        https://bugs.webkit.org/show_bug.cgi?id=188358

        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::didReceiveData):
        Return after appending data for synchronous loads.  We used to send unused messages.

2018-08-09  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
        https://bugs.webkit.org/show_bug.cgi?id=188453
        <rdar://problem/43102553>

        Reviewed by Chris Dumez.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::beginSafeBrowsingCheck):

2018-08-09  Alex Christensen  <achristensen@webkit.org>

        WKURLSchemeHandler crashes when sent errors with sync XHR
        https://bugs.webkit.org/show_bug.cgi?id=188358

        Reviewed by Chris Dumez.

        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::didReceiveData):
        (WebKit::WebURLSchemeTask::didComplete):
        * UIProcess/WebURLSchemeTask.h:

2018-08-09  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION (r232083): WKWebView loses first-party cookies on iOS
        https://bugs.webkit.org/show_bug.cgi?id=188443
        <rdar://problem/42991584>

        Reviewed by Chris Dumez.

        Revert the change to set sharedCookieStorage for iOS as it is breaking Kayak.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-08-09  Per Arne Vollan  <pvollan@apple.com>

        DisplayRefreshMonitorMac should hold a weak pointer to WebPage.
        https://bugs.webkit.org/show_bug.cgi?id=186683

        Reviewed by Brent Fulgham.

        Instead of DisplayRefreshMonitorMac having a RefPtr to WebPage, it should have a weak pointer.
        Having a RefPtr could in theory create reference cycles. This potential problem has not been
        observed in practice, but it is safer to use a weak pointer.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
        (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):

2018-08-09  Ali Juma  <ajuma@chromium.org>

        Import WPTs for IntersectionObserver
        https://bugs.webkit.org/show_bug.cgi?id=188416

        Reviewed by Simon Fraser.

        Make IntersectionObserver an experimental feature, so that it is enabled in
        WebKitTestRunner.

        * Shared/WebPreferences.yaml:

2018-08-08  Tim Horton  <timothy_horton@apple.com>

        Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
        https://bugs.webkit.org/show_bug.cgi?id=188427
        <rdar://problem/43064672>

        Reviewed by Wenson Hsieh.

        Speculatively fix more crashes seen under setSuggestions.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFormInputSession isValid]):
        (-[WKFormInputSession setSuggestions:]):
        (-[WKFormInputSession invalidate]):
        Belt-and-suspenders fix: use WeakObjCPtr for WKFormInputSession's WKContentView reference.

        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        Invalidate the WKFormInputSession before replacing it; we theorize that
        there is a path in which we get here without having previously called stopAssistingNode.
        Most of the code is OK with this, but this leaves WKFormInputSession
        with a raw reference to WKContentView which can later become stale.

2018-08-08  Don Olmstead  <don.olmstead@sony.com>

        [Curl] Surface additional NetworkLoadMetrics
        https://bugs.webkit.org/show_bug.cgi?id=188391

        Reviewed by Joseph Pecoraro.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):

2018-08-08  Alex Christensen  <achristensen@webkit.org>

        Fix possible null dereference in WebBackForwardList::restoreFromState
        https://bugs.webkit.org/show_bug.cgi?id=188418
        <rdar://problem/42531726>

        Reviewed by Chris Dumez.

        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::restoreFromState):
        Null-check m_page like we do everywhere else in this file because it can be set to null when closing the page.

2018-08-08  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234314, r234320, and r234321.
        https://bugs.webkit.org/show_bug.cgi?id=188414

        Caused email sign in issue (Requested by ryanhaddad on
        #webkit).

        Reverted changesets:

        "Remove unused WKNavigationDelegatePrivate
        decidePolicyForNavigationAction SPI"
        https://bugs.webkit.org/show_bug.cgi?id=188077
        https://trac.webkit.org/changeset/234314

        "Fix API tests after r234314"
        https://bugs.webkit.org/show_bug.cgi?id=188077
        https://trac.webkit.org/changeset/234320

        "Fix API tests after r234314"
        https://bugs.webkit.org/show_bug.cgi?id=188077
        https://trac.webkit.org/changeset/234321

2018-08-08  Simon Fraser  <simon.fraser@apple.com>

        Add a WebKit2 logging channel for ActivityState
        https://bugs.webkit.org/show_bug.cgi?id=188411

        Reviewed by Tim Horton.
        
        Add logging for ActivityState changes and the entrypoints that affect ActivityState.

        * Platform/Logging.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::windowDidOrderOffScreen):
        (WebKit::WebViewImpl::windowDidOrderOnScreen):
        (WebKit::WebViewImpl::windowDidChangeOcclusionState):
        (WebKit::WebViewImpl::viewDidMoveToWindow):
        (WebKit::WebViewImpl::viewDidHide):
        (WebKit::WebViewImpl::viewDidUnhide):
        (WebKit::WebViewImpl::activeSpaceDidChange):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::activityStateDidChange):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::isViewVisible):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setActivityState):

2018-08-05  Darin Adler  <darin@apple.com>

        [Cocoa] More tweaks and refactoring to prepare for ARC
        https://bugs.webkit.org/show_bug.cgi?id=188245

        Reviewed by Dan Bernstein.

        * Platform/cocoa/WKCrashReporter.mm:
        (WebKit::setCrashLogMessage): Refactor into a separate function for clarity.
        (WebKit::setCrashReportApplicationSpecificInformation): Use a bridging cast.

        * Shared/mac/PasteboardTypes.mm:
        (WebKit::PasteboardTypes::forEditing): Use a bridging cast.

        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::convertToNPNNString): Added. Uses CFStringRef rather than NSString so we can
        manually manage the autoreleasing.
        (WebKit::initializeKeyboardEvent): Use convertToNPNNString.
        (WebKit::NetscapePlugin::sendComplexTextInput): Ditto.

        * WebProcess/Plugins/PDF/PDFPlugin.mm: Use __unsafe_unretained explicitly
        for a parent pointer. We could consider moving to __weak after switching to ARC.

2018-08-07  Ben Richards  <benton_richards@apple.com>

        Add SPI for launching WebContent process with pre-linked injected bundle
        https://bugs.webkit.org/show_bug.cgi?id=188367

        Reviewed by Ryosuke Niwa.

        Added SPI to allow applications to set a "customWebContentServiceBundleIdentifier" which will be launched instead of the default WebContent XPC service.
        The "customWebContentServiceBundleIdentifier" should be the bundle identifier for an XPC service that calls [WKProcessPool _webContentProcessXPCMain].
        The new XPC service should be hard linked to the application's injected bundle in order to receive the intended performance benefit.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        (main):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCustomWebContentServiceBundleIdentifier):
        * UIProcess/API/C/WKContext.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (+[WKProcessPool _webContentProcessXPCMain]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration customWebContentServiceBundleIdentifier]):
        (-[_WKProcessPoolConfiguration setCustomWebContentServiceBundleIdentifier:]):
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setCustomWebContentServiceBundleIdentifier):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getLaunchOptions):
        * WebKit.xcodeproj/project.pbxproj:

2018-08-07  Chris Dumez  <cdumez@apple.com>

        StorageManager should stop ref'ing IPC::Connections as this is leak-prone
        https://bugs.webkit.org/show_bug.cgi?id=188380

        Reviewed by Alex Christensen.

        StorageManager should stop ref'ing IPC::Connections as this is leak-prone. Instead, assign a unique identifier
        to each IPC::Connection and store this identifier intead of a RefPtr<IPC::Connection>. When the StorageManager
        needs an actual IPC::Connection, it can look it up from the identifier.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::~Connection):
        (IPC::Connection::connection):
        * Platform/IPC/Connection.h:
        (IPC::Connection::uniqueID const):
        * UIProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::StorageArea::addListener):
        (WebKit::StorageManager::StorageArea::removeListener):
        (WebKit::StorageManager::StorageArea::hasListener const):
        (WebKit::StorageManager::StorageArea::setItem):
        (WebKit::StorageManager::StorageArea::removeItem):
        (WebKit::StorageManager::StorageArea::clear):
        (WebKit::StorageManager::StorageArea::dispatchEvents const):
        (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const):
        (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
        (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::processDidCloseConnection):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        (WebKit::StorageManager::applicationWillTerminate):
        (WebKit::StorageManager::findStorageArea const):
        * UIProcess/WebStorage/StorageManager.h:

2018-08-07  Eric Carlson  <eric.carlson@apple.com>

        NotReadableError when calling getUserMedia
        https://bugs.webkit.org/show_bug.cgi?id=188309
        <rdar://problem/42916838>

        Reviewed by Brent Fulgham.

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream): Deal with audio and video sandbox
        extensions being issued at different times. Use new ProcessState methods.
        (WebKit::UserMediaProcessManager::endedCaptureSession): Use new ProcessState methods.

2018-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r233778): Text selection sometimes cannot be extended in iframes
        https://bugs.webkit.org/show_bug.cgi?id=188374
        <rdar://problem/42928657>

        Reviewed by Simon Fraser.

        rangeForPoint contains logic for converting a selection handle location in root view coordinates to an updated
        selection. In doing so, we first convert the selection handle location to content coordinates; however, the call
        site to EventHandler::hitTestResultAtPoint still hit-tests using the location in root view coordinates rather
        than content coordinates, which means that when the focused frame is a subframe, hit-testing will fail to find
        nodes within the subframe under the selection handle. This manifests in behaviors such as snapping to a single
        character when selecting text in subframes.

        To fix this, we just need to pass in the point in the frame's content coordinates when hit-testing.

        Tests:  editing/selection/ios/selection-handles-in-iframe.html
                editing/selection/ios/selection-handles-in-readonly-input.html

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeForPointInRootViewCoordinates):

        Make a couple of other minor adjustments:
        1.  Take a Frame& instead of a Frame*, since Frame& is assumed to be non-null here.
        2.  Rename rangeForPoint to rangeForPointInRootViewCoordinates, as well as the point argument to
            pointInRootViewCoordinates.

        (WebKit::WebPage::updateSelectionWithTouches):
        (WebKit::rangeForPoint): Deleted.

2018-08-07  Alex Christensen  <achristensen@webkit.org>

        Fix things after r234640
        https://bugs.webkit.org/show_bug.cgi?id=188133

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        Fix assertions as I had in r234552.  Also fix a possible race condition with fragment navigations by only keeping the first "use" response.
        * config.h:
        Fix IOSMAC build.

2018-08-07  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Scrollbars are not visible when using 3rd party mouse
        https://bugs.webkit.org/show_bug.cgi?id=188372

        Reviewed by Simon Fraser.

        The scrollbars are not visible because they are not updated with the recommended scroller style
        when a 3rd party mouse is used. They still have the overlay style, but the system is
        recommending the legacy style in this case. The UI process is currently notifying the WebProcess
        about changes in the scroller style, but the current style is not set in the WebProcess on
        startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
        the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
        is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
        is called to update all NSScrollerImpPairs with the new recommended style. This method was
        previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
        this method. This has been manually tested by using a 3rd party mouse.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::scrollerStylePreferenceChanged):

2018-08-06  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] suspendWiFiAssertions() should be able to delay sending ProcessReadyToSuspend
        https://bugs.webkit.org/show_bug.cgi?id=188373
        <rdar://problem/42857398>

        Reviewed by Tim Horton.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformPrepareToSuspend):

2018-08-06  Alex Christensen  <achristensen@webkit.org>

        Check with SafeBrowsing during navigation in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=188133

        Reviewed by Chris Dumez.

        This turns WebFramePolicyListenerProxy into an object that now listens for the results
        of two processes happening in parallel: the API::NavigationClient's decidePolicyForNavigation{Action, Response}
        (which it was already waiting for) and, on platforms that support it, the SafariSafeBrowsing framework's check.
        The first result is stored as it waits for the second result unless the first result is the API::NavigationClient
        saying to cancel or convert the navigation to a download, in which cases we don't care what the safe browsing
        framework results are because we won't show the URL in the browser.

        Nothing is done with the safe browsing results yet.

        * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Added.
        (WebKit::SafeBrowsingResult::SafeBrowsingResult):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::beginSafeBrowsingCheck):
        * UIProcess/SafeBrowsingResult.h: Added.
        (WebKit::SafeBrowsingResult::provider const):
        (WebKit::SafeBrowsingResult::isPhishing const):
        (WebKit::SafeBrowsingResult::isMalware const):
        (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
        (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-08-06  Chris Dumez  <cdumez@apple.com>

        Regression(NetworkLoadChecker): CORS preflights are no longer able to deal with client certificate authentication
        https://bugs.webkit.org/show_bug.cgi?id=188355
        <rdar://problem/42546319>

        Reviewed by Alex Christensen.

        Before we started using the NetworkLoadChecker to do CORS-preflighting in the Network process, challenges would
        use the NetworkLoad::completeAuthenticationChallenge() code path with isAllowedToAskUserForCredentials to set
        to false. This would call:
        1. completionHandler(AuthenticationChallengeDisposition::UseCredential, { }); for TLS handshakes (server trust
           evaluation & client certification authentication)
        2. NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge() otherwise

        However, NetworkCORSPreflightChecker::didReceiveChallenge() was behaving differently and calling:
        1. completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { }); for server trust evaluations
        2. completionHandler(AuthenticationChallengeDisposition::Cancel, { }); otherwise

        Restore previous behavior by aligning NetworkCORSPreflightChecker::didReceiveChallenge() with
        NetworkLoad::completeAuthenticationChallenge() when isAllowedToAskUserForCredentials is set to false. This means
        we end up asking the AuthenticationManager for client certificate authentication instead or cancelling the
        preflight.

        This fixes CORS-preflighting on some internal sites.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):

2018-08-06  Alex Christensen  <achristensen@webkit.org>

        Use enum classes and OptionSets for PaintPhase and PaintBehavior
        https://bugs.webkit.org/show_bug.cgi?id=188323

        Reviewed by Simon Fraser.

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::imageForRect):
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::shouldCreateTransientPaintingSnapshot const):

2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234552.

        Introduced 2 layout test failures on High Sierra.

        Reverted changeset:

        "Check with SafeBrowsing during navigation in WKWebView"
        https://bugs.webkit.org/show_bug.cgi?id=188133
        https://trac.webkit.org/changeset/234552

2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234569.

        Breaks internal builds.

        Reverted changeset:

        "We should cache the compiled sandbox profile in a data vault"
        https://bugs.webkit.org/show_bug.cgi?id=184991
        https://trac.webkit.org/changeset/234569

2018-08-06  Chris Dumez  <cdumez@apple.com>

        Fix IPC::Connection leak in StorageManager
        https://bugs.webkit.org/show_bug.cgi?id=188321
        <rdar://problem/42748485>

        Reviewed by Alex Christensen.

        When a StorageMap is destroyed on WebContent process side, StorageManager::destroyStorageMap()
        gets called via IPC with a (IPC::Connection, StorageMapID) pair. Normally, it removes this
        pair from m_storageAreasByConnection. However, if this is a *transient* StorageMap (sessionStorage),
        then we keep the pair in the map and we merely remove the StorageMapID as a listener from the
        StorageArea. We do this so that:
        1. The StorageArea stays alive so that it can be reused later on for the same security origin, on
           the same IPC::Connection (logic for this is in StorageManager::createTransientLocalStorageMap()
        2. Removing the StorageMapID as a listener from the StorageArea is important because
           StorageArea::m_eventListeners holds a strong reference to the IPC::Connection in a std::pair
           with the StorageMapID (HashSet<std::pair<RefPtr<IPC::Connection>, uint64_t>> m_eventListeners).

        As mentioned in 1 above, in StorageManager::createTransientLocalStorageMap(), there is logic to
        check if there is already an existing StorageArea for the given IPC::Connection that is transient
        and is for the same security origin. In this case, we could avoid constructing a new StorageArea
        and we would:
        1. Add a new entry to m_storageAreasByConnection with the key (connection, newStorageMapID), using
           same same StorageArea as value.
        2. Remove the previous (connection, oldStorageMapID) key from m_storageAreasByConnection.

        Step 2 here is wrong and is updated in this patch. It is only safe to remove the previous 
        (connection, oldStorageMapID) if this oldStorageMapID no longer exists (i.e. destroyStorageMap()
        was already called for it). This patch thus adds a check before removing (connection, oldStorageMapID)
        from the HashMap to make sure that the oldStorageMapID is no longer a listener of the StorageArea).

        This would cause leaks in the following case:
        1. We construct a StorageArea for (connection1, storageMapId1)
        2. We ask for a StorageArea for (connection1, storageMapId2) and decide to reuse the existing StorageArea
           since it has the same SecurityOrigin.
        3. As a result of step2, we would remove (connection1, storageMapId1) from m_storageAreasByConnection
           and add (connection1, storageMapId2), even though there is still a StorageMap with storageMapId1
           on WebContent process side.
        4. Later on, we would try to call destroyStorageMap(connection1, storageMap1), it would fail to find
           it in m_storageAreasByConnection and return early. It would therefore fail to remove storageMapId1
           as a listener of the StorageArea which still exists.
        -> This would leak the IPC::Connection that there would be a std::pair<RefPtr<IPC::Connection>, StorageMapID>
           with value (connection1, storageMap1) which would get leaked and it would ref the IPC::Connection.

        This code should really be refactored to be less leak prone but I have kept the patch minimal for now
        to facilitate cherry-picking.

        Note that this would reproduce very easily on sina.com.cn, when clicking bold links at the top, which
        opens new tabs to different pages in the same WebContent process. When closing all Safari windows, the
        IPC::Connection for this WebContent process would stay alive.

        * UIProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::StorageArea::hasListener const):
        (WebKit::StorageManager::createTransientLocalStorageMap):

2018-08-06  Alex Christensen  <achristensen@webkit.org>

        Make BlendMode an enum class
        https://bugs.webkit.org/show_bug.cgi?id=188325

        Reviewed by Darin Adler.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):

2018-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained
        https://bugs.webkit.org/show_bug.cgi?id=188322
        <rdar://problem/42455270>

        Reviewed by Tim Horton.

        Prior to r230745, when a user selects a word in non-editable web content without a prior selection, we would
        always try to activate the text interaction assistant, creating a selection view (a UITextSelectionView). After
        the long press is recognized, this text selection view is configured for "highlight mode", which is a special
        mode for presenting selection UI where the grabber handles at the start and end of the selection are suppressed.
        UIKit then prepares to show the selection by asking WKContentView for the number of selection rects; if this
        number is zero, the UITextSelectionView is removed from the superview, and state that keeps track of whether the
        selection view is in "highlight mode" is reset.

        In the case where there's no prior selection, our cached EditorState in the UI process will not be up to date
        yet when the gesture is recognized. This means that when UIKit asks us for the number of selection rects, we'll
        return 0, which causes any state tracking "highlight mode" for the selection to be reset, subsequently resulting
        in selection handles showing up before the user has ended the initial loupe gesture.

        r230745 addressed this bug by removing logic to activate the text selection when becoming first responder,
        instead deferring until the next `-_selectionChanged` call with post-layout editor state data to activate the
        selection. While this does ensure that selection handles don't erroneously appear, it also means that clients
        that call -becomeFirstResponder to show selection UI and the keyboard in a web view while an element is already
        focused will not have an active selection assistant (i.e. the selection view will still be hidden). One way this
        happens is when Safari uses `-_retainActiveFocusedState` in combination with `-resignFirstResponder` and
        `-becomeFirstResponder` to temporarily switch focus away from the web view when the URL bar is tapped.

        To fix both the inactive selection after `-becomeFirstResponder` as well as the selection handles showing up
        when performing a loupe gesture, we simply make the check in `-becomeFirstResponderForWebView` more nuanced.
        Instead of always activating the selection or never activating the selection, only activate the selection if the
        current editor state has information about a selection to avoid causing the selection view to be immediately
        removed and "highlight mode" to be reset when selecting a word via loupe gesture for the first time.

        Tests:  KeyboardInputTests.CaretSelectionRectAfterRestoringFirstResponder
                KeyboardInputTests.RangedSelectionRectAfterRestoringFirstResponder
                editing/selection/ios/selection-handles-after-touch-end.html

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView becomeFirstResponderForWebView]):
        (-[WKContentView canShowNonEmptySelectionView]):

2018-08-06  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add Nicosia::Scene
        https://bugs.webkit.org/show_bug.cgi?id=188340

        Reviewed by Carlos Garcia Campos.

        CompositingCoordinator spawns a Nicosia::Scene object that it shares
        with the CoordinatedGraphicsSceneState instance. All the
        Nicosia::CompositionLayer objects indirectly managed by
        CompositingCoordinator are now stored in a local Nicosia::Scene::State
        member object. Upon each flush that requires frame synchronization the
        Nicosia::Scene object is updated in a thread-safe manner, increasing
        the scene ID value as well as copying the local HashSet and root layer
        values into the shared Scene object, allowing for the consumer (which
        currently is the related CoordinatedGraphicsScene instance) to update
        its output accordingly.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::CompositingCoordinator):
        (WebKit::CompositingCoordinator::flushPendingLayerChanges):
        (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
        (WebKit::CompositingCoordinator::createGraphicsLayer):
        (WebKit::CompositingCoordinator::detachLayer):
        (WebKit::CompositingCoordinator::attachLayer):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Add support for microtasks in workers
        https://bugs.webkit.org/show_bug.cgi?id=188246

        Reviewed by Darin Adler.

        Rename JSMainThreadExecState.h to JSExecState.h.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:

2018-08-03  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
        (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
            in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
        (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
            compile a sandbox, and cache it.
        (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
            file which contains an entitlement with a process specific "storage class" which ensures that each process
            can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
        (4) The sandbox entitlements file for the Network, WebContent and Plugin services are loaded dynamically
            through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
            The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
            The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
            are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.

        * Configurations/Network-OSX-sandbox.entitlements: Added.
        * Configurations/Plugin-OSX-sandbox.entitlements: Added.
        * Configurations/Storage-OSX-sandbox.entitlements: Added.
        * Configurations/StorageService.xcconfig:
        * Configurations/WebContent-OSX-sandbox.entitlements: Added.
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/NetworkProcess.h:
        * PluginProcess/PluginProcess.h:
        * Scripts/process-network-entitlements.sh: Added.
        * Scripts/process-plugin-entitlements.sh: Added.
        * Scripts/process-webcontent-entitlements.sh:
        * Shared/ChildProcess.h:
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/SandboxInitializationParameters.h:
        (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
        (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
        (WebKit::SandboxInitializationParameters::setSandboxProfile):
        (WebKit::SandboxInitializationParameters::sandboxProfile const):
        (): Deleted.
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::SandboxProfileDeleter::operator()):
        (WebKit::SandboxParametersDeleter::operator()):
        (WebKit::SandboxInfo::SandboxInfo):
        (WebKit::fileContents):
        (WebKit::processStorageClass):
        (WebKit::setAndSerializeSandboxParameters):
        (WebKit::getUserCacheDirectory):
        (WebKit::sandboxDataVaultParentDirectory):
        (WebKit::sandboxDirectory):
        (WebKit::sandboxFilePath):
        (WebKit::ensureSandboxCacheDirectory):
        (WebKit::writeSandboxDataToCacheFile):
        (WebKit::compileAndCacheSandboxProfile):
        (WebKit::tryApplyCachedSandbox):
        (WebKit::webKit2Bundle):
        (WebKit::sandboxProfilePath):
        (WebKit::compileAndApplySandboxSlowCase):
        (WebKit::applySandbox):
        (WebKit::initializeSandboxParameters):
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/mac/SandboxInitialiationParametersMac.mm:
        (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
        * StorageProcess/StorageProcess.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.h:

2018-08-03  Alex Christensen  <achristensen@webkit.org>

        Fix spelling of "overridden"
        https://bugs.webkit.org/show_bug.cgi?id=188315

        Reviewed by Darin Adler.

        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::receiveSourceEventHandler):
        * Shared/WebPreferencesStore.cpp:
        (WebKit::WebPreferencesStore::encode const):
        (WebKit::WebPreferencesStore::decode):
        (WebKit::valueForKey):
        (WebKit::setValueForKey):
        (WebKit::WebPreferencesStore::setStringValueForKey):
        (WebKit::WebPreferencesStore::getStringValueForKey const):
        (WebKit::WebPreferencesStore::setBoolValueForKey):
        (WebKit::WebPreferencesStore::getBoolValueForKey const):
        (WebKit::WebPreferencesStore::setUInt32ValueForKey):
        (WebKit::WebPreferencesStore::getUInt32ValueForKey const):
        (WebKit::WebPreferencesStore::setDoubleValueForKey):
        (WebKit::WebPreferencesStore::getDoubleValueForKey const):
        (WebKit::WebPreferencesStore::setOverrideDefaultsStringValueForKey):
        (WebKit::WebPreferencesStore::setOverrideDefaultsBoolValueForKey):
        (WebKit::WebPreferencesStore::setOverrideDefaultsUInt32ValueForKey):
        (WebKit::WebPreferencesStore::setOverrideDefaultsDoubleValueForKey):
        * Shared/WebPreferencesStore.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
        (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView _systemContentInset]):

2018-08-03  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r234517.

        Caused API test failures on iOS

        Reverted changeset:

        "[Cocoa] setCookie API fails to set session cookies for
        defaultDataStore if processPool created but not used"
        https://bugs.webkit.org/show_bug.cgi?id=188209
        https://trac.webkit.org/changeset/234517

2018-08-03  Ben Richards  <benton_richards@apple.com>

        Add configuration for automatic process pre-warming
        https://bugs.webkit.org/show_bug.cgi?id=187108

        Reviewed by Ryosuke Niwa.

        Added configurations to allow setting the maximum number of processes that should be automatically prewarmed.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetMaximumNumberOfPrewarmedProcesses):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setMaximumNumberOfPrewarmedProcesses:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setMaximumPrewarmedProcessCount:]):
        (-[_WKProcessPoolConfiguration maximumPrewarmedProcessCount]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFinishLoadForFrame): Moved call to notifyProcessPoolToPrewarm from didFirstVisuallyNonEmptyLayoutForFrame to here.
        This is to try to ensure that frame loading and prewarming don't happen at the same time as this would be heavy for some devices.
        (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setMaximumNumberOfProcesses): Condition changed so that calling setMaximumNumberOfProcesses after warmInitialProcess
        doesn't result in a crash.
        (WebKit::WebProcessPool::setMaximumNumberOfPrewarmedProcesses):
        (WebKit::WebProcessPool::warmInitialProcess):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        * UIProcess/WebProcessPool.h:

2018-08-03  Alex Christensen  <achristensen@webkit.org>

        Check with SafeBrowsing during navigation in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=188133

        Reviewed by Chris Dumez.

        This turns WebFramePolicyListenerProxy into an object that now listens for the results
        of two processes happening in parallel: the API::NavigationClient's decidePolicyForNavigation{Action, Response}
        (which it was already waiting for) and, on platforms that support it, the SafariSafeBrowsing framework's check.
        The first result is stored as it waits for the second result unless the first result is the API::NavigationClient
        saying to cancel or convert the navigation to a download, in which cases we don't care what the safe browsing
        framework results are because we won't show the URL in the browser.

        Nothing is done with the safe browsing results yet.

        * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Added.
        (WebKit::SafeBrowsingResult::SafeBrowsingResult):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::beginSafeBrowsingCheck):
        * UIProcess/SafeBrowsingResult.h: Added.
        (WebKit::SafeBrowsingResult::provider const):
        (WebKit::SafeBrowsingResult::isPhishing const):
        (WebKit::SafeBrowsingResult::isMalware const):
        (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
        (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-08-03  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234513.

        14 API tests fail the assertions added in this change.

        Reverted changeset:

        "Check with SafeBrowsing during navigation in WKWebView"
        https://bugs.webkit.org/show_bug.cgi?id=188133
        https://trac.webkit.org/changeset/234513

2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] WebDriver: add support for action commands
        https://bugs.webkit.org/show_bug.cgi?id=188301

        Reviewed by Žan Doberšek.

        WPE doesn't support action commands because the platform specific code for handling events is not implemented.

        * SourcesWPE.txt: Add new file to compilation.
        * UIProcess/API/glib/WebKitUIClient.cpp: Use the drawing area size as window size in WPE.
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::viewBackend): Return the WPE backend of the view.
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::performInteractionSequence):
        (WebKit::WebAutomationSession::cancelInteractionSequence):
        * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Added.
        (WebKit::modifiersToEventState):
        (WebKit::mouseButtonToWPEButton):
        (WebKit::stateModifierForWPEButton):
        (WebKit::doMouseEvent):
        (WebKit::doMotionEvent):
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        (WebKit::doKeyStrokeEvent):
        (WebKit::keyCodeForVirtualKey):
        (WebKit::modifiersForKeyCode):
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        (WebKit::WebAutomationSession::platformSimulateKeySequence):
        * UIProcess/WebPageProxy.h:
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebPageProxy::viewBackend): Return the WPE backend.

2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Implement MouseEvent.buttons
        https://bugs.webkit.org/show_bug.cgi?id=187998

        Reviewed by Žan Doberšek.

        Pass buttons currently pressed to WebMouseEvent.

        * Shared/wpe/WebEventFactory.cpp:
        (WebKit::pressedMouseButtons): Helper to get the pressed buttons mask for the WPE modifiers.
        (WebKit::WebEventFactory::createWebMouseEvent): Use pressedMouseButtons().
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithTouchEvent): Update the event modifiers.

2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Use WPE key symbols and new API instead of xkbcommon and the key mapper
        https://bugs.webkit.org/show_bug.cgi?id=188093

        Reviewed by Žan Doberšek.

        * Shared/WebEvent.h: Add WebKeyboardEvent constructor for WPE.
        * Shared/WebKeyboardEvent.cpp:
        (WebKit::WebKeyboardEvent::WebKeyboardEvent): WebKeyboardEvent constructor for WPE.
        * Shared/wpe/WebEventFactory.cpp:
        (WebKit::isWPEKeyCodeFromKeyPad): Helper tpo check if a key symbols is from key pad.
        (WebKit::WebEventFactory::createWebKeyboardEvent): Use PlatformKeyboardEvent API to provide key code, hardware
        key code, key identifier and windows key code to WebKeyboardEvent.
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend): Use WPE key symbols.

2018-08-02  Tim Horton  <timothy_horton@apple.com>

        PDFPlugin: Context menus in RTL are left-aligned
        https://bugs.webkit.org/show_bug.cgi?id=188292
        <rdar://problem/32293787>

        Reviewed by Simon Fraser.

        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
        Add some SPI.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::handleContextMenuEvent):
        Translate UI layout direction back into the platform enum, and pass it to PDFKit.

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::userInterfaceLayoutDirection const):
        Add a getter for UI layout direction.

2018-08-02  Chris Dumez  <cdumez@apple.com>

        Regression(r234486): assertion hit in ~CallbackAggregator()
        https://bugs.webkit.org/show_bug.cgi?id=188283
        <rdar://problem/42851342>

        Reviewed by Alex Christensen.

        [NSHTTPCookieStorage _saveCookies:] SPI may call its completion block on the background queue
        so we need to make sure we dispatch back to the main thread before calling our completion
        handler.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::saveCookies):
        (WebKit::NetworkProcess::platformSyncAllCookies):

2018-08-02  Alex Christensen  <achristensen@webkit.org>

        Fix some builds after r234516
        ​https://bugs.webkit.org/show_bug.cgi?id=188250

        * Platform/IPC/ArgumentCoders.h:
        This assertion was comparing integers of different signs.
        Since we don't allow exception throwing in WebKit, valueless_by_exception won't be true,
        so this assertion will always be true.  I'll just remove it.

2018-08-02  Sihui Liu  <sihui_liu@apple.com>

        httpCookieStore.getAllCookies() does not always call completion block
        https://bugs.webkit.org/show_bug.cgi?id=188242

        Reviewed by Chris Dumez.

        Take background assertion for network process to keep it alive during cookieStore API calls.

        * UIProcess/GenericCallback.h:
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
        (WebKit::WebCookieManagerProxy::deleteCookie):
        (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
        (WebKit::WebCookieManagerProxy::setCookie):
        (WebKit::WebCookieManagerProxy::setCookies):
        (WebKit::WebCookieManagerProxy::getAllCookies):
        (WebKit::WebCookieManagerProxy::getCookies):
        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):

2018-08-02  Sihui Liu  <sihui_liu@apple.com>

        [Cocoa] setCookie API fails to set session cookies for defaultDataStore if processPool created but not used
        https://bugs.webkit.org/show_bug.cgi?id=188209

        Reviewed by Geoffrey Garen.

        If defaultDataStore is already created when launching network process, it means user 
        probably set cookies for default session via API, so we should update m_websiteDataStore to 
        make sure pendingCookies is passed to network process.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-08-02  Alex Christensen  <achristensen@webkit.org>

        Use WTF::Variant for WebPreferencesStore::Value
        https://bugs.webkit.org/show_bug.cgi?id=188250

        Reviewed by Sam Weinig.

        It was conceptually a variant. This just uses an actual WTF::Variant.
        Since it's encoded and decoded, I wrote variadic template encoders and decoders
        like we have for other types (Expected, std::tuple, KeyValuePair, etc.)

        * Platform/IPC/ArgumentCoders.h:
        (IPC::VariantCoder::encode):
        (IPC::VariantCoder::decode):
        Introduce ArgumentCoder<Variant>, which encodes which type the Variant currently
        holds followed by the encoding of the current type.
        * Platform/IPC/Decoder.cpp:
        (IPC::Decoder::Decoder):
        * Platform/IPC/Decoder.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::createMessageDecoder):
        Use move semantics to prevent an unnecessary copy of the Vector<Attachment>
        * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
        * Shared/WebPreferencesStore.cpp:
        (WebKit::WebPreferencesStore::decode):
        Use modern std::optional-based decoding supported by the new Variant decoding.
        (WebKit::valueForKey):
        Use WTF::get and WTF::holds_alternative instead of custom type checks.
        (WebKit::WebPreferencesStore::Value::encode const): Deleted.
        (WebKit::WebPreferencesStore::Value::decode): Deleted.
        (WebKit::as<String>): Deleted.
        (WebKit::as<bool>): Deleted.
        (WebKit::as<uint32_t>): Deleted.
        (WebKit::as<double>): Deleted.
        * Shared/WebPreferencesStore.h:
        (WebKit::WebPreferencesStore::Value::Value): Deleted.
        (WebKit::WebPreferencesStore::Value::operator=): Deleted.
        (WebKit::WebPreferencesStore::Value::~Value): Deleted.
        (WebKit::WebPreferencesStore::Value::type const): Deleted.
        (WebKit::WebPreferencesStore::Value::asString const): Deleted.
        (WebKit::WebPreferencesStore::Value::asBool const): Deleted.
        (WebKit::WebPreferencesStore::Value::asUInt32 const): Deleted.
        (WebKit::WebPreferencesStore::Value::asDouble const): Deleted.
        (WebKit::WebPreferencesStore::Value::destroy): Deleted.
        (): Deleted.
        Use WTF::Variant instead of a custom type/union pair.

2018-08-02  Alex Christensen  <achristensen@webkit.org>

        Check with SafeBrowsing during navigation in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=188133

        Reviewed by Chris Dumez.

        This turns WebFramePolicyListenerProxy into an object that now listens for the results
        of two processes happening in parallel: the API::NavigationClient's decidePolicyForNavigation{Action, Response}
        (which it was already waiting for) and, on platforms that support it, the SafariSafeBrowsing framework's check.
        The first result is stored as it waits for the second result unless the first result is the API::NavigationClient
        saying to cancel or convert the navigation to a download, in which cases we don't care what the safe browsing
        framework results are because we won't show the URL in the browser.

        Nothing is done with the safe browsing results yet.

        * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Added.
        (WebKit::SafeBrowsingResult::SafeBrowsingResult):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::beginSafeBrowsingCheck):
        * UIProcess/SafeBrowsingResult.h: Added.
        (WebKit::SafeBrowsingResult::provider const):
        (WebKit::SafeBrowsingResult::isPhishing const):
        (WebKit::SafeBrowsingResult::isMalware const):
        (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
        (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-08-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Keyboard becomes unresponsive after pressing delete while pressing down on a character key with accents
        https://bugs.webkit.org/show_bug.cgi?id=188251
        <rdar://problem/37842108>

        Reviewed by Tim Horton.

        Fixes a bug in key event handling where invoking -handleKeyWebEvent:withCompletionHandler: from within the
        completion callback of a previous call to -handleKeyWebEvent:withCompletionHandler: would cause the completion
        callback to be cleared out prematurely. In some cases (as described in the title of this bug), UIKit exercises
        this codepath and subsequently hangs due to their completion block never getting invoked by WebKit.

        Test: KeyboardInputTests.CanHandleKeyEventInCompletionHandler

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
        (-[WKContentView _didHandleKeyEvent:eventWasHandled:]):

2018-08-01  Dan Bernstein  <mitz@apple.com>

        Optionally expose Attr::style to JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=188226
        <rdar://problem/42818113>

        Reviewed by Darin Adler.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Encode new attrStyleEnabled member.
        (WebKit::WebProcessCreationParameters::decode): Decode new attrStyleEnabled member.
        * Shared/WebProcessCreationParameters.h: Define new attrStyleEnabled member, initialized to
          false.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy): Copy new m_attrStyleEnabled member.
        * UIProcess/API/APIProcessPoolConfiguration.h: Define new m_attrStyleEnabled member.

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declare new attrStyleEnabled boolean
          property.
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration attrStyleEnabled]): New accessor.
        (-[_WKProcessPoolConfiguration setAttrStyleEnabled:]): Ditto.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess): Initialize parameters.attrStyleEnabled
          from the configuration.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess): Set the attrStyleEnabled runtime feature based
          on the creation parameters.

2018-08-02  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r234489.

        Caused 50+ crashes and 60+ API failures on iOS

        Reverted changeset:

        "[WTF] Rename String::format to String::deprecatedFormat"
        https://bugs.webkit.org/show_bug.cgi?id=188191
        https://trac.webkit.org/changeset/234489

2018-08-01  Tomas Popela  <tpopela@redhat.com>

        [WTF] Rename String::format to String::deprecatedFormat
        https://bugs.webkit.org/show_bug.cgi?id=188191

        Reviewed by Darin Adler.

        It should be replaced with string concatenation.

        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::buildAcceptLanguages):
        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::createServerAndClientIdentifiers):
        * Shared/WebMemorySampler.cpp:
        (WebKit::WebMemorySampler::writeHeaders):
        * Shared/win/WebEventFactory.cpp:
        (WebKit::keyIdentifierFromEvent):
        * Shared/wpe/WebEventFactory.cpp:
        (WebKit::identifierStringForKeyEvent):
        * UIProcess/API/APINavigation.cpp:
        (API::Navigation::loggingString const):
        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::IconDatabase::performURLImport):
        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::loggingString const):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::loggingString):
        * UIProcess/WebInspectorUtilities.cpp:
        (WebKit::inspectorPageGroupIdentifierForPage):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processDidFinishLaunching):
        (WebKit::WebProcessPool::startMemorySampler):
        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
        (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
        (WebKit::InputMethodFilter::logConfirmCompositionForTesting):
        (WebKit::InputMethodFilter::logSetPreeditForTesting):

2018-08-01  Tim Horton  <timothy_horton@apple.com>

        Using the keyboard arrow keys to scroll a webpage is very slow, not smooth, takes too long
        https://bugs.webkit.org/show_bug.cgi?id=188239
        <rdar://problem/22997654>

        Reviewed by Simon Fraser.

        Instead of depending on key repeat to drive scrolling with arrow keys held down,
        run a display link that animates the scroll. We still do a single discrete scroll
        first (so that you can tap the key and shift by line/page), but then on the first
        repeat we ramp up to a constant velocity determined by the desired increment,
        stopping when the key is lifted or a different key is pressed.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _scrollByContentOffset:animated:]):
        (-[WKWebView _scrollByContentOffset:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        Add animated parameter to scrollByContentOffset, and plumb it through to UIScrollView.

        * UIProcess/ios/WKContentViewInteraction.h:
        Add a WKKeyboardScrollingAnimator member.
        Conform to WKKeyboardScrollable.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        Install the WKKeyboardScrollingAnimator.

        (-[WKContentView cleanupInteraction]):
        Uninstall the WKKeyboardScrollingAnimator.

        (-[WKContentView unscaledView]):
        Fix a stupid style nit.

        (-[WKContentView handleKeyWebEvent:]):
        Give WKKeyboardScrollingAnimator the first shot at incoming keyboard events.
        It will only consume events here if it's already performing a scrolling animation
        (because otherwise they should go straight through to the page).

        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
        Give WKKeyboardScrollingAnimator a shot at handling keyboard events that
        the web content did not handle. We will only start a scrolling animation
        if the page did not handle an event that would start a scroll.

        (-[WKContentView isKeyboardScrollable]):
        Part of WKKeyboardScrollable; only report ourselves as scrollable if
        we would previously have allowed scrolling from keyboard events (if
        we're not in contenteditable, and don't have a <select> focused).

        (-[WKContentView distanceForScrollingIncrement:]):
        Part of WKKeyboardScrollable; compute the distance for each scrolling increment.

        (-[WKContentView scrollByContentOffset:animated:]):
        Part of WKKeyboardScrollable; plumb scrolls up to WKWebView.

        (-[WKContentView _scrollOffsetForEvent:]): Moved to WKKeyboardScrollingAnimator.mm.

        * UIProcess/ios/WKKeyboardScrollingAnimator.h: Added.
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm: Added.
        (-[WKKeyboardScrollingAnimator init]):
        (-[WKKeyboardScrollingAnimator initWithScrollable:]):
        (-[WKKeyboardScrollingAnimator invalidate]):
        (-[WKKeyboardScrollingAnimator _scrollOffsetForEvent:]):
        Compute the scroll offset given a particular event. This is moved from WKContentView;
        otherwise the primary change is that it now asks the WKKeyboardScrollable
        for the distance instead of computing it directly.

        (-[WKKeyboardScrollingAnimator beginWithEvent:]):
        If we're currently in the initial state (WaitingForFirstEvent), and
        a given event should start a scroll, transition into WaitingForRepeat,
        and do a single animated scroll of the appropriate distance.

        (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
        If this key event should terminate a scroll (because it is either a keyup
        or a non-scrolling keydown), shut down any running animations.

        If this is the first key repeat after the initial scroll, start a scrolling
        animation.

        Eat the event if it either started or continued a scroll.

        (-[WKKeyboardScrollingAnimator startAnimatedScroll]):
        (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
        Helpers to start and stop the display link and do some bookkeeping.

        (-[WKKeyboardScrollingAnimator displayLinkFired:]):
        Ask the WKKeyboardScrollable to scroll the content based on the frame time,
        an acceleration curve, and the current animation's scrolling increment.

        * WebKit.xcodeproj/project.pbxproj:

2018-08-01  Chris Dumez  <cdumez@apple.com>

        Make sure cookies get flushed to disk before exiting or suspending the network process
        https://bugs.webkit.org/show_bug.cgi?id=188241
        <rdar://problem/42831831>

        Reviewed by Alex Christensen and Geoffrey Garen.

        Make sure cookies get flushed to disk before exiting or suspending the network process,
        to make sure they do not get lost.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didClose):
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::platformSyncAllCookies):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::syncAllCookies):
        (WebKit::NetworkProcess::platformSyncAllCookies):
        * Shared/ChildProcess.cpp:
        (WebKit::ChildProcess::didClose):
        (WebKit::callExitNow):
        (WebKit::callExitSoon):
        (WebKit::ChildProcess::initialize):
        (WebKit::didCloseOnConnectionWorkQueue): Deleted.
        * Shared/ChildProcess.h:
        (WebKit::ChildProcess::shouldCallExitWhenConnectionIsClosed const):

2018-08-01  Alex Christensen  <achristensen@webkit.org>

        Move all calls to ResourceLoader::start to WebKitLegacy
        https://bugs.webkit.org/show_bug.cgi?id=184946

        Reviewed by Andy Estes.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::setDefersLoading):
        * WebProcess/Network/WebLoaderStrategy.h:

2018-08-01  Nan Wang  <n_wang@apple.com>

        AX: AOM: Add ARIA IDL Attribute Reflection
        https://bugs.webkit.org/show_bug.cgi?id=184676
        <rdar://problem/39476882>

        Added ARIA property string reflection on Element, behind
        a new runtime flag. 
        Spec: https://w3c.github.io/aria/#idl-interface

        Reviewed by Chris Fleizach.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetAriaReflectionEnabled):
        (WKPreferencesGetAriaReflectionEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:

2018-08-01  Alex Christensen  <achristensen@webkit.org>

        Allow WebFramePolicyListenerProxy to be used multiple times
        https://bugs.webkit.org/show_bug.cgi?id=188229

        Reviewed by Chris Dumez.

        This fixes a regression from r234210 in clients that misuse the API.

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):

2018-08-01  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Color picker should have a border when presented in a popover
        https://bugs.webkit.org/show_bug.cgi?id=188207

        Reviewed by Wenson Hsieh.

        The color picker should have a border when presented in a popover. This matches
        the behavior of color pickers in other parts of iOS.

        Since the popover will resize its view to fill its size, we first place the
        color picker in a container view. The container view can then fill the popover,
        while the smaller color picker is centered in it's container - creating the
        appearance of a border.

        * UIProcess/ios/forms/WKFormColorControl.mm:
        (-[WKColorPopover initWithView:]):
        * UIProcess/ios/forms/WKFormColorPicker.mm:

2018-08-01  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234443 and r234445.
        https://bugs.webkit.org/show_bug.cgi?id=188224

        Revision caused 3 api failures across all platforms.
        (Requested by Truitt on #webkit).

        Reverted changesets:

        "Add configuration for automatic process pre-warming"
        https://bugs.webkit.org/show_bug.cgi?id=187108
        https://trac.webkit.org/changeset/234443

        "Add configuration for automatic process pre-warming"
        https://bugs.webkit.org/show_bug.cgi?id=187108
        https://trac.webkit.org/changeset/234445

2018-08-01  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] WKColorPicker's selection indicator doesn't always cover the selected swatch
        https://bugs.webkit.org/show_bug.cgi?id=188124

        Reviewed by Wenson Hsieh.

        - On iPhone, the size of an individual color swatch can change on rotation. In
        this case, we should resize the selection indicator along with the swatch. Added
        a new delegate method to WKColorMatrixViewDelegate to notify the color picker if
        the matrix was redrawn. We then resize the selection indicator to match the
        selected swatch's size.

        - On iPad, the selection indicator should have rounded corners if it's at the
        corner of the color picker. Otherwise, part of the indicator will be hidden by
        the popover. The selected swatch's position is checked before drawing the
        indicator. If it's at one of the four corners of the picker, the appropriate mask
        is applied to the color selection indicator's border.

        * UIProcess/ios/forms/WKFormColorPicker.h:
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorMatrixView layoutSubviews]):
        (-[WKColorPicker initWithView:]):
        (-[WKColorPicker drawSelectionIndicatorForColorButton:]):
        (-[WKColorPicker colorMatrixViewDidLayoutSubviews:]):
        (-[WKColorPicker colorMatrixView:didTapColorButton:]):
        (-[WKColorPicker didPanColors:]):

2018-08-01  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Move CoordinatedBackingStore to WebCore
        https://bugs.webkit.org/show_bug.cgi?id=188158

        Reviewed by Carlos Garcia Campos.

        Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
        dependency on anything in the WebKit layer, and it's more suitable to
        future needs to keep it in the WebCore layer.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        * SourcesGTK.txt:
        * SourcesWPE.txt:

2018-07-31  Alex Christensen  <achristensen@webkit.org>

        REGRESSION (r231107): MoviStar+ launches to a blank black screen
        https://bugs.webkit.org/show_bug.cgi?id=188139

        Reviewed by Brent Fulgham.

        Add infrastructure to check UIProcess SDK from the WebProcess and NetworkProcess for linked-on-or-after checks.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2018-07-31  Ryosuke Niwa  <rniwa@webkit.org>

        Add configuration for automatic process pre-warming
        https://bugs.webkit.org/show_bug.cgi?id=187108

        Reviewed by Ryosuke Niwa.

        Added the missing availability macros.

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:

2018-07-31  Ben Richards  <benton_richards@apple.com>

        Add configuration for automatic process pre-warming
        https://bugs.webkit.org/show_bug.cgi?id=187108

        Reviewed by Ryosuke Niwa.

        Added configurations to allow setting the maximum number of processes that should be automatically prewarmed.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetMaximumNumberOfPrewarmedProcesses):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setMaximumPrewarmedProcessCount:]):
        (-[_WKProcessPoolConfiguration maximumPrewarmedProcessCount]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFinishLoadForFrame): Moved call to notifyProcessPoolToPrewarm from didFirstVisuallyNonEmptyLayoutForFrame to here.
        This is to try to ensure that frame loading and prewarming don't happen at the same time as this would be heavy for some devices.
        (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setMaximumNumberOfProcesses): Condition changed so that calling setMaximumNumberOfProcesses after warmInitialProcess
        doesn't result in a crash.
        (WebKit::WebProcessPool::setMaximumNumberOfPrewarmedProcesses):
        (WebKit::WebProcessPool::warmInitialProcess):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        * UIProcess/WebProcessPool.h:

2018-07-31  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] <select> elements do not popup options
        https://bugs.webkit.org/show_bug.cgi?id=188172

        Reviewed by Fujii Hironori.

        * PlatformWin.cmake: Add WebPopupMenuProxyWin
        * Shared/PlatformPopupMenuData.cpp:
        (WebKit::PlatformPopupMenuData::encode const): Encode
        windows parameters
        (WebKit::PlatformPopupMenuData::decode): Decode windows
        parameters
        * Shared/PlatformPopupMenuData.h: Add the windows specific
        parameters (based on removed Windows implementation)
        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createPopupMenuProxy):
        * UIProcess/win/WebPopupMenuProxyWin.cpp: Added. (based on
        removed Windows implementation plus some fixes/api changes
        since the removal)
        (WebKit::isASCIIPrintable):
        (WebKit::translatePoint):
        (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWndProc):
        (WebKit::WebPopupMenuProxyWin::wndProc):
        (WebKit::WebPopupMenuProxyWin::registerWindowClass):
        (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWin):
        (WebKit::WebPopupMenuProxyWin::~WebPopupMenuProxyWin):
        (WebKit::WebPopupMenuProxyWin::showPopupMenu):
        (WebKit::WebPopupMenuProxyWin::hidePopupMenu):
        (WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
        (WebKit::WebPopupMenuProxyWin::clientRect const):
        (WebKit::WebPopupMenuProxyWin::invalidateItem):
        (WebKit::WebPopupMenuProxyWin::scrollSize const):
        (WebKit::WebPopupMenuProxyWin::setScrollOffset):
        (WebKit::WebPopupMenuProxyWin::visibleSize const):
        (WebKit::WebPopupMenuProxyWin::contentsSize const):
        (WebKit::WebPopupMenuProxyWin::scrollableAreaBoundingBox const):
        (WebKit::WebPopupMenuProxyWin::scrollTo):
        (WebKit::WebPopupMenuProxyWin::invalidateScrollbarRect):
        (WebKit::WebPopupMenuProxyWin::onMouseActivate):
        (WebKit::WebPopupMenuProxyWin::onSize):
        (WebKit::WebPopupMenuProxyWin::onKeyDown):
        (WebKit::WebPopupMenuProxyWin::onChar):
        (WebKit::WebPopupMenuProxyWin::onMouseMove):
        (WebKit::WebPopupMenuProxyWin::onLButtonDown):
        (WebKit::WebPopupMenuProxyWin::onLButtonUp):
        (WebKit::WebPopupMenuProxyWin::onMouseWheel):
        (WebKit::WebPopupMenuProxyWin::onPaint):
        (WebKit::WebPopupMenuProxyWin::onPrintClient):
        (WebKit::WebPopupMenuProxyWin::down):
        (WebKit::WebPopupMenuProxyWin::up):
        (WebKit::WebPopupMenuProxyWin::paint):
        (WebKit::WebPopupMenuProxyWin::setFocusedIndex):
        (WebKit::WebPopupMenuProxyWin::visibleItems const):
        (WebKit::WebPopupMenuProxyWin::listIndexAtPoint const):
        (WebKit::WebPopupMenuProxyWin::focusedIndex const):
        (WebKit::WebPopupMenuProxyWin::focusFirst):
        (WebKit::WebPopupMenuProxyWin::focusLast):
        (WebKit::WebPopupMenuProxyWin::incrementWheelDelta):
        (WebKit::WebPopupMenuProxyWin::reduceWheelDelta):
        (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
        * UIProcess/win/WebPopupMenuProxyWin.h: Added. (based on
        removed Windows implementation plus some fixes/api changes
        since then)
        (WebKit::WebPopupMenuProxyWin::create):
        (WebKit::WebPopupMenuProxyWin::hide):
        (WebKit::WebPopupMenuProxyWin::scrollbar const):
        (WebKit::WebPopupMenuProxyWin::itemHeight const):
        (WebKit::WebPopupMenuProxyWin::windowRect const):
        (WebKit::WebPopupMenuProxyWin::wheelDelta const):
        (WebKit::WebPopupMenuProxyWin::setWasClicked):
        (WebKit::WebPopupMenuProxyWin::wasClicked const):
        (WebKit::WebPopupMenuProxyWin::scrollbarCapturingMouse const):
        (WebKit::WebPopupMenuProxyWin::setScrollbarCapturingMouse):
        * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
        (WebKit::WebPopupMenu::setUpPlatformData): Make the data to
        pass between processes.

2018-07-31  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
        https://bugs.webkit.org/show_bug.cgi?id=188109
        <rdar://problem/42664391>

        Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.

        This patch removes cookie partitioning which reduces the model to just
        blocked cookies (in third-party contexts) and first-party cookie access.

        Several of the changes are renaming to reflect that there are no more
        cookie partitions. However, the compile-time check remains for now since
        this change is not ready to ship.

        The API changes are mostly in C APIs used for layout tests. The slight
        change in Cocoa API is that there no longer is a functionality to
        "enable" cookie partitioning. The boolean member is still there but it
        no longer does anything.

        The functional changes are in WebKit::ResourceLoadStatisticsMemoryStore
        and WebKit::NetworkDataTaskCocoa where cookie partitioning used to be
        managed and applied respectively. The IPC communication has changed to
        reflect this.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
            Name change from updatePrevalentDomainsToPartitionOrBlockCookies().
            No longer supports the partitioned category.
        (WebKit::NetworkProcess::removeAllStorageAccess):
            Now supports a completion handler. This change was made to address
            flakiness that came after layout test changes that were needed because
            of the removal of partitioned cookies.
        (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
            Partitioning removed from message name.
            RemoveAllStorageAccess message now supports a completion handler
            as explained above
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
            Removed parameter cookieStoragePartitioningEnabled.
        (WebKit::NetworkProcessCreationParameters::decode):
            Removed parameter cookieStoragePartitioningEnabled.
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation):
            No longer takes partitioning into account.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            Now only applies cookie blocking.
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
            Now only applies cookie blocking.
        (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy): Deleted.
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
            Removed the call to setCookieStoragePartitioningEnabled().
        (WebKit::NetworkProcess::setCookieStoragePartitioningEnabled): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
            WebCore::NetworkStorageSession::shouldBlockCookies() now takes a
            frame ID and page ID to resolve cookie access with the Storage
            Access API. This was previously handled by
            WebCore::NetworkStorageSession::cookieStoragePartition().
        * UIProcess/API/C/WKCookieManager.cpp:
        (WKCookieManagerSetCookieStoragePartitioningEnabled): Deleted.
        * UIProcess/API/C/WKCookieManager.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
        (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction): Deleted.
            There is no longer a difference between recent and non-recent
            user interaction so this test function was removed.
        (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree): Deleted.
        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): Deleted.
        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): Deleted.
            Deleted because partitioning is no longer a thing.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
            Deprecated _isCookieStoragePartitioningEnabled() and
            _setCookieStoragePartitioningEnabled() via WK_API_DEPRECATED.
        * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
        (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
            Removed support for ResourceLoadStatisticsTimeToLiveCookiePartitionFree.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
            No longer sets a parameter based on cookieStoragePartitioningEnabled().
        (WebKit::WebProcessPool::setCookieStoragePartitioningEnabled):
            Added a FIXME comment that this setter no longer does anything meaningful.
            Removed the IPC call to the network process to propagate the setting.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::clearCallbackStates):
            Name change from m_updatePartitionOrBlockCookiesCallbackMap to
            m_updateBlockCookiesCallbackMap.
        (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
            Name change plus it now just takes one vector of strings named domainsToBlock.
        (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
            Name change from didUpdatePartitionOrBlockCookies().
        (WebKit::NetworkProcessProxy::storageAccessRequestResult):
            Just moved to its right place.
        (WebKit::NetworkProcessProxy::removeAllStorageAccess):
            Now take a completion handler.
        (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
            To call the completion handler.
        (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies): Deleted.
            Name change.
        (WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies): Deleted.
            Name change.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
            Name change and added completion handler message for removeAllStorageAccess().
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
        (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
        (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction const):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockAndKeepCookies):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockAndPurgeCookies):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::resetCookieBlockingState):
        (WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction): Deleted.
            There is no longer a difference between recent and non-recent
            user interaction so this test function was removed.
        (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree): Deleted.
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies): Deleted.
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies): Deleted.
            Now split into shouldBlockAndKeepCookies() and shouldBlockAndPurgeCookies().
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning): Deleted.
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains): Deleted.
        (WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains): Deleted.
        (WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState): Deleted.
        * UIProcess/ResourceLoadStatisticsMemoryStore.h:
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
            Added an empty completion handler to the m_memoryStore.clear() call.
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::setCookieStoragePartitioningEnabled): Deleted.
        * UIProcess/WebCookieManagerProxy.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
            Now has a completion handler.
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
            Now supports a completion handler for removeAllStorageAccess().
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Deleted.
            There is no longer a difference between recent and non-recent
            user interaction so this test function was removed.
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): Deleted.
            Renamed to scheduleCookieBlockingUpdate().
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): Deleted.
            Renamed to scheduleCookieBlockingUpdateForDomains().
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Deleted.
            Renamed to scheduleClearBlockingStateForDomains().
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset): Deleted.
            Renamed to scheduleCookieBlockingStateReset().
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): Deleted.
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler): Deleted.
            Renamed callUpdatePrevalentDomainsToBlockCookiesForHandler().
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
        (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
            Now supports a completion handler for removeAllStorageAccess().
        (WebKit::WebsiteDataStore::networkProcessDidCrash):
            Name change in function called to get rid of "partitioning."
        (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies): Deleted.
            Renamed updatePrevalentDomainsToBlockCookiesFor().
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-07-31  Rob Buis  <rbuis@igalia.com>

        Remove ResourceResponse::cacheBodyKey API
        https://bugs.webkit.org/show_bug.cgi?id=188192

        Reviewed by Frédéric Wang.

        Remove unused API.

        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::decodeStorageRecord):

2018-07-30  Sihui Liu  <sihui_liu@apple.com>

        Add support for fetching and remove type  _WKWebsiteDataTypeHSTSCache
        https://bugs.webkit.org/show_bug.cgi?id=187379
        <rdar://problem/41879559>

        WKWebsiteDataStore should support _WKWebsiteDataTypeHSTSCache so Safari could list HSTS cache entries
        and be able to remove them on a per-domain basis.

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::filterPreloadHSTSEntry):
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::encode const):
        (WebKit::WebsiteData::decode):
        * Shared/WebsiteData/WebsiteData.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
        (WebKit::WebsiteDataRecord::displayNameForHostName):
        (WebKit::WebsiteDataRecord::addHSTSCacheHostname):
        (WebKit::WebsiteDataRecord::displayNameForPluginDataHostName): Deleted.
        * UIProcess/WebsiteData/WebsiteDataRecord.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):

2018-07-30  Simon Fraser  <simon.fraser@apple.com>

        Shrink GraphicsLayerCA
        https://bugs.webkit.org/show_bug.cgi?id=188141

        Reviewed by Zalan Bujtas.

        Shrink GraphicsLayerCA from 1040 to 880 bytes by:
        * moving all the clone-related stuff into the lazily-allocated m_layerClones
        * moving all the animation-related stuff into the lazily-allocated m_animations
        * making enums be 8-bit
        * re-ordering data members

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::updateCustomAppearance):
        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange const):

2018-07-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r230817): Terrible performance when selecting text on Stash code review
        https://bugs.webkit.org/show_bug.cgi?id=188144
        <rdar://problem/42642489>

        Reviewed by Darin Adler.

        After r230817, mouse events were serially dispatched to the web process and handled before the subsequent mouse
        event. However, this resulted in rapid-fire mouse move events filling up the mouse event queue in the case where
        mouse move events were being handled by the web process at a slower rate than the UI process was enqueueing
        them. To mitigate this, r231511 introduced a mechanism for replacing the most recently enqueued mouse move event
        with an incoming mouse move event.

        However, when a user with a force-click-enabled trackpad performs a mouse drag, a rapid stream of
        "mouseforcechanged" events is interleaved alongside the stream of "mousemove" events. This renders r231511
        ineffective, since the most recently queued event is often a "mouseforcechanged" event instead of a "mousemove".
        On the stash code review page, this can result in hundreds of mouse events being backed up in the mouse event
        queue, causing perceived slowness when selecting text.

        To fix this, we extend the mechanism introduced in r231511, such that it is capable of replacing both
        "mouseforcechanged" and "mousemove" events in the queue. Rather than consider only the most recently queued
        item, we instead find the most recently queued event that matches the type of the incoming event, remove it from
        the queue, and then append the incoming event to the end of the queue. To avoid the risk of removing the only
        "mousemove" or "mouseforcechanged" event in the middle of a mouse down and mouse up, we also bail when searching
        backwards for an event to replace if we come across any event that is neither of these types.

        This effectively throttles the rate at which mouseforcechanged or mousemove events are dispatched when a user
        with force-click-enabled hardware clicks and drags the mouse across the page.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::removeOldRedundantEvent):
        (WebKit::WebPageProxy::handleMouseEvent):

2018-07-30  Devin Rousso  <webkit@devinrousso.com>

        Add missing CoreGraphics SPI
        https://bugs.webkit.org/show_bug.cgi?id=188177

        Reviewed by Joseph Pecoraro.

        * WebProcess/cocoa/WebProcessCocoa.mm:

2018-07-30  Rob Buis  <rbuis@igalia.com>

        https://bugs.webkit.org/show_bug.cgi?id=188137
        Merge PlatformCookieJar functions into NetworkStorageSession

        Adapt callsites to use NetworkStorageSession instead of CookieJar functions.

        Reviewed by Alex Christensen.

        * NetworkProcess/Cookies/WebCookieManager.cpp:
        (WebKit::WebCookieManager::getHostnamesWithCookies):
        (WebKit::WebCookieManager::deleteCookiesForHostname):
        (WebKit::WebCookieManager::deleteAllCookies):
        (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        (WebKit::NetworkConnectionToWebProcess::deleteCookie):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::logCookieInformationInternal):
        * NetworkProcess/cache/NetworkCache.cpp:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

2018-07-30  Alex Christensen  <achristensen@webkit.org>

        Add RefCounted CompletionHandler wrapping abstraction for sending policy decisions back to WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=188089

        Reviewed by Geoffrey Garen and Said Abou-Hallawa.

        This will be necessary for when I add an asynchronous parallel step to decidePolicyForNavigationAction.
        We will want to wait for that asynchronous step for decidePolicyForNavigationActionSync but not for a client.

        No change in behavior.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::PolicyDecisionSender::create):
        (WebKit::WebPageProxy::PolicyDecisionSender::operator()):
        (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-07-30  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r234327.

        Caused 2 crashes on macOS and iOS debug API tests

        Reverted changeset:

        "Add RefCounted CompletionHandler wrapping abstraction for
        sending policy decisions back to WebProcess"
        https://bugs.webkit.org/show_bug.cgi?id=188089
        https://trac.webkit.org/changeset/234327

2018-07-30  Chris Dumez  <cdumez@apple.com>

        Potential null dereference under WebPage::applicationDidBecomeActive()
        https://bugs.webkit.org/show_bug.cgi?id=188170
        <rdar://problem/37493418>

        Reviewed by Wenson Hsieh.

        WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
        until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
        handlers.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::applicationDidEnterBackground):
        (WebKit::WebPage::applicationWillEnterForeground):
        (WebKit::WebPage::applicationDidBecomeActive):

2018-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix incorrect guards around a method declaration in PageClient.h
        https://bugs.webkit.org/show_bug.cgi?id=188153

        Reviewed by Tim Horton.

        `WebCore::DragItem` is forward declared under `ENABLE(DRAG_SUPPORT)`, but `startDrag` is declared under
        `PLATFORM(COCOA)`. If `ENABLE(DRAG_SUPPORT)` is off but `PLATFORM(COCOA)` is on, the build breaks.

        We fix this by moving `startDrag` under `ENABLE(DRAG_SUPPORT)`.

        * UIProcess/PageClient.h:
        (WebKit::PageClient::startDrag):

2018-07-28  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Pass a ResumptionReason to resumeWiFiAssertions
        https://bugs.webkit.org/show_bug.cgi?id=188142
        <rdar://problem/42628842>

        Reviewed by Darin Adler.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformProcessDidResume):
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):

2018-07-28  Darin Adler  <darin@apple.com>

        [Cocoa] Update more WebCore Objective-C code to be ARC compatible
        https://bugs.webkit.org/show_bug.cgi?id=188140

        Reviewed by Sam Weinig.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController enterFullScreen:]): Removed the call to
        setAction: since the full screen placeholder view now always uses the
        cancelOperation: method.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::lookupTextAtLocation): Updated to use the new
        DictionaryLookup function that returns a tuple instead of using an out argument.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
        (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.

2018-07-27  Chris Dumez  <cdumez@apple.com>

        Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
        https://bugs.webkit.org/show_bug.cgi?id=188097
        <rdar://problem/42558823>

        Reviewed by Eric Carlson.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:

2018-07-27  Alex Christensen  <achristensen@webkit.org>

        Don't include WebPageProxy.h just for UndoOrRedo
        https://bugs.webkit.org/show_bug.cgi?id=188086

        Reviewed by Saam Barati.

        * Shared/UndoOrRedo.h: Added.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::registerEditCommand):
        * UIProcess/PageClient.h:
        * UIProcess/WebEditCommandProxy.cpp:
        (WebKit::WebEditCommandProxy::unapply):
        (WebKit::WebEditCommandProxy::reapply):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::registerEditCommandForUndo):
        (WebKit::WebPageProxy::canUndoRedo):
        (WebKit::WebPageProxy::executeUndoRedo):
        (WebKit::WebPageProxy::canUndo):
        (WebKit::WebPageProxy::canRedo):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::registerEditCommand):
        (WebKit::PageClientImpl::canUndoRedo):
        (WebKit::PageClientImpl::executeUndoRedo):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::registerEditCommand):
        (WebKit::PageClientImpl::canUndoRedo):
        (WebKit::PageClientImpl::executeUndoRedo):
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::canUndo const):
        (WebKit::WebEditorClient::canRedo const):
        (WebKit::WebEditorClient::undo):
        (WebKit::WebEditorClient::redo):

2018-07-27  Alex Christensen  <achristensen@webkit.org>

        Make CompletionHandler more const correct
        https://bugs.webkit.org/show_bug.cgi?id=186543

        Reviewed by Saam Barati.

        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearAllCaches):
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::simulateMouseInteraction):
        (WebKit::WebAutomationSession::simulateKeyboardInteraction):
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::requestNewPageWithOptions):
        (WebKit::AutomationSessionClient::requestSwitchToPage):
        (WebKit::AutomationSessionClient::requestHideWindowOfPage):
        (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
        (WebKit::UIDelegate::UIClient::createNewPage):
        (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
        (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
        (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
        (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
        (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
        (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
        (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
        (WebKit::UIDelegate::UIClient::runOpenPanel):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::WebPageProxy::webGLPolicyForURL):
        (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
        (WebKit::WebPageProxy::getWindowFrame):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):

2018-07-27  Simon Fraser  <simon.fraser@apple.com>

        Be more conservative with compositing layer creation when memory is low
        https://bugs.webkit.org/show_bug.cgi?id=187866
        rdar://problem/42366345

        Reviewed by Zalan Bujtas.
        
        When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
        compositing layers. We avoid compositing for these situations:
        1. Layers with 3D transforms which are affine (like translateZ(0)).
        2. Layers with will-change
        3. Layers for canvases (other than WebGL/WebGPU)
        
        We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
        falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
        Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
        
        Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
        flakily falling into a different mode, and so that we can impose the conservative
        mode for testing.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetCompositingPolicyOverride):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2018-07-27  Alex Christensen  <achristensen@webkit.org>

        Add RefCounted CompletionHandler wrapping abstraction for sending policy decisions back to WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=188089

        Reviewed by Geoffrey Garen.

        This will be necessary for when I add an asynchronous parallel step to decidePolicyForNavigationAction.
        We will want to wait for that asynchronous step for decidePolicyForNavigationActionSync but not for a client.

        No change in behavior.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::PolicyDecisionSender::create):
        (WebKit::WebPageProxy::PolicyDecisionSender::operator()):
        (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-07-27  Saam Barati  <sbarati@apple.com>

        Use SPI to compute the jetsam limit on iOS instead of hardcoding 840MB
        https://bugs.webkit.org/show_bug.cgi?id=188091
        <rdar://problem/42647697>

        Reviewed by Simon Fraser.

        Give the Network/Storage/WebContent process the com.apple.private.memorystatus
        entitlement. This allows them to read the process jetsam limit.

        * Configurations/Databases-iOS.entitlements:
        * Configurations/Network-iOS.entitlements:
        * Configurations/WebContent-iOS.entitlements:

2018-07-03  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r233461.

        assertions triggered on ios11 Debug wk2

        Reverted changeset:

        "[iOS] Add assert to catch improper use of WebCore::Timer in
        UI Process"
        https://bugs.webkit.org/show_bug.cgi?id=185330
        https://trac.webkit.org/changeset/233461

2018-07-27  Alex Christensen  <achristensen@webkit.org>

        Remove unused WKNavigationDelegatePrivate decidePolicyForNavigationAction SPI
        https://bugs.webkit.org/show_bug.cgi?id=188077

        Reviewed by Darin Adler.

        The one client has moved to the version with userInfo, and it never used the SPI
        on old operating systems.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

2018-07-27  Alex Christensen  <achristensen@webkit.org>

        Begin making WKWebViewConfiguration a wrapper around an API::PageConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=188030

        Reviewed by Sam Weinig.

        Eventually WKWebViewConfiguration should become just a API::ObjectStorage<API::PageConfiguration>.
        The transition includes adding fields that exist in WKWebViewConfiguration to API::PageConfiguration
        and making WKWebViewConfiguration's getters and setters just call API::PageConfiguration's corresponding methods
        instead of having an ivar for each value then copying it to an API::PageConfiguration we construct in
        the WKWebView constructor.  To transition incrementally, I've added a RefPtr<API::PageConfiguration> ivar to
        WKWebViewConfiguration and moved a few ivars to use the values stored in that API::PageConfiguration instead.
        I've arbitrarily chosen _treatsSHA1SignedCertificatesAsInsecure and _urlSchemeHandlers as the first two 
        properties to transition, and I'll continue transitioning each ivar in small, easy-to-review bunches.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        (API::PageConfiguration::urlSchemeHandlerForURLScheme):
        (API::PageConfiguration::setURLSchemeHandlerForURLScheme):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::urlSchemeHandlers):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
        (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
        (-[WKWebViewConfiguration copyPageConfiguration]):
        (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]):
        (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]):
        (-[WKWebViewConfiguration _urlSchemeHandlers]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:

2018-07-27  Chris Dumez  <cdumez@apple.com>

        Loading a file URL and then issuing a reload right away causes the load to fail due to sandboxing
        https://bugs.webkit.org/show_bug.cgi?id=188078
        <rdar://problem/42562493>

        Unreviewed, follow-up fix after r234290 to address assertion hits on the bots. Make the fix
        specific to reloads as we know the existing provisional sandbox extension is for the same
        URL then.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reload):
        (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
        (WebKit::WebPage::SandboxExtensionTracker::beginReload):
        * WebProcess/WebPage/WebPage.h:

2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>

        [INTL] Remove INTL sub-feature compile flags
        https://bugs.webkit.org/show_bug.cgi?id=188081

        Reviewed by Michael Catanzaro.

        * Configurations/FeatureDefines.xcconfig:

2018-07-26  Chris Dumez  <cdumez@apple.com>

        Loading a file URL and then issuing a reload right away causes the load to fail due to sandboxing
        https://bugs.webkit.org/show_bug.cgi?id=188078
        <rdar://problem/42562493>

        Reviewed by Geoff Garen.

        When WebPageProxy::loadFile() is called, we create a SandboxExtension::Handle for the resource path provided
        by the caller and pass it to the WebProcess. WebPage::loadRequest() then calls SandboxExtensionTracker::beginLoad()
        to store this handle in m_provisionalSandboxExtension for later consumption.

        If a reload is issued before this sandbox extension has been consumed, then the following happens:
        1. WebPageProxy::reload() does NOT create a SandboxExtension::Handle because it has already issued one earlier.
           maybeInitializeSandboxExtensionHandle() returns early due to m_process->hasAssumedReadAccessToURL(url) check.
        2. WebPage::reload() then calls SandboxExtensionTracker::beginLoad() with a null handle, which overwrites the
           previous m_provisionalSandboxExtension its needs.
        3. The load fails because the WebContent process is missing the sandbox extension.

        To address the issue, SandboxExtensionTracker::beginLoad() is updated to only overwrite m_provisionalSandboxExtension
        if the new handle is not null. This avoids inadvertently clearing a valid sandbox extension we may need for the load,
        since the UIProcess sends us a null handle if it previously sent us a sandbox extension for the path in question.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::SandboxExtensionTracker::beginLoad):

2018-07-26  Chris Dumez  <cdumez@apple.com>

        It should be possible to use WTF::CallbackAggregator from a background thread
        https://bugs.webkit.org/show_bug.cgi?id=188084

        Reviewed by Alex Christensen.

        This code was passing CallbackAggregator objects for background thread and not being
        careful on which thread the CallbackAggregator gets destroyed. This patch fixes this
        since the CallbackAggregator destructor no longer takes care of dispatching to the
        main thread.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):

2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>

        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
        https://bugs.webkit.org/show_bug.cgi?id=187963

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::updateVaryInformation):
        * NetworkProcess/capture/NetworkCaptureManager.cpp:
        (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
        (WebKit::getPluginInfoFromPropertyLists):
        (WebKit::PluginVersion::parse):
        * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
        (WebKit::NetscapePluginModule::parseMIMEDescription):
        * Shared/Plugins/unix/PluginSearchPath.cpp:
        (WebKit::pluginsDirectories):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox):
        * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::fileCanBeAcceptedForUpload):
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
        (WebKit::PluginProcessProxy::scanPlugin):
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        (WebKit::isTransparentSilverlightBackgroundValue):
        Update split/splitAllowingEmptyEntries usage.

2018-07-26  Alex Christensen  <achristensen@webkit.org>

        Fix assertions introduced in r234210
        https://bugs.webkit.org/show_bug.cgi?id=188074

        Reviewed by Chris Dumez.

        There is a client that uses WKFramePolicyListenerUseWithPolicies to send website policies as
        a response to the WKPageNavigationClient's decidePolicyForNavigationResponse.  That is wasting
        effort to generate policies that don't change anything. Once that client adopts WKWebView
        they won't be able to do this any more, so temporarily remove the assertion.
        Also, make the assertion about process swapping a release assert to prevent that client
        from adopting WKFramePolicyListenerUseInNewProcessWithPolicies for navigation responses.
        It should only be used for navigation actions.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):

2018-07-26  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234181 and r234189.
        https://bugs.webkit.org/show_bug.cgi?id=188075

        These are not needed right now (Requested by thorton on
        #webkit).

        Reverted changesets:

        "Enable Web Content Filtering on watchOS"
        https://bugs.webkit.org/show_bug.cgi?id=187979
        https://trac.webkit.org/changeset/234181

        "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
        https://bugs.webkit.org/show_bug.cgi?id=187985
        https://trac.webkit.org/changeset/234189

2018-07-26  Chris Dumez  <cdumez@apple.com>

        ERROR: Unhandled web process message 'WebPage:SetUseDarkAppearance' when browsing in dark mode
        https://bugs.webkit.org/show_bug.cgi?id=188028

        Reviewed by Wenson Hsieh.

        The issue was that the WebViewImpl constructor was calling setUseDarkAppearance() *before* calling
        initializeWebPage(), which would cause us to send IPC the WebContent process for a pageID that does
        not exist on WebProcess side yet.

        To address the issue, the WebViewImpl constructor no longer calls setUseDarkAppearance() and WebPageProxy
        no longer holds a flag indicates is dark appearance is used. Instead, the WebPageProxy asks the WebView
        for the value whenever it needs to, via the PageClient.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl):
        (WebKit::WebViewImpl::effectiveAppearanceDidChange):
        (WebKit::WebViewImpl::setUseDarkAppearance): Deleted.
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::useDarkAppearance const):
        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
        (WebKit::WebPageProxy::showPlaybackTargetPicker):
        (WebKit::WebPageProxy::setUseDarkAppearance): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::useDarkAppearance const): Deleted.
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::effectiveAppearanceIsDark const):

2018-07-26  Sihui Liu  <sihui_liu@apple.com>

        Remove a forward protocol declaration of '_WKWebViewPrintProvider'
        https://bugs.webkit.org/show_bug.cgi?id=188012
        <rdar://problem/42309526>

        Reviewed by Darin Adler.

        @procotol() expressions emit invalid protocol metadata when used with forward @protocol declarations. 
        Clang is going to make it an error for using a forward-declared protocol in a @protocol expression, so
        we need to stop doing this.

        * UIProcess/API/Cocoa/WKWebViewInternal.h:

2018-07-26  Chris Dumez  <cdumez@apple.com>

        Disable Dark Mode in the Plugin process to avoid rendering issues
        https://bugs.webkit.org/show_bug.cgi?id=188059
        <rdar://problem/42369281>

        Reviewed by Tim Horton.

        Plugins generally do not support dark mode and this causes rendering issues so
        disable dark mode in the plugin process.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializePluginProcess):

2018-07-26  Chris Dumez  <cdumez@apple.com>

        WebSiteData-related methods should take in CompletionHandlers instead of Functions
        https://bugs.webkit.org/show_bug.cgi?id=188027

        Reviewed by Alex Christensen.

        WebSiteData-related methods should take in CompletionHandlers instead of Functions since
        they are need to be called and are only called once.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::fetchWebsiteData):
        (WebKit::NetworkProcessProxy::deleteWebsiteData):
        (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::fetchWebsiteData):
        (WebKit::PluginProcessProxy::deleteWebsiteData):
        (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::fetchWebsiteData):
        (WebKit::StorageProcessProxy::deleteWebsiteData):
        (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
        * UIProcess/Storage/StorageProcessProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
        (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
        (WebKit::WebProcessProxy::fetchWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
        * UIProcess/WebProcessProxy.h:

2018-07-26  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Improve the way request displayRefresh notifications
        https://bugs.webkit.org/show_bug.cgi?id=188005

        Reviewed by Žan Doberšek.

        Add a new interface ThreadedDisplayRefreshMonitor::Client and use it to pipe the the
        requestDisplayRefreshMonitorUpdate and handleDisplayRefreshMonitorUpdate to the
        ThreadedCoordinatedLayerTreeHost.

        In response to requestDisplayRefreshMonitorUpdate, the LayerTreeHost will force a layer
        flush that in the end causes a repaint, which generates the requested display refresh
        event.

        In response to handleDisplayRefreshMonitorUpdate, the call to renderNextFrame will happen,
        and if the DisplayRefreshMonitor has been rescheduled, renderNextFrame will also force
        a new layer flush, causing the repaint that will generate the display refreh event.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::create):
        (WebKit::ThreadedCompositor::ThreadedCompositor):
        (WebKit::m_displayRefreshMonitor):
        (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
        (WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
        (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
        (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
        (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
        (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
        (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
        (WebKit::ThreadedDisplayRefreshMonitor::create):
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
        (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
        (WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
        (WebKit::ThreadedCoordinatedLayerTreeHost::requestDisplayRefreshMonitorUpdate):
        (WebKit::ThreadedCoordinatedLayerTreeHost::handleDisplayRefreshMonitorUpdate):
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

2018-07-25  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Update sandboxes for revised OpenCL calls and streaming media
        https://bugs.webkit.org/show_bug.cgi?id=188013
        <rdar://problem/42594262>

        Reviewed by Eric Carlson.

        Testing logs from recent Mojave builds shows that OpenCL is checking more CPU-specific values as part of WebKit
        painting operations. We need to allow these checks in the sandbox to support these more optimized drawing operations.

        I also corrected some sandbox violations I found while investigating streaming media issues.

        * WebProcess/com.apple.WebProcess.sb.in:

2018-07-25  Jeremy Jones  <jeremyj@apple.com>

        Mask AVBackgroundView to the corner radius.
        https://bugs.webkit.org/show_bug.cgi?id=187976
        rdar://problem/41810866

        Reviewed by Jon Lee.

        This changes sets the appropriate mask to the layer so the corners look correct.

        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        (-[WKFullscreenStackView init]):

2018-07-25  Zalan Bujtas  <zalan@apple.com>

        REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
        https://bugs.webkit.org/show_bug.cgi?id=188018
        <rdar://problem/42517520>

        Reviewed by Dean Jackson.

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

2018-07-25  Tim Horton  <timothy_horton@apple.com>

        Fix the build.

        * UIProcess/mac/ServicesController.mm:
        (WebKit::hasCompatibleServicesForItems):
        I can't even.

2018-07-25  Tim Horton  <timothy_horton@apple.com>

        Crashing on some builds that don't have async NSSharingService API
        https://bugs.webkit.org/show_bug.cgi?id=188015
        <rdar://problem/42593935>

        Reviewed by Eric Carlson.

        * UIProcess/mac/ServicesController.mm:
        (WebKit::hasCompatibleServicesForItems):

2018-07-25  Chris Dumez  <cdumez@apple.com>

        navigator.userAgent may return outdated value after webView.customUserAgent is set
        https://bugs.webkit.org/show_bug.cgi?id=188009
        <rdar://problem/42566456>

        Reviewed by Alex Christensen.

        Let the page know when the user agent changes.

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

2018-07-25  Alex Christensen  <achristensen@webkit.org>

        Use CompletionHandler for policy decisions
        https://bugs.webkit.org/show_bug.cgi?id=187975

        Reviewed by Chris Dumez.

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        (WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision): Deleted.
        (WebKit::WebFramePolicyListenerProxy::setNavigation): Deleted.
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        (WebKit::WebFramePolicyListenerProxy::policyListenerType const): Deleted.
        (WebKit::WebFramePolicyListenerProxy::listenerID const): Deleted.
        (): Deleted.
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
        (WebKit::WebFrameProxy::activePolicyListenerProxy): Deleted.
        (WebKit::WebFrameProxy::changeWebsiteDataStore): Deleted.
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:

2018-07-25  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234196.
        https://bugs.webkit.org/show_bug.cgi?id=188011

        broke API tests (Requested by alexchristensen on #webkit).

        Reverted changeset:

        "Use CompletionHandler for policy decisions"
        https://bugs.webkit.org/show_bug.cgi?id=187975
        https://trac.webkit.org/changeset/234196

2018-07-25  Alex Christensen  <achristensen@webkit.org>

        Use CompletionHandler for policy decisions
        https://bugs.webkit.org/show_bug.cgi?id=187975

        Reviewed by Chris Dumez.

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        (WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision): Deleted.
        (WebKit::WebFramePolicyListenerProxy::setNavigation): Deleted.
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        (WebKit::WebFramePolicyListenerProxy::policyListenerType const): Deleted.
        (WebKit::WebFramePolicyListenerProxy::listenerID const): Deleted.
        (): Deleted.
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
        (WebKit::WebFrameProxy::activePolicyListenerProxy): Deleted.
        (WebKit::WebFrameProxy::changeWebsiteDataStore): Deleted.
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:

2018-07-25  Brent Fulgham  <bfulgham@apple.com>

        [macOS] PluginProcess needs TCC entitlements for media capture
        https://bugs.webkit.org/show_bug.cgi?id=187981
        <rdar://problem/42433634>

        Reviewed by Chris Dumez.

        The changes needed in Bug 185526 are also needed for the plugin process, or else the UIProcess
        (e.g., Safari) is not able to pass the user's camera/microphone access permission to the plugin process.

        This patch has the following changes:

        1. Rename "WebContent-OSX-restricted.entitlements" to "WebContent-or-Plugin-OSX-restricted.entitlements"
        2. Rename "process-webcontent-entitlements.sh" to "process-webcontent-or-plugin-entitlements.sh"
        3. Add a run-script step to the Plugin.64 and Plugin.32 builds to add the relevant entitlements.
        4. Silence some Flash plugin sandbox exceptions triggered after activating the camera.

        * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX-restricted.entitlements.
        * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player ESR.plugin.sb: Address sandbox violations needed by camera use.
        * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb: Ditto.
        * Scripts/process-webcontent-or-plugin-entitlements.sh: Renamed from Source/WebKit/Scripts/process-webcontent-entitlements.sh.
        * WebKit.xcodeproj/project.pbxproj: Update for renaming, and perform entitlement steps on Plugin process.

2018-07-24  Tim Horton  <timothy_horton@apple.com>

        Enable Web Content Filtering on watchOS
        https://bugs.webkit.org/show_bug.cgi?id=187979
        <rdar://problem/42559346>

        Reviewed by Wenson Hsieh.

        * Configurations/FeatureDefines.xcconfig:

2018-07-24  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][macOS] Display suggestions for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=187794

        Reviewed by Tim Horton.

        An input[type=color] element that has an associated datalist element should
        display the color values provided. We now support 1-12 suggested colors, that
        will be displayed at the top of the color selection popover. If no suggestions
        are specified we keep the existing default colors.

        Created an NSPopoverColorWell subclass that allows custom colors to be specified
        in the form of an NSColorList.

        Also fixed a bug where an additional color well was displayed when clicking on
        the input element.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Color>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createColorPicker):
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showColorPicker):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::createColorPicker):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::createColorPicker):
        * UIProcess/mac/WebColorPickerMac.h:
        * UIProcess/mac/WebColorPickerMac.mm:
        (WebKit::WebColorPickerMac::create):
        (WebKit::WebColorPickerMac::WebColorPickerMac):
        (WebKit::WebColorPickerMac::showColorPicker):
        (+[WKPopoverColorWell _colorPopoverCreateIfNecessary:]):
        (-[WKPopoverColorWell _showPopover]):
        (-[WKPopoverColorWell setSuggestedColors:]):
        (-[WKColorPopoverMac initWithFrame:inView:]):
        (-[WKColorPopoverMac setAndShowPicker:withColor:suggestions:]):
        (-[WKColorPanelMac setAndShowPicker:withColor:suggestions:]):
        * WebProcess/WebCoreSupport/WebColorChooser.cpp:
        (WebKit::WebColorChooser::WebColorChooser):
        (WebKit::WebColorChooser::reattachColorChooser):

2018-07-24  Alex Christensen  <achristensen@webkit.org>

        Modernize NavigationState
        https://bugs.webkit.org/show_bug.cgi?id=187966

        Reviewed by Andy Estes.

        Don't ignore switch warnings any more.
        Use BlockPtr.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):

2018-07-24  Alex Christensen  <achristensen@webkit.org>

        Remove WebFramePolicyListenerProxy::changeWebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=187967

        Reviewed by Andy Estes.

        We need to call WebFrameProxy::changeWebsiteDataStore if the _WKWebsitePolicies has a WKWebsiteDataStore.
        We're doing that in a weird way that is not in the right layer.  Inside the call to WebFramePolicyListenerProxy::use
        we can inform the frame if there's a new WebsiteDataStore.
        
        No change in behavior, as verified by the WebKit.WebsitePoliciesDataStore API test.
        This is a step towards using lambdas in WebFramePolicyListenerProxy.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::decidePolicyForNavigationAction):
        (API::NavigationClient::decidePolicyForNavigationResponse):
        * UIProcess/API/APIPolicyClient.h:
        (API::PolicyClient::decidePolicyForNavigationAction):
        (API::PolicyClient::decidePolicyForNewWindowAction):
        (API::PolicyClient::decidePolicyForResponse):
        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (WKFramePolicyListenerUse):
        (WKFramePolicyListenerUseInNewProcess):
        (useWithPolicies):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPagePolicyClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::changeWebsiteDataStore): Deleted.
        * UIProcess/WebFramePolicyListenerProxy.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/mac/PageClientImplMac.mm:

2018-07-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234121.

        Caused perf test failures.

        Reverted changeset:

        "We should cache the compiled sandbox profile in a data vault"
        https://bugs.webkit.org/show_bug.cgi?id=184991
        https://trac.webkit.org/changeset/234121

2018-07-24  Jeff Miller  <jeffm@apple.com>

        WKUIDelegate needs an alternate decideDatabaseQuotaForSecurityOrigin method that provides the database name and display name
        https://bugs.webkit.org/show_bug.cgi?id=187567

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        Declare alternate decideDatabaseQuotaForSecurityOrigin method, copying the existing FIXME comment
        from the old method.
        
        * UIProcess/Cocoa/UIDelegate.h:
        Add flag for new delegate method.
        
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        Initialize new flag.
        
        (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
        Prefer the new UIDelegate method that takes the database name and display name, falling back to the
        existing method if the client doesn't implement it.

2018-07-24  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] Add support to WebView for setting tooltips
        https://bugs.webkit.org/show_bug.cgi?id=187930

        Reviewed by Fujii Hironori.

        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::toolTipChanged): Set tooltip on WebView
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::setToolTip): Add support for updating the
        tooltip text in Windows.
        * UIProcess/win/WebView.h:

2018-07-24  Alex Christensen  <achristensen@webkit.org>

        Reduce getters/setters in WebFramePolicyListenerProxy
        https://bugs.webkit.org/show_bug.cgi?id=187830

        Reviewed by Dean Jackson.

        This is a step towards making it a lambda, which has no getters or setters.
        No change in behavior.

        setApplyPolicyInNewProcessIfPossible can be replaced by passing another parameter.
        This bit was just piggy-backing on the WebFramePolicyListenerProxy.

        isMainFrame was only used in an assert, which has a corresponding ObjC exception in
        NavigationState::NavigationClient::decidePolicyForNavigationAction for the one relevant client.

        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (WKFramePolicyListenerUseInNewProcess):
        (useWithPolicies):
        (WKFramePolicyListenerUseWithPolicies):
        (WKFramePolicyListenerUseInNewProcessWithPolicies):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision):
        (WebKit::WebFramePolicyListenerProxy::use):
        (WebKit::WebFramePolicyListenerProxy::download):
        (WebKit::WebFramePolicyListenerProxy::ignore):
        (WebKit::WebFramePolicyListenerProxy::isMainFrame const): Deleted.
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::setApplyPolicyInNewProcessIfPossible): Deleted.
        (WebKit::WebFramePolicyListenerProxy::applyPolicyInNewProcessIfPossible const): Deleted.
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::receivedPolicyDecision):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        (WebKit::WebProcessPool::processForNavigationInternal):
        * UIProcess/WebProcessPool.h:

2018-07-24  Alex Christensen  <achristensen@webkit.org>

        Remove WebFramePolicyListenerProxy::invalidate
        https://bugs.webkit.org/show_bug.cgi?id=187833

        Reviewed by Dean Jackson.

        When we're invalidating the listener, calling ignore instead will at worst cause
        an ignored message to be sent.  The load will be cancelled either way.
        Removing the invalidate method gets it closer to being a lambda.

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::invalidate): Deleted.
        * UIProcess/WebFramePolicyListenerProxy.h:
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::webProcessWillShutDown):
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):

2018-07-24  Chris Dumez  <cdumez@apple.com>

        WebFullScreenManagerProxy does not need to be ref counted
        https://bugs.webkit.org/show_bug.cgi?id=187928

        Reviewed by Eric Carlson.

        WebFullScreenManagerProxy does not need to be ref counted, it is owned by WebPageProxy.
        It is also error-prone because WebFullScreenManagerProxy has a raw pointer to its WebPageProxy
        and anybody could extend the lifetime of the WebFullScreenManagerProxy by refing it, which
        would make the WebPageProxy pointer stale.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
        (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
        (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
        (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
        (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
        (WebKit::WebFullScreenManagerProxy::setAnimatingFullScreen):
        (WebKit::WebFullScreenManagerProxy::requestExitFullScreen):
        (WebKit::WebFullScreenManagerProxy::saveScrollPosition):
        (WebKit::WebFullScreenManagerProxy::restoreScrollPosition):
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
        (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
        (WebKit::WebFullScreenManagerProxy::invalidate):
        * UIProcess/WebFullScreenManagerProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::reattachToWebProcess):
        * UIProcess/WebPageProxy.h:

2018-07-24  Zan Dobersek  <zdobersek@igalia.com>

        [TextureMapper] Separate repaint counter state from debug visuals
        https://bugs.webkit.org/show_bug.cgi?id=187946

        Reviewed by Carlos Garcia Campos.

        Instead of managing the repaint counter visibility along with the
        debug border visuals, do that together with the repaint count value.

        In the CoordinatedGraphicsScene class, remove the helper
        setLayerRepaintCountIfNeeded() method that's only been called in one
        place, and instead set the repaint count information on the
        TextureMapperLayer object directly from setLayerState(). The repaint
        counter visiblity and count value are gathered from the new struct
        that's kept on the CoordinatedGraphicsLayerState object.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::setLayerState):
        (WebKit::CoordinatedGraphicsScene::setLayerRepaintCountIfNeeded): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

2018-07-24  Thibault Saunier  <tsaunier@igalia.com>

        [WPE][GTK] Implement WebRTC based on libwebrtc
        https://bugs.webkit.org/show_bug.cgi?id=186932

        Reviewed by Philippe Normand.

        * WebProcess/Network/webrtc/LibWebRTCProvider.h: Use LibWebRTCProviderGlib when building WPE or GTK ports.

2018-07-23  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] Add implementation for setting cursors
        https://bugs.webkit.org/show_bug.cgi?id=187868

        Reviewed by Fujii Hironori.

        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::setCursor): Set cursor on the webview
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::setCursor): Add implementation to set the
        web cursor to update the Windows cursor
        * UIProcess/win/WebView.h:

2018-07-23  Jeremy Jones  <jeremyj@apple.com>

        Crash when loadViewIfRequired called while WKFullScreenViewController is being deallocated.
        https://bugs.webkit.org/show_bug.cgi?id=187920
        rdar://problem/41324023

        Reviewed by Eric Carlson.

        Clear dangling weak-ref.
        Prevent async playback state calls from instantiating the interface.
        Release WKFullScreenViewController when it is no longer needed.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController dealloc]):
        (-[WKFullScreenViewController setPlaying:]):
        (-[WKFullScreenViewController setAnimating:]):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController _completedExitFullScreen]):

2018-07-23  Timothy Horton  <timothy_horton@apple.com>

        Try to fix the build.

        * UIProcess/mac/ServicesController.mm:
        (WebKit::hasCompatibleServicesForItems):

2018-07-23  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
        (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
            in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
        (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
            compile a sandbox, and cache it.
        (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
            file which contains an entitlement with a process specific "storage class" which ensures that each process
            can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
        (4) The sandbox entitlements file for the Network, WebContent and Plugin services are loaded dynamically
            through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
            The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
            The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
            are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.

        * Configurations/Network-OSX-sandbox.entitlements: Added.
        * Configurations/Plugin-OSX-sandbox.entitlements: Added.
        * Configurations/Storage-OSX-sandbox.entitlements: Added.
        * Configurations/StorageService.xcconfig:
        * Configurations/WebContent-OSX-sandbox.entitlements: Added.
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/NetworkProcess.h:
        * PluginProcess/PluginProcess.h:
        * Scripts/process-network-entitlements.sh: Added.
        * Scripts/process-plugin-entitlements.sh: Added.
        * Scripts/process-webcontent-entitlements.sh:
        * Shared/ChildProcess.h:
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/SandboxInitializationParameters.h:
        (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
        (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
        (WebKit::SandboxInitializationParameters::setSandboxProfile):
        (WebKit::SandboxInitializationParameters::sandboxProfile const):
        (): Deleted.
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::SandboxProfileDeleter::operator()):
        (WebKit::SandboxParametersDeleter::operator()):
        (WebKit::SandboxInfo::SandboxInfo):
        (WebKit::fileContents):
        (WebKit::processStorageClass):
        (WebKit::setAndSerializeSandboxParameters):
        (WebKit::getUserCacheDirectory):
        (WebKit::sandboxDataVaultParentDirectory):
        (WebKit::sandboxDirectory):
        (WebKit::sandboxFilePath):
        (WebKit::ensureSandboxCacheDirectory):
        (WebKit::writeSandboxDataToCacheFile):
        (WebKit::compileAndCacheSandboxProfile):
        (WebKit::tryApplyCachedSandbox):
        (WebKit::webKit2Bundle):
        (WebKit::sandboxProfilePath):
        (WebKit::compileAndApplySandboxSlowCase):
        (WebKit::applySandbox):
        (WebKit::initializeSandboxParameters):
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/mac/SandboxInitialiationParametersMac.mm:
        (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
        * StorageProcess/StorageProcess.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.h:

2018-07-23  Tim Horton  <timothy_horton@apple.com>

        Creating and loading content in a WKWebView triggers Main Thread Checker warnings under ServicesController
        https://bugs.webkit.org/show_bug.cgi?id=186963
        <rdar://problem/41393682>

        Reviewed by Timothy Hatcher.

        * UIProcess/mac/ServicesController.h:
        * UIProcess/mac/ServicesController.mm:
        (WebKit::hasCompatibleServicesForItems):
        (WebKit::ServicesController::refreshExistingServices):
        Adopt async ShareKit SPI that is actually thread-safe instead of the not-quite-safe
        synchronous API. Request all three sets of services immediately, and dispatch
        to the Web Content processes when all three have returned.

2018-07-23  Chris Dumez  <cdumez@apple.com>

        WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
        https://bugs.webkit.org/show_bug.cgi?id=187910
        <rdar://problem/42356526>

        Reviewed by Brent Fulgham.

        The WebResourceLoadStatisticsStore was only removing itself as a MessageReceiver from the WebProcessProxy
        and that WebProcessProxy's connection was getting closed. However, it is possible for the
        WebResourceLoadStatisticsStore to get destroyed before this happens. This would lead to crashes such as
        the one in <rdar://problem/42356526>.

        To address the issue, we let the WebsiteDataStore take care of registering / unregistering the
        WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy. This is more reliable since
        the WebsiteDataStore is the one that subclasses WebProcessLifetimeObserver. Make sure the
        WebResourceLoadStatisticsStore is removed as a MessageReceiver whenever the WebsiteDataStore is destroyed
        or WebsiteDataStore::m_resourceLoadStatistics gets cleared.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        * UIProcess/WebResourceLoadStatisticsStore.h:
        Drop logic to add / remove the WebResourceLoadStatisticsStore as a receiver now that the
        WebsiteDataStore takes care of it.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        Make sure the WebResourceLoadStatisticsStore gets unregistered as a MessageReceiver from all associated
        WebProcessProxy objects when the WebsiteDataStore gets destroyed.

        (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
        (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
        Register / Unregister the WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy.

        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
        Make sure we unregister the WebResourceLoadStatisticsStore as a MessageReceiver with all associated
        WebProcessProxy objects before we clear m_resourceLoadStatistics as this will causes the
        WebResourceLoadStatisticsStore to get destroyed.

        (WebKit::WebsiteDataStore::unregisterWebResourceLoadStatisticsStoreAsMessageReceiver):
        (WebKit::WebsiteDataStore::registerWebResourceLoadStatisticsStoreAsMessageReceiver):
        Add utility functions to register / unregister WebResourceLoadStatisticsStore as a MessageReceiver with
        all associated WebProcessProxy objects.

        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        Register the new WebResourceLoadStatisticsStore as a MessageReceiver with all associated WebProcessProxy
        objects in case setResourceLoadStatisticsEnabled(true) gets called *after* we've already started
        WebProcesses.

        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-07-23  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Add logging of Storage Access API use in experimental debug mode
        https://bugs.webkit.org/show_bug.cgi?id=187918
        <rdar://problem/42509062>

        Reviewed by Jiewen Tan.

        Tested manually by looking at log output.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
            This is just a clean-up change.
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
            Both these now log proper info in debug mode.

2018-07-23  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Add support for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=187871

        Reviewed by Tim Horton.

        Created WKFormColorControl to display a color picker once a color input gains
        focus. The control is presented as an inputView on iPhone and as a popover on
        iPad. The picker itself consists of two color matrices. The first is a set of 12
        default colors, displayed on the top row of the picker. In a subsequent patch,
        this top row will be made customizable through the use of the datalist element.
        The second matrix is a grid of 120 colors, provided by the system. Colors can be
        selected from either matrix by tapping or with a pan gesture.

        WKColorMatrixView represents a single color matrix and is comprised of
        WKColorButtons that represent each color in the matrix.

        * Shared/AssistedNodeInformation.h:
        * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::createColorPicker):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
        (-[WKContentView _requiresKeyboardWhenFirstResponder]):
        (-[WKContentView inputView]):
        (-[WKContentView requiresAccessoryView]):
        (isAssistableInputType):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView actionNameForFocusedFormControlView:]):
        * UIProcess/ios/forms/WKFormColorControl.h: Added.
        * UIProcess/ios/forms/WKFormColorControl.mm: Added.
        (-[WKColorPopover initWithView:]):
        (-[WKColorPopover controlView]):
        (-[WKColorPopover controlBeginEditing]):
        (-[WKColorPopover controlEndEditing]):
        (-[WKFormColorControl initWithView:]):
        (-[WKFormColorControl assistantView]):
        (-[WKFormColorControl beginEditing]):
        (-[WKFormColorControl endEditing]):
        * UIProcess/ios/forms/WKFormColorPicker.h: Added.
        * UIProcess/ios/forms/WKFormColorPicker.mm: Added.
        (+[WKColorButton colorButtonWithColor:]):
        (-[WKColorMatrixView initWithFrame:]):
        (-[WKColorMatrixView initWithFrame:colorMatrix:]):
        (-[WKColorMatrixView layoutSubviews]):
        (-[WKColorMatrixView colorButtonTapped:]):
        (+[WKColorPicker defaultTopColorMatrix]):
        (-[WKColorPicker initWithView:]):
        (-[WKColorPicker setControlValueFromUIColor:]):
        (-[WKColorPicker controlView]):
        (-[WKColorPicker controlBeginEditing]):
        (-[WKColorPicker controlEndEditing]):
        (-[WKColorPicker colorMatrixView:didTapColorButton:]):
        (-[WKColorPicker didPanColors:]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::isAssistableElement):
        (WebKit::WebPage::getAssistedNodeInformation):

2018-07-23  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] Fix detection of held modifier keys for key events
        https://bugs.webkit.org/show_bug.cgi?id=187862

        Reviewed by Fujii Hironori.

        * Shared/win/WebEventFactory.cpp:
        (WebKit::IsKeyInDownState): Use requested modifier not VK_MENU

2018-07-20  Jer Noble  <jer.noble@apple.com>

        REGRESSION(r233925): Can't go into PiP twice
        https://bugs.webkit.org/show_bug.cgi?id=187876
        <rdar://problem/42444520>

        Reviewed by Jon Lee.

        We fail to enter PiP the second time because the video fullscreen interface no longer has a
        model, and so gives a contentSize of 0x0. This happens because we disassociate the
        interface from the model in didCleanupFullscreen. However, the interface and model can still
        be re-used if they're kept alive by another client. We should delay disassociating the model
        from the interface until just before the model is destroyed in removeClientForContext.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::removeClientForContext):
        (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):

2018-07-20  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Enable basic functionality in experimental debug mode
        https://bugs.webkit.org/show_bug.cgi?id=187835
        <rdar://problem/42408590>

        Reviewed by Chris Dumez.

        This patch makes the experimental ITP Debug Mode feature work, at least
        to a basic level. This means:
        - Debug logging on the INFO level.
        - Permanently treat 3rdpartytestwebkit.org as a prevalent resource.
        - Support manual setting of a custom permanently prevalent resource through user
          defaults on Cocoa platforms.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsDebugModeWithCompletionHandler):
        (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
            Test infrastructure.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
        (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
            Used to pick up custom set prevalent resource on Cocoa platforms (for debug mode).
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
        (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
            Now skips processing of debug mode prevalent resources so that they
            stay prevalent.
        (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
            Convenience function to make 3rdpartytestwebkit.org and any custom domain
            set through ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode()
            be prevalent resources.
        (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
            Sets a custom domain to always be treated as prevalent in debug mode.
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
            Now makes sure 3rdpartytestwebkit.org and any custom domain set through
            ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode()
            are prevalent resources even after a clear of the store.
        (WebKit::debugLogDomainsInBatches):
            We may have too many domain names to fit in a single log statement.
            This function logs them in batches of 50, if we have more than 50.
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
            Now makes use of debugLogDomainsInBatches() in debug mode.
        * UIProcess/ResourceLoadStatisticsMemoryStore.h:
        (WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
            Now accepts a non-empty memory store in debug mode. This is to support a
            pre-populated store with 3rdpartytestwebkit.org and any custom domain already
            set as prevalent.
        (WebKit::ResourceLoadStatisticsPersistentStorage::setResourceLoadStatisticsDebugMode):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-07-20  Tim Horton  <timothy_horton@apple.com>

        Occasional crash under -[WKFormInputSession setSuggestions:]
        https://bugs.webkit.org/show_bug.cgi?id=187869
        <rdar://problem/41357063>

        Reviewed by Dean Jackson.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView inputDelegate]):
        Make inputDelegate weak.

2018-07-20  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Relax WebKit sandbox to permit proper App Store behavior
        https://bugs.webkit.org/show_bug.cgi?id=187831
        <rdar://problem/42047455>

        Reviewed by Alexey Proskuryakov.

        The Mac App Store is unable to perform some gift card redemption tasks on macOS due to missing sandbox permissions.
        This patch adds those permissions.

        * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:

2018-07-20  Brady Eidson  <beidson@apple.com>

        Add WKNavigation/WKNavigationAction related SPI.
        https://bugs.webkit.org/show_bug.cgi?id=187826

        Reviewed by Chris Dumez.

        * UIProcess/API/APINavigationAction.h:

        * UIProcess/API/C/mac/WKPagePrivateMac.h:
        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
        (WKPageLoadURLRequestReturningNavigation):

        * UIProcess/API/Cocoa/WKNavigationAction.mm:
        (-[WKNavigationAction _mainFrameNavigation]):
        * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:

        * UIProcess/API/glib/WebKitUIClient.cpp:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):

2018-07-20  Philippe Normand  <pnormand@igalia.com>

        [GTK][WPE] enable-media-capabilities websetting
        https://bugs.webkit.org/show_bug.cgi?id=187847

        Reviewed by Carlos Garcia Campos.

        Add a new WebKitSetting for the MediaCapabilities spec defined in:
        https://wicg.github.io/media-capabilities/

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty):
        (webKitSettingsGetProperty):
        (webkit_settings_class_init):
        (webkit_settings_get_enable_media_capabilities):
        (webkit_settings_set_enable_media_capabilities):
        * UIProcess/API/gtk/WebKitSettings.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitSettings.h:

2018-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.5 release.

        * gtk/NEWS: Add release notes for 2.21.5.
        * webkitglib-symbols.map: Remove symbols.

2018-07-19  Chris Dumez  <cdumez@apple.com>

        Null pointer dereference under WebPage::autofillLoginCredentials()
        https://bugs.webkit.org/show_bug.cgi?id=187823
        <rdar://problem/37152195>

        Reviewed by David Kilzer.

        Deal with m_assistedNode being null under WebPage::autofillLoginCredentials().

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::autofillLoginCredentials):

2018-07-19  Chris Dumez  <cdumez@apple.com>

        [ITP] Crash under ResourceLoadStatisticsMemoryStore::removeDataRecords()
        https://bugs.webkit.org/show_bug.cgi?id=187821
        <rdar://problem/42112693>

        Reviewed by David Kilzer.

        In two cases, ResourceLoadStatisticsMemoryStore (which lives on a background queue) needs to call WebPageProxy
        operations on the main thread and then dispatch back on the background queue when the operation completes.
        However, it is possible for the ResourceLoadStatisticsMemoryStore to get destroyed on the background queue
        during this time and we would then crash when trying to use m_workQueue to re-dispatch. To address the issue,
        I now ref the work queue in the lambda so that we're guaranteed to be able to re-dispatch to the background
        queue. When we're back on the background queue, we'll realize that weakThis in gone and we'll call the callback
        and return early.

        Note that I am not checking weakThis on the main thread as this would not be safe. weakThis should only be
        used on the background queue.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):

2018-07-19  Fujii Hironori  <Hironori.Fujii@sony.com>

        Move WebFrameListenerProxy to WebFramePolicyListenerProxy, its only subclass
        https://bugs.webkit.org/show_bug.cgi?id=187825
        <rdar://problem/42405081>

        Unreviewed build fix for Windows port.

        RefPtr.h(45): error C2027: use of undefined type 'API::Navigation'

        * UIProcess/win/WebInspectorProxyWin.cpp: Include "APINavigation.h".

2018-07-19  Alex Christensen  <achristensen@webkit.org>

        Move WebFrameListenerProxy to WebFramePolicyListenerProxy, its only subclass
        https://bugs.webkit.org/show_bug.cgi?id=187825

        Reviewed by Brady Eidson.

        * CMakeLists.txt:
        * UIProcess/API/C/WKPage.cpp:
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        * UIProcess/Automation/WebAutomationSession.cpp:
        * UIProcess/Cocoa/WebViewImpl.mm:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        * UIProcess/WebFormSubmissionListenerProxy.h:
        (WebKit::WebFormSubmissionListenerProxy::create):
        (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
        * UIProcess/WebFrameListenerProxy.cpp: Removed.
        * UIProcess/WebFrameListenerProxy.h: Removed.
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        (WebKit::WebFramePolicyListenerProxy::receivedPolicyDecision):
        (WebKit::WebFramePolicyListenerProxy::changeWebsiteDataStore):
        (WebKit::WebFramePolicyListenerProxy::invalidate):
        (WebKit::WebFramePolicyListenerProxy::isMainFrame const):
        (WebKit::WebFramePolicyListenerProxy::setNavigation):
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::listenerID const):
        (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::activePolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebInspectorProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        * UIProcess/mac/ViewGestureControllerMac.mm:
        * UIProcess/mac/WKInspectorViewController.mm:
        * WebKit.xcodeproj/project.pbxproj:

2018-07-19  Jon Lee  <jonlee@apple.com>

        Update iOS fullscreen alert text again
        https://bugs.webkit.org/show_bug.cgi?id=187797
        rdar://problem/42373783

        Reviewed by Jer Noble.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]):

2018-07-19  Brady Eidson  <beidson@apple.com>

        Add an SPI policy action to allow clients to explicitly ask for a new process on a navigation.
        https://bugs.webkit.org/show_bug.cgi?id=187789

        Reviewed by Andy Estes.

        At navigation policy time, when a client says "use/allow", they can now say "use/allow in a new process if possible"

        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (WKFramePolicyListenerUseInNewProcess):
        (WKFramePolicyListenerUseInNewProcessWithPolicies):
        * UIProcess/API/C/WKFramePolicyListener.h:

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

        * UIProcess/WebFrameListenerProxy.h:
        (WebKit::WebFrameListenerProxy::setApplyPolicyInNewProcessIfPossible):
        (WebKit::WebFrameListenerProxy::applyPolicyInNewProcessIfPossible const):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        (WebKit::WebProcessPool::processForNavigationInternal):
        * UIProcess/WebProcessPool.h:

2018-07-19  Youenn Fablet  <youenn@apple.com>

        Ensure experimentalPlugInSandboxProfilesEnabled is set on PluginProcess
        https://bugs.webkit.org/show_bug.cgi?id=187729

        Reviewed by Ryosuke Niwa.

        experimentalPlugInSandboxProfilesEnabled flag is used at initialization of the plugin process sandbox.
        This flag value should be set according to the value of this flag in the UIProcess.
        We set this value in the plugin process manager.
        At launch of the plugin process, this flag will also be passed to it so that it is set properly.

        * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
        (WebKit::PluginServiceInitializerDelegate::getExtraInitializationData):
        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializeProcess):
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins):
        (WKPreferencesGetPluginSandboxProfilesEnabledForAllPlugins):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setExperimentalPlugInSandboxProfilesEnabled:]):
        (-[WKPreferences _experimentalPlugInSandboxProfilesEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/Plugins/PluginProcessManager.h:
        (WebKit::PluginProcessManager::experimentalPlugInSandboxProfilesEnabled const):
        * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
        (WebKit::PluginProcessManager::setExperimentalPlugInSandboxProfilesEnabled):
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::platformGetLaunchOptions):

2018-07-18  Ricky Mondello  <rmondello@apple.com>

        Let clients override _WKThumbnailView's background color

        https://bugs.webkit.org/show_bug.cgi?id=187788

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/_WKThumbnailView.h: Declare a property.
        * UIProcess/API/Cocoa/_WKThumbnailView.mm: Define an ivar.
        (-[_WKThumbnailView updateLayer]): Consult the background color.
        (-[_WKThumbnailView setOverrideBackgroundColor:]): Notably, call -updateLayer.
        (-[_WKThumbnailView overrideBackgroundColor]): Added.

2018-07-18  Jer Noble  <jer.noble@apple.com>

        CRASH at WebKit: WebKit::WebFullScreenManagerProxy::saveScrollPosition
        https://bugs.webkit.org/show_bug.cgi?id=187769
        <rdar://problem/42160666>

        Reviewed by Tim Horton.

        Null-check all uses of _page and _manager in WKFullScreenWindowControllerIOS.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::WKWebViewState::applyTo):
        (WebKit::WKWebViewState::store):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):

2018-07-18  Chris Dumez  <cdumez@apple.com>

        WebContent crash in WebProcess::ensureNetworkProcessConnection
        https://bugs.webkit.org/show_bug.cgi?id=187791
        <rdar://problem/41995022>

        Reviewed by Ryosuke Niwa.

        If the WebProcessProxy::GetNetworkProcessConnection synchronous IPC between the WebProcess
        and the UIProcess succeeded but we received an invalid connection identifier, then try
        once more. This may indicate the network process has crashed, in which case it will be
        relaunched.

        * WebProcess/WebProcess.cpp:
        (WebKit::getNetworkProcessConnection):
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2018-07-18  Per Arne Vollan  <pvollan@apple.com>

        The WebContent process does not suspend when MiniBrowser is minimized.
        https://bugs.webkit.org/show_bug.cgi?id=187708

        Reviewed by Chris Dumez.

        Using the NSRunLoop runloop type prevents the WebContent process from suspending. Instead, use the new
        _WebKit runloop type. Also do not leak a boost to the WebContent process, since this also prevents the
        WebContent process from going to sleep. Calling SetApplicationIsDaemon prevents the WebContent process
        from being assigned the application process priority level. To block WindowServer connections, call
        CGSSetDenyWindowServerConnections(true) instead. Finally, App nap must be manually enabled, since the
        WebContent process is no longer a NSApplication.

        * Configurations/WebContentService.xcconfig:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::shouldLeakBoost):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateThrottleState):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2018-07-18  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit::SuspendedPageProxy::webProcessDidClose(WebKit::WebProcessProxy&)
        https://bugs.webkit.org/show_bug.cgi?id=187780

        Reviewed by Brady Eidson.

        Protect |this| in SuspendedPageProxy::webProcessDidClose() since the call to
        WebPageProxy::suspendedPageClosed() may destroy us before the method is done
        executing.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::webProcessDidClose):

2018-07-18  Jer Noble  <jer.noble@apple.com>

        -_beginAnimatedResizeWithUpdates: can leave view in bad state if called during an existing animation
        https://bugs.webkit.org/show_bug.cgi?id=187739

        Reviewed by Tim Horton.

        It's not enough to reset _dynamicViewportUpdateMode to NotResizing; other parts of the code
        check whether _resizeAnimationView is non-nil, the contentView may be hidden, etc. Add a new
        internal method _cancelAnimatedResize that cleans up state when a call to
        _beginAnimatedResizeWithUpdates: fails.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        (-[WKWebView _cancelAnimatedResize]):
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):

2018-07-18  Jer Noble  <jer.noble@apple.com>

        PiP from Element Fullscreen should match AVKit's behavior
        https://bugs.webkit.org/show_bug.cgi?id=187623

        Reviewed by Jon Lee.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
        (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
        (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
        (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
        (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
        (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
        (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
        (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
        (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
        (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
        (-[WKFullScreenViewController initWithWebView:]):
        (-[WKFullScreenViewController dealloc]):
        (-[WKFullScreenViewController videoControlsManagerDidChange]):
        (-[WKFullScreenViewController ensurePiPAnimator]):
        (-[WKFullScreenViewController willEnterPictureInPicture]):
        (-[WKFullScreenViewController didEnterPictureInPicture]):
        (-[WKFullScreenViewController failedToEnterPictureInPicture]):
        (-[WKFullScreenViewController loadView]):
        (-[WKFullScreenViewController viewWillAppear:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::videoControlsManagerDidChange):
        * UIProcess/mac/WKFullScreenWindowController.h:
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
        (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
        (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
        (-[WKFullScreenWindowController initWithWindow:webView:page:]):
        (-[WKFullScreenWindowController dealloc]):
        (-[WKFullScreenWindowController videoControlsManagerDidChange]):
        (-[WKFullScreenWindowController willEnterPictureInPicture]):

2018-07-18  Jer Noble  <jer.noble@apple.com>

        Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
        https://bugs.webkit.org/show_bug.cgi?id=187775
        <rdar://problem/42343229>

        Reviewed by Jon Lee.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):

2018-07-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add SPI to defer running async script until after document load
        https://bugs.webkit.org/show_bug.cgi?id=187748
        <rdar://problem/42317378>

        Reviewed by Ryosuke Niwa and Tim Horton.

        Add plumbing for a new ShouldDeferAsynchronousScriptsUntilAfterDocumentLoad configuration that determines
        whether async script execution should be deferred until document load (i.e. DOMContentLoaded). This
        configuration defaults to NO on all platforms. See WebCore ChangeLog for more detail.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad]):
        (-[WKWebViewConfiguration _setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2018-07-18  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Start tracking Nicosia layers in CoordinatedGraphicsState
        https://bugs.webkit.org/show_bug.cgi?id=187751

        Reviewed by Carlos Garcia Campos.

        Start including the Nicosia::CompositionLayer objects in the
        CoordinatedGraphicsState struct, under a separate NicosiaState struct.
        References to all the layers in a given scene are kept in a HashSet,
        and a separate reference to the root layer kept in a separate member
        variable.

        CompositingCoordinator now takes care of adding or removing the
        Nicosia::CompositionLayer objects to the NicosiaState's HashSet, as well
        as setting the root layer object when it's being initialized. Additions
        and removals of Nicosia::CompositionLayer correspond to the additions
        and removals of CoordinatedGraphicsLayer objects to the coordinator's
        m_registeredLayers HashMap.

        Upon each state commit that's done in CoordinatedGraphicsScene, the
        NicosiaState object will be copied into the member variable. Nothing is
        done yet with that state object, but in the near future it will be used
        to finally commit all the state details into the TextureMapper layers.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::commitSceneState):
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
        (WebKit::CompositingCoordinator::createGraphicsLayer):
        (WebKit::CompositingCoordinator::detachLayer):
        (WebKit::CompositingCoordinator::attachLayer):

2018-07-17  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (iOS 12): Can't scroll to the bottom of the page in WKWebView while keyboard is up on pages with viewport-fit=cover
        https://bugs.webkit.org/show_bug.cgi?id=187743
        <rdar://problem/41651546>

        Reviewed by Simon Fraser.

        UIScrollView's _systemContentInset no longer includes keyboard insets
        in apps linked on iOS 12+ when contentInsetAdjustmentBehavior is None.

        We use contentInsetAdjustmentBehavior to control adjustment of other
        sources of insets, but expect the keyboard inset to always be applied.

        For now, barring a more comprehensive way to separate insets, re-add
        the keyboard inset in cases where UIKit does not.

        * Platform/spi/ios/UIKitSPI.h:
        Move some IPI to the SPI header.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _haveSetObscuredInsets]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        Make it possible for WKScrollView to check whether the client is overriding insets.

        * UIProcess/Cocoa/VersionChecks.h:
        Add a linkedOnOrAfter() version for this new UIScrollView behavior.

        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):
        Force WKScrollView's scroll indicator to always respect insets. We always
        want the scroll bars in a sensible place, even if the page sets
        viewport-fit=cover.

        (-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):
        Store the bottom inset due to the keyboard.

        (-[WKScrollView _systemContentInset]):
        Add the bottom inset due to the keyboard to the systemContentInset 
        in all cases where UIKit does not. Also avoid adding it if the client takes
        full control of the insets, because the only client that does (MobileSafari)
        includes insets-due-to-keyboard in their custom insets.

2018-07-17  Chris Dumez  <cdumez@apple.com>

        RELEASE_ASSERT() under IPC::Connection::sendSync() from PluginProxy::supportsSnapshotting()
        https://bugs.webkit.org/show_bug.cgi?id=187740
        <rdar://problem/41818955>

        Reviewed by Youenn Fablet.

        As per the crash trace, PluginProxy::supportsSnapshotting() can be called during layout but does synchronous
        IPC. As a result, we need to prevent WebCore re-entrancy by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply
        sendOption.

        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::supportsSnapshotting const):

2018-07-17  Chris Dumez  <cdumez@apple.com>

        Turn on PSON in WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=186542

        Reviewed by Brady Eidson.

        Fix leaking of pre-warmed WebContent processes which became obvious when turning
        on process-swap-on-navigation by default in WebKitTestRunner. The issue was that
        the WebProcessPool holds a strong reference to its WebProcessProxy objects via
        m_processes data members. In turn, WebProcessProxy objects hold a strong reference
        to their WebProcessPool via their m_processPool data member. This reference cycle
        normally gets broken by calling WebProcessProxy::shutDown() which removes the
        WebProcessProxy objects from its WebProcessPool's m_processes container.
        WebProcessProxy::shutDown() normally gets called when a WebProcessProxy no longer
        has any WebPageProxy objects. However, in the case of unused pre-warmed
        WebProcessProxy objects, those never get any page and therefore we'd never break
        the reference cycle. To address the issue, pre-warmed WebProcessProxy objects
        now only hold a Weak reference to their process pool, only regular WebProcessProxy
        objects hold a strong reference to their pool.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::~WebProcessPool):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::WebProcessProxy::getLaunchOptions):
        (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::processPool):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::WeakOrStrongPtr):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::setIsWeak):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::get const):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::operator-> const):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::operator* const):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::operator bool const):
        (WebKit::WebProcessProxy::WeakOrStrongPtr::updateStrongReference):

2018-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add an SPI hook to allow clients to yield document parsing and script execution
        https://bugs.webkit.org/show_bug.cgi?id=187682
        <rdar://problem/42207453>

        Reviewed by Ryosuke Niwa.

        Add hooks to WKDOMDocument to create and return an internal WKDOMDocumentParserYieldToken object, whose lifetime
        is tied to a document parser yield token. See WebCore ChangeLog for more detail.

        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
        (-[WKDOMDocumentParserYieldToken initWithDocument:]):
        (-[WKDOMDocument parserYieldToken]):

2018-07-17  John Wilander  <wilander@apple.com>

        Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatisticsPrevalentResource(), setStatisticsVeryPrevalentResource(), setStatisticsHasHadUserInteraction(), and setStatisticsHasHadNonRecentUserInteraction()
        https://bugs.webkit.org/show_bug.cgi?id=187710
        <rdar://problem/42252757>

        Reviewed by Chris Dumez.

        These changes are to back the completion handler functionality of
        TestRunner functions:
        - setStatisticsLastSeen(),
        - setStatisticsPrevalentResource(),
        - setStatisticsVeryPrevalentResource(),
        - setStatisticsHasHadUserInteraction(), and
        - setStatisticsHasHadNonRecentUserInteraction().

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsLastSeen):
        (WKWebsiteDataStoreSetStatisticsPrevalentResource):
        (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
        (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
        (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-07-16  Simon Fraser  <simon.fraser@apple.com>

        Add color filter for transforming colors in Dark Mode
        https://bugs.webkit.org/show_bug.cgi?id=187717

        Reviewed by Dean Jackson.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<FilterOperation>::encode):
        (IPC::decodeFilterOperation):

2018-07-16  Tim Horton  <timothy_horton@apple.com>

        Black flash in content area when returning to Mail
        https://bugs.webkit.org/show_bug.cgi?id=187719
        <rdar://problem/42165340>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
        This still reproduces sometimes even after r233723, because:

        If a pending commit arrives after ApplicationDidEnterBackground (when we
        ask the web content process to freeze the layer tree), and after
        ApplicationDidFinishSnapshottingAfterEnteringBackground (when we hide
        WKContentView), but before the process sleeps, it will cause WKContentView
        to be unhidden (potentially including layers with empty surfaces as contents).
        Nothing will re-hide WKContentView. Instead, we should wait for the next
        *pending* commit, which will necessarily not come until after the application
        returns to the foreground because of the strict IPC ordering between
        the message that freezes the layer tree and the "next commit" mechanism.

2018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
        https://bugs.webkit.org/show_bug.cgi?id=187375

        Reviewed by Simon Fraser.

        For immediate-paint transaction, we should force all the images which are 
        pending decoding to be repainted before building this transaction.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::updateControlTints):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::paint):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):

2018-07-11  Dean Jackson  <dino@apple.com>

        Allow removal of white backgrounds
        https://bugs.webkit.org/show_bug.cgi?id=187574
        <rdar://problem/41146792>

        Reviewed by Simon Fraser.

        Add a new WebPreference for punching out white backgrounds.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode):
        (WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _punchOutWhiteBackgroundsInDarkMode]):
        (-[WKWebViewConfiguration _setPunchOutWhiteBackgroundsInDarkMode:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2018-07-16  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][macOS] Add suggestions UI for TextFieldInputTypes
        https://bugs.webkit.org/show_bug.cgi?id=186531

        Reviewed by Tim Horton.

        Created WebDataListSuggestionsDropdownMac as a wrapper around the suggestions
        view. The suggestions for TextFieldInputTypes are displayed using an NSTableView
        in it's own child window. This is done so that suggestions can be presented
        outside of the page if the parent window's size is too small. The maximum number
        of suggestions that are visible at one time is 6, with additional suggestions made
        available by scrolling.

        Suggestions in the view can be selected via click or by using arrow keys. If the
        input element associated with the suggestions is blurred, or the page is moved in
        any way, the suggestions view is hidden.

        Added IPC messages to the UIProcess to enable the display of the suggestions view.
        This required a new ArgumentCoder for DataListSuggestionInformation.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<DataListSuggestionInformation>::encode):
        (IPC::ArgumentCoder<DataListSuggestionInformation>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebDataListSuggestionsDropdown.cpp: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
        (WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
        (WebKit::WebDataListSuggestionsDropdown::~WebDataListSuggestionsDropdown):
        (WebKit::WebDataListSuggestionsDropdown::close):
        * UIProcess/WebDataListSuggestionsDropdown.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
        (WebKit::WebDataListSuggestionsDropdown::Client::~Client):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::viewWillStartLiveResize):
        (WebKit::WebPageProxy::viewDidLeaveWindow):
        (WebKit::WebPageProxy::handleWheelEvent):
        (WebKit::WebPageProxy::setPageZoomFactor):
        (WebKit::WebPageProxy::setPageAndTextZoomFactors):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::WebPageProxy::pageDidScroll):
        (WebKit::WebPageProxy::showDataListSuggestions):
        (WebKit::WebPageProxy::handleKeydownInDataList):
        (WebKit::WebPageProxy::endDataListSuggestions):
        (WebKit::WebPageProxy::didCloseSuggestions):
        (WebKit::WebPageProxy::didSelectOption):
        (WebKit::WebPageProxy::resetState):
        (WebKit::WebPageProxy::closeOverlayedViews):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: Added.
        (WebKit::WebDataListSuggestionsDropdownMac::create):
        (WebKit::WebDataListSuggestionsDropdownMac::~WebDataListSuggestionsDropdownMac):
        (WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
        (WebKit::WebDataListSuggestionsDropdownMac::show):
        (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
        (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
        (WebKit::WebDataListSuggestionsDropdownMac::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionsDropdownMac::close):
        (-[WKDataListSuggestionCell initWithFrame:]):
        (-[WKDataListSuggestionCell setText:]):
        (-[WKDataListSuggestionCell setActive:]):
        (-[WKDataListSuggestionCell drawRect:]):
        (-[WKDataListSuggestionCell mouseEntered:]):
        (-[WKDataListSuggestionCell mouseExited:]):
        (-[WKDataListSuggestionCell acceptsFirstResponder]):
        (-[WKDataListSuggestionTable initWithElementRect:]):
        (-[WKDataListSuggestionTable setVisibleRect:]):
        (-[WKDataListSuggestionTable currentActiveRow]):
        (-[WKDataListSuggestionTable setActiveRow:]):
        (-[WKDataListSuggestionTable reload]):
        (-[WKDataListSuggestionTable acceptsFirstResponder]):
        (-[WKDataListSuggestionTable enclosingScrollView]):
        (-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]):
        (-[WKDataListSuggestionsView initWithInformation:inView:]):
        (-[WKDataListSuggestionsView currentSelectedString]):
        (-[WKDataListSuggestionsView updateWithInformation:]):
        (-[WKDataListSuggestionsView moveSelectionByDirection:]):
        (-[WKDataListSuggestionsView invalidate]):
        (-[WKDataListSuggestionsView dropdownRectForElementRect:]):
        (-[WKDataListSuggestionsView showSuggestionsDropdown:]):
        (-[WKDataListSuggestionsView selectedRow:]):
        (-[WKDataListSuggestionsView numberOfRowsInTableView:]):
        (-[WKDataListSuggestionsView tableView:heightOfRow:]):
        (-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
        (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionPicker::didSelectOption):
        (WebKit::WebDataListSuggestionPicker::didCloseSuggestions):
        (WebKit::WebDataListSuggestionPicker::close):
        (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h:

2018-07-16  Jeremy Jones  <jeremyj@apple.com>

        Fullscreen requires active document.
        https://bugs.webkit.org/show_bug.cgi?id=186226
        rdar://problem/36187413

        Reviewed by Jer Noble.

        This change guarantees the document to be visible for both element fullscreen and video fullscreen.

        User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
        because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
        be hidden.

        Document::hidden() can't be relied upon because it won't update while JavaScript spins.

        This change adds a sync call to the UI process to get the current UI visibility state.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getIsViewVisible):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::isViewVisible):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2018-07-16  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempting to dismiss it
        https://bugs.webkit.org/show_bug.cgi?id=187706
        <rdar://problem/42137088>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        Remove an unused member.

        (-[WKFileUploadPanel _dismissDisplayAnimated:]):
        Allow us to dismiss the camera view controller in addition to the menu.

2018-07-16  Alex Christensen  <achristensen@webkit.org>

        Reduce size of NetworkLoadMetrics and therefore ResourceResponse
        https://bugs.webkit.org/show_bug.cgi?id=187671

        Reviewed by Darin Adler.

        * Shared/WebCoreArgumentCoders.h:

2018-07-16  Sihui Liu  <sihui_liu@apple.com>

        IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
        https://bugs.webkit.org/show_bug.cgi?id=187631
        <rdar://problem/42164227>

        Reviewed by Brady Eidson.

        We need to return all origins, both openingOrigin and mainFrameOrigin, of IndexedDB so users
        could be better aware of which origins are using databases and decide what they want to 
        remove.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::indexedDatabaseOrigins):
        * StorageProcess/StorageProcess.h:

2018-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] http/tests/misc/bubble-drag-events.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=182352

        Reviewed by Youenn Fablet.

        PingLoad is not refcounted and deletes itself when the load finishes. The problem is that the network data
        task can also finish the load, causing the PingLoad to be deleted early. We tried to fix it in r233032 in the
        network data task soup implementation, but it caused regressions.

        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveChallenge): Create a weak ref for the ping load before calling the operation completion
        handler and return early after the completion handler if it was deleted.
        (WebKit::PingLoad::didReceiveResponseNetworkSession): Ditto.
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::continueAuthenticate): Revert r233032.

2018-07-13  Timothy Hatcher  <timothy@apple.com>

        Add _drawsBackground to WKWebViewConfiguration.
        https://bugs.webkit.org/show_bug.cgi?id=187665
        rdar://problem/42182268

        Reviewed by Tim Horton.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const): Copy m_drawsBackground, and some missing values.
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::drawsBackground const): Added.
        (API::PageConfiguration::setDrawsBackground): Added.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Transfer _drawsBackground to page config.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]): Set _drawsBackground to YES.
        (-[WKWebViewConfiguration encodeWithCoder:]): Encode _drawsBackground.
        (-[WKWebViewConfiguration initWithCoder:]): Decode _drawsBackground.
        (-[WKWebViewConfiguration copyWithZone:]): Copy _drawsBackground.
        (-[WKWebViewConfiguration _drawsBackground]): Added.
        (-[WKWebViewConfiguration _setDrawsBackground:]): Added.
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp: Set m_drawsBackground based on configuration.

2018-07-13  Tim Horton  <timothy_horton@apple.com>

        WebKit sometimes holds WiFi/BT assertions while the Networking process is suspended
        https://bugs.webkit.org/show_bug.cgi?id=187662
        <rdar://problem/41999448>

        Reviewed by Chris Dumez.

        Inform WiFiAssertions when the Networking process is first going into the background,
        so it has a chance of dropping its assertions even in cases where the system
        suspends the process before we receive prepareToSuspend.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processDidTransitionToForeground):
        (WebKit::NetworkProcess::processDidTransitionToBackground):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendProcessDidTransitionToForeground):
        (WebKit::NetworkProcessProxy::sendProcessDidTransitionToBackground):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::updateProcessAssertions):
        Plumb the foreground/background transition to NetworkProcess.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        Make use of SuspensionReason to explain to WiFiAssertions the
        difference between prepareToSuspend and didTransitionToBackground,
        so that it can adjust the timing of dropping the assertion.

2018-07-13  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r231676): watchOS WebKit usually doesn't load in the background
        https://bugs.webkit.org/show_bug.cgi?id=187663
        <rdar://problem/42181185>

        Reviewed by Chris Dumez.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackground):
        "Screen lock" is very aggressive on watchOS; we want to do our usual
        30 seconds of loading in the background when you drop your wrist,
        so disable this power optimization on that platform.

2018-07-13  Chris Dumez  <cdumez@apple.com>

        WebResourceLoader may try to send a IPC with a destination ID that is 0
        https://bugs.webkit.org/show_bug.cgi?id=187654
        <rdar://problem/39265927>

        Reviewed by Brady Eidson.

        WebResourceLoader may try to send a IPC with a destination ID that is 0 according to release
        assertion hits we see in the wild. This can lead to HashMap corruption on recipient side when
        trying to lookup a key that is 0.

        As per the crash traces, we see it starts from WebLoaderStrategy::internallyFailedLoadTimerFired()
        which is likely due to the Network process crashing. WebLoaderStrategy::networkProcessCrashed()
        calls scheduleInternallyFailedLoad() on each ResourceLoader and clears the WebResourceLoaders in
        m_webResourceLoaders. When a ResourceLoader is cancelled (marked as failed), we clear its identifier
        and we normally null out the WebLoaderStrategy's coreLoader. However, if we cannot find the
        WebResourceLoader in m_webResourceLoaders (because that map was already cleared) then the
        WebResourceLoader's coreLoader may not get nulled out, even if the coreLoader's identifier has
        been reset. We have 2 lambdas in WebResourceLoader which keep the WebResourceLoader alive and
        try to send IPC and are merely doing a null check on the coreLoader before trying to send the
        IPC.

        To address the issue, we now clear the WebResourceLoader's coreLoader in
        WebLoaderStrategy::networkProcessCrashed(). For robustness, we also check that a coreLoader's
        identifier is not 0 before trying to send IPC.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::networkProcessCrashed):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        (WebKit::WebResourceLoader::didReceiveResponse):

2018-07-13  Zach Li  <zachli@apple.com>

        Allow BOCOM and ABC plug-ins to run unsandboxed
        https://bugs.webkit.org/show_bug.cgi?id=187652
        rdar://problem/42149182

        Reviewed by Youenn Fablet.

        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):

2018-07-13  Chris Dumez  <cdumez@apple.com>

        Add more threading release assertions
        https://bugs.webkit.org/show_bug.cgi?id=187647

        Reviewed by Alex Christensen.

        Add more threading release assertions to help debug <rdar://problem/39265927>.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::m_isInPrewarmedPool):
        (WebKit::WebProcessProxy::~WebProcessProxy):
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::didFinishLaunching):

2018-07-13  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] Add windows storage process connection implementation
        https://bugs.webkit.org/show_bug.cgi?id=187531

        Reviewed by Fujii Hironori.

        * NetworkProcess/NetworkProcess.cpp:
        * Platform/IPC/Attachment.h:
        * StorageProcess/StorageProcess.cpp:
        * UIProcess/Storage/StorageProcessProxy.cpp:

2018-07-13  Dan Bernstein  <mitz@apple.com>

        [macOS] REGRESSION (r233536): Development WebContent service got opted back into Library Validation
        https://bugs.webkit.org/show_bug.cgi?id=187640

        Reviewed by Daniel Bates.

        * Scripts/process-webcontent-entitlements.sh: Add the
          com.apple.security.cs.disable-library-validation to the Development service regardless of
          whether restricted entitlements are to be used, because that entitlement is not restricted.

2018-07-13  Chris Dumez  <cdumez@apple.com>

        NetworkConnectionToWebProcess::m_networkResourceLoaders should use Ref<> for its values
        https://bugs.webkit.org/show_bug.cgi?id=187629

        Reviewed by Youenn Fablet.

        NetworkConnectionToWebProcess::m_networkResourceLoaders should use Ref<> for its values
        since they cannot be null.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:

2018-07-12  Alex Christensen  <achristensen@webkit.org>

        Reduce size of WebCore::URL
        https://bugs.webkit.org/show_bug.cgi?id=186820

        Reviewed by Yusuke Suzuki and Youenn Fablet.

        * NetworkProcess/cache/NetworkCacheStorage.h:
        Increment cache version because of URL encoding change.

2018-07-12  Chris Dumez  <cdumez@apple.com>

        [Cocoa] Make sure NetworkProcess::createNetworkConnectionToWebProcess() returns a valid mach port
        https://bugs.webkit.org/show_bug.cgi?id=187625

        Reviewed by Youenn Fablet.

        Make sure NetworkProcess::createNetworkConnectionToWebProcess() returns a valid mach port to help
        debug <rdar://problem/41995022>.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):

2018-07-12  Chris Dumez  <cdumez@apple.com>

        PingLoad does not need to ref the NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=187624

        Reviewed by Youenn Fablet.

        PingLoad does not need to ref the NetworkConnectionToWebProcess and keep it alive longer than it needs to be.
        Instead, ref the IPC::Connection which is lighter weight and gets invalidated when the NetworkConnectionToWebProcess
        is destroyed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:

2018-07-12  Brady Eidson  <beidson@apple.com>

        Make process-swap-on-navigation an experimental feature.
        <rdar://problem/41995053> and https://bugs.webkit.org/show_bug.cgi?id=187558

        Reviewed by Chris Dumez.

        * Shared/WebPreferences.yaml:
        
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetProcessSwapOnNavigationEnabled):
        (WKPreferencesGetProcessSwapOnNavigationEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
        
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage): If the new web page has PSON enabled via WebPreferences,
          absorb that setting into this process pool's configuration.

2018-07-12  Chris Dumez  <cdumez@apple.com>

        Simplify code in NetworkConnectionToWebProcess::didReceiveMessage()
        https://bugs.webkit.org/show_bug.cgi?id=187621

        Reviewed by Youenn Fablet.

        Simplify code in NetworkConnectionToWebProcess::didReceiveMessage() by not using HashMap iterators and
        calling get() directly.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

2018-07-12  Chris Dumez  <cdumez@apple.com>

        Make sure WebProcess::ensureNetworkProcessConnection() is always called on the main thread
        https://bugs.webkit.org/show_bug.cgi?id=187607

        Reviewed by Alex Christensen.

        Add release assertion to make sure that ensureNetworkProcessConnection() is always called on the main
        thread. Calling it on a background thread would not be safe. It would not be safe because:
        1. We check if we have a network process connection and then create one if we don't without any locking.
        2. It is not safe to construct or use a NetworkProcessConnection object from a non-main thread

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2018-07-12  Chris Dumez  <cdumez@apple.com>

        Assert that the IPC::Connection is valid in Connection::dispatchMessage(Decoder&)
        https://bugs.webkit.org/show_bug.cgi?id=187617

        Reviewed by Youenn Fablet.

        Assert that the IPC::Connection is valid in Connection::dispatchMessage(Decoder&) as
        m_client would be stale otherwise.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::dispatchMessage):

2018-07-12  Youenn Fablet  <youenn@apple.com>

        Add a FrameLoaderClient willInjectUserScriptForFrame callback
        https://bugs.webkit.org/show_bug.cgi?id=187565

        Reviewed by Alex Christensen.

        Introduce a new WKBundlePageLoaderClient callback that is called everytime a user script is injected.
        Implement WebFrameLoaderClient::willInjectUserScript by calling this new callback.

        * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
        (API::InjectedBundle::PageLoaderClient::willInjectUserScriptForFrame):
        * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (setUpPageLoaderClient):
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
        (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame):
        (WebKit::InjectedBundlePageLoaderClient::willInjectUserScriptForFrame):
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::willInjectUserScript):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2018-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] When bringing MobileSafari to the foreground, images are drawn asynchronously after removing a snapshot that included them
        https://bugs.webkit.org/show_bug.cgi?id=187374
        <rdar://problem/41249545>

        Reviewed by Tim Horton.

        UIProcess should block committing all the layer tree transactions for 
        immediate update until it receives a one whose activityStateChangeID is
        greater than or equal to the one it sends with SetActivityState message.

        * Scripts/webkit/messages.py:
        Fix the messages code generator to include DrawingAreaInfo.h for the WebKit
        typedef ActivityStateChangeID.

        * Shared/DrawingAreaInfo.h:
        Define ActivityStateChangeID to be uint64_t. Add a definition for the case
        when the UIProcess won't be blocked for a reply back from the WebProcess.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::activityStateChangeID const):
        (WebKit::RemoteLayerTreeTransaction::setActivityStateChangeID):
        Add a member for activityStateChangeID in the LayerTreeTransaction.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::encode const):
        (WebKit::RemoteLayerTreeTransaction::decode):
        Make LayerTreeTransaction know how to encode and decode activityStateChangeID.

        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
        Make the DrawingArea in the UIProcess wait the layer tree with a certain
        activityStateChangeID.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::waitForDidUpdateActivityState):
        If m_activityStateChangeWantsSynchronousReply is true, generate a new 
        activityStateChangeID and send it in the SetActivityState message.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::takeNextActivityStateChangeID):
        A simple way to generate a new activityStateChangeID.

        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
        Fix the UIProcess functions' prototype for Mac.

        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        (WebKit::AcceleratedDrawingArea::activityStateDidChange):
        * WebProcess/WebPage/AcceleratedDrawingArea.h:
        Fix the UIProcess functions' prototype for GTK.

        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::activityStateDidChange):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        Replace wantsDidUpdateActivityState with activityStateChangeID. Treat
        activityStateChangeID == ActivityStateChangeAsynchronous as if 
        wantsDidUpdateActivityState == false.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        Make the WebPrcess pass the activityStateChangeID which it receives from
        the SetActivityState message to the LayerTreeTransaction.

        (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
        When receiving the SetActivityState, treat activityStateChangeID !=
        ActivityStateChangeAsynchronous as if wantsDidUpdateActivityState == true.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reinitializeWebPage):
        (WebKit::WebPage::setActivityState):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        Replace the boolean wantsDidUpdateActivityState with activityStateChangeID
        in the SetActivityState message.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
        (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
        Fix the WebProcess functions' prototype for Mac.

2018-07-12  Antti Koivisto  <antti@apple.com>

        REGRESSION (r232356): After zooming a page in and out, it's possible to temporarily have missing tiles (google.com, apple.com)
        https://bugs.webkit.org/show_bug.cgi?id=187553
        <rdar://problem/41863803>

        Reviewed by Simon Fraser.

        We ignore zoom scale from UI process if it doesn't match the last remote layer tree transaction. However nothing
        guarantees that we receive the real scale again until user interacts with the page. This means the web process
        scale and the UI process scale can be wildly out of sync.

        This problem becomes more likely to be visible when
        - we are under memory pressure so we don't update tiles during zooming and rely on the one final update afterwards
        - the page generates lots of layer tree transactions

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

        Remember the last transaction where we actually changed the page scale.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::scaleFromUIProcess const):

        Only reject the UI process scale if there has been a scale changing transaction meanwhile.
        The transaction id test was added in r218149 and the problem it fixed remains fixed. This change also matches better
        what it was purpoted to implement.

2018-07-12  Megan Gardner  <megan_gardner@apple.com>

        Keep Selections within Shadow DOM boundaries
        https://bugs.webkit.org/show_bug.cgi?id=187556
        <rdar://problem/41664567>

        Reviewed by Ryosuke Niwa.

        Update rangeForPosition to take into account both editing and shadow DOM boundries.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeForPoint):
        (WebKit::WebPage::updateSelectionWithTouches):
        (WebKit::rangeForPosition): Deleted.
        
2018-07-12  Jer Noble  <jer.noble@apple.com>

        REGRESSION (r230163): Videos cannot be seen full screen in Complete Anatomy app
        https://bugs.webkit.org/show_bug.cgi?id=187527
        <rdar://problem/40511527>

        Reviewed by Ryosuke Niwa.

        Do not enable element fullscreen mode unless apps specifically opt-in. The Fullscreen API is
        an experimental feature on iOS, but not on Mac, but we can't simply not return the ExperimentalFeature
        object from the list of experimental features, as this keeps Safari from being able to apply a
        NSUserDefault value for that feature. Instead, add a property to API::ExperimentalFeature and
        _WKExperimentalFeature called "hidden", which signals to clients whether to display the feature
        in their UI.

        * Scripts/GeneratePreferences.rb:
        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/APIExperimentalFeature.cpp:
        (API::ExperimentalFeature::create):
        (API::ExperimentalFeature::ExperimentalFeature):
        * UIProcess/API/APIExperimentalFeature.h:
        * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
        * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
        (-[_WKExperimentalFeature isHidden]):

2018-07-12  Alexey Proskuryakov  <ap@apple.com>

        [Mac] Run Unlock Keychain more reliably
        https://bugs.webkit.org/show_bug.cgi?id=187604

        Reviewed by Dan Bernstein.

        Move unlocking to a separate target, and make it a dependency for all targets that
        produce binaries.
        
        This is more than strictly required to fix the build, but this way, we won't need
        to remember about keychain when project structure changes. Another consideration that
        wasn't initially apparent to me is that is should be possible to build any target,
        not just "All", so projects aren't necessarily built in the same order even now.

        * WebKit.xcodeproj/project.pbxproj: 

2018-07-12  Per Arne Vollan  <pvollan@apple.com>

        Add compile guard for enabling NSRunLoop in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=187563

        Reviewed by Chris Dumez.

        Also, replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) where appropriate.

        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Shared/ChildProcess.h:
        * Shared/mac/ChildProcessMac.mm:
        * Shared/mac/HangDetectionDisablerMac.mm:
        (WebKit::setClientsMayIgnoreEvents):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::shouldLeakBoost):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::PDFPlugin):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::stopRunLoop):

2018-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Pass the backend library name as command line parameter to the web process
        https://bugs.webkit.org/show_bug.cgi?id=186841

        Reviewed by Žan Doberšek.

        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess): Add --backend-library parameter when launching the web process.
        * WebProcess/wpe/WebProcessMainWPE.cpp: Call wpe_loader_init() with the library passed as --backend-library parameter.

2018-07-11  Jon Lee  <jonlee@apple.com>

        Update iOS fullscreen alert text
        https://bugs.webkit.org/show_bug.cgi?id=187576
        rdar://problem/42052284

        Reviewed by Ryosuke Niwa.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]): Update text and string keys.

2018-07-11  Aditya Keerthi  <akeerthi@apple.com>

        REGRESSION (231276): Attempting to copy an image fails
        https://bugs.webkit.org/show_bug.cgi?id=187212
        <rdar://problem/41540074>

        Reviewed by Ryosuke Niwa.

        r210683 introduced logic to prevent file URLs from being copied to the clipboard
        in unexpected cases. In order to achieve this functionality,
        checkURLReceivedFromWebProcess was called on all items in the pathnames array
        passed into WebPasteboardProxy::setPasteboardPathnamesForType. However, this
        method is a misnomer, as the pathnames array always contains exactly one URL and
        one title for the URL.

        Renamed methods to make it clear that one URL and one title are being passed in
        and updated logic to ensure that checkURLReceivedFromWebProcess is only called
        on the URL and not the title.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PasteboardURL>::encode):
        (IPC::ArgumentCoder<PasteboardURL>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardURL):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::setURL):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-07-11  Alex Christensen  <achristensen@webkit.org>

        Add SPI for immediate injection of user scripts
        https://bugs.webkit.org/show_bug.cgi?id=173342
        <rdar://problem/29202285>

        Reviewed by Brady Eidson, Youenn Fablet, and Geoff Garen.

        * UIProcess/API/C/WKPageGroup.cpp:
        (WKPageGroupAddUserScript):
        * UIProcess/API/C/WKUserContentControllerRef.cpp:
        (WKUserContentControllerAddUserScript):
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        (-[WKUserContentController addUserScript:]):
        (-[WKUserContentController _addUserScriptImmediately:]):
        * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addUserScript):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserScripts):
        (WebKit::WebUserContentController::addUserScriptInternal):
        If we are to inject the script internally, inject it into the appropriate pages.
        If we're injecting into the top frame only, there's no need to traverse the frame tree.
        (WebKit::WebUserContentController::addUserScript):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/UserContent/WebUserContentController.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_cpuLimit):

2018-07-11  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Address a possible cause of missing tiles
        https://bugs.webkit.org/show_bug.cgi?id=187570
        rdar://problem/40941118

        Reviewed by Tim Horton.
        
        If the web process crashes, it's possible for the user to trigger a scroll before
        the process is re-launched. The pre-commit handler will bail early on the _isValid
        check without clearing _hasScheduledVisibleRectUpdate, so that remains YES and we
        get stuck doing no more visible content rect updates.
        
        Fix by adding -[WKWebView _didRelaunchProcess] (WKContentView got this already), and
        in that clear state that could have been set in the UI process while the web process
        connection was invalid.
        
        Also add more release logging around process termination, crash and relaunch.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        (-[WKWebView _didRelaunchProcess]):
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
        (-[WKWebView _updateVisibleContentRects]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::processDidTerminate):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didClose):
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didRelaunchProcess):

2018-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Release logging dumps "Cleaning up dragging state…" every time gesture recognizers are reset in WKContentView
        https://bugs.webkit.org/show_bug.cgi?id=187562

        Reviewed by Tim Horton.

        Tweaks up a release logging statement, such that it only logs when performing a drag or drop.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpDragSourceSessionState]):

2018-07-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233741.
        https://bugs.webkit.org/show_bug.cgi?id=187568

        "WKTR vs exp features, booooooo" (Requested by bradee-oh on
        #webkit).

        Reverted changeset:

        "Make process-swap-on-navigation an experimental feature."
        https://bugs.webkit.org/show_bug.cgi?id=187558
        https://trac.webkit.org/changeset/233741

2018-07-11  Brady Eidson  <beidson@apple.com>

        Make process-swap-on-navigation an experimental feature.
        <rdar://problem/41995053> and https://bugs.webkit.org/show_bug.cgi?id=187558

        Reviewed by Geoff Garen.

        * Shared/WebPreferences.yaml:

        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage): If the new web page has PSON enabled via WebPreferences,
          absorb that setting into this process pool's configuration.

2018-07-11  Jer Noble  <jer.noble@apple.com>

        Disable all network caching for HLS streams.
        https://bugs.webkit.org/show_bug.cgi?id=187544
        <rdar://problem/41863600>

        Reviewed by Chris Dumez.

        Revert the behavior added in r215263 where Media responses are cached if they are from
        a resource whose expected content length is <4MB.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::makeStoreDecision):
        (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange): Deleted.

2018-07-11  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] AC for fixed-position elements is not enabled
        https://bugs.webkit.org/show_bug.cgi?id=187514

        Reviewed by Carlos Garcia Campos.

        Enable accelerated compositing for fixed-position elements when using
        AcceleratedDrawingArea and AC is force-enabled. This effectively enables
        this option for the WPE port which is using the AcceleratedDrawingArea
        implementation and not DrawingAreaImpl like the GTK+ port.

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

2018-07-11  Christopher Reid  <chris.reid@sony.com>

        [Win][WebKit] Disable accelerated compositing until it is supported
        https://bugs.webkit.org/show_bug.cgi?id=187503

        Reviewed by Žan Doberšek.

        * UIProcess/win/WebView.cpp:

2018-07-10  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r233480): Mail contents flash black when activating
        https://bugs.webkit.org/show_bug.cgi?id=187504
        <rdar://problem/41752351>

        Reviewed by Simon Fraser.

        The sequence of events to reproduce the bug originally fixed in r203371
        is either:

        A) the simple background/foreground case

        1] app begins to suspend
        2] app suspension snapshots are taken
        3] WKWebView's surfaces are marked volatile
        4] app completes suspension
            ... time goes by ...
        5] WKWebView's volatile surfaces are purged
            ... time goes by ...
        6] app begins to resume, shows (good) suspension snapshot
        7] app removes suspension snapshot
        8] WKWebView has sublayers with purged (black) surfaces
        9] WKWebView sublayers are repaired by a new commit with nonvolatile surfaces

        B) the re-snapshot while in the background case

        1] app begins to suspend
        2] app suspension snapshots are taken
        3] WKWebView's surfaces are marked volatile
        4] app completes suspension
        ... time goes by ...
        5] WKWebView's volatile surfaces are purged
        ... time goes by ...
        6] app wakes up in the background to update its snapshots
        7] in the updated snapshots, WKWebView has sublayers with purged (black) surfaces
        ... time goes by ...
        8] app begins to resume, shows (bad) suspension snapshot
        9] WKWebView presents layers with purged (black) surfaces until new commit fixes them
        10] WKWebView sublayers are repaired by a new commit with nonvolatile surfaces

        WebKit's current approach to fix this problem is simply to hide the
        WKWebView's sublayers at some point after A2/B2 (suspension snapshots),
        but before A8/B7 (the first time the empty layers would be presented
        or snapshotted).

        Previously, we did this by hiding the layers when the window's CAContext
        was created, which happened early enough in both cases (at A6/B6).
        However, that notification was removed underneath us at some point.

        However, in looking at the timelines, there's a better place to do this:
        immediately after marking the surfaces volatile (A3/B3), which is always
        strictly after the app suspension snapshots are taken, and also always
        before the freshly-made-volatile layers could be presented or snapshotted.

        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::applicationDidCreateWindowContext): Deleted.
        * UIProcess/ios/WKApplicationStateTrackingView.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]): Deleted.
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _applicationDidCreateWindowContext]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
        Remove the didCreateWindowContext notification, and hide content after
        snapshotting after entering the background.

2018-07-10  Youenn Fablet  <youenn@apple.com>

        Make fetch() use "same-origin" credentials by default
        https://bugs.webkit.org/show_bug.cgi?id=176023

        Reviewed by Chris Dumez.

        Before the patch, when changing the credential mode in case of redirection,
        we were not waiting for WebProcess response to restart the load.
        This patch updates the implementation to ask the WebProcess whether to proceed as for other regular asynchronous loads.
        This requires some refactoring in particular we now pass request, redirectRequest and redirectResponse to NetworkLoadChecker
        that will send them back as part of the completion handler.

        To do so, we change manual redirection handling and make it a successful case and not an error case as before.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::redirectionError):
        (WebKit::NetworkLoadChecker::checkRedirection):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::restartNetworkLoad):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):

2018-07-10  Chris Dumez  <cdumez@apple.com>

        [IOS] We should prevent WebProcess suspension while the UIProcess is waiting for a reply from its injected bundle
        https://bugs.webkit.org/show_bug.cgi?id=187536
        <rdar://problem/41931912>

        Reviewed by Brady Eidson.

        Update RemoteObjectRegistry to take a background process assertion for each pending reply on the
        UIProcess side. Otherwise, the destination web process may get suspended and the reply block would
        not get called. We already do this in WebPageProxy for callbacks waiting for an IPC from the
        WebProcess.

        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        * Shared/API/Cocoa/RemoteObjectRegistry.mm:
        (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
        (WebKit::RemoteObjectRegistry::sendInvocation):
        (WebKit::RemoteObjectRegistry::callReplyBlock):
        (WebKit::RemoteObjectRegistry::releaseUnusedReplyBlock):
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _initWithWebPage:]):
        (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
        (-[_WKRemoteObjectRegistry _initWithMessageSender:]): Deleted.
        * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _remoteObjectRegistry]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::remoteObjectRegistry):
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):

2018-07-09  Brian Burg  <bburg@apple.com>

        WebDriver: hang when running Selenium test correct_event_firing_tests.py::testShouldEmitOnChangeEventsWhenSelectingElements[Safari]
        https://bugs.webkit.org/show_bug.cgi?id=187486
        <rdar://problem/41987110>

        Reviewed by Tim Horton.

        This test takes the unusual step of doing Element Click directly on a <select> element,
        despite the specification supporting clicking on <option> elements directly. It hangs
        because we fire a nested run loop when the Carbon popup menu appears, and the nested runloop
        is not exited until the popup menu is clicked or dismissed.

        If a click is being simulated on the <select> via WebDriver, we should just not show
        the popup menu but still deliver all of the events that are fired when clicking the element.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showPopupMenu):

2018-07-10  Tim Horton  <timothy_horton@apple.com>

        Try to fix the build

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):

2018-07-10  Tim Horton  <timothy_horton@apple.com>

        doAfterNextPresentationUpdate should not be called while content is hidden due to animated resize
        https://bugs.webkit.org/show_bug.cgi?id=187500
        <rdar://problem/41294139>

        Reviewed by Simon Fraser.

        Clients generally expect that after doAfterNextPresentationUpdate, there's
        something vaguely sensible on the screen. They use this to remove snapshots,
        unhide web views, etc.

        During some kinds of resize/rotation, we will hide the WKContentView,
        and asynchronously hide it when the resize/rotation is complete. This
        can cause clients to prematurely expose a blank WKWebView.

        To fix this, avoid calling doAfterNextPresentationUpdate until the
        animated resize completes. Add a variant that does not wait for this
        (to be used for testing purposes).

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        Rename the vector of blocks that we call after animated resize completes
        to be generic rather than just about snapshots.

        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
        Add this _internal variant of _doAfterNextPresentationUpdate that takes bits determining
        which waits to perform or avoid, to reduce duplication.

        (-[WKWebView _doAfterNextPresentationUpdate:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
        Call _internalDoAfterNextPresentationUpdate with the appropriate bits set for each situation.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        Add _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting to WKWebView(WKTesting).

2018-07-10  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r231510): Dismissing PDFPlugin context menu automatically clicks the first item
        https://bugs.webkit.org/show_bug.cgi?id=187507
        <rdar://problem/42007155>

        Reviewed by Per Arne Vollan.

        WebPageProxy::showPDFContextMenu, introduced in r213510, assumes that
        the user always chooses some item from the menu; it does not handle
        the case where the context menu is dismissed without selecting anything.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/WebPageProxyMac.mm:
        (-[WKPDFMenuTarget selectedMenuItem]):
        (-[WKPDFMenuTarget contextMenuAction:]):
        (WebKit::WebPageProxy::showPDFContextMenu):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::handleContextMenuEvent):
        Make showPDFContextMenu return an optional index, instead of always
        returning an index. Don't perform any action if it is nullopt.

2018-07-10  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] Support display of webinspector ui on non-legacy minibrowser
        https://bugs.webkit.org/show_bug.cgi?id=187415

        Reviewed by Brian Burg.

        * UIProcess/WebInspectorProxy.h:
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::getInspectedWindowInfo):
        (WebKit::WebInspectorProxy::windowReceivedMessage):
        (WebKit::WebInspectorProxy::wndProc):
        (WebKit::WebInspectorProxy::registerWindowClass):
        (WebKit::decidePolicyForNavigationAction):
        (WebKit::webProcessDidCrash):
        (WebKit::WebInspectorProxy::platformCreateFrontendPage):
        (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
        (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
        (WebKit::WebInspectorProxy::platformAttach):
        (WebKit::WebInspectorProxy::platformDetach):
        (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
        (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
        (WebKit::WebInspectorProxy::platformIsFront):
        (WebKit::WebInspectorProxy::platformHide):
        (WebKit::WebInspectorProxy::platformBringToFront):
        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
        (WebKit::WebInspectorProxy::platformInspectedURLChanged):
        (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
        (WebKit::WebInspectorProxy::platformDidCloseForCrash):
        (WebKit::WebInspectorProxy::platformInvalidate):
        (WebKit::WebInspectorProxy::platformStartWindowDrag):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openFrontendConnection):
        * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL):

2018-07-10  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make testRunner.statisticsResetToConsistentState() take a completion handler
        https://bugs.webkit.org/show_bug.cgi?id=187499
        <rdar://problem/41999431>

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
            Now uses a WTF::CallbackAggregator to call its
            completion handler when both the call to
            WebResourceLoadStatisticsStore::scheduleClearInMemory()
            and to
            WebResourceLoadStatisticsStore::resetParametersToDefaultValues()
            are complete.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
            Now takes a WTF::CompletionHandler so that it can support the
            completion handler in
            WKWebsiteDataStoreStatisticsResetToConsistentState().
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
            Now takes a WTF::CompletionHandler so that it can support the
            completion handler in
            WKWebsiteDataStoreStatisticsResetToConsistentState().
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>

        Disable cross-origin-window-policy by default
        https://bugs.webkit.org/show_bug.cgi?id=187509

        Reviewed by Chris Dumez.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCrossOriginWindowPolicyEnabled):
        (WKPreferencesGetCrossOriginWindowPolicyEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:

2018-07-09  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r232416): Flickering when going back to Google search results on back swipe
        https://bugs.webkit.org/show_bug.cgi?id=187506
        <rdar://problem/41939594>

        Reviewed by Chris Dumez.

        Same document navigations won't have a preceding didStartProvisionalLoadForMainFrame,
        so the code introduced in r232416 would immediately remove the snapshot
        upon any same document navigation.

        Instead, adjust r232416 slightly to start tracking snapshot removal events
        after didStartProvisionalLoad OR didSameDocumentNavigation. Call the block
        that starts tracking, then immediately fire the same-document navigation event.

        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
        (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
        (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
        (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
        * UIProcess/Cocoa/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::endSwipeGesture):

2018-07-09  Youenn Fablet  <youenn@apple.com>

        Remove cfca.com.npCryptoKit.CGB.MAC.sb and cfca.com.npP11CertEnroll.MAC.CGB.sb
        https://bugs.webkit.org/show_bug.cgi?id=187487
        <rdar://problem/41991584>

        Reviewed by Alexey Proskuryakov.

        * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Removed.
        * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Removed.
        * WebKit.xcodeproj/project.pbxproj:

2018-07-09  Youenn Fablet  <youenn@apple.com>

        Add the possibility to run unsandboxed plug-ins
        https://bugs.webkit.org/show_bug.cgi?id=187310
        <rdar://problem/41798808>

        Reviewed by Alexey Proskuryakov.

        Add a utility method to know which plug-ins are allowed to run unsandboxed.
        For such plug-ins, we skip the sandboxing done when starting the plug-in process.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::initializeSandbox):
        * Shared/WebPreferences.yaml:
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::shouldRunPluginUnsandboxed):
        * UIProcess/Plugins/PluginInfoStore.h:
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::shouldRunPluginUnsandboxed):
        (WebKit::PluginInfoStore::shouldUsePlugin):

2018-07-09  Dean Jackson  <dino@apple.com>

        Remove fullscreen-auto-hide-delay
        https://bugs.webkit.org/show_bug.cgi?id=187493
        <rdar://problem/41830852>

        Reviewed by Antoine Quint.

        Now there is no delay, rename setFullscreenAutoHideTiming to setFullscreenAutoHideDuration,
        and only send that value over to the Web Process.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming): Deleted.
        * UIProcess/WebFullScreenManagerProxy.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController viewWillAppear:]):
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::didExitFullScreen):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideDuration):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming): Deleted.
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/FullScreen/WebFullScreenManager.messages.in:

2018-07-09  Timothy Hatcher  <timothy@apple.com>

        Semantic colors don't update when accessibility Increase Contrast mode is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=187425
        rdar://problem/39948240

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
        (-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
        (-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKView _effectiveAppearanceIsDark]): Deleted.
        (-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
        (WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
        The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
        and dark colors seperatly in RenderThemeMac.

2018-07-09  Simon Fraser  <simon.fraser@apple.com>

        Shrink various loading-related enums to shrink CachedResource
        https://bugs.webkit.org/show_bug.cgi?id=187443

        Reviewed by Chris Dumez.

        * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
        (WebKit::LegacyCustomProtocolManager::wasRedirectedToRequest):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::continueWillSendRequest):
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::canUseCache const):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::cachePolicyAllowsExpired):
        (WebKit::NetworkCache::makeRetrieveDecision):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
        * Shared/API/c/mac/WKURLRequestNS.mm:
        (WKURLRequestCopyNSURLRequest):
        * Shared/Cocoa/WKNSURLRequest.mm:
        (-[WKNSURLRequest _web_createTarget]):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo request]):
        * UIProcess/API/Cocoa/WKNavigation.mm:
        (-[WKNavigation _request]):
        * UIProcess/API/Cocoa/WKNavigationAction.mm:
        (-[WKNavigationAction request]):
        * UIProcess/API/Cocoa/WKNavigationData.mm:
        (-[WKNavigationData originalRequest]):
        * UIProcess/API/Cocoa/WKNavigationResponse.mm:
        (-[WKNavigationResponse _request]):
        * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
        (-[WKURLSchemeTaskImpl request]):
        * UIProcess/API/Cocoa/_WKDownload.mm:
        (-[_WKDownload request]):
        * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
        (WebKit::LegacyCustomProtocolManagerClient::startLoading):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::maximumBufferingTime):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::platformCanHandleRequest):

2018-07-09  Chris Dumez  <cdumez@apple.com>

        WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() fails to protect the page in its lambda
        https://bugs.webkit.org/show_bug.cgi?id=187478
        <rdar://problem/41975998>

        Reviewed by Youenn Fablet.

        Make sure we protect the WebPageProxy when we capture it in the lambda or it might go away by the
        time the lambda gets called.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):

2018-07-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Remove unused AuthenticationManager static methods.
        https://bugs.webkit.org/show_bug.cgi?id=187419

        Reviewed by Yusuke Suzuki.

        The file for curl port was added without implementation and never called from anyware.
        Also interfaces only used by the curl port were removed from the shared header file.

        * PlatformWin.cmake:
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Removed.

2018-07-09  Stephan Szabo  <stephan.szabo@sony.com>

        Check that LayerTreeHost was created before use
        https://bugs.webkit.org/show_bug.cgi?id=187404

        Reviewed by Žan Doberšek.

        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):

2018-07-09  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233612.
        https://bugs.webkit.org/show_bug.cgi?id=187475

        Revision caused the api test LinkColorWithSystemAppearance to
        fail on all systems. (Requested by Truitt on #webkit).

        Reverted changeset:

        "Semantic colors don't update when accessibility Increase
        Contrast mode is enabled."
        https://bugs.webkit.org/show_bug.cgi?id=187425
        https://trac.webkit.org/changeset/233612

2018-07-09  Brian Burg  <bburg@apple.com>

        WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
        https://bugs.webkit.org/show_bug.cgi?id=187418
        <rdar://problem/41909520>

        Unreviewed build fix for Sierra.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        According to some compilers, the local 'automationSession' is unused. Change this
        to just convert the return value to boolean rather than assign to an unused local.

2018-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        Introduce a layout milestone to track when the document contains a large number of rendered characters
        https://bugs.webkit.org/show_bug.cgi?id=187412
        <rdar://problem/41744338>

        Reviewed by Ryosuke Niwa.

        Add plumbing for the new significant rendered text layout milestone in the modern WebKit client layer. See
        WebCore/ChangeLog for more details.

        * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
        * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
        (renderingProgressEvents):
        * Shared/API/c/WKPageLoadTypes.h:
        * Shared/API/c/WKSharedAPICast.h:
        (WebKit::toWKLayoutMilestones):
        (WebKit::toLayoutMilestones):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (layoutMilestones):

2018-07-07  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r233561): MobileMail crashes when replying to an email
        https://bugs.webkit.org/show_bug.cgi?id=187436
        rdar://problem/41931915

        Reviewed by Alan Bujtas.
        
        r233561 added a RELEASE_ASSERT(isMainThread()) in this function. This is fine most of the time,
        until Mail spawns a WebThread for mail compose, at which point the meaning of isMainThread changes
        and the RELEASE_ASSERT fires.
        
        For now, just remove the RELEASE_ASSERT.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

2018-07-06  Timothy Hatcher  <timothy@apple.com>

        Semantic colors don't update when accessibility Increase Contrast mode is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=187425
        rdar://problem/39948240

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
        (-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
        (-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKView _effectiveAppearanceIsDark]): Deleted.
        (-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
        (WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
        The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
        and dark colors seperatly in RenderThemeMac.

2018-07-06  Chris Dumez  <cdumez@apple.com>

        Add release assertions to try and catch a possible HashMap corruption in NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=187417

        Reviewed by Ryosuke Niwa.

        Add assertions to make sure we:
        - Always use NetworkConnectionToWebProcess::m_networkResourceLoaders from the main thread
        - Never use a 0 identifier as key for NetworkConnectionToWebProcess::m_networkResourceLoaders

        We see crashes (rdar://problem/39265927) that only seem to make sense if this HashMap was
        somehow getting corrupted. Let's try and catch the most common reasons for HashMap corruption.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
        (WebKit::NetworkConnectionToWebProcess::setDefersLoading):
        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::messageSenderDestinationID):

2018-07-06  Brian Burg  <bburg@apple.com>

        WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
        https://bugs.webkit.org/show_bug.cgi?id=187418
        <rdar://problem/41909520>

        Reviewed by Timothy Hatcher.

        Per the W3C specification, “User prompts that are spawned from beforeunload event handlers,
        are dismissed implicitly upon navigation or close window, regardless of the defined user prompt handler.”

        This behavior differs from legacy Selenium behavior where (as in the test) it's expected that
        a test can accept or dismiss a beforeunload alert manually.

        Prior to this patch, beforeunload alerts hang because Safari uses a nested modal run loop, which does
        not process incoming Automation messages, so there was no way for the test to manually dismiss
        the alert.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        Don't show beforeunload alerts for pages being controlled by automation.


2018-07-06  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: contextConnection under WebCore::SWServer::terminateWorkerInternal
        https://bugs.webkit.org/show_bug.cgi?id=187348
        <rdar://problem/41853270>

        Reviewed by Youenn Fablet.

        Make sure we mark corresponding SWServerWorkers as terminated when we terminate a
        Service Worker context connection once it is no longer needed.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):

2018-07-06  Andy Estes  <aestes@apple.com>

        [iOS] WKPDFView should show the Data Detectors sheet when long-pressing a URL that Data Detectors can handle
        https://bugs.webkit.org/show_bug.cgi?id=187396
        <rdar://problem/41786980>

        Reviewed by Dan Bernstein.

        If a URL can be presented by Data Detectors, show the Data Detectors sheet instead
        of the link sheet. Also implement the optional WKActionSheetAssistantDelegate
        method that asks the UI delegate for its data detection context.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
        (-[WKPDFView dataDetectionContextForActionSheetAssistant:]):

2018-07-06  Chris Dumez  <cdumez@apple.com>

        WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler() should take in a CompletionHandler
        https://bugs.webkit.org/show_bug.cgi?id=187392

        Reviewed by Youenn Fablet.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-07-06  Chris Dumez  <cdumez@apple.com>

        [iOS] Assertion failure in WebProcessProxy::allProcesses() (isMainThread())
        https://bugs.webkit.org/show_bug.cgi?id=187394

        Reviewed by Dan Bernstein.

        Use RunLoop::isMain() instead of isMainThread() in the assertion to fix issues for
        applications using both WebKit and WebKitLegacy.

        * UIProcess/WebProcessProxy.cpp:

2018-07-06  Daniel Bates  <dabates@apple.com>

        Remove Strong Confirmation Password button
        https://bugs.webkit.org/show_bug.cgi?id=187306
        <rdar://problem/41795185>

        Reviewed by Sam Weinig.

        Remove support for the Strong Confirmation Password button because we never made use of it.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
        (toAutoFillButtonType):
        (toWKAutoFillButtonType):
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
        (toAutoFillButtonType):
        (toWKAutoFillButtonType):
        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:

2018-07-05  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r230843): Flash doesn't work; Produces blue box on page
        https://bugs.webkit.org/show_bug.cgi?id=187346
        <rdar://problem/41773974>

        Reviewed by Ryosuke Niwa.

        Reset page plugins when the load client policies are updated.
        This will ensure that pages will rebuild their plugin lists based on the new policies.

        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):
        (WebKit::WebPluginInfoProvider::clearPluginClientPolicies):

2018-07-05  Brady Eidson  <beidson@apple.com>

        IndexedDB operations in a Page fail after a StorageProcess crash.
        <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123

        Reviewed by Alex Christensen.

        When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
        in the WebProcess about it.
        
        This puts Documents/Workers in an error mode where requests fail instead of timeout.
        It also clears the Page's connection so *new* Documents and Workers will get a fresh 
        new connection that works.
        
        * UIProcess/API/C/WKContext.cpp:
        (WKContextTerminateStorageProcess):
        
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _terminateStorageProcess]):
        
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::terminateForTesting):
        * UIProcess/Storage/StorageProcessProxy.h:
        
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::terminateStorageProcessForTesting):
        (WebKit::WebProcessPool::terminateStorageProcess): Deleted.
        * UIProcess/WebProcessPool.h:
        
        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
        (WebKit::WebToStorageProcessConnection::didClose):
        * WebProcess/Storage/WebToStorageProcessConnection.h:
        (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier):
        
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::webToStorageProcessConnectionClosed):

2018-07-05  Simon Fraser  <simon.fraser@apple.com>

        Address two possible causes of missing tiles in iOS Safari, and add logging to gather more data about other possible causes
        https://bugs.webkit.org/show_bug.cgi?id=187376
        rdar://problem/40941118

        Reviewed by Tim Horton.
        
        We have continual reports of users experiencing missing tiles in MobileSafari, where loading a page
        shows the tiles at the top, but we don't render new tiles as the user scrolls down. This is consistent
        with failing to dispatch visible content rect updates via -[WKWebView _updateVisibleContentRects].
        
        This patch addresses two possible (but unlikely) causes. First, it resets _currentlyAdjustingScrollViewInsetsForKeyboard
        after a web process crash. Second, it catches exceptions thrown by [webView _updateVisibleContentRects]
        and resets _hasScheduledVisibleRectUpdate.
        
        This patch also adds release logging that fires if over 1s has elapsed between scheduling
        a visible content rect update and trying to re-schedule, and logging for all reasons that
        -_updateVisibleContentRects returns early.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _processDidExit]):
        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
        (-[WKWebView _updateVisibleContentRects]):

2018-07-05  Olivia Barnett  <obarnett@apple.com>

        iPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the page, detaches popover
        https://bugs.webkit.org/show_bug.cgi?id=187363
        <rdar://problem/41106306>

        Reviewed by Tim Horton.

        Added extra check to prevent keyboard scrolling when the select box is open.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _scrollOffsetForEvent:]):

2018-07-05  Timothy Hatcher  <timothy@apple.com>

        Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
        https://bugs.webkit.org/show_bug.cgi?id=187369
        rdar://problem/41870420

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _effectiveAppearanceIsDark]):
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _setUseSystemAppearance:]):
        (-[WKWebView effectiveAppearanceDidChange]):
        (-[WKWebView _defaultAppearance]): Deleted.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _effectiveAppearanceIsDark]):
        (-[WKView effectiveAppearanceDidChange]):
        (-[WKView _setUseSystemAppearance:]):
        (-[WKView _defaultAppearance]): Deleted.
        (-[WKView _setDefaultAppearance:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::effectiveAppearanceIsDark):
        (WebKit::WebViewImpl::setUseDarkAppearance):
        (WebKit::WebViewImpl::useDefaultAppearance): Deleted.
        (WebKit::WebViewImpl::setDefaultAppearance): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::setUseDarkAppearance):
        (WebKit::WebPageProxy::showPlaybackTargetPicker):
        (WebKit::WebPageProxy::setDefaultAppearance): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::useDarkAppearance const):
        (WebKit::WebPageProxy::defaultAppearance const): Deleted.
        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView drawRect:]):
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::paintControlForLayerInContext):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::WebPage::drawRect):
        (WebKit::WebPage::setUseDarkAppearance):
        (WebKit::WebPage::setDefaultAppearance): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-07-05  Brian Burg  <bburg@apple.com>

        REGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when elementInViewClientCenterPoint returns nullopt
        https://bugs.webkit.org/show_bug.cgi?id=187367
        <rdar://problem/41861346>

        Reviewed by Timothy Hatcher.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        There's no reason to unwrap this optional, as the IPC argument type is std::optional<IntPoint>.

2018-07-05  Tim Horton  <timothy_horton@apple.com>

        Upstream hover gesture implementation
        https://bugs.webkit.org/show_bug.cgi?id=187366

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView _hoverGestureRecognizerChanged:]):

2018-07-05  Tim Horton  <timothy_horton@apple.com>

        Fix some -Wdocumentation warnings in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=187318

        Reviewed by Dan Bernstein.

        Fix most of the -Wdocumentation warnings in WebKit. The remaining
        ones are slightly mysterious, so we can't turn the warning on yet.

        * Configurations/BaseTarget.xcconfig:
        Define U_HIDE_DEPRECATED_API. It's defined in all other WebKit projects,
        and the doc comments in the deprecated ICU API have some errors.

        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
        Adjust comments or parameter names to be consistent with each other.

2018-07-05  Chris Dumez  <cdumez@apple.com>

        Regression(r232886): WebsiteDataStore objects may get destroyed on a background thread
        https://bugs.webkit.org/show_bug.cgi?id=187356
        <rdar://problem/41854555>

        Reviewed by Geoffrey Garen.

        As of r232886, CallbackAggregators in WebsiteDataStore hold a Ref<> to their WebsiteDataStore. This
        is an issue because CallbackAggregator objects can get destroyed on a background thread and may be
        the last ones holding a ref to the data store. When this happens, the WebsiteDataStore would get
        destroyed on a background store and potentially cause crashes. Note that even if the callback
        aggregator would not be the last one to hold a ref to the store, it still would not be safe to deref
        the store on the background thread since WebsiteDataStore is not ThreadSafeRefCounted.

        To address the issue, this patch updates the CallbackAggregators' destructor to deref their data
        store member on the main thread. Note that we could also have WebsiteDataStore subclass
        ThreadSafeRefCounted<T, DestructionThread::Main> but the data store technically does not need to
        be ThreadSafeRefCounted at the moment.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::WebsiteDataStore):
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):

2018-07-05  Dan Bernstein  <mitz@apple.com>

        [macOS] REGRESSION: Development WebContent service has restricted entitlements, rendering it useless for development
        https://bugs.webkit.org/show_bug.cgi?id=187355

        Reviewed by Anders Carlsson.

        * Configurations/WebContentService.Development.xcconfig: Set WK_USE_RESTRICTED_ENTITLEMENTS
          to NO for the Development service.

2018-07-05  Rob Buis  <rbuis@igalia.com>

        [GTK] Remove soup/DownloadSoupErrors.h
        https://bugs.webkit.org/show_bug.cgi?id=187339

        This header is not used anymore.

        Reviewed by Frédéric Wang.

        * NetworkProcess/Downloads/soup/DownloadSoupErrors.h: Removed.
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        * PlatformGTK.cmake:

2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r233325): [GTK] Broke 40 animations tests
        https://bugs.webkit.org/show_bug.cgi?id=187264

        Reviewed by Žan Doberšek.

        Use a different PlatformDisplayID for compositing in the GTK port. This way, when entering AC a window screen
        changed is emitted and the GTK default display refresh monitor is destroyed, ensuring the one created by the
        threaded compositor is used.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::create): Remove unused WebPage parameter and add PlatformDisplayID.
        (WebKit::ThreadedCompositor::ThreadedCompositor): Create the display refresh monitor with the given displayID.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
        (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Pass the given displayID to the parent constructor.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
        (WebKit::ThreadedDisplayRefreshMonitor::create): Add PlatformDisplayID parameter.
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Use compositingDisplayID when
        creating the threaded compositor and notify about the window screen change.
        (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): Use primaryDisplayID when leaving AC and
        compositingDisplayID when re-entering.

2018-07-04  Olivia Barnett  <obarnett@apple.com>

        A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
        https://bugs.webkit.org/show_bug.cgi?id=185257
        <rdar://problem/40819252>

        Reviewed by Tim Horton.

        Call to dismiss the presented modal was being called on the parent and not the child, which caused the file picker to be incorrectly dismissed along with the modal. A test for this bug-fix could not be completed without additional tools as TestWebKitAPI is not a UI application.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _dismissDisplayAnimated:]):

2018-07-04  Tim Horton  <timothy_horton@apple.com>

        Introduce PLATFORM(IOSMAC)
        https://bugs.webkit.org/show_bug.cgi?id=187315

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        * Configurations/FeatureDefines.xcconfig:
        * Configurations/NetworkService.xcconfig:
        * Configurations/WebContentService.xcconfig:
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::sourceApplicationAuditData const):
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeProcessName):
        (WebKit::overrideSystemProxies):
        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Platform/spi/ios/UIKitSPI.h:
        * Shared/ios/ChildProcessIOS.mm:
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::setApplicationIsDaemon):
        (WebKit::enableSandboxStyleFileQuarantine):
        * Shared/mac/CodeSigning.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _webViewPrintFormatter]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::updateLayerTree):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (-[WKRemoteView initWithFrame:contextID:]):
        * UIProcess/_WKWebViewPrintFormatter.mm:
        * UIProcess/_WKWebViewPrintFormatterInternal.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _didExitStableState]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _defineForWebView:]):
        (-[WKContentView setSelectedTextRange:]):
        (-[WKContentView closestPositionToPoint:]):
        (-[WKContentView _updateChangedSelection:]):
        * UIProcess/ios/WKLegacyPDFView.mm:
        * UIProcess/ios/WKPDFView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::getPositionInformation):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeSandbox):
        * config.h:

2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        50 failing WebDriver tests after r233417
        https://bugs.webkit.org/show_bug.cgi?id=187263

        Reviewed by Frédéric Wang.

        A std::optional value is used while being std::nullopt. This is because the wrong input source is used when
        transitioning keyboard input states.

        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Remove quarantine for Webex plugin
        https://bugs.webkit.org/show_bug.cgi?id=187050
        rdar://problem/41478189

        Reviewed by Brent Fulgham.

        Update the Plugin Info.plist to not do quarantine of downloaded files by default.
        Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

        * Platform/spi/mac/QuarantineSPI.h: Add qtn_proc_init.
        * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
        * PluginProcess/PluginProcess.h:
        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::shouldOverrideQuarantine):
        * Shared/ChildProcess.h:
        (WebKit::ChildProcess::shouldOverrideQuarantine):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox):

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Crash in  WebKit::CacheStorage::Cache::toRecordInformation when running http/tests/cache-storage/cache-persistency.https.html
        https://bugs.webkit.org/show_bug.cgi?id=187243

        Reviewed by Chris Dumez.

        In case a caches object has an engine, it uses the engine to get the salt.
        In case engine/caches are non persistent, no salt was set for the engine, hence the crashes.
        Add an empty salt whenever initializing a non-persistent engine to remove the crash.

        Covered by updated expectations for two tests.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::initialize):

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Fix regression introduced in r233335
        https://bugs.webkit.org/show_bug.cgi?id=187282

        Reviewed by Chris Dumez.

        When checking for navigation loads, we need to return whether the request URL matches the service worker URL.
        Before this patch, if the request URL was not matching the service worker URL, we were using the origin/referrer
        which should only be used for subresource loads.

        Covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https.html
        being no longer flaky.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::isValidFetch):

2018-07-03  Chris Dumez  <cdumez@apple.com>

        Make CallbackMap::invalidate() safe to re-enter
        https://bugs.webkit.org/show_bug.cgi?id=187298
        <rdar://problem/41057167>

        Reviewed by Geoffrey Garen.

        Made it safe to re-enter CallbackMap::invalidate(), GenericCallback::performCallbackWithReturnValue(),
        GenericCallback::invalidate() & invalidateCallbackMap() since those execute client blocks which may
        re-enter WebKit.

        * UIProcess/GenericCallback.h:
        (WebKit::GenericCallback::performCallbackWithReturnValue):
        (WebKit::invalidateCallbackMap):

2018-07-03  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Clean up sandbox warnings found during Public Beta
        https://bugs.webkit.org/show_bug.cgi?id=187308
        <rdar://problem/41203914>

        Reviewed by Eric Carlson.

        I made our sandbox overly restrictive during our iOS 12.0 development cycle, and have found a number of missing items.

        This patch adds the missing IOKit properties, and removes a duplicate call to (play-media).

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2018-07-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Embed certificate information into ResourceResponse.
        https://bugs.webkit.org/show_bug.cgi?id=187102

        Reviewed by Youenn Fablet.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::curlDidComplete):.

2018-07-03  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] We fail to make surfaces volatile when suspending, increasing memory impact
        https://bugs.webkit.org/show_bug.cgi?id=187285
        rdar://problem/41732391

        Reviewed by Tim Horton.
        
        The "Mach port as layer contents" code path used in iOS WK2 relies on replacing the 
        Mach port layer contents with the actual IOSurface on suspension (otherwise the
        live Mach port will keep the surface in use). However, we were never hitting this
        RemoteLayerTreeHost::mapAllIOSurfaceBackingStore() code path on iOS 11 and later
        because UIKit stopped firing the notification we relied on.
        
        To fix this, use the _UIApplicationDidFinishSuspensionSnapshotNotification notification
        which is fired on UIApp.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):

2018-07-02  Simon Fraser  <simon.fraser@apple.com>

        Clean up the layer volatility code and logging
        https://bugs.webkit.org/show_bug.cgi?id=187286

        Reviewed by Tim Horton.
        
        Fix the layer volatility logging so it doesn't say "succeeded" when it actually failed
        and gave up.
        
        Use a couple of lambda functions in RemoteLayerBackingStore::setBufferVolatility() to
        make the code easier to read.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::setBufferVolatility):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::callVolatilityCompletionHandlers):
        (WebKit::WebPage::layerVolatilityTimerFired):
        (WebKit::WebPage::markLayersVolatile):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::markLayersVolatile):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::markAllLayersVolatile):
        * WebProcess/WebProcess.h:

2018-07-03  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make WebsiteDataStore::getAllStorageAccessEntries() call the right network process instead of iterating over the process pools
        https://bugs.webkit.org/show_bug.cgi?id=187277
        <rdar://problem/41745510>

        Reviewed by Chris Dumez.

        Existing tests use this code. The change is for correctness.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
            Now receives a WKWebView from its caller and gets the page ID from it.
        (-[WKWebsiteDataStore _getAllStorageAccessEntries:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
            Now gets a page ID from its caller and gets the right network process
            through it.
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-07-03  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed, rolling out r233461.

        Assertions triggered during iOS 11 debug layout and API tests

        Reverted changeset:

        "[iOS] Add assert to catch improper use of WebCore::Timer in
        UI Process"
        https://bugs.webkit.org/show_bug.cgi?id=185330
        https://trac.webkit.org/changeset/233461

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Update com.cmbchina.CMBSecurity.sb to make it functional
        https://bugs.webkit.org/show_bug.cgi?id=187278

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb:

2018-07-03  Jer Noble  <jer.noble@apple.com>

        Update Fullscreen anti-phishing alert text
        https://bugs.webkit.org/show_bug.cgi?id=187199
        <rdar://problem/41162543>

        Reviewed by Brent Fulgham.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]):

2018-07-03  David Kilzer  <ddkilzer@apple.com>

        [iOS] Add assert to catch improper use of WebCore::Timer in UI Process
        <https://webkit.org/b/185330>
        <rdar://problem/32816079>

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::StorageProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::m_nonVisibleProcessCleanupTimer):
        - Call setWebKitProcessType() to se the global for the current
          process.

2018-07-03  Frederic Wang  <fred.wang@free.fr>

        [iOS] Animations with Bézier timing function not suspended on UI process when animation-play-state is set to "paused"
        https://bugs.webkit.org/show_bug.cgi?id=170784

        Reviewed by Antoine Quint.

        In order to pause a running animation, GraphicsLayerCA::pauseCAAnimationOnLayer calls
        PlatformCALayer::addAnimationForKey, assuming it will replace the current animation.
        This patch fixes PlatformCALayerRemote::addAnimationForKey to ensure this assumption holds.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::addAnimationForKey): If the animation was already sent to
        the UI process, make sure it is properly updated.

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Add sandbox to microdone plugin
        https://bugs.webkit.org/show_bug.cgi?id=187149
        <rdar://problem/41538057>

        Unreviewed.

        * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.sb: Renamed from Source/WebKit/Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.
        * WebKit.xcodeproj/project.pbxproj:

2018-07-02  Tim Horton  <timothy_horton@apple.com>

        Adjust now-incorrect animated resize logging after r232544
        https://bugs.webkit.org/show_bug.cgi?id=187281
        <rdar://problem/41645347>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        _beginAnimatedResizeWithUpdate: and _didCompleteAnimatedResize are
        not strictly paired; we could instead track the SPI, but it's a bit
        tricky since resizeWithContentHidden has an implicit endAnimatedResize.
        Instead, just log if we still have a resizeAnimationView when we're
        committing outside of an animated resize, which seems to be the original concern,
        and point toward the possibility of unpaired begin/end.
        Also fix logging that has the wrong method name.

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Update com.apple.NPSafeInput.sb to make it functional
        https://bugs.webkit.org/show_bug.cgi?id=187276

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb:

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Update com.cfca.npSecEditCtl.MAC.BOC.plugin.sb to make it functional
        https://bugs.webkit.org/show_bug.cgi?id=187261

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb:

2018-07-02  Brady Eidson  <beidson@apple.com>

        Crash notifying observers of responsiveness state change
        <rdar://problem/41267796> and https://bugs.webkit.org/show_bug.cgi?id=187262

        Reviewed by Tim Horton.

        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::callObserverCallback): Copy the container ahead of time.

2018-07-02  Sihui Liu  <sihui_liu@apple.com>

        Remove InitWebCoreThreadSystemInterface() in WKProcessPool _initWithConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=187252

        Reviewed by Dan Bernstein.

        Clean up after <rdar://problem/15256572>.

        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (-[WKProcessGroup initWithInjectedBundleURL:]):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _initWithConfiguration:]):

2018-07-02  Zan Dobersek  <zdobersek@igalia.com>

        REGRESSION(r233381): Double WebResourceLoadStatisticsStore destructor invocation
        https://bugs.webkit.org/show_bug.cgi?id=187247

        Reviewed by Chris Dumez.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        Don't call postTask() to dispatch this task, as that keeps a reference
        to this WebResourceLoadStatisticsStore object and thus causes problems
        when invoked from the destructor in the form of a second destructor
        invocation that ends up crashing the process. Blocking nature of this
        call should be enough to avoid WebResourceLoadStatisticsStore lifetime
        issues.

2018-07-02  Per Arne Vollan  <pvollan@apple.com>

        Delete display link when closing page or the WebContent process has crashed.
        https://bugs.webkit.org/show_bug.cgi?id=186895

        Reviewed by Brent Fulgham.

        If there is a running display link in the UI process, there is no need to keep it around if the
        page is being closed or the WebContent process has crashed.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):

2018-06-23  Darin Adler  <darin@apple.com>

        [Cocoa] Improve ARC compatibility of more code in JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=186973

        Reviewed by Dan Bernstein.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
        (WebKit::XPCServiceInitializerDelegate::hasEntitlement): Use WTF::hasEntitlement.

        * Shared/mac/SandboxUtilities.h: Removed connectedProcessHasEntitlement since
        we can now use WTF::hasEntitlement instead.
        * Shared/mac/SandboxUtilities.mm: Ditto.

        * StorageProcess/ios/StorageProcessIOS.mm:
        (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement): Use
        WTF::hasEntitlement.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement): Ditto.

2018-06-30  David Kilzer  <ddkilzer@apple.com>

        Fix clang static analyzer warnings: Garbage return value
        <https://webkit.org/b/187224>

        Reviewed by Eric Carlson.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::changeCount):
        (WebKit::WebPlatformStrategies::addTypes):
        (WebKit::WebPlatformStrategies::setTypes):
        (WebKit::WebPlatformStrategies::setBufferForType):
        (WebKit::WebPlatformStrategies::setPathnamesForType):
        (WebKit::WebPlatformStrategies::setStringForType):
        (WebKit::WebPlatformStrategies::getNumberOfFiles):
        (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
        (WebKit::WebPlatformStrategies::writeCustomData):
        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        (WebKit::WebEditorClient::substitutionsPanelIsShowing):
        - Use brace initialization for local variables.

2018-06-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, add missing PLATFORM(COCOA) guard after r233207
        https://bugs.webkit.org/show_bug.cgi?id=186788
        <rdar://problem/41094167>

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleExtendClassesForParameterCoder):

2018-06-30  Dan Bernstein  <mitz@apple.com>

        Added a missing availability attribute.

        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:

2018-06-29  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make network process calls only for the process pool that the page belongs to
        https://bugs.webkit.org/show_bug.cgi?id=187206
        <rdar://problem/41659160>

        Reviewed by Chris Dumez.

        Instead of iterating over all process pools, we should resolve which
        process pool the page belongs to and call the network process only for
        that pool. This is especially important since we use WTFMove for the
        completion handlers.

        This patch also renames "callback" to "completionHandler" for
        the functions touched.

        A FIXME comment is added to WebsiteDataStore::getAllStorageAccessEntries()
        where we currently don't have a page ID to do the lookup with.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
        (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
        (WebKit::WebsiteDataStore::grantStorageAccessHandler):
        (WebKit::WebsiteDataStore::hasStorageAccess):
        (WebKit::WebsiteDataStore::requestStorageAccess):
        (WebKit::WebsiteDataStore::grantStorageAccess):

2018-06-29  Chris Dumez  <cdumez@apple.com>

        Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads
        https://bugs.webkit.org/show_bug.cgi?id=187200

        Reviewed by Brent Fulgham.

        Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads,
        in order the simplify the code a little bit.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::postTask):
        (WebKit::WebResourceLoadStatisticsStore::postTaskReply):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
        (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
        (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
        (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-29  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
        https://bugs.webkit.org/show_bug.cgi?id=187183

        Reviewed by Wenson Hsieh.

        r210683 introduced logic to prevent file URLs from being copied to the clipboard
        in unexpected cases. The current logic always crashes the WebProcess if
        webProcessProxy->checkURLReceivedFromWebProcess returns false. Instead of
        crashing, we can fail silently and not copy anything to the clipboard.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Removed call to markCurrentlyDispatchedMessageAsInvalid() which was causing the process to crash.

2018-06-29  Chris Dumez  <cdumez@apple.com>

        Regression(r233359): Caused ITP tests to be flaky
        https://bugs.webkit.org/show_bug.cgi?id=187189

        Reviewed by Youenn Fablet.

        r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
        m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
        with what we do for other database paths so that things like '~' in paths get resolved.

        This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
        resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
        Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
        properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-06-29  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=187154
        <rdar://problem/41487250>

        Reviewed by Brent Fulgham and Chris Dumez.

        Most of the changes in this patch remove the boolean parameter for tracking
        ephemeral sessions and the IsReadOnly enum.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
            Now returns early for ephemeral sessions.
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
            Now returns early for ephemeral sessions.
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-06-29  Chris Dumez  <cdumez@apple.com>

        Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=187165

        Reviewed by Brent Fulgham.

        Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore. Instead,
        WebResourceLoadStatisticsStore now holds a weak pointer to its WebsiteDataStore and is able to call
        methods on it directly. Reducing the indirection makes the code less complex and more understandable.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
        (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
        (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-06-29  Miguel Gomez  <magomez@igalia.com>

        [WPE] Some frames are dropped when using rAF to animate an element
        https://bugs.webkit.org/show_bug.cgi?id=187175

        Always call renderNextFrame in ThreadedCompositor::requestDisplayRefreshMonitorUpdate()
        so we have to process any pending layer flush request.

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Make sure the WebResourceLoadStatisticsStore gets destroyed on the main thread
        https://bugs.webkit.org/show_bug.cgi?id=187143

        Reviewed by Youenn Fablet.

        Have WebResourceLoadStatisticsStore subclass ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>
        instead of IPC::Connection::WorkQueueMessageReceiver. This makes sure that the WebResourceLoadStatisticsStore
        objects get destroyed on the main thread, even if the last ref was held by a background thread.

        Also, methods called by IPC are now called on the main thread instead of the background queue. I think it is clearer for all
        of WebResourceLoadStatisticsStore usage to be on the main thread. Expensive work is still done on the background queue, inside
        the persistent / memory store classes.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
        (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-28  Jiewen Tan  <jiewen_tan@apple.com>

        Add nullptr check for xpc_connection_t in AuthenticationManager::initializeConnection
        https://bugs.webkit.org/show_bug.cgi?id=187110
        <rdar://problem/41536815>

        Reviewed by Brent Fulgham.

        In some rare cases as shown by crash tracers that the passed xpc_connection_t object could be nullptr,
        and xpc_connection_set_event_handler won't do the nullptr check on its parameters. Therefore, we should
        do it by ourselves.

        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection):
        * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
        (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):

2018-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] DataTransfer.getData always returns the empty string when dropping text
        https://bugs.webkit.org/show_bug.cgi?id=187130
        <rdar://problem/41014117>

        Reviewed by Ryosuke Niwa.

        Add plumbing to grab information for each item in the pasteboard. See WebCore ChangeLog for more detail.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::allPasteboardItemInfo):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-06-28  Youenn Fablet  <youenn@apple.com>

        Early return when handling fetch event in case service worker origin does not match origin of a subresource load
        https://bugs.webkit.org/show_bug.cgi?id=187153
        <rdar://problem/41329832>

        Reviewed by Chris Dumez.

        Stop crashing the service worker process in case a subresource load origin is not matching a service worker origin.
        Instead, just return early so that the load will be handled by the network process.

        Keep crashing in case a navigation load is not matching its service worker origin.
        Add more logging to help with the debugging.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::logValidFetchError):
        (WebKit::isValidFetch):
        (WebKit::WebSWContextManagerConnection::startFetch):

2018-06-28  Jeremy Jones  <jeremyj@apple.com>

        Fullscreen exits when placeholder is removed then added during a single runloop.
        https://bugs.webkit.org/show_bug.cgi?id=187079

        Reviewed by Jer Noble.

        Instead of closing fullscreen as soon as the placeholder is removed from the view hierarchy,
        give the placeholder until the next runloop to be re-added to the view hierarchy.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):

2018-06-28  Youenn Fablet  <youenn@apple.com>

        Handle the case of registerMDNSNameCallback called several times
        https://bugs.webkit.org/show_bug.cgi?id=187150
        <rdar://problem/41329832>

        Reviewed by Eric Carlson.

        This is a speculative fix on the basis that registerMDNSNameCallback may be called several times.
        In that case, we would have freed the context after the first call and would reuse it for the second call.

        Instead, keep a map of pending requests and pass to registerMDNSNameCallback an identifier to that map.
        If the map has no value for that identifier, return early.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
        (WebKit::pendingRegistrationRequests):
        (WebKit::registerMDNSNameCallback):
        (WebKit::NetworkMDNSRegister::clearPendingRequests):
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        * NetworkProcess/webrtc/NetworkMDNSRegister.h:
        (): Deleted.

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix Win Cairo build after r233310.

        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix Win Cairo build after r233310.

        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
        https://bugs.webkit.org/show_bug.cgi?id=187055
        <rdar://problem/41584026>

        Unreviewed, temporarily disable main thread assertion added to flushAndDestroyPersistentStore()
        in r233310, until Bug 187143 is fixed.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

2018-06-28  Youenn Fablet  <youenn@apple.com>

        Add sandbox to microdone plugin
        https://bugs.webkit.org/show_bug.cgi?id=187149
        rdar://problem/41538057

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-28  Brian Burg  <bburg@apple.com>

        Web Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified URL doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=187146
        <rdar://problem/41369591>

        Reviewed by Joseph Pecoraro.

        When Web Inspector's page receives a navigation request, it's supposed to redirect any
        non-Inspector navigations to be loaded in the inspected page. When I refactored to use
        modern a policy delegate, the one line that redirects the loads was left out.

        No new tests, because inspector tests can't navigate the inspector or inspected pages.

        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):

2018-06-28  Jeremy Jones  <jeremyj@apple.com>

        Crash when _topConstraint is null in element fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=187075

        Reviewed by Eric Carlson.

        NSArray can't contain a null pointer, so check for null before creating an array from a pointer.
        Use the recommended +deactivateConstraints: instead of -removeConstraints:.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
        https://bugs.webkit.org/show_bug.cgi?id=187055
        <rdar://problem/41584026>

        Reviewed by Brent Fulgham.

        Split memory store logic out of WebResourceLoadStatisticsStore and into a ResourceLoadStatisticsMemoryStore class
        to clarify the threading model. Previously, some of the methods of the WebResourceLoadStatisticsStore had to be
        called on the main thread and some of them on the background queue, which was confusing and error prone. Now,
        all WebResourceLoadStatisticsStore methods (except for IPC ones which will be addressed in a follow-up) are called
        on the main thread. The ResourceLoadStatisticsMemoryStore objects is constructed / used and destroyed on the
        background queue, similarly to the ResourceLoadStatisticsPersistentStore. The WebResourceLoadStatisticsStore
        objects merely proxies calls from WebKit to those persistent / memory stores and takes care of hopping back and
        forth between the background thread and the work queue.

        While spliting code code, I found several instances where we were calling completion handlers on the wrong thread.
        I fixed those in this patch now that the model is clearer.

        We can likely clean up (organize the code a bit better) in a follow-up). This patch takes care of splitting the
        code as it was. Code that was called on the background queue was moved to ResourceLoadStatisticsMemoryStore class
        and code that was called on the main thread stays in WebResourceLoadStatisticsStore.

        * CMakeLists.txt:
        * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm.
        (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp: Added.
        (WebKit::appendWithDelimiter):
        (WebKit::OperatingDate::fromWallTime):
        (WebKit::OperatingDate::today):
        (WebKit::OperatingDate::secondsSinceEpoch const):
        (WebKit::OperatingDate::operator== const):
        (WebKit::OperatingDate::operator< const):
        (WebKit::OperatingDate::operator<= const):
        (WebKit::OperatingDate::OperatingDate):
        (WebKit::mergeOperatingDates):
        (WebKit::pruneResources):
        (WebKit::computeImportance):
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
        (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
        (WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry):
        (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry):
        (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
        (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
        (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
        (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
        (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
        (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest):
        (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
        (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
        (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
        (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
        (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder):
        (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
        (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
        (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree):
        (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved):
        (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain):
        (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
        (WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
        (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState):
        (WebKit::ResourceLoadStatisticsMemoryStore::processStatistics const):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
        (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
        (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
        (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues):
        (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent):
        (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
        (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
        (WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
        * UIProcess/ResourceLoadStatisticsMemoryStore.h: Added.
        (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled):
        (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
        (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
        (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
        (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
        (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
        (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
        (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::sortedPrevalentResourceTelemetry):
        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
        * UIProcess/WebResourceLoadStatisticsTelemetry.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-06-28  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
        https://bugs.webkit.org/show_bug.cgi?id=175602

        Reviewed by Carlos Garcia Campos.

        We check using the GdkDragContext to ensure the DroppingContext is still alive (present in
        m_droppingContexts), but access it via the pointer to the DroppingContext that could be
        dangling. This happens on every drag. I can't actually reproduce the original assertion
        since I'm currently working with an asan build, but I imagine it's probably the same issue
        that I'm fixing here.

        * UIProcess/gtk/DragAndDropHandler.cpp:
        (WebKit::DragAndDropHandler::dragLeave):

2018-06-27  Timothy Hatcher  <timothy@apple.com>

        Don't expose new semantic -apple-system color keywords on iOS.
        https://bugs.webkit.org/show_bug.cgi?id=187080
        rdar://problem/41505699

        Reviewed by Tim Horton.

        * DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.

2018-06-27  Megan Gardner  <megan_gardner@apple.com>

        Fix IBeam issues with iPad apps on Mac
        https://bugs.webkit.org/show_bug.cgi?id=186900

        Reviewed by Wenson Hsieh.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):

        Add functionality to determine what a caret rect should be, but as it is
        expensive, it should only be done for this platform.
        
        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::isApproximateForRequest):
        * Shared/ios/InteractionInformationRequest.h:

        As there is no way to premptively request information on hover, we need to use 
        the last cached information, but only if it is close to the point we are about
        to request information for. So having a way to determine if a point is very close
        to a previous point is a good idea.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _currentPositionInformationIsApproximateForRequest:]):
        (-[WKContentView closestPositionToPoint:]):

        UIKit is using this function to determine if we should show an Ibeam or not.
        So we need to implement it, at least for this platform. 

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPositionInformation):

        Pass up the calculated caret rect, but only for iPad apps on Mac.

2018-06-27  Yusuke Suzuki  <utatane.tea@gmail.com>

        [GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
        https://bugs.webkit.org/show_bug.cgi?id=187089

        Reviewed by Michael Catanzaro.

        Use LazyNeverDestroyed<XErrorTrapper> instead of global std::unique_ptr<XErrorTrapper>.
        Since this variable's exit time destructor is not important in this code, using
        LazyNeverDestroyed<XErrorTrapper> is fine. This removes the last static initializer
        of libwebkit2gtk.so.

        * PluginProcess/unix/PluginProcessMainUnix.cpp:

2018-06-27  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile for some additional bank plugins
        https://bugs.webkit.org/show_bug.cgi?id=187105

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Added.
        * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Added.
        * Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Added.
        * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Added.
        * Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Added.
        * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Added.
        * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Added.
        * Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-27  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=186551

        Reviewed by Daniel Bates.

        Removed the need for NetworkLoadChecker to reference a NetworkConnectionToWebProcess.
        Instead a CSP client is given to NetworkLoadChecker when needed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::check):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy):
        (WebKit::NetworkLoadChecker::addConsoleMessage): Deleted.
        (WebKit::NetworkLoadChecker::sendCSPViolationReport): Deleted.
        (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Deleted.
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::willPerformHTTPRedirection):
        * NetworkProcess/PingLoad.h:

2018-06-27  Stephan Szabo  <stephan.szabo@sony.com>

        [Wincairo] Add support for context menus to non-legacy minibrowser
        https://bugs.webkit.org/show_bug.cgi?id=186815.

        Reviewed by Ryosuke Niwa.

        * UIProcess/WebPageProxy.h:
        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::viewWidget):
        * UIProcess/win/PageClientImpl.h:
        * UIProcess/win/WebContextMenuProxyWin.cpp:
        (WebKit::WebContextMenuProxyWin::show):
        (WebKit::createMenu):
        (WebKit::createMenuItem):
        (WebKit::populate):
        (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
        (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
        * UIProcess/win/WebContextMenuProxyWin.h:
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::viewWidget):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::wndProc):
        (WebKit::WebView::onMenuCommand):
        * UIProcess/win/WebView.h:

2018-06-27  Youenn Fablet  <youenn@apple.com>

        Disable content blockers in NetworkLoadChecker except for ping loads
        https://bugs.webkit.org/show_bug.cgi?id=187083
        <rdar://problem/41440083>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::enableContentExtensionsCheck):
        * NetworkProcess/PingLoad.cpp:

2018-06-27  Simon Fraser  <simon.fraser@apple.com>

        https://hackernoon.com/ uses lots of layer backing store
        https://bugs.webkit.org/show_bug.cgi?id=186909
        rdar://problem/40257540

        Reviewed by Tim Horton.
        
        PlatformCALayerRemote was actually holding onto backing stores for layers with
        backing store detached, which could increase memory use. When told that backing stores
        are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay)
        when attached. This is now similar to what PlatformLayerCACocoa does.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
        (WebKit::PlatformCALayerRemote::setNeedsDisplay):
        (WebKit::PlatformCALayerRemote::hasContents const):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

2018-06-27  Jonathan Bedard  <jbedard@apple.com>

        Enable WebKit iOS 12 build
        https://bugs.webkit.org/show_bug.cgi?id=187024
        <rdar://problem/39759057>

        Reviewed by David Kilzer.

        * Platform/spi/ios/PDFKitSPI.h: Added PDFKit SPI.
        * Platform/spi/ios/UIKitSPI.h: Add new UIKit SPI and UICompositingMode enumeration.
        * UIProcess/ios/WKPDFView.mm: Use PDFKitSPI header.
        * UIProcess/ios/WKSystemPreviewView.mm: Use CoreGraphicsSPI.h.
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Use QuartzCoreSPI.h.

2018-06-27  Timothy Horton  <timothy_horton@apple.com>

        CSS Animation Triggers is not an experimental feature, should be globally off by default

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2018-06-27  Timothy Horton  <timothy_horton@apple.com>

        Promote the Secure Context API feature from experimental-yet-on-by-default to always-on

        Reviewed by Dan Bates.

        * Shared/WebPreferences.yaml:
        Secure Context API is on by default, it's not experimental anymore.

2018-06-27  Timothy Horton  <timothy_horton@apple.com>

        Make Link Preload an on-by-default feature
        https://bugs.webkit.org/show_bug.cgi?id=187104

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:
        This should be on, not experimental. It already shipped on in the past.

2018-06-27  Chris Dumez  <cdumez@apple.com>

        Regression(r233208): Completion handler does not get called on GTK port
        https://bugs.webkit.org/show_bug.cgi?id=187099

        Reviewed by Antti Koivisto.

        Make sure UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler's completion handler
        gets called on non-COCOA ports.

        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-27  Tim Horton  <timothy_horton@apple.com>

        When trying to print a very long email on iOS, the print preview is blank
        https://bugs.webkit.org/show_bug.cgi?id=187077
        <rdar://problem/41107013>

        Reviewed by Timothy Hatcher.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
        ChildProcessProxy::sendSync has a (surprising) default timeout of 1 second,
        (as opposed to Connection::sendSync's default timeout of ∞ seconds).
        The printing path already waits ∞ seconds for the final PDF, but currently
        uses the default 1 second timeout for page count computation. If page
        count computation takes more than 1 second, the preview will be blank.
        Since the print preview is generated asynchronously, we really want
        to wait until it's done, and not give up after 1 second.

2018-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPad apps on macOS] Unable to interact with video elements that have started playing
        https://bugs.webkit.org/show_bug.cgi?id=187073
        <rdar://problem/40591107>

        Reviewed by Tim Horton.

        On iOS, we currently force remote hosting contexts to be non-interactive by passing in `kCAContextIgnoresHitTest`
        when creating the CAContext. However, this flag is not respected by CoreAnimation when running iOS apps on macOS.
        This means all HID events dispatched over a video that has been played (which causes WebKit to insert a
        CALayerHost-backed WKRemoteView in the view hierarchy) will be routed to the context ID of the video's CAContext
        rather than the context ID of the key window containing the WKWebView.

        This subsequently causes all gesture recognizers (hover, touch, tap, long press) to fail recognition when
        running iOS apps on macOS. To address this, we set a flag on WKRemoteView's CALayerHost to prevent hit-testing
        to the remote layer. This allows us to avoid routing HID events to the wrong context, and instead target the
        main UIWindow.

        Manually verified that click, touch, and mouseenter/mouseleave events are dispatched when interacting over a
        video element.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (-[WKRemoteView initWithFrame:contextID:]):

2018-06-26  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233232.
        https://bugs.webkit.org/show_bug.cgi?id=187081

        "This is breaking launching some plugins" (Requested by youenn
        on #webkit).

        Reverted changeset:

        "Remove quarantine for Webex plugin"
        https://bugs.webkit.org/show_bug.cgi?id=187050
        https://trac.webkit.org/changeset/233232

2018-06-26  Timothy Horton  <timothy_horton@apple.com>

        Rearrange some WebPreferences; move two experimental prefs into the experimental section

        * Shared/WebPreferences.yaml:

2018-06-26  Chris Dumez  <cdumez@apple.com>

        Deal better with the network process crashing on startup
        https://bugs.webkit.org/show_bug.cgi?id=187065
        <rdar://problem/41451622>

        Reviewed by Geoffrey Garen.

        When a network process crashes on startup, we would not attempt to relaunch it. If there were web
        processes waiting for a connection to this network process, we would send them an invalid connection
        identifier which would cause them to forcefully crash.

        Instead, we now apply the same policy whether a network process crashes on startup or later:
        - We attempt to relaunch the network process
        - If there were pending connections from WebContent processes, we ask the new Network process instead.

        As a result, WebContent processes no longer crash in this case. Instead, they wait for a valid
        connection to the network process.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _makeNextNetworkProcessLaunchFailForTesting]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getLaunchOptions):
        (WebKit::NetworkProcessProxy::didFinishLaunching):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessCrashed):
        * UIProcess/WebProcessPool.h:

2018-06-26  Daniel Bates  <dabates@apple.com>

        REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
        https://bugs.webkit.org/show_bug.cgi?id=186090
        <rdar://problem/40692595>

        Reviewed by Andy Estes.

        Fixes an issue where a page P delivered with "X-Frame-Options: SAMEORIGIN" loaded in a sub-
        frame would be blocked if we were redirected to it in response to the cross-origin POST
        request regardless of whether P is same-origin with its parent document.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Compare the origin
        of the top frame's document as opposed to the source origin. The latter represents the
        origin of the document that initiated the navigation, which can be cross-origin, and
        should not be considered when applying "X-Frame-Options: SAMEORIGIN". This check exists
        as a performance optimization to avoid traversing over all frame ancestors only to find
        out that the innermost frame (the one that made this request) is cross-origin with the
        top-most frame.
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Exclude the origin of the
        frame that is making the load request from the list of ancestor origins. This makes the
        X-Frame-Options algorithm in WebKit2 match the logic we do in FrameLoader::shouldInterruptLoadForXFrameOptions().

2018-06-26  Youenn Fablet  <youenn@apple.com>

        Remove quarantine for Webex plugin
        https://bugs.webkit.org/show_bug.cgi?id=187050
        rdar://problem/41478189

        Reviewed by Brent Fulgham.

        Update the Plugin Info.plist to not do quarantine of downloaded files by default.
        Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

        * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
        * PluginProcess/PluginProcess.h:
        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::shouldOverrideQuarantine):
        * Shared/ChildProcess.h:
        (WebKit::ChildProcess::shouldOverrideQuarantine):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox):

2018-06-26  Jeremy Jones  <jeremyj@apple.com>

        Ensure element fullscreen animation is always visible.
        https://bugs.webkit.org/show_bug.cgi?id=187068
        rdar://problem/36187369

        Reviewed by Eric Carlson.

        The fullscreen animation is important for communicating to users that they are no longer in inline mode.
        If fullscreen animation's inline rect is not visible, animate from a point in the middle of the screen.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::safeInlineRect):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

2018-06-26  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile for com.google.o1dbrowserplugin plugin
        https://bugs.webkit.org/show_bug.cgi?id=187067

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-26  Tim Horton  <timothy_horton@apple.com>

        Promote two more experimental features to traditional features
        https://bugs.webkit.org/show_bug.cgi?id=187063

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:
        Promote some shipped/default-on features to non-experimental.

2018-06-26  Jiewen Tan  <jiewen_tan@apple.com>

        Rollout macOS sandbox change in r232276
        https://bugs.webkit.org/show_bug.cgi?id=186904
        <rdar://problem/41350969>

        Reviewed by Brent Fulgham.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

2018-06-26  Aditya Keerthi  <akeerthi@apple.com>

        Tap highlight displayed when tapping a field that is already focussed
        https://bugs.webkit.org/show_bug.cgi?id=187004
        <rdar://problem/41428008>
        Reviewed by Tim Horton.

        In the case where fast-clicking is enabled, _singleTapCommited: could be invoked
        before the tap highlight request, causing _potentialTapInProgress to be set to NO.
        This results in the early return for preventing multiple tap highlights on an
        assisted node to be skipped. Since a tap highlight should never be shown for an
        input field that is already focussed, _potentialTapInProgress can be removed from
        the early return condition.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):

2018-06-26  Timothy Horton  <timothy_horton@apple.com>

        Rearrange some WebPreferences; move two non-experimental prefs out of the experimental section

        * Shared/WebPreferences.yaml:

2018-06-26  Tim Horton  <timothy_horton@apple.com>

        Promote some experimental features to traditional features
        https://bugs.webkit.org/show_bug.cgi?id=187047

        Reviewed by Simon Fraser.

        * Shared/WebPreferences.yaml:
        Reindent.
        Promote some shipped/default-on features to non-experimental.

2018-06-26  Eric Carlson  <eric.carlson@apple.com>

        [Mac] AirPlay picker uses incorrect theme in Dark mode
        https://bugs.webkit.org/show_bug.cgi?id=187054
        <rdar://problem/41291093>

        Reviewed by Timothy Hatcher.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass m_defaultAppearance.

2018-06-26  Chris Dumez  <cdumez@apple.com>

        Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
        https://bugs.webkit.org/show_bug.cgi?id=186903
        <rdar://problem/41350182>

        Reviewed by Brady Eidson.

        Follow-up fix after r233180 to address an API test crash. We need to keep the
        NetworkProcessProxy alive during the async updatePrevalentDomainsToPartitionOrBlockCookies
        request to make sure it completes.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):

2018-06-26  Brent Fulgham  <bfulgham@apple.com>

        Provide a way for Injected Bundles to indicate classes approved for NSSecureCoding
        https://bugs.webkit.org/show_bug.cgi?id=186788
        <rdar://problem/41094167>

        Reviewed by Chris Dumez.

        InjectedBundles support a mechanism to serialize data between the UIProcess and the
        WebContent process hosting the bundle. In some cases, we want to be able to serialize
        a custom data object that is not part of WebKit's native data types.

        After switching to strict NSSecureCoding, WebKit clients attempting to serialize these
        custom objects trigger a failure.

        This patch makes it possible for the InjectedBundle author to specify one (or more) data
        classes that are allowed to be serialized between the two processes.
        
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleExtendClassesForParameterCoder): Added.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
        (createWKArray): Added.
        (-[WKWebProcessPlugInController extendClassesForParameterCoder:]): Added.
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::extendClassesForParameterCoder): Added.
        (WebKit::InjectedBundle::classesForCoder): New helper function.
        (WebKit::InjectedBundle::setBundleParameter): Modified to use the new set of valid
        classes for NSSecureCoding.

2018-06-26  Eric Carlson  <eric.carlson@apple.com>

        Enable mock capture devices on the iOS simulator
        https://bugs.webkit.org/show_bug.cgi?id=186846
        <rdar://problem/41289134>

        Reviewed by Youenn Fablet.

        * Shared/WebPreferences.yaml: Use DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED.
        * Shared/WebPreferencesDefaultValues.h: Define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED, set to
        true in the iOS simulator only.

2018-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains::<lambda_9d761a6dc12d95db7fa2d6f3f5aa26fa>'
        https://bugs.webkit.org/show_bug.cgi?id=187035

        Unreviewed build fix.

        MSVC can't compile the code using `this` in a generalized lambda
        capture in another lambda.

        In this case, there is no need to copy `protectedThis` for the
        inner lambda. Move `protectedThis` of the outer lambda to the
        inner as well as `completionHandler`.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
        Moved `protectedThis` from the outer lambda to the inner.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
        Ditto.

2018-06-26  Miguel Gomez  <magomez@igalia.com>

        [GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
        https://bugs.webkit.org/show_bug.cgi?id=179304

        Reviewed by Michael Catanzaro.

        Add a way to attach to the CompositingCoordinator layers that were not created by it.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::attachLayer):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

2018-06-25  Tim Horton  <timothy_horton@apple.com>

        WKThumbnailView fallback background is blindingly bright in Dark Mode
        https://bugs.webkit.org/show_bug.cgi?id=187017
        <rdar://problem/41036209>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        (-[_WKThumbnailView initWithFrame:]):
        (-[_WKThumbnailView wantsUpdateLayer]):
        (-[_WKThumbnailView updateLayer]):
        Use a semantic color for the WKThumbnailView background color
        instead of flat white.

2018-06-25  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
        https://bugs.webkit.org/show_bug.cgi?id=186903
        <rdar://problem/41350182>

        Reviewed by Chris Dumez.

        This patch stores the callback sent to
        WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(),
        sets up a context ID, and sends that ID to the network process when
        asking it to update cookie partitioning and blocking. The network
        process then tells the UI process when it's done, at which point the
        callback is called.

        This change is meant to address layout test flakiness.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
        (WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-06-25  Brent Fulgham  <bfulgham@apple.com>

        Allow access to APTDevice in iOS WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=187021
        <rdar://problem/41339769>

        Reviewed by Youenn Fablet.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2018-06-25  Keith Rollin  <krollin@apple.com>
        Unreviewed, rolling out r233087.

        Causes 5% Mac PLT regression.

        Reverted changeset:

        "Recalc styles every time defaultAppearance changes."
        https://bugs.webkit.org/show_bug.cgi?id=186866
        https://trac.webkit.org/changeset/233087

2018-06-25  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile to Hangout plug-in
        https://bugs.webkit.org/show_bug.cgi?id=187005
        <rdar://problem/41428391>

        Reviewed by Brent Fulgham.

        Add a sandbox profile so that this plug-in can be run when UIProcess is sandboxed.

        * Resources/PlugInSandboxProfiles/com.google.googletalkbrowserplugin.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-25  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should not check CORS for 304 responses triggered by WebProcess revalidation
        https://bugs.webkit.org/show_bug.cgi?id=186939
        <rdar://problem/40941725>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateResponse):

2018-06-25  Keith Rollin  <krollin@apple.com>

        Adjust UNEXPORTED_SYMBOL_LDFLAGS for LTO
        https://bugs.webkit.org/show_bug.cgi?id=186949
        <rdar://problem/41386438>

        Reviewed by David Kilzer.

        When building with LTO, WebKit's
        'check-for-weak-vtables-and-externals' script reports weak external
        symbols:

        ERROR: WebKit has a weak external symbol in it (.../OpenSource/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit)
        ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
        ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
        ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
        ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
        ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
        ERROR: symbol __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
        ERROR: symbol __ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
        ERROR: symbol __ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
        Command /bin/sh failed with exit code 1

        Address these by adding those symbols to UNEXPORTED_SYMBOL_LDFLAGS in
        WebKit.xcconfig.

        * Configurations/WebKit.xcconfig:

2018-06-25  Chris Dumez  <cdumez@apple.com>

        Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called
        https://bugs.webkit.org/show_bug.cgi?id=187007
        <rdar://problem/41293989>

        Reviewed by Brady Eidson.

        Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called by
        switching its type to WTF::CompletionHandler instead of WTF::Function. This also has the benefit
        of destroying our captured objects when the completion handler gets called by the client on the
        main thread instead of whatever thread the ObjC block gets released on.

        * UIProcess/API/APIIconLoadingClient.h:
        (API::IconLoadingClient::getLoadDecisionForIcon):
        * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView maybeInstallIconLoadingClient]):
        * UIProcess/Cocoa/IconLoadingDelegate.h:
        * UIProcess/Cocoa/IconLoadingDelegate.mm:
        (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

2018-06-25  Youenn Fablet  <youenn@apple.com>

        Add API to control mock media devices
        https://bugs.webkit.org/show_bug.cgi?id=186958

        Reviewed by Eric Carlson.

        Add API to clear, set, remove and reset mock media devices.
        The mock media center of UIProcess and all WebProcesses are updated.

        * CMakeLists.txt:
        * UIProcess/API/C/WKMockMediaDevice.cpp: Added.
        (typeFromString):
        (WKAddMockMediaDevice):
        (WKClearMockMediaDevices):
        (WKRemoveMockMediaDevice):
        (WKResetMockMediaDevices):
        * UIProcess/API/C/WKMockMediaDevice.h: Added.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addMockMediaDevice):
        (WebKit::WebProcessPool::clearMockMediaDevices):
        (WebKit::WebProcessPool::removeMockMediaDevice):
        (WebKit::WebProcessPool::resetMockMediaDevices):
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::addMockMediaDevice):
        (WebKit::WebProcess::clearMockMediaDevices):
        (WebKit::WebProcess::removeMockMediaDevice):
        (WebKit::WebProcess::resetMockMediaDevices):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-06-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPad apps on macOS] Click events are broken in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=186964
        <rdar://problem/41369145>

        Reviewed by Tim Horton.

        Tapping in WKWebView currently does not dispatch click events to the page. This is because the long press loupe
        gesture (in the text interaction assistant) has a delay of 0 when running iOS apps on macOS, but on iOS, it's
        0.5. The zero delay on macOS means that the loupe gesture will be recognized before the synthetic click gesture;
        this, in turn, causes the synthetic click gesture to be excluded by the loupe gesture. To address this, we
        simply allow the click and loupe gesture to recognize simultaneously.

        Additionally, a new hover gesture was added recently to handle macOS cursor types when hovering over selectable
        text. This patch also allows other gestures to recognize alongside hover gestures, which matches macOS behavior.

        We don't have the capacity to write automated tests for this yet; I manually tested text selection, editing in
        some text form controls, as well as clicking on links, buttons, and other elements with click event handlers.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):

2018-06-23  Brian Burg  <bburg@apple.com>

        [Mac] Web Automation: include correct key code with synthesized NSEvents used for keystrokes
        https://bugs.webkit.org/show_bug.cgi?id=186937

        Reviewed by Timothy Hatcher.

        In some cases, a missing keyCode for an ASCII letter/number can cause synthesized
        NSEvents to not be converted into a key equivalent action like copy: or paste:.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        Drive by, always initialize keyCode.

        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        (WebKit::keyCodeForCharKey): Compute the keyCode as defined by HLTB headers.
        This only needs to be computed for characters with physical keys, excluding the
        number pad and some traditional virtual keys that do not usually have glyphs.

2018-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix GTK debug build after r233131
        https://bugs.webkit.org/show_bug.cgi?id=186899
        <rdar://problem/38222248>

        This assertion was intended to be removed.

        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):

2018-06-21  Brian Burg  <bburg@apple.com>

        Web Automation: key actions should support multiple pressed virtual keys
        https://bugs.webkit.org/show_bug.cgi?id=186899
        <rdar://problem/38222248>

        Reviewed by Timothy Hatcher.

        This patch changes the protocol to allow multiple virtual keys per input source state.
        Chords like Cmd-Shift-A and Shift-F12 must be represented this way as they are encoded
        in the VirtualKey enum rather than as an ASCII char.

        * UIProcess/Automation/Automation.json:
        * UIProcess/Automation/SimulatedInputDispatcher.h:
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::simulateKeyboardInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::performInteractionSequence):

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        Also clean up the signature of WebAutomationSession::platformSimulateKeyboardInteraction
        to use a variant instead of mutually exclusive optional values with different types.

2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Add user-defined literal for ASCIILiteral
        https://bugs.webkit.org/show_bug.cgi?id=186839

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        (WebKit::NetworkCORSPreflightChecker::wasBlocked):
        (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::suggestedFilename const):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::checkRequest):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):
        (WebKit::PingLoad::didReceiveChallenge):
        (WebKit::PingLoad::timeoutTimerFired):
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::PreconnectTask):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::initialize):
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::toRecordInformation):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::cachesListFilename):
        (WebKit::CacheStorage::cachesOriginFilename):
        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
        (WebKit::NetworkCache::Statistics::initialize):
        (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
        (WebKit::NetworkCache::Statistics::queryWasEverRequested):
        (WebKit::NetworkCache::Statistics::clear):
        (WebKit::NetworkCache::Statistics::addHashesToDatabase):
        (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
        (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
        * Shared/Plugins/Netscape/PluginInformation.cpp:
        (WebKit::pluginInformationBundleIdentifierKey):
        (WebKit::pluginInformationBundleVersionKey):
        (WebKit::pluginInformationBundleShortVersionKey):
        (WebKit::pluginInformationPathKey):
        (WebKit::pluginInformationDisplayNameKey):
        (WebKit::pluginInformationDefaultLoadPolicyKey):
        (WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
        (WebKit::pluginInformationHasSandboxProfileKey):
        (WebKit::pluginInformationFrameURLKey):
        (WebKit::pluginInformationMIMETypeKey):
        (WebKit::pluginInformationPageURLKey):
        (WebKit::pluginInformationPluginspageAttributeURLKey):
        (WebKit::pluginInformationPluginURLKey):
        (WebKit::plugInInformationReplacementObscuredKey):
        * Shared/ios/WebIOSEventFactory.mm:
        (WebIOSEventFactory::createWebKeyboardEvent):
        * Shared/linux/WebMemorySamplerLinux.cpp:
        (WebKit::WebMemorySampler::sampleWebKit const):
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (debuggableTypeString):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_set_preferred_languages):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::setSessionPermissions):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::performInteractionSequence):
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/ChildProcessProxy.cpp:
        (WebKit::ChildProcessProxy::getLaunchOptions):
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::selectorExceptionMap):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::pluginsDirectories):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
        (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):
        (WebKit::UserMediaProcessManager::endedCaptureSession):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::goToItem):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadHTMLString):
        (WebKit::WebPageProxy::loadPlainTextString):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getLaunchOptions):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
        * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::notifyPages):
        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView copyForWebView:]):
        (-[WKContentView cutForWebView:]):
        (-[WKContentView pasteForWebView:]):
        (-[WKContentView selectAllForWebView:]):
        (-[WKContentView deleteBackward]):
        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
        * UIProcess/ios/WKLegacyPDFView.mm:
        (-[WKLegacyPDFView _URLForLinkAnnotation:]):
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
        (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::connectionToServerLost):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        (webkit_dom_document_get_ready_state):
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        (WebKit::uniqueWorldName):
        * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
        (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::pluginInfo):
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::validateResponse):
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        (WebKit::WebContextMenuClient::searchWithGoogle):
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::initialize):
        (WebKit::RemoteWebInspectorUI::didSave):
        (WebKit::RemoteWebInspectorUI::didAppend):
        (WebKit::RemoteWebInspectorUI::frontendLoaded):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openInNewTab):
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::setDockSide):
        (WebKit::WebInspectorUI::setDockingUnavailable):
        (WebKit::WebInspectorUI::setIsVisible):
        (WebKit::WebInspectorUI::showConsole):
        (WebKit::WebInspectorUI::showResources):
        (WebKit::WebInspectorUI::showTimelines):
        (WebKit::WebInspectorUI::showMainResourceForFrame):
        (WebKit::WebInspectorUI::startPageProfiling):
        (WebKit::WebInspectorUI::stopPageProfiling):
        (WebKit::WebInspectorUI::startElementSelection):
        (WebKit::WebInspectorUI::stopElementSelection):
        (WebKit::WebInspectorUI::didSave):
        (WebKit::WebInspectorUI::didAppend):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadStringImpl):
        (WebKit::WebPage::loadAlternateHTMLString):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::computeAutocorrectionContext):
        * WebProcess/WebProcess.cpp:
        (WebKit::getWebCoreMemoryCacheStatistics):
        (WebKit::WebProcess::getWebCoreStatistics):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeProcessName):

2018-06-22  Chris Dumez  <cdumez@apple.com>

        Regression(r230211): Crash under WebInspectorClient::~WebInspectorClient()
        https://bugs.webkit.org/show_bug.cgi?id=186950
        <rdar://problem/40602069>

        Reviewed by Darin Adler.

        Re-introduce null-check that was accidentally dropped in r230211.

        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::~WebInspectorClient):

2018-06-22  Timothy Hatcher  <timothy@apple.com>

        Corner of two scroll bars is white with dark mode enabled.
        https://bugs.webkit.org/show_bug.cgi?id=186819
        rdar://problem/40434350

        Reviewed by Tim Horton.

        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView drawRect:]): Added LocalDefaultSystemAppearance.
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::paintControlForLayerInContext): Ditto. Dropped ScrollView argument.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::drawRect): Added LocalDefaultSystemAppearance.

2018-06-22  Tim Horton  <timothy_horton@apple.com>

        Make it possible to add a border around loading or failed-to-load images
        https://bugs.webkit.org/show_bug.cgi?id=186614
        <rdar://problem/39050152>

        Reviewed by Zalan Bujtas.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _setColorFilterEnabled:]):
        (-[WKWebViewConfiguration _incompleteImageBorderEnabled]):
        (-[WKWebViewConfiguration _setIncompleteImageBorderEnabled:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        Plumb the setting to WebKit2.

2018-06-22  Brady Eidson  <beidson@apple.com>

        WKURLSchemeHandler doesn't handle sync XHR.
        <rdar://problem/40955884> and https://bugs.webkit.org/show_bug.cgi?id=186902

        Reviewed by Chris Dumez.

        This patch allows WebProcesses to block on sync loads to a custom scheme,
        and teaches WebURLSchemeTasks how to buffer up data and the response if 
        operating synchronously.

        * Shared/WebErrors.cpp:
        (WebKit::failedCustomProtocolSyncLoad):
        * Shared/WebErrors.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::startURLSchemeTask):
        (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::startTask):
        * UIProcess/WebURLSchemeHandler.h:

        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::create):
        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
        (WebKit::WebURLSchemeTask::didPerformRedirection):
        (WebKit::WebURLSchemeTask::didReceiveResponse):
        (WebKit::WebURLSchemeTask::didReceiveData):
        (WebKit::WebURLSchemeTask::didComplete):
        (WebKit::WebURLSchemeTask::pageDestroyed):
        (WebKit::WebURLSchemeTask::stop):
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::isSync const):

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebLoaderStrategy.h:

        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
        (WebKit::WebURLSchemeHandlerProxy::loadSynchronously):
        * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:

2018-06-22  Chris Dumez  <cdumez@apple.com>

        Implement IPC throttling to keep the main thread responsive when a process misbehaves
        https://bugs.webkit.org/show_bug.cgi?id=186607
        <rdar://problem/41073205>

        Reviewed by Geoff Garen and Brady Eidson.

        Implement IPC throttling to keep the main thread responsive when a process misbehaves.
        Instead of doing one main runloop dispatch per incoming message, we now do a single
        runloop dispatch and process incoming messages in batch. We put a limit on the number
        of messages to be processed in a batch (600). If the queue is larger that this limit,
        we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
        to process other events. Additionally, if an IPC connection keeps hitting this maximum
        batch size limit, we implement back off and we'll further decrease the number of messages
        we process in each batch (going as low as 60). This keeps Safari responsive enough to
        allow the user to close the bad tab (even on older devices such as iPhone 5s).

        Finally, if the incoming message queue becomes too large (50000), we go one step further
        and kill the IPC connection in order to maintain performance / battery life.

        Every time we apply throttling or terminate a connection due to throttling, we do a
        RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
        in the future.

        For now, incoming IPC messages throttling is only enabled on the UIProcess' connections
        to the WebProcesses.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::MessagesThrottler::MessagesThrottler):
        (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
        (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
        (IPC::Connection::dispatchIncomingMessages):
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::kill):

2018-06-22  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION (r231850): Cookie file cannot be read or written by network process
        https://bugs.webkit.org/show_bug.cgi?id=186806
        <rdar://problem/41113791>

        Unreviewed. Fix failure after r233084 by adding missing initialization.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-06-22  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Home indicator should show and hide with status bar
        https://bugs.webkit.org/show_bug.cgi?id=186942
        <rdar://problem/41302190>

        Reviewed by Tim Horton.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):
        (-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):

2018-06-22  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Add a pinch-to-exit gesture
        https://bugs.webkit.org/show_bug.cgi?id=186821

        Reviewed by Tim Horton.

        Add a pinch gesture recognizer that overrides the pan gesture recognizer when active. Hide the
        WKFullscreenViewController's controls while a dismiss gesture is active.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController setAnimating:]):
        (-[WKFullScreenViewController prefersStatusBarHidden]):
        (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
        (-[WKFullScreenViewController _touchDetected:]):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullscreenAnimationController context]):
        (-[WKFullscreenAnimationController updateWithProgress:scale:translation:anchor:]):
        (-[WKFullScreenInteractiveTransition animator]):
        (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withScale:andTranslation:]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController interactionControllerForDismissal:]):
        (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
        (-[WKFullScreenWindowController _dismissFullscreenViewController]):
        (-[WKFullScreenWindowController _interactiveDismissChanged:]):
        (-[WKFullScreenWindowController _interactivePinchDismissChanged:]):

2018-06-22  Brian Burg  <bburg@apple.com>

        [Cocoa] REGRESSION(W3C): actions for key equivalents are not respected
        https://bugs.webkit.org/show_bug.cgi?id=186936

        Reviewed by Timothy Hatcher.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
        This erroneously reported false unless there was both a mouse and key interaction
        being dispatched, which is not possible in the current serial event simulation model.
        As a result, Safari could not tell whether the action came from a simulated event
        or the user, and thus rejected all key equivalents like Cmd-A,V,C,X.

2018-06-22  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Exit fullscreen when opening a new tab
        https://bugs.webkit.org/show_bug.cgi?id=186826
        <rdar://problem/40853211>

        Reviewed by Brent Fulgham.

        Make the fullscreen placeholder view a custom UIView, and exit fullscreen when the
        placeholder is removed from its superview.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenPlaceholderView willMoveToSuperview:]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        (-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):
        (-[WKFullScreenWindowController _exitFullscreenImmediately]):

2018-06-22  Timothy Horton  <timothy_horton@apple.com>

        Fix the build after r233089

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setColorFilterEnabled:]):
        (-[WKPreferences _colorFilterEnabled]):

2018-06-22  Chris Dumez  <cdumez@apple.com>

        Crash under WebResourceLoadStatisticsStore::mergeStatistics(WTF::Vector<WebCore::ResourceLoadStatistics, 0ul, WTF::CrashOnOverflow, 16ul>&&)
        https://bugs.webkit.org/show_bug.cgi?id=186905
        <rdar://problem/41266775>

        Reviewed by Brent Fulgham.

        I believe the crash was caused by the WebResourceLoadStatisticsStore object being dead
        when mergeStatistics() is called. In particular, the crash was happening when the
        ResourceLoadStatisticsPersistentStorage's FileMonitor would detect a file change and
        we would re-sync statistics from the disk. The FileMonitor's lambda function was
        capturing |this| without ref'ing it, and the FileMonitor monitors the disk and
        calls the lambda on the background queue, while it gets destroyed on the main thread.

        To make lifetime management less complex, the following changes were made:
        - The ResourceLoadStatisticsPersistentStorage object is now always constructed / used
          and destroyed on the background queue. We no longer have to worry about being on
          the right thread in a given method.
        - Now that ResourceLoadStatisticsPersistentStorage is always used from the background
          queue and no longer needs to be thread-safe, drop its ref() / deref() methods and
          use weak pointers instead to make sure the ResourceLoadStatisticsPersistentStorage
          is still alive when a lamdba gets called on the background queue.
        - For write scheduling use WorkQueue::dispatchAfter() and a WeakPtr instead of a
          RunLoop::Timer. This is more convenient to use as the RunLoop::Timer has to be used
          on the main thread.

        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
        (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
        (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-21  Jer Noble  <jer.noble@apple.com>

        CRASH in WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac()
        https://bugs.webkit.org/show_bug.cgi?id=186892

        Reviewed by Eric Carlson.

        Protect against m_contentMap being mutated while its contents are being invalidated
        by moving the map into a local variable and iterating over it instead.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::invalidate):
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::invalidate):

2018-06-22  Luming Yin  <luming_yin@apple.com>

        Expose colorFilterEnabled SPI in WKPreferencesPrivate.h
        https://bugs.webkit.org/show_bug.cgi?id=186935
        <rdar://problem/41109387>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setColorFilterEnabled:]):
        (-[WKPreferences _colorFilterEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-06-22  Timothy Hatcher  <timothy@apple.com>

        Recalc styles every time defaultAppearance changes.
        https://bugs.webkit.org/show_bug.cgi?id=186866
        rdar://problem/41309805

        Reviewed by Tim Horton.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setDefaultAppearance):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setDefaultAppearance):

2018-06-22  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION (r231850): Cookie file cannot be read or written by network process
        https://bugs.webkit.org/show_bug.cgi?id=186806
        <rdar://problem/41113791>

        Reviewed by Geoffrey Garen.

        Add defaultSessionPendingCookies to NetworkProcessCreationParameters, so pending cookies of default session 
        can be added right after default session is set. This improves the fix r231850 as it does not send additional 
        message and avoids the regression.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::NetworkProcessProxy):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-06-22  Brent Fulgham  <bfulgham@apple.com>

        [iOS Debug] Multiple resourceLoadStatistics redirect tests are flaky timeouts
        https://bugs.webkit.org/show_bug.cgi?id=183216
        <rdar://problem/37992317>

        Reviewed by Chris Dumez.

        Improve consistency of test results by make sure that completion handlers written to run
        on the main thread are only called on the main thread. Add additional assertions to help
        catch any cases where this invariant is not being honored.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Use Completion handler and assert
        we are on the right thread.
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): 
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Update to perform callbacks
        on the main thread (as intended). This function was doing them on a work queue.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): Ditto.
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r230950): [GTK] WebKit::CoordinatedBackingStoreTile::setBackBuffer(): WebKitWebProcess killed by SIGSEGV (ASSERTION FAILED: it != m_tiles.end())
        https://bugs.webkit.org/show_bug.cgi?id=186206

        Unreviewed manual rollout of r230950

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::layerShouldHaveBackingStore):

2018-06-20  Darin Adler  <darin@apple.com>

        [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
        https://bugs.webkit.org/show_bug.cgi?id=186875

        Reviewed by Anders Carlsson.

        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): Use isDirectory:YES to create a URL
        to the temporary directory.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): Use isDirectory:NO to create a URL
        pointing to the write location.
        * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
        (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const): Use isDirectory:YES to
        create a URL for the local storage directory.
        * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
        (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup const): Use isDirectory:NO to
        create a URL for the storage directory.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _prepareToDragPromisedBlob:]): Use isDirectory:NO to create a URL for the temporary
        file location.
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]): Use isDirectory:NO
        to create a URL for the image file to upload.
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::inspectorPageURL): Use isDirectory:NO to create a URL for the HTML file.
        (WebKit::WebInspectorProxy::inspectorTestPageURL): Ditto.
        (WebKit::WebInspectorProxy::inspectorBaseURL): Ditto.
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::createIconForFiles): Use isDirectory:NO to create a URL for the image file.
        * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
        (WebKit::webInspectorUILocalizedStringsURL): Use isDirectory:NO to create a URL for the localized
        strings file.

2018-06-21  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r232995.

        Seems to have caused flakiness

        Reverted changeset:

        "Implement IPC throttling to keep the main thread responsive
        when a process misbehaves"
        https://bugs.webkit.org/show_bug.cgi?id=186607
        https://trac.webkit.org/changeset/232995

2018-06-15  Jer Noble  <jer.noble@apple.com>

        Address fullscreen api CSS env feedback
        https://bugs.webkit.org/show_bug.cgi?id=186684

        Reviewed by Simon Fraser.

        + Update the phishing alert text to be more explicit about the specific threats
          phishing sites represent.
        + Make the top inset static, rather than dynamic.
        + Add bottom, left, and right insets for completeness.
        + Set the fullscreen animation duration as well as delay.
        + Notify the page when the controls show and hide.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming):
        (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop): Deleted.
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay): Deleted.
        * UIProcess/WebFullScreenManagerProxy.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):
        (-[WKFullScreenViewController viewWillAppear:]):
        (-[WKFullScreenViewController _effectiveFullscreenInsets]):
        (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
        (-[WKFullScreenViewController _showPhishingAlert]):
        (-[WKFullScreenViewController _effectiveFullscreenInsetTop]): Deleted.
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::didExitFullScreen):
        (WebKit::WebFullScreenManager::setFullscreenInsets):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming):
        (WebKit::WebFullScreenManager::setFullscreenControlsHidden):
        (WebKit::WebFullScreenManager::setFullscreenInsetTop): Deleted.
        (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay): Deleted.
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/FullScreen/WebFullScreenManager.messages.in:

2018-06-21  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r232884.
        https://bugs.webkit.org/show_bug.cgi?id=186891

        "Introduced assertion failure in ~DisplayRefreshMonitorMac()."
        (Requested by perarne on #webkit).

        Reverted changeset:

        "DisplayRefreshMonitorMac should hold a weak pointer to
        WebPage."
        https://bugs.webkit.org/show_bug.cgi?id=186683
        https://trac.webkit.org/changeset/232884

2018-06-21  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=186822

        Reviewed by Simon Fraser.

        Set the minimum zoom, maximum zoom, zoom bouncing, and user scalability settings of the
        WKWebView's UIScrollView upon entering fullscreen, and restore those same settings upon
        exit. Override the viewport arguments upon entering fullscreen, restore them upon exit.

        * Platform/IPC/ArgumentCoder.h:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ViewportArguments>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::forceAlwaysUserScalable const):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setOverrideViewportArguments):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::WKWebViewState::applyTo):
        (WebKit::WKWebViewState::store):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::forceAlwaysUserScalable const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setOverrideViewportArguments):

2018-06-21  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Use secondary glyph style for fullscreen controls
        https://bugs.webkit.org/show_bug.cgi?id=186862
        <rdar://problem/41212210>

        Reviewed by Tim Horton.

        Adopt AVBackgroundView, and use its predefined enums to set the material and tint styles for
        the fullscreen controls.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController loadView]):
        * UIProcess/ios/fullscreen/WKFullscreenStackView.h:
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        (-[WKFullscreenStackView init]):
        (-[WKFullscreenStackView dealloc]):
        (-[WKFullscreenStackView addArrangedSubview:applyingMaterialStyle:tintEffectStyle:]):
        (-[WKFullscreenStackView layoutSubviews]):
        (+[WKFullscreenStackView baseEffects]): Deleted.
        (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]): Deleted.
        (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]): Deleted.
        (+[WKFullscreenStackView secondaryMaterialOverlayView]): Deleted.
        (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]): Deleted.
        (+[WKFullscreenStackView applySecondaryGlyphTintToView:]): Deleted.
        (-[WKFullscreenStackView initWithArrangedSubviews:axis:]): Deleted.
        (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]): Deleted.
        (-[WKFullscreenStackView contentView]): Deleted.
        (-[WKFullscreenStackView _setArrangedSubviews:axis:]): Deleted.
        (-[WKFullscreenStackView setBounds:]): Deleted.
        (-[WKFullscreenStackView updateConstraints]): Deleted.

2018-06-21  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Suspend page (and pause video) while phishing warning is presented
        https://bugs.webkit.org/show_bug.cgi?id=186856
        <rdar://problem/41212444>

        Reviewed by Tim Horton.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]):

2018-06-21  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r232989.

        Causes API regressions on macOS

        Reverted changeset:

        "REGRESSION (r231850): Cookie file cannot be read or written
        by network process"
        https://bugs.webkit.org/show_bug.cgi?id=186806
        https://trac.webkit.org/changeset/232989

2018-06-21  Zan Dobersek  <zdobersek@igalia.com>

        [GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
        https://bugs.webkit.org/show_bug.cgi?id=186884

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (webkitAutomationSessionCreate): Handle any host-certificate pair that's
        been set for this session, creating a GTlsCertificate object through
        loading from the specified certificate path and marking that certificate
        as allowed for the specified host through the
        webkit_web_context_allow_tls_certificate_for_host() API.

2018-06-21  Chris Dumez  <cdumez@apple.com>

        Regression(r226990) : Crash under WebCore::Page::applicationWillResignActive
        https://bugs.webkit.org/show_bug.cgi?id=186850
        <rdar://problem/37394469>

        Reviewed by Eric Carlson.

        Make sure m_page is not null before calling applicationWillResignActive(). m_page
        gets nulled out when WebPage::close() is called. The crash trace seems to indicate
        we're calling applicationWillResignActive() on a Page that is dead since we crash
        accessing Page::mainFrame().

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::applicationWillResignActive):

2018-06-21  Fujii Hironori  <Hironori.Fujii@sony.com>

        [GTK] http/tests/misc/bubble-drag-events.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=182352

        Reviewed by Carlos Garcia Campos.

        PingLoad::didFinish was called twice if it is used with
        NetworkDataTaskSoup. PingLoad is not a ref-counted object. It is
        destructed when PingLoad::didFinish is called.

        PingLoad::didReceiveChallenge calls the ChallengeCompletionHandler
        with AuthenticationChallengeDisposition::Cancel to cancel the
        challenge and calls PingLoad::didFinish.

        NetworkDataTaskSoup::continueAuthenticate calls
        didReceiveChallenge with a ChallengeCompletionHandler which calls
        didCompleteWithError. PingLoad::didCompleteWithError calls
        PingLoad::didFinish.

        didCompleteWithError callback should not be called in the
        ChallengeCompletionHandler.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::continueAuthenticate): Do not call
        didFail() in the ChallengeCompletionHandler. Call
        invalidateAndCancel() instead.

2018-06-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Fixed position elements sometimes flicker when scrolling
        https://bugs.webkit.org/show_bug.cgi?id=186860
        <rdar://problem/39953563>

        Reviewed by Tim Horton.

        Remove conditional guards that are no longer necessary, now that the oldest iOS version our builders support is
        iOS 11. Conditionalizing this logic only for iOS 11+ meant that on watchOS, we're always falling down the path
        where we don't schedule a visible content rect update until the next runloop, which makes it possible for a
        remote layer tree transaction to arrive and cause us to update the scrolling tree with stale viewport geometry.

        Test: WKScrollViewTests.PositionFixedLayerAfterScrolling

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

2018-06-20  Megan Gardner  <megan_gardner@apple.com>

        Restrict Selection in contenteditable the extent of that contenteditable
        https://bugs.webkit.org/show_bug.cgi?id=186792

        Reviewed by Wenson Hsieh.

        We have not been checking to make sure that when we make a selection that it is restricted to 
        a single content editable on iOS. There is functionality to ensure this on mac, so it has been
        exposed and utilized for restricting the extent of a selection.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateSelectionWithTouches):

2018-06-19  Dean Jackson  <dino@apple.com>

        Blank viewer comes up and then auto-dismisses when device is not connected to Internet
        https://bugs.webkit.org/show_bug.cgi?id=186825
        <rdar://problem/40294170>

        Reviewed by Tim Horton.

        Handle the case where the network load fails, and send that
        error onto QuickLook.

        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didReceiveResponse): Check for success.
        (WebKit::DownloadClient::processDidCrash): Cancel in the case of a crash.
        (WebKit::DownloadClient::didFail): Propagate the error onto QuickLook.
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource failWithError:]): New method that calls
        the completion handler with the error data.
        (WebKit::SystemPreviewController::fail): New API method.
        * UIProcess/SystemPreviewController.h:

2018-06-19  Chris Dumez  <cdumez@apple.com>

        Implement IPC throttling to keep the main thread responsive when a process misbehaves
        https://bugs.webkit.org/show_bug.cgi?id=186607
        <rdar://problem/41073205>

        Reviewed by Geoffrey Garen.

        Implement IPC throttling to keep the main thread responsive when a process misbehaves.
        Instead of doing one main runloop dispatch per incoming message, we now do a single
        runloop dispatch and process incoming messages in batch. We put a limit on the number
        of messages to be processed in a batch (600). If the queue is larger that this limit,
        we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
        to process other events. Additionally, if an IPC connection keeps hitting this maximum
        batch size limit, we implement back off and we'll further decrease the number of messages
        we process in each batch (going as low as 60). This keeps Safari responsive enough to
        allow the user to close the bad tab (even on older devices such as iPhone 5s).

        Finally, if the incoming message queue becomes too large (50000), we go one step further
        and kill the IPC connection in order to maintain performance / battery life.

        Every time we apply throttling or terminate a connection due to throttling, we do a
        RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
        in the future.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::MessagesThrottler::MessagesThrottler):
        (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
        (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
        (IPC::Connection::dispatchIncomingMessages):
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::kill):

2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>

        Make SecItemShim to not send return value for SecItemAdd
        https://bugs.webkit.org/show_bug.cgi?id=186789
        <rdar://problem/40892596>

        Reviewed by Brent Fulgham.

        Return value of SecItemAdd is often ignored. Even if it isn't, we don't have the ability to serialize SecKeychainItemRef.
        Otherwise, it would go through the weird route of serializing SecKeychainItemRef by asking Keychain for its persistent
        reference. This route contradicts the purpose of SecItemShim, which is to proxy all Keychain operations to UIProcess.

        Also, this patch removes the release assertion on encode(Encoder&, SecAccessControlRef) and decode(Decoder&, RetainPtr<SecAccessControlRef>&)
        as they don't query Keychain.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode):
        (IPC::decode):
        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):
        (WebKit::webSecItemAdd):
        * UIProcess/mac/SecItemShimProxy.cpp:
        (WebKit::SecItemShimProxy::secItemRequest):
        * UIProcess/mac/SecItemShimProxy.h:
        * UIProcess/mac/SecItemShimProxy.messages.in:

2018-06-19  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION (r231850): Cookie file cannot be read or written by network process
        https://bugs.webkit.org/show_bug.cgi?id=186806
        <rdar://problem/41113791>

        Reviewed by Geoffrey Garen.

        Default websiteDataStore may be added wrongly to network process before default session was 
        set, as messages were asynchronous, so the cookie storage could be improperly set.   

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-06-19  Don Olmstead  <don.olmstead@sony.com>

        Use getCurrentProcessID over getpid
        https://bugs.webkit.org/show_bug.cgi?id=186813

        Reviewed by Alex Christensen.

        * Shared/WebMemorySampler.cpp:
        (WebKit::WebMemorySampler::initializeTimers):
        (WebKit::WebMemorySampler::stop):
        (WebKit::WebMemorySampler::writeHeaders):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):

2018-06-19  Don Olmstead  <don.olmstead@sony.com>

        WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations does not invoke callback when Service Workers disabled
        https://bugs.webkit.org/show_bug.cgi?id=186809

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):

2018-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Vend username text content type when using scribble in login fields
        https://bugs.webkit.org/show_bug.cgi?id=186791
        <rdar://problem/41226935>

        Reviewed by Beth Dakin.

        Vend additional context to Quickboard when focusing an element that is likely to be a username field.

        Test: fast/forms/watchos/username-text-content-type.html

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:

        Add a new flag to tell the UI process when the currently focused element is an autofillable username input
        field (using existing app autofill heuristics).

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView textContentTypeForTesting]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        Add new testing SPI to grab the computed text content type for the focused element.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (contentTypeFromFieldName):

        If `autocomplete="username"` is specified, return a username text content type. This was not originally added in
        r197626 because UITextContentTypeUsername was only introduced later, in iOS 11.

        (-[WKContentView textContentTypeForListViewController:]):
        (-[WKContentView textContentTypeForTesting]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

2018-06-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r232947.

        Caused an API test to time out

        Reverted changeset:

        "Implement IPC throttling to keep the main thread responsive
        when a process misbehaves"
        https://bugs.webkit.org/show_bug.cgi?id=186607
        https://trac.webkit.org/changeset/232947

2018-06-19  Chris Dumez  <cdumez@apple.com>

        HTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
        https://bugs.webkit.org/show_bug.cgi?id=186735
        <rdar://problem/41189164>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/cache/NetworkCacheCoders.cpp:
        (WTF::Persistence::Coder<WebCore::HTTPHeaderMap>::decode):

2018-06-19  Youenn Fablet  <youenn@apple.com>

        Network Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=186312
        <rdar://problem/40495434>

        Reviewed by Chris Dumez.

        Add buffering of all request/response of a given load, including redirections and preflights.
        This buffering is switched on/off by a boolean which is switched on in case Web Inspector is launched.

        Buffering is done in NetworkLoadChecker.
        We add ways to retrieve preflight information from NetworkCORSPreflightChecker.

        Implement LoaderStrategy new methods through sync IPC.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
        (WebKit::NetworkCORSPreflightChecker::startPreflight):
        (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
        (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
        (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
        (WebKit::NetworkCORSPreflightChecker::takeInformation):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationRequest):
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadIntermediateInformation):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformation):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::check):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::checkResponse):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        (WebKit::NetworkLoadChecker::storeRedirection):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::takeNetworkLoadInformation):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        * Scripts/webkit/messages.py:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
        * WebProcess/Network/WebLoaderStrategy.h:

2018-06-19  Brent Fulgham  <bfulgham@apple.com>

        MAP_JIT is not present for minimal simulator builds
        https://bugs.webkit.org/show_bug.cgi?id=186608

        Reviewed by Darin Adler.

        * Configurations/WebContent-iOS-minimalsimulator.entitlements:

2018-06-18  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make sure to call callbacks even if there is no store (test infrastructure)
        https://bugs.webkit.org/show_bug.cgi?id=186777
        <rdar://problem/41216181>

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):

2018-06-18  Chris Dumez  <cdumez@apple.com>

        Crash under WebProcessPool::networkProcessFailedToLaunch():
        https://bugs.webkit.org/show_bug.cgi?id=186784
        <rdar://problem/33535377>

        Reviewed by Brady Eidson.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (+[WKProcessPool _allProcessPoolsForTesting]):
        Add SPI to retrieve all WebProcessPool for testing purposes.

        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::clearCallbackStates):
        Make iteration over completion handlers robust against completion handlers
        getting removed while we iterate.

        (WebKit::NetworkProcessProxy::didClose):
        Ref the WebProcessPool (which keeps the NetworkProcessProxy alive too)
        as several calls within this method might cause the WebProcessPool /
        NetworkProcessProxy to get destroyed.

2018-06-18  Chris Dumez  <cdumez@apple.com>

        Implement IPC throttling to keep the main thread responsive when a process misbehaves
        https://bugs.webkit.org/show_bug.cgi?id=186607

        Reviewed by Geoffrey Garen.

        Implement IPC throttling to keep the main thread responsive when a process misbehaves.
        Instead of doing one main runloop dispatch per incoming message, we now do a single
        runloop dispatch and process incoming messages in batch. We put a limit on the number
        of messages to be processed in a batch (600). If the queue is larger that this limit,
        we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
        to process other events. Additionally, if an IPC connection keeps hitting this maximum
        batch size limit, we implement back off and we'll further decrease the number of messages
        we process in each batch (going as low as 60). This keeps Safari responsive enough to
        allow the user to close the bad tab (even on older devices such as iPhone 5s).

        Finally, if the incoming message queue becomes too large (50000), we go one step further
        and kill the IPC connection in order to maintain performance / battery life.

        Every time we apply throttling or terminate a connection due to throttling, we do a
        RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
        in the future.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::MessagesThrottler::MessagesThrottler):
        (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
        (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
        (IPC::Connection::dispatchIncomingMessages):
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::kill):

2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>

        Add a graceful exit for AuthenticationManager::initializeConnection
        https://bugs.webkit.org/show_bug.cgi?id=186632
        <rdar://problem/41041033>

        Reviewed by Brent Fulgham.

        Add a graceful exit for AuthenticationManager::initializeConnection when the provided IPC connection
        is null or the underlying xpc connection is null.

        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection):

2018-06-18  Youenn Fablet  <youenn@apple.com>

        Validate Cross-Origin-Resource-Policy for resources cached in the MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=186639
        <rdar://problem/41106984>

        Reviewed by Geoffrey Garen.

        Make use of WebCore method to check CORP.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:

2018-06-18  Karl Leplat  <karl.leplat_ext@softathome.com>

        [Threaded paintingEngine] Fix rendering glitches
        https://bugs.webkit.org/show_bug.cgi?id=186764

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
        (WebKit::CoordinatedBackingStoreTile::swapBuffers):
        We call Nicosia::Buffer function waitUntilPaintingComplete()
        in order to synchronize of using Nicosia:buffer between MainThread
        and ThreadedCompositor.


2018-06-17  Chris Dumez  <cdumez@apple.com>

        Crash under SuspendedPageProxy::~SuspendedPageProxy()
        https://bugs.webkit.org/show_bug.cgi?id=186688
        <rdar://problem/41060769>

        Reviewed by Darin Adler.

        Ref the WebProcessProxy before calling suspendedPageWasDestroyed() on it as this
        might cause the WebProcessProxy / WebProcessPool to get destroyed otherwise, and
        we would crash trying to call unregisterSuspendedPageProxy() on the WebProcessPool
        on the next line.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):

2018-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Darin Adler.

        Rename a category referencing "Extra zoom mode".

        * UIProcess/ios/WKContentViewInteraction.mm:

2018-06-12  Darin Adler  <darin@apple.com>

        [Cocoa] Make some RetainPtr refinements to get more ready for ARC
        https://bugs.webkit.org/show_bug.cgi?id=186526

        Reviewed by Anders Carlsson.

        * Platform/cf/ModuleCF.cpp:
        (WebKit::Module::load): Use move assignment instead of adoptCF/leakRef.

        * Shared/Cocoa/WKNSURLExtras.mm:
        (+[NSURL _web_URLWithWTFString:]): Cast to NSURL * instead of doing the autorelease
        here, since the NSURL * operator already does what we want.
        (+[NSURL _web_URLWithWTFString:relativeToURL:]): Ditto.

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_printedDocument]): Get rid of incorrect use of
        RetainPtr::autorelease. We don't want to null out _printedDocument each time this
        function is called.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        (collectIcons): Get rid of unnecessary use of RetainPtr::autorelease in a function
        that returns a RetainPtr.

2018-06-15  Chris Dumez  <cdumez@apple.com>

        Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
        https://bugs.webkit.org/show_bug.cgi?id=186681

        Reviewed by Brady Eidson.

        Make sure StorageProcess::unregisterSWServerConnection() does not unnecessarily
        create a SWServer. Otherwise, we were in quick session destroying the SWServer
        and then re-constructing it for the same sessionID, merely to try ot unregister
        a SWServerConnection.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::existingSWOriginStoreForSession const):
        (WebKit::StorageProcess::unregisterSWServerConnection):
        * StorageProcess/StorageProcess.h:

2018-06-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [WinCairo] Move unrelated features of WorkQueueWin into IPC::Connection
        https://bugs.webkit.org/show_bug.cgi?id=186582

        Add EventListener private class to handle signaled tasks for I/O.
        Originally they were in WTF::WorkQueueWin, but those features were not related
        to WorkQueue and only used in IPC::ConnectionWin. Moved logic is more specialized
        than old generalized logic. That was unneeded generalization.

        Reviewed by Brent Fulgham.

        * Platform/IPC/Connection.h:
        (IPC::Connection::EventListener::state):
        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::platformInitialize):
        (IPC::Connection::platformInvalidate):
        (IPC::Connection::readEventHandler):
        (IPC::Connection::writeEventHandler):
        (IPC::Connection::invokeReadEventHandler):
        (IPC::Connection::invokeWriteEventHandler):
        (IPC::Connection::open):
        (IPC::Connection::sendOutgoingMessage):
        (IPC::Connection::EventListener::open):
        (IPC::Connection::EventListener::callback):
        (IPC::Connection::EventListener::close):

2018-06-15  Brady Eidson  <beidson@apple.com>

        Crash in both StorageProcess and UIProcess when using custom WKWebsiteDataStores for data management.
        <rdar://problem/41019893> and https://bugs.webkit.org/show_bug.cgi?id=186682

        Reviewed by Chris Dumez.

        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::didClose): Protect this and the process pool as the cleanup that follows
          might cause either to get destroyed.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply): Protect the operating WebsiteDataStore while async operations
          are in flight. Otherwise if the data store is destroyed, the SessionIDs for those operations will get
          destroyed before they complete.
        (WebKit::WebsiteDataStore::removeData): Ditto.

2018-06-15  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r232634.

        * WebProcess/WebPage/DrawingArea.h:
        * WebProcess/WebPage/DrawingArea.messages.in:

2018-06-15  Per Arne Vollan  <pvollan@apple.com>

        DisplayRefreshMonitorMac should hold a weak pointer to WebPage.
        https://bugs.webkit.org/show_bug.cgi?id=186683

        Reviewed by Brent Fulgham.

        Instead of DisplayRefreshMonitorMac having a RefPtr to WebPage, it should have a weak pointer.
        Having a RefPtr could in theory create reference cycles. This potential problem has not been
        observed in practice, but it is safer to use a weak pointer.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
        (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):

2018-06-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WKE] Disable memory pressure handling when running layout tests (WTR)
        https://bugs.webkit.org/show_bug.cgi?id=186663

        Reviewed by Michael Catanzaro.

        r196943 added a mechanism to disable the memory pressure handling
        on Mac. This patch enables using that mechanism also for GTK/WPE.
        To do that the environment variable WEBKIT_DISABLE_MEMORY_PRESSURE_MONITOR
        should bet set to 1.
        We want to use this on the layout tests to avoid flaky tests caused
        by accumulated leaks on the WebProcess by different tests.

        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/wpe/WebProcessPoolWPE.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2018-06-15  Per Arne Vollan  <pvollan@apple.com>

        Rollout r231818, as it introduced regression on tickets.com.
        https://bugs.webkit.org/show_bug.cgi?id=186675

        Unreviewed, rolling out.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::pause): Deleted.
        (WebKit::DisplayLink::resume): Deleted.
        * UIProcess/mac/DisplayLink.h:

2018-06-15  Thibault Saunier  <tsaunier@igalia.com>

        [GTK][WPE]: Avoid using uninitialized launchOptions in getLaunchOptions
        https://bugs.webkit.org/show_bug.cgi?id=185611

        Reviewed by Chris Dumez.

        Otherwise we might segfault.

        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::getLaunchOptions):

2018-06-14  Youenn Fablet  <youenn@apple.com>

        Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
        https://bugs.webkit.org/show_bug.cgi?id=186166

        Reviewed by Alex Christensen.

        Make CacheStorage::Engine creation asynchronous.
        Update Engine public methods be static methods taking a SessionID, which will be used to create the engine.

        Add IPC methods to retrieve cache storage parameters from NetworkProcess to UIProcess.

        Add NetworkProcessProxy ability to compute the cache storage parameters based on the SessionID.
        For that purpose, make NetworkProcessProxy store a map of SessionID-to-WebsiteDataStore.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::cacheStorageParameters):
        (WebKit::NetworkProcess::setCacheStorageParameters):
        (WebKit::NetworkProcess::cacheStorageDirectory const): Deleted.
        (WebKit::NetworkProcess::cacheStoragePerOriginQuota const): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::from):
        (WebKit::CacheStorage::Engine::fetchEntries):
        (WebKit::CacheStorage::Engine::open):
        (WebKit::CacheStorage::Engine::remove):
        (WebKit::CacheStorage::Engine::retrieveCaches):
        (WebKit::CacheStorage::Engine::retrieveRecords):
        (WebKit::CacheStorage::Engine::putRecords):
        (WebKit::CacheStorage::Engine::deleteMatchingRecords):
        (WebKit::CacheStorage::Engine::lock):
        (WebKit::CacheStorage::Engine::unlock):
        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
        (WebKit::CacheStorage::Engine::representation):
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        (WebKit::CacheStorage::Engine::Engine):
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::defaultEngine): Deleted.
        * NetworkProcess/cache/CacheStorageEngine.h:
        (WebKit::CacheStorage::Engine::shouldPersist const):
        (WebKit::CacheStorage::Engine::weakPtrFactory):
        (WebKit::CacheStorage::Engine::create): Deleted.
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::remove):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
        (WebKit::CacheStorageEngineConnection::putRecords):
        (WebKit::CacheStorageEngineConnection::reference):
        (WebKit::CacheStorageEngineConnection::dereference):
        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
        (WebKit::CacheStorageEngineConnection::engineRepresentation):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * Shared/WebsiteDataStoreParameters.h:
        (): Deleted.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::addSession):
        (WebKit::NetworkProcessProxy::removeSession):
        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):

2018-06-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Win] Add IPC error case for broken pipe
        https://bugs.webkit.org/show_bug.cgi?id=186445

        Add error handling for ERROR_BROKEN_PIPE on IPC::Connection::readEventHandler.

        Reviewed by Ryosuke Niwa.

        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::readEventHandler):

2018-06-14  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Shortcut classification for redirect to prevalent resource
        https://bugs.webkit.org/show_bug.cgi?id=186627
        <rdar://problem/41132308>

        Reviewed by Brent Fulgham.

        This patch shortcuts classification of redirect collusion so that we more seldom
        have to rely on the recursive backtrace of the redirect graph. The initial
        implementation of Resource Load Statistics actually had this classification method.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent):
            Iterates through a non-classified resource's data for where it has redirected
            and classifies it as prevalent if has redirected to 
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
            Now calls WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent()
            before regular classification steps. 
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-14  Youenn Fablet  <youenn@apple.com>

        Apply CSP checks before Content blocker checks in NetworkLoadChecker as done by CachedResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=186550

        Reviewed by Alex Christensen.

        Do CSP checks and URL upgrade before content blocker checks.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):

2018-06-14  Brent Fulgham  <bfulgham@apple.com>

        Plug-in Process crashing on Mojave (affects Flash, others)
        https://bugs.webkit.org/show_bug.cgi?id=186628
        <rdar://problem/41120462>

        Reviewed by Eric Carlson.

        Add the missing “com.apple.security.cs.allow-unsigned-executable-memory” entitlement. Also alphabetize
        the entitlements file to make it easier to read.

        * Configurations/PluginService.entitlements:

2018-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] WebDriver: handle acceptInsecureCertificates capability
        https://bugs.webkit.org/show_bug.cgi?id=186560

        Reviewed by Brian Burg.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (webkitAutomationSessionCreate): Check the acceptInsecureCertificates capability and set the TLS error policy in
        the WebContext accordingly if needed.
        * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        * UIProcess/Cocoa/AutomationClient.h:
        * UIProcess/Cocoa/AutomationClient.mm:
        (WebKit::AutomationClient::requestAutomationSession): Use SessionCapabilities to fill the session configuration.
        (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): Deleted.

2018-06-13  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Trying to access the remote inspector hits an assertion in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=186588

        Reviewed by Carlos Garcia Campos.

        Make both the WPE and GTK+ ports use /org/webkit/inspector as base prefix
        for resource paths, which avoids needing a switcheroo depending on the port.

        * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml:
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        * UIProcess/wpe/WebInspectorProxyWPE.cpp:
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL):

2018-06-13  Chris Dumez  <cdumez@apple.com>

        Crash under SWServer::unregisterConnection(Connection&)
        https://bugs.webkit.org/show_bug.cgi?id=186584
        <rdar://problem/40931680>

        Reviewed by Youenn Fablet.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/StorageToWebProcessConnection.cpp:
        (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
        (WebKit::StorageToWebProcessConnection::didReceiveMessage):
        (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
        (WebKit::StorageToWebProcessConnection::didClose):
        (WebKit::StorageToWebProcessConnection::unregisterSWConnections):
        (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
        * StorageProcess/StorageToWebProcessConnection.h:

2018-06-13  Dean Jackson  <dino@apple.com>

        Disable AR support in WKWebView clients
        https://bugs.webkit.org/show_bug.cgi?id=186611
        <rdar://problem/39544684>

        Reviewed by Jon Lee.

        Since it hasn't been adequately tested, System Preview (AR) should
        be disabled by default for WKWebViews.

        Add a new WebPreference, and SPI into WKWebViewConfiguration. Also
        don't register the WebViewContentProvider if the feature is
        disabled.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration encodeWithCoder:]):
        (-[WKWebViewConfiguration initWithCoder:]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _contentProviderRegistry]):
        (-[WKWebViewConfiguration _systemPreviewEnabled]):
        (-[WKWebViewConfiguration _setSystemPreviewEnabled:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
        (-[WKWebViewContentProviderRegistry init]): Deleted.

2018-06-13  Youenn Fablet  <youenn@apple.com>

        Supported plugin check should be based on plugin identifier
        https://bugs.webkit.org/show_bug.cgi?id=186578
        <rdar://problem/40523828>

        Reviewed by Darin Adler.

        Refactoring to move from Plugin name to Plugin identifier.
        Set built-in pdf plugin identifier.
        This allows making sure that the PDF plug-in check might not change according localization.

        * Scripts/webkit/messages.py:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PluginInfo>::encode):
        (IPC::ArgumentCoder<PluginInfo>::decode):
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::supportedPluginIdentifiers):
        (WebKit::PluginInfoStore::addSupportedPlugin):
        (WebKit::PluginInfoStore::supportedPluginNames): Deleted.
        * UIProcess/Plugins/PluginInfoStore.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPlugins):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::pluginInfo):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::pluginInfo):
        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
        (WebKit::WebPluginInfoProvider::populatePluginCache):
        * WebProcess/Plugins/WebPluginInfoProvider.h:

2018-06-13  Chris Dumez  <cdumez@apple.com>

        PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
        https://bugs.webkit.org/show_bug.cgi?id=186545

        Reviewed by Brady Eidson.

        Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
        This information was previously logged in DocumentLoader::willSendRequest() and was getting
        sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
        statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
        WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
        DocumentLoader::willSendRequest()).

        This is more efficient and will also be needed soon due to the way process swap on navigation 
        deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
        the load and started a new load to the redirected to URL in the new WebProcess. As a result,
        the new WebProcess is not aware that the load is a redirect, which is information that ITP
        requires. By moving the ITP logging to the UIProcess, we still have access to this
        information.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        - We now pass the full redirect response the the delegate method instead of a simple
        isRedirect boolean.
        - Log the navigation in the WebResourceLoadStatisticsStore for ITP purposes.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::areDomainsAssociated):
        Equivalent of ResourceLoadObserver's areDomainsAssociated(). Most of the logic was moved
        to ResourceLoadStatistics::areDomainsAssociated() to avoid code duplication.

        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        This is called whenever a WebProcess sends new resource load statistics to the UIProcess.
        Whenever this happens, we call processStatisticsAndDataRecords() right away, which is
        sometimes the tests currently rely on. As a result, we can cancels any pending statistics
        processing request that was scheduled by logFrameNavigation().

        (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
        (WebKit::WebResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
        Whenever a navigation is logged and statistics have been updated, we need to make sure we
        schedule a "timer" to process the new data. We do this at most every 5 seconds for performance
        reasons. This 5 second interval matches what the ResourceLoadObserver is using in the WebProcess
        to notify the UIProcess of new data.

        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        This code was moved from ResourceLoadObserver to WebResourceLoadStatisticsStore now that we
        do this logging in the UIProcess instead of the WebProcess. One difference with WebCore is
        that we use WebPageProxy::pageLoadState().url() as mainFrameURL instead of
        WebPageProxy::mainFrame().url(). The reason for that is that WebPageProxy::mainFrame().url()
        becomes empty in case of process swap but ITP still needs the actual main frame URL when the
        navigation was triggered. WebPageProxy::pageLoadState().url() gives us this information.

        * UIProcess/WebResourceLoadStatisticsStore.h:

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        We now pass the full redirect response the the delegate method instead of a simple
        isRedirect boolean.

2018-06-13  Brent Fulgham  <bfulgham@apple.com>

        Crash during interrupted process termination
        https://bugs.webkit.org/show_bug.cgi?id=185373
        <rdar://problem/40019480>

        Reviewed by Alex Christensen.

        It's possible to encounter a crash if a user agent feature (such as Safari's responsiveness timer) decides
        to kill a Web Process around the same time that a user decides to trigger a new page load. One of the two
        termination operations may attempt to call methods on a nulled process pointer.

        We can avoid this by holding our own reference to the terminating process until the termination steps have
        been completed.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageTerminate): Ref<> the active process while the termination call is performed.
        * UIProcess/API/Cocoa/WKWebView.mm:
        ([WKWebView _killWebContentProcessAndResetState]): Ditto.

2018-06-13  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: wrong modifiers sent for 'Help' virtual key
        https://bugs.webkit.org/show_bug.cgi?id=186600
        <rdar://problem/41088912>

        Reviewed by Timothy Hatcher.

        This fixes a hang when running W3C test:

            special_keys.py::test_webdriver_special_key_sends_keydown[HELP-expected2]

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::eventModifierFlagsForVirtualKey):
        The help modifier doesn't seem to be used when pressing the Help key.
        I verified this using the Help key on the Keyboard Viewer, since no
        keyboards from the past decade actually have this physical button.

2018-06-13  Thibault Saunier  <tsaunier@igalia.com>

        [WPE] Build getUserMedia support
        https://bugs.webkit.org/show_bug.cgi?id=186547

        Reviewed by Alejandro G. Castro.

        * SourcesWPE.txt: Compile files necessary for MediaStream/webrtc.

2018-06-13  Andy Estes  <aestes@apple.com>

        [iOS] Synchronize PDF resizing with device rotation
        https://bugs.webkit.org/show_bug.cgi?id=186587
        <rdar://problem/40922462>

        Reviewed by Darin Adler.

        Both -beginPDFViewRotation and -endPDFViewRotation need to be called as part of
        the transition coordinator's -animateAlongsideTransition: block to be synchronized
        with rotation. Additionally, updateBlock needs to be invoked between the two calls
        so that PDFKit can capture the frame geometry before and after the update.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        * UIProcess/Cocoa/WKWebViewContentProvider.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_beginAnimatedResizeWithUpdates:]):
        (-[WKPDFView web_beginAnimatedResize]): Renamed to web_beginAnimatedResizeWithUpdates:.
        (-[WKPDFView web_endAnimatedResize]): Deleted.

2018-06-12  Brent Fulgham  <bfulgham@apple.com>

        Turn CSS Spring Animations and Link Preload off by default for production builds.
        https://bugs.webkit.org/show_bug.cgi?id=186548
        <rdar://problem/41023774>

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml: Switch these features from 'on' to
        DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.

2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 2)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Tim Horton.

        Upstream most of the work around form controls on watchOS. Also, rename WKFormControlListViewController.* to
        its intended name, WKQuickboardListViewController.*.

        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/forms/WKDatePickerViewController.h:
        * UIProcess/ios/forms/WKDatePickerViewController.mm:
        (datePickerSetButtonHeight):
        (datePickerVerticalMargin):
        (-[WKDatePickerWheelLabel initWithFrame:]):
        (-[WKDatePickerWheelLabel lastSelectedDate]):
        (-[WKDatePickerWheelLabel setLastSelectedDate:]):
        (-[WKDatePickerWheelLabel needsUpdateForIndex:selectedDate:]):
        (-[WKDatePickerWheel initWithStyle:]):
        (-[WKDatePickerWheel initWithController:style:]):
        (-[WKDatePickerWheel gestureRecognized:]):
        (-[WKDatePickerWheel setDrawsFocusOutline:]):
        (-[WKDatePickerWheel drawsFocusOutline]):
        (-[WKDatePickerWheel gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKDatePickerViewController initWithDelegate:]):
        (-[WKDatePickerViewController viewDidLoad]):
        (-[WKDatePickerViewController prefersStatusBarHidden]):
        (-[WKDatePickerViewController viewWillAppear:]):
        (-[WKDatePickerViewController viewDidAppear:]):
        (-[WKDatePickerViewController viewDidDisappear:]):
        (-[WKDatePickerViewController _handleStatusBarNavigation]):
        (-[WKDatePickerViewController viewWillLayoutSubviews]):
        (-[WKDatePickerViewController becomeFirstResponder]):
        (-[WKDatePickerViewController defaultMinimumDate]):
        (-[WKDatePickerViewController defaultMaximumDate]):
        (-[WKDatePickerViewController _valueForInput]):
        (-[WKDatePickerViewController _dateFromInitialText]):
        (-[WKDatePickerViewController _setButtonPressed]):
        (-[WKDatePickerViewController _updateSelectedPickerViewIndices]):
        (-[WKDatePickerViewController _configurePickerView:]):
        (-[WKDatePickerViewController setMinimumDate:]):
        (-[WKDatePickerViewController minimumDate]):
        (-[WKDatePickerViewController setMaximumDate:]):
        (-[WKDatePickerViewController maximumDate]):
        (-[WKDatePickerViewController setDate:]):
        (-[WKDatePickerViewController setDateFromComponents:]):
        (-[WKDatePickerViewController setDay:month:year:era:]):
        (-[WKDatePickerViewController date]):
        (-[WKDatePickerViewController _dateComponentForDay:month:year:era:]):
        (-[WKDatePickerViewController _adjustDateToValidDateIfNecessary]):
        (-[WKDatePickerViewController _createAndConfigureGranularityLabelWithText:]):
        (-[WKDatePickerViewController _canonicalizeAndUpdateSelectedDate]):
        (-[WKDatePickerViewController numberOfItemsInPickerView:]):
        (-[WKDatePickerViewController pickerView:viewForItemAtIndex:]):
        (-[WKDatePickerViewController didBeginInteractingWithDatePicker:]):
        (-[WKDatePickerViewController pickerView:didSelectItemAtIndex:]):
        (-[WKDatePickerViewController pickerViewWillBeginSelection:]):
        (-[WKDatePickerViewController pickerViewDidEndSelection:]):
        (-[WKDatePickerViewController _dayFromIndex:]):
        (-[WKDatePickerViewController _eraAndYearFromIndex:]):
        (-[WKDatePickerViewController _monthFromIndex:]):
        (-[WKDatePickerViewController _indexFromDay:]):
        (-[WKDatePickerViewController _indexFromYear:era:]):
        (-[WKDatePickerViewController _indexFromMonth:]):
        * UIProcess/ios/forms/WKFormControlListViewController.h: Removed.
        * UIProcess/ios/forms/WKFormControlListViewController.mm: Removed.
        * UIProcess/ios/forms/WKNumberPadViewController.h:
        * UIProcess/ios/forms/WKNumberPadViewController.mm:
        (inputLabelFontSize):
        (-[WKNumberPadViewController initWithDelegate:initialText:inputMode:]):
        (-[WKNumberPadViewController dealloc]):
        (-[WKNumberPadViewController viewDidLoad]):
        (-[WKNumberPadViewController viewWillDisappear:]):
        (-[WKNumberPadViewController viewWillLayoutSubviews]):
        (-[WKNumberPadViewController _reloadHeaderViewFromInputText]):
        (-[WKNumberPadViewController didSelectKey:]):
        (-[WKNumberPadViewController _handleKeyPress:]):
        (-[WKNumberPadViewController _cancelInput]):
        (-[WKNumberPadViewController _deleteLastInputCharacter]):
        (-[WKNumberPadViewController _deleteButtonPressed]):
        (-[WKNumberPadViewController _cancelDeletionTimers]):
        (-[WKNumberPadViewController _startDeletionTimer]):
        (-[WKNumberPadViewController _deletionTimerFired]):
        (-[WKNumberPadViewController addContentViewAnimations:]):
        * UIProcess/ios/forms/WKQuickboardListViewController.h: Added.
        * UIProcess/ios/forms/WKQuickboardListViewController.mm: Added.
        (-[WKQuickboardListItemCell topToLabelBaselineSpecValue]):
        (-[WKQuickboardListItemCell baselineToBottomSpecValue]):
        (-[WKQuickboardListViewController initWithDelegate:]):
        (-[WKQuickboardListViewController updateContextViewIfNeeded]):
        (-[WKQuickboardListViewController prefersStatusBarHidden]):
        (-[WKQuickboardListViewController viewDidLoad]):
        (-[WKQuickboardListViewController viewWillAppear:]):
        (-[WKQuickboardListViewController viewDidDisappear:]):
        (-[WKQuickboardListViewController _handleStatusBarNavigation]):
        (-[WKQuickboardListViewController reloadContextView]):
        (-[WKQuickboardListViewController actionController]):
        (-[WKQuickboardListViewController languageControllerDidChangePrimaryLanguage:]):
        (-[WKQuickboardListViewController headerContentViewHeight]):
        (-[WKQuickboardListViewController headerContentView]):
        (configureStatusBarForController):
        * UIProcess/ios/forms/WKSelectMenuListViewController.h:
        * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
        (-[WKSelectMenuItemCell initWithStyle:reuseIdentifier:]):
        (-[WKSelectMenuItemCell imageView]):
        (-[WKSelectMenuListViewController initWithDelegate:]):
        (-[WKSelectMenuListViewController viewDidLoad]):
        (-[WKSelectMenuListViewController acceptButtonTappedWithCompletion:]):
        (-[WKSelectMenuListViewController shouldShowTrayView]):
        (-[WKSelectMenuListViewController didSelectListItem:]):
        (-[WKSelectMenuListViewController numberOfListItems]):
        (-[WKSelectMenuListViewController heightForListItem:width:]):
        (-[WKSelectMenuListViewController cellForListItem:]):
        (-[WKSelectMenuListViewController selectItemAtIndex:]):
        * UIProcess/ios/forms/WKTimePickerViewController.h:
        * UIProcess/ios/forms/WKTimePickerViewController.mm:
        (-[WKTimePickerViewController initWithDelegate:]):
        (-[WKTimePickerViewController dateFormatter]):
        (-[WKTimePickerViewController timeValueForFormControls]):
        (-[WKTimePickerViewController dateComponentsFromInitialValue]):
        (-[WKTimePickerViewController viewDidAppear:]):
        (-[WKTimePickerViewController viewDidLoad]):
        (-[WKTimePickerViewController becomeFirstResponder]):
        (-[WKTimePickerViewController setHour:minute:]):
        (-[WKTimePickerViewController leftButtonWOTAction]):
        (-[WKTimePickerViewController rightButtonWOTAction]):
        * WebKit.xcodeproj/project.pbxproj:

2018-06-12  Jer Noble  <jer.noble@apple.com>

        Make Modern EME An Experimental Feature Again
        https://bugs.webkit.org/show_bug.cgi?id=186569
        <rdar://problem/41054402>

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2018-06-12  Andy Estes  <aestes@apple.com>

        [watchOS] Enable NetworkActivityTracker
        https://bugs.webkit.org/show_bug.cgi?id=186568
        <rdar://problem/41050624>

        Reviewed by Tim Horton.

        * NetworkProcess/NetworkActivityTracker.h:

2018-06-12  Antti Koivisto  <antti@apple.com>

        Add performance logging for slow cache retrieves
        https://bugs.webkit.org/show_bug.cgi?id=186520
        <rdar://problem/41002070>

        Reviewed by Chris Dumez.

        We sometimes see slow cache retrieves in logs. Add some more logging to better analyze these cases.

        This patch adds timings to all cache storage retrieve operations and passes them up to the client.
        We then log the timings on NetworkResourceLoader levels if needed. Items logged include

        - total retrieve time
        - dispatch delay and number of resources dispatched before this one
        - record I/O time
        - blob I/O time
        - whether cache shrink was in progress
        - whether cache synchronization was in progress
        - cancellation

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::logSlowCacheRetrieveIfNeeded):

        Log if the retrieve took more than 1s.

        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::readRecord):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::retrieve):
        (WebKit::NetworkCache::Cache::completeRetrieve):
        (WebKit::NetworkCache::Cache::retrieveData):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
        (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):

        SpeculativeLoadManager does not records specific timings yet but at least we do log when they occur.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::ReadOperation::cancel):
        (WebKit::NetworkCache::Storage::ReadOperation::finish):

        Record timing info in ReadOperations.

        (WebKit::NetworkCache::Storage::dispatchReadOperation):
        (WebKit::NetworkCache::retrieveFromMemory):
        (WebKit::NetworkCache::Storage::retrieve):
        * NetworkProcess/cache/NetworkCacheStorage.h:

2018-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.4 release.

        * gtk/NEWS: Add release notes for 2.21.4.

2018-06-11  Youenn Fablet  <youenn@apple.com>

        Improve error messages in case FetchEvent.respondWith has a rejected promise
        https://bugs.webkit.org/show_bug.cgi?id=186368

        Reviewed by Chris Dumez.

        Log in JS console in case of failures.
        Rely on ThreadableLoader to log which client actually failed.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didFail):

2018-06-11  Chris Dumez  <cdumez@apple.com>

        http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=186546

        Reviewed by Brady Eidson.

        Disable process swap on navigation in frames that have opened other frames via
        window.open(). These new windows may have a WindowProxy to their opener, and it
        would therefore be unsafe to process swap at this point.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const):
        (WebKit::NavigationActionData::decode):
        * Shared/NavigationActionData.h:
        * UIProcess/API/APINavigation.h:
        (API::Navigation::setHasOpenedFrames):
        (API::Navigation::hasOpenedFrames const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-06-11  Keith Rollin  <krollin@apple.com>

        Add logging around internalError(const URL&)
        https://bugs.webkit.org/show_bug.cgi?id=186369
        <rdar://problem/40872046>

        Reviewed by Brent Fulgham.

        There are times when we receive bug reports where the user says that
        they are simply shown a page saying an internal error occurred. To
        help understand the circumstances of that error, add some logging to
        internalError() in WebErrors.cpp. This logging logs at the Error level
        that internalError() was called and then logs a backtrace.

        * Shared/WebErrors.cpp:
        (WebKit::internalError):

2018-06-11  Tim Horton  <timothy_horton@apple.com>

        Link drag image is inconsistently unreadable in dark mode
        https://bugs.webkit.org/show_bug.cgi?id=186472

        Reviewed by Timothy Hatcher.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::useDefaultAppearance):
        Make defaultAppearance accurate even if useSystemAppearance is false.
        Some parts of WebKit (like the link drag image, but also context menus)
        want to be able to follow the system appearance regardless of whether
        the view or content has opted in.

2018-06-11  Chris Dumez  <cdumez@apple.com>

        http/tests/security/cors-post-redirect-307.html fails with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=186441

        Reviewed by Brady Eidson.

        Rename existing flag to something a bit more generic, now that it is used for
        more things than bypassing the navigation policy check.

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcessForReload):
        (WebKit::WebPageProxy::reattachToWebProcessWithItem):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigation):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):
        (WebKit::WebPage::goToBackForwardItem):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-06-11  Nan Wang  <n_wang@apple.com>

        AX: [iOS] accessibility sometimes doesn't know process suspension is canceled
        https://bugs.webkit.org/show_bug.cgi?id=186450

        Reviewed by Chris Fleizach.

        There's some early return condition in WebProcess::cancelPrepareToSuspend() which
        could lead to accessibility failing to post process status notificaiton. Fixed it
        by moving the accessibility notification before the early return condition.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::cancelPrepareToSuspend):

2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
        https://bugs.webkit.org/show_bug.cgi?id=186192

        Reviewed by Michael Catanzaro.

        Add webkit_web_view_run_javascript_in_world() that receives a world name. Also add
        webkit_script_world_new_with_name() to create an isolated world with a name and webkit_script_world_get_name()
        to get the name of a WebKitScriptWorld.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_run_javascript):
        (webkit_web_view_run_javascript_finish):
        (webkit_web_view_run_javascript_in_world):
        (webkit_web_view_run_javascript_in_world_finish):
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): Send RunJavaScriptInMainFrameScriptWorld message to
        the WebProcess.
        * UIProcess/WebPageProxy.h:
        * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
        (webkitScriptWorldCreate):
        (webkit_script_world_new_with_name):
        (webkit_script_world_get_name):
        * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h:
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        (WebKit::InjectedBundleScriptWorld::find): Find an InjectedBundleScriptWorld by its name.
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): Find the InjectedBundleScriptWorld for the given name
        and run the script in its js context.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add RunJavaScriptInMainFrameScriptWorld message.

2018-06-10  Chris Dumez  <cdumez@apple.com>

        Reload the Web view in case of crash if the client does not implement webViewWebContentProcessDidTerminate delegate
        https://bugs.webkit.org/show_bug.cgi?id=186468

        Reviewed by Geoffrey Garen.

        We now attempt to reload the Web view if the web content process crashes and the client
        does not implement the webViewWebContentProcessDidTerminate delegate (or any of the similar
        delegates in our SPI).

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::processDidCrash):
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::processDidTerminate):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/glib/WebKitNavigationClient.cpp:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::processDidTerminate):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::shouldReloadAfterProcessTermination):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):
        (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
        (WebKit::WebPageProxy::resetRecentCrashCountSoon):
        (WebKit::WebPageProxy::resetRecentCrashCount):
        (WebKit::m_configurationPreferenceValues): Deleted.
        * UIProcess/WebPageProxy.h:

2018-06-09  Dan Bernstein  <mitz@apple.com>

        [Xcode] Clean up and modernize some build setting definitions
        https://bugs.webkit.org/show_bug.cgi?id=186463

        Reviewed by Sam Weinig.

        * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
        * Configurations/BaseTarget.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
          now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
        * Configurations/DebugRelease.xcconfig: Removed definition for macOS 10.11.
        * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
          ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
        * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
        * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.

2018-06-09  Dan Bernstein  <mitz@apple.com>

        Added missing file references to the Configuration group.

        * WebKit.xcodeproj/project.pbxproj:

2018-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
        (-[WKContentView quickboard:textEntered:]):
        (-[WKContentView quickboardInputCancelled:]):
        (-[WKContentView viewController:inputContextViewHeightForSize:]):
        (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
        (-[WKContentView inputContextViewForViewController:]):
        (-[WKContentView inputLabelTextForViewController:]):
        (-[WKContentView initialValueForViewController:]):
        (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
        (-[WKContentView numericInputModeForListViewController:]):
        (-[WKContentView textContentTypeForListViewController:]):
        (-[WKContentView textSuggestionsForListViewController:]):
        (-[WKContentView listViewController:didSelectTextSuggestion:]):
        (-[WKContentView allowsDictationInputForListViewController:]):
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):
        (-[WKScrollView addGestureRecognizer:]):
        (-[WKScrollView _configureDigitalCrownScrolling]):
        (-[WKScrollView _puic_contentOffsetForCrownInputSequencerOffset:]):
        * UIProcess/ios/forms/WKFocusedFormControlView.h:
        * UIProcess/ios/forms/WKFocusedFormControlView.mm:
        (pathWithRoundedRectInFrame):
        (-[WKFocusedFormControlView initWithFrame:delegate:]):
        (-[WKFocusedFormControlView handleWheelEvent:]):
        (-[WKFocusedFormControlView show:]):
        (-[WKFocusedFormControlView hide:]):
        (-[WKFocusedFormControlView delegate]):
        (-[WKFocusedFormControlView setDelegate:]):
        (-[WKFocusedFormControlView dimmingMaskLayer]):
        (-[WKFocusedFormControlView handleTap]):
        (-[WKFocusedFormControlView _wheelChangedWithEvent:]):
        (-[WKFocusedFormControlView didDismiss]):
        (-[WKFocusedFormControlView didSubmit]):
        (-[WKFocusedFormControlView layoutSubviews]):
        (-[WKFocusedFormControlView setHighlightedFrame:]):
        (-[WKFocusedFormControlView computeDimmingViewCutoutPath]):
        (-[WKFocusedFormControlView disengageFocusedFormControlNavigation]):
        (-[WKFocusedFormControlView engageFocusedFormControlNavigation]):
        (-[WKFocusedFormControlView reloadData:]):
        (-[WKFocusedFormControlView setMaskLayerPosition:animated:]):
        (-[WKFocusedFormControlView setHighlightedFrame:animated:]):
        (-[WKFocusedFormControlView submitActionName]):
        (submitActionNameFontAttributes):
        (-[WKFocusedFormControlView setSubmitActionName:]):
        (-[WKFocusedFormControlView scrollViewForCrownInputSequencer]):
        (-[WKFocusedFormControlView updateViewForCurrentCrownInputSequencerState]):
        (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):
        (-[WKFocusedFormControlView _crownInputSequencerTimerFired]):
        (-[WKFocusedFormControlView cancelPendingCrownInputSequencerUpdate]):
        (-[WKFocusedFormControlView scheduleCrownInputSequencerUpdate]):
        (-[WKFocusedFormControlView crownInputSequencerOffsetDidChange:]):
        (-[WKFocusedFormControlView crownInputSequencerDidBecomeIdle:willDecelerate:]):
        (-[WKFocusedFormControlView crownInputSequencerIdleDidChange:]):
        (-[WKFocusedFormControlView suggestions]):
        (-[WKFocusedFormControlView setSuggestions:]):
        (-[WKFocusedFormControlView handleWebViewCredentialsSaveForWebsiteURL:user:password:passwordIsAutoGenerated:]):
        (-[WKFocusedFormControlView selectionWillChange:]):
        (-[WKFocusedFormControlView selectionDidChange:]):
        (-[WKFocusedFormControlView textWillChange:]):
        (-[WKFocusedFormControlView textDidChange:]):

2018-06-08  Per Arne Vollan  <pvollan@apple.com>

        Only display refresh monitors having requested display refresh callback should get notified on screen updates.
        https://bugs.webkit.org/show_bug.cgi?id=186397
        <rdar://problem/40897835>

        Reviewed by Brent Fulgham.

        Since all display refresh monitors in the WebContent process share a single UI process display link,
        we should make sure that only the monitors having requested callback are getting notified on screen
        updates. I have not been able to reproduce a case where a monitor is being notified without having
        requested updates, but we should safeguard the code for future code changes.

        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:

2018-06-08  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist] Allow TextFieldInputType to show and hide suggestions
        https://bugs.webkit.org/show_bug.cgi?id=186151

        Reviewed by Tim Horton.

        Added WebDataListSuggestionPicker to send messages to the UIProcess in order to update the suggestions view.
        This object is also responsible for forwarding messages from WebKit into the DataListSuggestionsClient, which
        is the TextFieldInputType in this case. The client needs to know when the suggestions are hidden or if an
        suggestion has been selected.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createDataListSuggestionPicker): Responsible for creating WebDataListSuggestionPicker to send/receive messages.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp: Added. Responsible for sending messages to UIProcess and updating the DataListSuggestionsClient.
        (WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker):
        (WebKit::WebDataListSuggestionPicker::~WebDataListSuggestionPicker):
        (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionPicker::didSelectOption):
        (WebKit::WebDataListSuggestionPicker::didCloseSuggestions):
        (WebKit::WebDataListSuggestionPicker::close):
        (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setActiveDataListSuggestionPicker):
        (WebKit::WebPage::didSelectDataListOption): Called by UIProcess when option selected.
        (WebKit::WebPage::didCloseSuggestions): Called by UIProcess if the suggestions view is closed.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-06-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Win] Fix initial value of HANDLE to INVALID_HANDLE_VALUE
        https://bugs.webkit.org/show_bug.cgi?id=186405

        The handle was not initialized at all. Initialized with INVALID_HANDLE_VALUE.

        Reviewed by Per Arne Vollan.

        * Platform/IPC/Attachment.h:
        * Platform/IPC/win/AttachmentWin.cpp:
        (IPC::Attachment::decode):

2018-06-08  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: include browser name and version in listing for automation targets
        https://bugs.webkit.org/show_bug.cgi?id=186204
        <rdar://problem/36950423>

        Reviewed by Darin Adler.

        Add a new delegate method that allows the client to set the name and version
        of the browser as returned in the 'browserName' and 'browserVersion' capabilities.
        If the delegate methods are not implemented, try to get this information from
        the main bundle.

        In the RWI protocol, these fields are added to automation target listings.

        * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
        * UIProcess/Cocoa/AutomationClient.h:
        * UIProcess/Cocoa/AutomationClient.mm:
        (WebKit::AutomationClient::AutomationClient):
        (WebKit::AutomationClient::browserName const):
        (WebKit::AutomationClient::browserVersion const):

2018-06-08  Per Arne Vollan  <pvollan@apple.com>

        Run display links in the UI process when ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) is true.
        https://bugs.webkit.org/show_bug.cgi?id=186379

        Reviewed by Brent Fulgham.

        Replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/DisplayLink.cpp:
        * UIProcess/mac/DisplayLink.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        * WebProcess/WebPage/DrawingArea.cpp:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:

2018-06-08  Per Arne Vollan  <pvollan@apple.com>

        Send display link IPC message from display link thread.
        https://bugs.webkit.org/show_bug.cgi?id=186429

        Reviewed by Geoffrey Garen.

        When the display link callback is firing on the display link thread in the UI process,
        we schedule a function to be called on the main thread to send the IPC message to the
        WebContent process. Since Connection::send is thread-safe, we can just send the message
        from the display link thread, instead. This should be a small performance improvement.

        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::DisplayLink):
        (WebKit::DisplayLink::displayLinkCallback):
        * UIProcess/mac/DisplayLink.h:

2018-06-07  Chris Dumez  <cdumez@apple.com>

        Add base class to get WeakPtrFactory member and avoid some boilerplate code
        https://bugs.webkit.org/show_bug.cgi?id=186407

        Reviewed by Brent Fulgham.

        Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
        order to avoid some boilerplate code in every class needing a WeakPtrFactory.
        This also gets rid of old-style createWeakPtr() methods in favor of the newer
        makeWeakPtr().

        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cache/CacheStorageEngine.h:
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::Attachment):
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
        * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateWindowAndViewFrames):
        (WebKit::WebViewImpl::setTopContentInset):
        (WebKit::WebViewImpl::viewDidMoveToWindow):
        (WebKit::WebViewImpl::prepareForMoveToWindow):
        (WebKit::WebViewImpl::validateUserInterfaceItem):
        (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
        (WebKit::WebViewImpl::interpretKeyEvent):
        (WebKit::WebViewImpl::firstRectForCharacterRange):
        (WebKit::WebViewImpl::performKeyEquivalent):
        (WebKit::WebViewImpl::keyUp):
        (WebKit::WebViewImpl::keyDown):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::setOriginatingPage):
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/ProcessAssertion.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::Surface::attachBuffer):
        * UIProcess/gtk/WaylandCompositor.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::displayLinkCallback):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:

2018-06-07  Dan Bernstein  <mitz@apple.com>

        Don’t install process-webcontent-entitlements.sh into the built XPC services.

        * WebKit.xcodeproj/project.pbxproj:

2018-06-07  Andy Estes  <aestes@apple.com>

        [iOS] Inform the client when PDFKit's extension process crashes
        https://bugs.webkit.org/show_bug.cgi?id=186418
        <rdar://problem/40175864>

        Reviewed by Tim Horton.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):

        Separated the dispatching of delegate methods from the rest of the web
        process-specific processDidTerminate logic.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):

        Minor style fix.

        (-[WKPDFView pdfHostViewControllerExtensionProcessDidCrash:]):

        Called WebPageProxy::dispatchProcessDidTerminate on the main thread.

2018-06-07  Andy Estes  <aestes@apple.com>

        [iOS] Unable to present the share sheet after saving a PDF to Files.app
        https://bugs.webkit.org/show_bug.cgi?id=186413
        <rdar://problem/39937488>

        Reviewed by Tim Horton.

        WKApplicationStateTrackingView (WKPDFView's superclass) keeps track of whether
        it's in a window so that it can suspend and resume the web process accordingly.
        However, in WKPDFView's case, PDFKit's host view is in the window instead of
        WKPDFView itself when a PDF is being displayed (WKPDFView is only in a window as a
        placeholder while the PDF loads). Since WKApplicationStateTrackingView doesn't
        think its in a window, it suspends the web process, preventing messages necessary
        to displaying the share sheet from being delivered.

        Fix this by teaching WKApplicationStateTrackingView to consider the in-windowness
        of the proper content view. For all cases other than WKPDFView, this is |self|.
        For WKPDFView, it is the PDFHostViewController's root view if it exists, otherwise
        it's |self|.

        * UIProcess/ios/WKApplicationStateTrackingView.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView willMoveToWindow:]):
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _contentView]):
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _contentView]):
        (-[WKPDFView web_contentView]):

2018-06-07  Dean Jackson  <dino@apple.com>

        Match HI spec for thumbnail view sizing and location
        https://bugs.webkit.org/show_bug.cgi?id=186412
        <rdar://problem/40226192>

        Reviewed by Tim Horton.

        Use the computed obscured inset to position the QuickLook
        view inside the WKSystemPreviewView.

        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
        (-[WKSystemPreviewView _layoutThumbnailView]):

2018-06-07  Tadeu Zagallo  <tzagallo@apple.com>

        Don't try to allocate JIT memory if we don't have the JIT entitlement
        https://bugs.webkit.org/show_bug.cgi?id=182605
        <rdar://problem/38271229>

        Reviewed by Mark Lam.

        Remove processHasEntitlement, which was moved into WTF and update all call sites.

        * Shared/mac/SandboxUtilities.h:
        * Shared/mac/SandboxUtilities.mm:
        (WebKit::processHasEntitlement): Deleted.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::applicationType):
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (applicationHasAppLinkEntitlements):

2018-06-07  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r232544): Pages are blank after homing out and then resuming on iPad
        https://bugs.webkit.org/show_bug.cgi?id=186408
        <rdar://problem/40907111>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        Clients who use _resizeWhileHidingContentWithUpdates don't call
        _endAnimatedResize; the former API is a one-shot. We can't wait for
        _endAnimatedResize to complete the animation (and don't need to, since
        the content is hidden), but instead should just finish it when the
        commit with the resized tiles arrives.

2018-06-07  Jiewen Tan  <jiewen_tan@apple.com>

        Use the same overloaded addInputString in WKContentViewInteraction
        https://bugs.webkit.org/show_bug.cgi?id=186376
        <rdar://problem/18498360>

        Reviewed by Brent Fulgham.

        Different overloaded variants of [UIKeyboardImpl -addInputString] behaves differently. We should use the same
        overloaded variant consistently: [UIKeyboardImpl -addInputString:withFlags:withInputManagerHint:].

        Sadly, there is no test case for this change as:
        1) UIScriptController has troubles simulating '\r' keyboard event, and
        2) API test couldn't simulate proper UI keyboard events.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _interpretKeyEvent:isCharEvent:]):

2018-06-07  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r224134) Client certificate challenges don't always appear
        https://bugs.webkit.org/show_bug.cgi?id=186402
        <rdar://problem/35967150>

        Reviewed by Brian Weinstein.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::completeAuthenticationChallenge):
        Add an exception for all TLS-handshake-related challenges, not just server trust.

2018-06-07  Ryosuke Niwa  <rniwa@webkit.org>

        Release assert in Document::updateLayout() in WebPage::determinePrimarySnapshottedPlugIn()
        https://bugs.webkit.org/show_bug.cgi?id=186383
        <rdar://problem/40849498>

        Reviewed by Jon Lee.

        The release assert was hit because the descendent elemenet iterator, which instantiates ScriptDisallowedScope,
        was alive as determinePrimarySnapshottedPlugIn invoked Document::updateLayout. Avoid this by copying
        the list of plugin image elements into a vector first.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Fixed the release assert, and deployed Ref and RefPtr
        to make this code safe.

2018-06-07  Don Olmstead  <don.olmstead@sony.com>

        [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
        https://bugs.webkit.org/show_bug.cgi?id=186374

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::sceneUpdateFinished):

2018-06-07  Brent Fulgham  <bfulgham@apple.com>

        Remove unused debug mode conditions
        https://bugs.webkit.org/show_bug.cgi?id=186358
        <rdar://problem/39117121>

        Reviewed by Zalan Bujtas.

        Remove some unused code paths related to ResourceLoadStatistics debug mode.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):

2018-06-07  Dan Bernstein  <mitz@apple.com>

        REGRESSION (r232520): Crash under IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData
        https://bugs.webkit.org/show_bug.cgi?id=186385
        <rdar://problem/40853796>

        Reviewed by Daniel Bates.

        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<Credential>::encodePlatformData): Fixed an incorrect cast.

2018-06-06  Per Arne Vollan  <pvollan@apple.com>

        Crash in lambda function WTF::Function<void ()>::CallableWrapper<WebKit::DisplayLink::displayLinkCallback
        https://bugs.webkit.org/show_bug.cgi?id=186370
        <rdar://problem/39791647>

        Reviewed by Brent Fulgham.

        When the display link is firing, the callback function is called on the display link thread, where a lambda function
        is created to be executed on the main thread. The WebPageProxy object is captured as a RefPtr in the lambda. This
        might crash when executing on the main thread, since the WebPageProxy object is possibly deleted then. Capturing
        the WebPageProxy will not prevent the object from being deleted if the destruction of the WebPageProxy object already
        has started on the main thread when the object is captured, which sometimes is the case. Instead, we can create a
        weak pointer to the object, which will work as intended, even if the WebPageProxy object is in the process of being
        deleted. This also matches the display link implementation used when the WebContent process has access to the
        WindowServer. This is not a frequent crash. I have not been able to reproduce it.
 
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::displayLinkCallback):

2018-06-06  Antoine Quint  <graouts@apple.com>

        Rename color-filter to -apple-color-filter and do not expose it to Web content
        https://bugs.webkit.org/show_bug.cgi?id=186306
        <rdar://problem/39874167>

        Reviewed by Simon Fraser.

        Change the ColorFilter setting to no longer be exposed as an experimental feature and ensure it's turned off by default.
        To allow internal clients to use the -apple-color-filter property, we expose a new _colorFilterEnabled property as SPI
        to WKWebViewConfigurationPrivate.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetColorFilterEnabled):
        (WKPreferencesGetColorFilterEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
        (-[WKWebViewConfiguration _colorFilterEnabled]):
        (-[WKWebViewConfiguration _setColorFilterEnabled:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2018-06-06  Jer Noble  <jer.noble@apple.com>

        REGRESSION (r232301) - Unable to enter video fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=186357
        <rdar://problem/40838449>

        Reviewed by Jon Lee.

        Only set up the standby fullscreen element if we are in element fullscreen.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::videoControlsManagerDidChange):

2018-06-06  Jeremy Jones  <jeremyj@apple.com>

        attenuationFactor should be in range [0,1]
        https://bugs.webkit.org/show_bug.cgi?id=186320
        rdar://problem/40821456

        Reviewed by Jer Noble.

        If attenuationFactor is outside of this range it can cause false positives.

        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
        (WebKit::FullscreenTouchSecheuristic::attenuationFactor):

2018-06-06  Tim Horton  <timothy_horton@apple.com>

        Move animated resize into the layer tree transaction, and make it asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=186130
        <rdar://problem/38477288>

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::setScrollPosition):
        (WebKit::RemoteLayerTreeTransaction::dynamicViewportSizeUpdateID const):
        (WebKit::RemoteLayerTreeTransaction::setDynamicViewportSizeUpdateID):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::encode const):
        (WebKit::RemoteLayerTreeTransaction::decode):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::willCommitLayerTree):
        Add scrollPosition to the transaction on all platforms, not just Mac.
        Add the optional dynamicViewportSizeUpdateID to the transaction, representing
        the most recent dynamicViewportSizeUpdate that commit contains, if any.

        * Shared/ios/DynamicViewportSizeUpdate.h:
        Added a typedef for DynamicViewportSizeUpdateID, and move the mode enum here.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): Deleted.
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::didCommitLayerTree):
        (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Deleted.
        (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::synchronizeDynamicViewportUpdate): Deleted.
        Remove dynamicViewportUpdateChangedTarget and synchronizeDynamicViewportUpdate.
        Move dynamicViewportSizeUpdateID maintenance into WKWebView.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        Remove _resizeAnimationTransformTransactionID. We now instead pack
        the resize ID inside the transaction, instead of separately sending
        back a transaction ID to wait for.

        (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
        (-[WKWebView _didCommitLayerTree:]):
        Added, factored out of _didCommitLayerTree:.
        If the transaction includes the result of the most recently-sent resize,
        store the requisite adjustments required to counter the new scale and
        scroll offset, update the resizeAnimationView, and, if endAnimatedResize
        has already been called, call _didCompleteAnimatedResize to tear down
        the animation view and put things back together.

        Add some code so that if a commit arrives before the resize, we update
        the scale of the resize animation view to keep the width fitting.

        (activeMaximumUnobscuredSize):
        (activeOrientation):
        Move these because the code that depends on them moved.

        (-[WKWebView _didCompleteAnimatedResize]):
        Broken out of _endAnimatedResize. This can now be called from
        either endAnimatedResize or _didCommitLayerTreeDuringAnimatedResize,
        depending on which is called first.

        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        Don't create a new resize view if we still have one. Otherwise, we'll
        get the view ordering all wrong when making the second one. This
        didn't previously cause trouble, because we don't have a lot of
        WKScrollView subviews, but it totally could.

        Adopt _initialContentOffsetForScrollView just to make this code more clear.

        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:


2018-06-05  Per Arne Vollan  <pvollan@apple.com>

        Move OpenGL display mask to screen data struct.
        https://bugs.webkit.org/show_bug.cgi?id=186198
        <rdar://problem/40724854>

        Reviewed by Brent Fulgham.

        Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
        it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
        resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
        display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
        the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
        window is available, the OpenGL display mask of the main display is used.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::windowScreenDidChange):
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::screenPropertiesStateChanged):
        (WebKit::displayReconfigurationCallBack):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2018-06-05  Keith Rollin  <krollin@apple.com>

        Remove tracksResourceLoadMilestones support
        https://bugs.webkit.org/show_bug.cgi?id=186329
        <rdar://problem/40829898>

        Reviewed by Darin Adler.

        Remove the mechanism for enabling/disabling the tracking of
        resource-load milestones. This was initially added in order to enable
        the tracking only for Safari. However, the decision has been made to
        enable the tracking for all WebKit clients, so it's now enabled
        unconditionally.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
        (WebKit::networkActivityTrackingEnabled): Deleted.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::tracksResourceLoadMilestones const): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationTracksResourceLoadMilestones): Deleted.
        (WKContextConfigurationSetTracksResourceLoadMilestones): Deleted.
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]): Deleted.
        (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-06-05  Darin Adler  <darin@apple.com>

        [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=186324

        Reviewed by Anders Carlsson.

        * NetworkProcess/cache/NetworkCacheData.h: Use OSObjectPtr instead of
        DispatchPtr and also use an rvalue reference in the constructor.
        * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
        (WebKit::NetworkCache::Data::Data): Use adoptOSObject, rvalue reference
        and WTFMove.
        (WebKit::NetworkCache::Data::empty): Use OSObjectPtr.
        (WebKit::NetworkCache::Data::data const): Use adoptOSObject.
        (WebKit::NetworkCache::Data::subrange const): Ditto.
        (WebKit::NetworkCache::concatenate): Ditto.
        (WebKit::NetworkCache::Data::adoptMap): Ditto. Also use WTFMove.

        * NetworkProcess/cache/NetworkCacheIOChannel.h: Use OSObjectPtr.
        * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
        (WebKit::NetworkCache::IOChannel::IOChannel): Use adoptOSObject.
        (WebKit::NetworkCache::IOChannel::read): Use OSObjectPtr.

2018-06-05  Brent Fulgham  <bfulgham@apple.com>

        Adjust compile and runtime flags to match shippable state of features
        https://bugs.webkit.org/show_bug.cgi?id=186319
        <rdar://problem/40352045>

        Reviewed by Maciej Stachowiak, Jon Lee, and others.

        Change the default state of various experimental features so that they are off by default in production
        builds, since they are still under development.

        Turn 'CacheAPIEnabled' and 'SubresourceIntegrityEnabled' on by default, since both features have been
        shipping for a full cycle and have proven to be stable in production.

        * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
        or ENABLE_INPUT_TYPE_COLOR_POPOVER.
        * Shared/WebPreferences.yaml: 
2018-06-05  Timothy Hatcher  <timothy@apple.com>

        Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query

        https://bugs.webkit.org/show_bug.cgi?id=186323
        rdar://problem/38382252

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _defaultAppearance]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _defaultAppearance]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::useDefaultAppearance):

2018-06-05  Sihui Liu  <sihui_liu@apple.com>

        [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies aren't flushed to file
        https://bugs.webkit.org/show_bug.cgi?id=186303
        <rdar://problem/40468716>

        Reviewed by Geoffrey Garen.

        No matter there is an observer or not, cookies in UI process should always be flushed to 
        file when new process pool is created, such that cookies created via API can be synced to
        network process.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::HTTPCookieStore):
        (API::HTTPCookieStore::registerObserver):
        (API::HTTPCookieStore::cookieManagerDestroyed):
        (API::HTTPCookieStore::registerForNewProcessPoolNotifications):

2018-06-05  Jeremy Jones  <jeremyj@apple.com>

        secheuristic should only use touch began and ended, not changed.
        https://bugs.webkit.org/show_bug.cgi?id=186318
        rdar://problem/39781486

        Reviewed by Jer Noble.

        Filter out change events so swiping gestures don't trigger the heuristic.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _touchDetected:]):

2018-06-05  Darin Adler  <darin@apple.com>

        [Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=186314

        Reviewed by Anders Carlsson.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::overrideSystemProxies): Ditto.
        (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::sendMessage): Ditto.
        (IPC::readFromMachPort): Ditto.

        * Platform/mac/StringUtilities.mm:
        (WebKit::formattedPhoneNumberString): Use __bridge for cast and
        CFBridgingRelease instead of an explicit autorelease.

        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
        (initializeMethods): Use auto instead of an explicit type so that we get
        the correct type for the result of protocol_copyProtocolList.

        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
        bridging cast to void* because that's needed to call _Block_signature
        under ARC and harmless outside ARC.

        * Shared/API/c/cf/WKStringCF.mm:
        (WKStringCreateWithCFString): Use __bridge for cast.
        * Shared/API/c/cf/WKURLCF.mm:
        (WKURLCreateWithCFURL): Ditto.
        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection): Ditto.
        * Shared/Cocoa/DataDetectionResult.mm:
        (WebKit::DataDetectionResult::encode const): Ditto.
        (WebKit::DataDetectionResult::decode): Ditto.
        * Shared/Cocoa/WKNSError.mm:
        (-[WKNSError _web_createTarget]): Ditto.
        * Shared/Cocoa/WKNSURLExtras.mm:
        (-[NSURL _web_originalDataAsWTFString]): Ditto.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer): Removed balanced calls to both
        adoptOSObject and xpc_retain and instead rely on the assignment
        operator just added to OSObjectPtr.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceEventHandler): Use __bridge for cast.
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode): Ditto.
        * Shared/mac/ArgumentCodersMac.mm:
        (IPC::isSerializableValue): Ditto.
        (IPC::encode): Ditto.
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
        when we need a CFString.
        (IPC::decodeNSError): Ditto.
        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
        (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
        (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
        (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
        * Shared/mac/WebHitTestResultData.mm:
        (WebKit::WebHitTestResultData::platformEncode const): Ditto.
        (WebKit::WebHitTestResultData::platformDecode): Ditto.
        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextIsPlugInUpdateAvailable): Ditto.
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController certificateChain]): Ditto.
        (didStartProvisionalLoadForFrame): Ditto.
        (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
        (didFailProvisionalLoadWithErrorForFrame): Ditto.
        (didCommitLoadForFrame): Ditto.
        (didFinishLoadForFrame): Ditto.
        (didFailLoadWithErrorForFrame): Ditto.
        (canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
        (didReceiveAuthenticationChallengeInFrame): Ditto.
        (didStartProgress): Ditto.
        (didChangeProgress): Ditto.
        (didFinishProgress): Ditto.
        (didChangeBackForwardList): Ditto.
        (processDidCrash): Ditto.
        (setUpPageLoaderClient): Ditto.
        (setUpPagePolicyClient): Ditto.
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
        (createWKArray): Ditto.
        (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
        (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
        * UIProcess/API/Cocoa/WKConnection.mm:
        (didReceiveMessage): Ditto.
        (didClose): Ditto.
        (setUpClient): Ditto.
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (didCreateConnection): Ditto.
        (getInjectedBundleInitializationUserData): Ditto.
        (setUpInjectedBundleClient): Ditto.
        (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
        (-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        (-[_WKThumbnailView _didTakeSnapshot:]): Ditto.

        * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.

        * UIProcess/Authentication/mac/WebCredentialMac.mm:
        (WebKit::chain): Use __bridge for cast.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
        Use CFBridgingRelease instead of adoptNS.
        (WebKit::privateBrowsingSession): Use __bridge for cast.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::beginSwipeGesture): Ditto.
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController enterFullScreen:]): Ditto.
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
        (didCreatePage): Ditto.
        (willDestroyPage): Ditto.
        (setUpBundleClient): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (didStartProvisionalLoadForFrame): Ditto.
        (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
        (didFinishLoadForFrame): Ditto.
        (globalObjectIsAvailableForFrame): Ditto.
        (didRemoveFrameFromHierarchy): Ditto.
        (didCommitLoadForFrame): Ditto.
        (didFinishDocumentLoadForFrame): Ditto.
        (didFailProvisionalLoadWithErrorForFrame): Ditto.
        (didFailLoadWithErrorForFrame): Ditto.
        (didSameDocumentNavigationForFrame): Ditto.
        (didLayoutForFrame): Ditto.
        (didReachLayoutMilestone): Ditto.
        (didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
        (didHandleOnloadEventsForFrame): Ditto.
        (userAgentForURL): Ditto.
        (setUpPageLoaderClient): Ditto.
        (willSendRequestForFrame): Ditto.
        (didInitiateLoadForResource): Ditto.
        (didFinishLoadForResource): Ditto.
        (didFailLoadForResource): Ditto.
        (setUpResourceLoadClient): Ditto.
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::initialize): Ditto.
        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::NetscapePlugin::popUpContextMenu): Ditto.

        * WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
        an #ifdef __OBJC__ and use __bridge for cast.

        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        (WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
        (WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::setTopOverhangImage): Ditto.
        (WebKit::WebPage::setBottomOverhangImage): Ditto.

2018-06-05  Youenn Fablet  <youenn@apple.com>

        ServiceWorker registration should store any script fetched through importScripts
        https://bugs.webkit.org/show_bug.cgi?id=182444
        <rdar://problem/37164835>

        Reviewed by Chris Dumez.

        Add C API to kill storage process.
        In case a Storage Process is closed or crashed, ensure that all its related service worker processes also exit.

        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextTerminateStorageProcess):
        * UIProcess/API/C/WKContextPrivate.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::webToStorageProcessConnectionClosed):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::setScriptResource):
        * WebProcess/Storage/WebSWContextManagerConnection.h:

2018-06-05  Brent Fulgham  <bfulgham@apple.com>

        Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
        https://bugs.webkit.org/show_bug.cgi?id=186286
        <rdar://problem/40782992>

        Reviewed by Dan Bernstein.

        Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
        to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
        change this flag when preparing for a production release.

        * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine whether
        experimental features should be enabled, and use it to properly define the feature flag.
        * Shared/WebPreferencesDefaultValues.h:

2018-06-04  Chris Dumez  <cdumez@apple.com>

        Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
        https://bugs.webkit.org/show_bug.cgi?id=186287
        <rdar://problem/40783352>

        Reviewed by Youenn Fablet.

        * Shared/WebPreferences.yaml:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::frameBecameRemote):

2018-06-04  Dan Bernstein  <mitz@apple.com>

        Restored code signing behavior when WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.

        * Configurations/DebugRelease.xcconfig: Use ad-hoc code signing when
          WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.

2018-06-04  Dan Bernstein  <mitz@apple.com>

        Removed a reference to a file that was deleted in r231190.

        * WebKit.xcodeproj/project.pbxproj: Removed the reference to WebProcessShim.xcconfig.

2018-06-04  Chris Dumez  <cdumez@apple.com>

        Update Fetch code to provide more useful exception messages
        https://bugs.webkit.org/show_bug.cgi?id=186156

        Reviewed by Youenn Fablet.

        Provide more useful error messages in our Loading / Fetch code.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::didFailFetch):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didFailFetch):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didFail):
        (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
        * WebProcess/Storage/ServiceWorkerClientFetch.h:
        * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
        (WebKit::WebServiceWorkerFetchTaskClient::didFail):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

2018-06-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
        https://bugs.webkit.org/show_bug.cgi?id=186279

        Reviewed by Tim Horton.

        Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).

        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _willStartScrollingOrZooming]):
        (-[WKContentView _didEndScrollingOrZooming]):
        (-[WKContentView _startAssistingKeyboard]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView reloadContextViewForPresentedListViewController]):
        (-[WKContentView _wheelChangedWithEvent:]):
        (-[WKContentView _simulateTextEntered:]):
        (-[WKContentView selectFormAccessoryPickerRow:]):
        (-[WKContentView formInputLabel]):
        (-[WKContentView setTimePickerValueToHour:minute:]):
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):
        (-[WKScrollView addGestureRecognizer:]):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel platformSupportsPickerViewController]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformPrefersTextLegibilityBasedZoomScaling const):

2018-06-04  Jeremy Jones  <jeremyj@apple.com>

        Disable keyboard in fullscreen ios.
        https://bugs.webkit.org/show_bug.cgi?id=186058

        Reviewed by Jer Noble.

        Disallow keyboard in ios fullscreen. This will still allow select keys useful for playback.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::supportsFullScreen):

2018-06-04  Youenn Fablet  <youenn@apple.com>

        NetworkCORSPreflightChecker should set the preflight request User-Agent header
        https://bugs.webkit.org/show_bug.cgi?id=186254
        <rdar://problem/40293504>

        Reviewed by Chris Dumez.

        Some servers misbehave if the User-Agent header is not set properly on preflight requests.
        Set it to the same value as the request triggering the preflight.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::startPreflight):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):

2018-06-03  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend is called
        https://bugs.webkit.org/show_bug.cgi?id=186247

        Reviewed by Tim Horton.

        Since we suspended assertions in prepareToSuspend, we need to resume them if
        cancelPrepareToSuspend is called.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::cancelPrepareToSuspend):

2018-06-03  Andy Estes  <aestes@apple.com>

        [iOS] Add a needed networking process entitlement
        https://bugs.webkit.org/show_bug.cgi?id=186246
        <rdar://problem/39578861>

        Reviewed by Brent Fulgham.

        Also sorted the existing entitlements.

        * Configurations/Network-iOS.entitlements:

2018-06-03  Brent Fulgham  <bfulgham@apple.com>

        Make sure that the fencePort received over IPC has the expected disposition (SEND)
        https://bugs.webkit.org/show_bug.cgi?id=186211
        <rdar://problem/37814171>

        Reviewed by Geoffrey Garen.

        It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
        If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
        drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
        are not checking this value.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setTopContentInsetFenced):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

2018-06-02  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r232275.

        May have caused a ~1% PLT regression on iOS

        Reverted changeset:

        "Store 0-lifetime stylesheets / scripts into the disk cache
        for faster history navigations"
        https://bugs.webkit.org/show_bug.cgi?id=186060
        https://trac.webkit.org/changeset/232275

2018-06-02  Jeremy Jones  <jeremyj@apple.com>

        Make WKWebView firstResponder after entering or exiting fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=186088
        rdar://problem/40387859

        Reviewed by Jer Noble.

        Update first responder when WKWebView moves to a new window, otherwise there won't be a first responder.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):

2018-06-02  Jeremy Jones  <jeremyj@apple.com>

        Exit fullscreen when javascript alerts are presented.
        https://bugs.webkit.org/show_bug.cgi?id=185619
        rdar://problem/35724264

        Reviewed by Jer Noble.

        Prevent users from being trapped in fullscreen by alert cycles.
        Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.

        Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
        before the alert is shown.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::exitFullscreenImmediately):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        * UIProcess/WebPageProxy.h:

2018-06-02  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile for com.cisco.webex.plugin.gpc64 plugin
        https://bugs.webkit.org/show_bug.cgi?id=186110

        Reviewed by Brent Fulgham.

        * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Webex needs to create some symlinks.
        * Resources/PlugInSandboxProfiles/com.cisco.webex.plugin.gpc64.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] The user should always be able to double tap to zoom to a scale of at least 1
        https://bugs.webkit.org/show_bug.cgi?id=186209
        <rdar://problem/40529255>

        Reviewed by Tim Horton.

        Tweaks the way double-tap-to-zoom scales are determined in extra zoom mode. Rather than zooming to make the 50th
        and 90th percentiles of text in the document legible, only consider the 90th percentile of text size when
        determining zoom scale, and fix the other potential zoom scale at 1; additionally, if the zoom scales are close
        (within 0.3 of each other), snap the lower zoom scale to the higher value.

        This results in the following changes in behavior:
        -   Enables double tap to zoom in cases where all the text in the page is already legible.
        -   On pages with mobile viewports, usually allows the user to toggle between initial scale and a scale of 1.
        -   If a significant portion of text is unusually small, the zoomed-in scale may exceed 1.

        Test: fast/events/extrazoom/double-tap-to-zoom-with-large-text.html

        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
        (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):

2018-06-01  Jeremy Jones  <jeremyj@apple.com>

        Keyboard focus should exit fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=185617
        rdar://problem/34697938

        Reviewed by Ryosuke Niwa.

        While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.

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

2018-06-01  Chris Dumez  <cdumez@apple.com>

        Regression(r230567): Unable to log into twitter.com in private sessions
        https://bugs.webkit.org/show_bug.cgi?id=186205
        <rdar://problem/40670799>

        Reviewed by Youenn Fablet.

        We were using the same SWServer for all private sessions and the SWServer's sessionID would
        be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
        as well and would not match the sessionID of its client pages. This sessionID mismatch was 
        causing the breakage.

        Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
        per private session. However, we now make sure that the SWServer gets destroyed whenever its
        corresponding session gets destroyed.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::destroySession):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::from):
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::destroySession):
        (WebKit::StorageProcess::swServerForSession):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):

        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::weakPtrFactory const):
        Fix memory leak caused by a reference cycle between the WebsiteDataStore and its
        WebResourceLoadStatisticsStore, by using WeakPtr to break the cycle. This was causing
        us to leak WebsiteDataStore objects, which would prevent the destruction of sessions.


2018-06-01  Youenn Fablet  <youenn@apple.com>

        Add an option to restrict communication to localhost sockets
        https://bugs.webkit.org/show_bug.cgi?id=186208

        Reviewed by Eric Carlson.

        Implement restriction to localhost sockets by setting any IP address to 127.0.0.1.
        This is done on WebProcess side just before requesting to open the socket by NetworkProcess.

        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::disableNonLocalhostConnections):
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::disableNonLocalhostConnections):
        (WebKit::LibWebRTCProvider::registerMDNSName):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::prepareSocketAddress):
        (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
        (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

2018-06-01  Chris Dumez  <cdumez@apple.com>

        Regression(r230876): Swipe navigation snapshot may get removed too early
        https://bugs.webkit.org/show_bug.cgi?id=186168
        <rdar://problem/39743617>

        Reviewed by Tim Horton.

        The swipe navigation snapshot would get removed too early when receiving a paint
        event after requesting a history navigation but before the provisional load has
        actually started. This is because of the asynchronous navigation policy decision
        which occurs after requesting to navigate. To address the issue, we now start
        listening for events only after the provisional load has started.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didStartProvisionalLoadForMainFrame]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
        (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
        (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
        * UIProcess/Cocoa/ViewGestureController.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::endSwipeGesture):

2018-06-01  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, build fix for r232276.

        iOS sandbox profiles don't preprocess macros. Therefore, remove the whole
        macro condition block.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2018-06-01  Sihui Liu  <sihui_liu@apple.com>

        Stop using StorageTracker.db in LocalStorageDatabaseTracker
        https://bugs.webkit.org/show_bug.cgi?id=186104

        Reviewed by Geoffrey Garen.

        Stop using StorageTracker.db and stop caching origins in LocalStorageDatabaseTracker for efficiency 
        and simplicity. Since functions in LocalStorageDatabaseTracker are not frequently called, we get 
        little benefits from caching origins.

        * Platform/Logging.h:
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
        (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
        (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
        (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
        (WebKit::LocalStorageDatabaseTracker::origins const):
        (WebKit::LocalStorageDatabaseTracker::originDetails):
        (WebKit::LocalStorageDatabaseTracker::databasePath const):
        (WebKit::fileCreationTime): Deleted.
        (WebKit::fileModificationTime): Deleted.
        (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath const): Deleted.
        (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase): Deleted.
        (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers): Deleted.
        (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles): Deleted.
        (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier): Deleted.
        (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): Deleted.
        (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier): Deleted.
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * UIProcess/WebStorage/StorageManager.h:

2018-06-01  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Crash in WebKitFaviconDatabase when pageURL is unset
        https://bugs.webkit.org/show_bug.cgi?id=186164

        Reviewed by Carlos Garcia Campos.

        PageURL can legitimately be null here if JavaScript does something silly with window.open.

        * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
        (webkitFaviconDatabaseSetIconURLForPageURL):
        (webkitFaviconDatabaseSetIconForPageURL):

2018-05-31  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: use the session delegate to perform window maximize
        https://bugs.webkit.org/show_bug.cgi?id=186167
        <rdar://problem/40544391>

        Reviewed by Timothy Hatcher.

        Add plumbing to hand off window maximizing to the session delegate.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::AutomationSessionClient):
        (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):

2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Try to fix GTK+ build with old versions of GTK+ after r232390.

        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):

2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
        https://bugs.webkit.org/show_bug.cgi?id=186146

        Reviewed by Michael Catanzaro.

        It's more convenient to use than the menu.

        * UIProcess/API/gtk/WebKitPopupMenu.cpp:
        (WebKit::menuCloseCallback):
        (WebKit::WebKitPopupMenu::activateItem):
        * UIProcess/API/gtk/WebKitPopupMenu.h:
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
        (WebKit::WebPopupMenuProxyGtk::selectItem):
        (WebKit::WebPopupMenuProxyGtk::activateItem):
        (WebKit::WebPopupMenuProxyGtk::activateItemAtPath):
        (WebKit::WebPopupMenuProxyGtk::treeViewRowActivatedCallback):
        (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
        (WebKit::WebPopupMenuProxyGtk::buttonPressEventCallback):
        (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
        (WebKit::WebPopupMenuProxyGtk::createPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::show):
        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
        (WebKit::WebPopupMenuProxyGtk::cancelTracking):
        (WebKit::WebPopupMenuProxyGtk::typeAheadFindIndex):
        (WebKit::WebPopupMenuProxyGtk::typeAheadFind):
        * UIProcess/gtk/WebPopupMenuProxyGtk.h:

2018-05-31  Per Arne Vollan  <pvollan@apple.com>

        Add OpenGL display mask to WebPage creation parameters.
        https://bugs.webkit.org/show_bug.cgi?id=186163
        <rdar://problem/40634504>

        Reviewed by Brent Fulgham.

        To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
        The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
        early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
        on some hardware configurations.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):

2018-05-31  Brent Fulgham  <bfulgham@apple.com>

        Add a rule to allow reading files with prefix /private/var/db/CVMS/cvmsCodeSignObj
        https://bugs.webkit.org/show_bug.cgi?id=186157
        <rdar://problem/40666437>

        Reviewed by Eric Carlson.

        * WebProcess/com.apple.WebProcess.sb.in:

2018-05-31  Megan Gardner  <megan_gardner@apple.com>

        Add setting to allow override screen size to be disabled.
        https://bugs.webkit.org/show_bug.cgi?id=186109

        Reviewed by Andy Estes.

        Pipe the needed settings through to WebCore.

        * Shared/WebPreferences.yaml:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues):

2018-05-31  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Add JIT entitlements to WebContent process and plugin process on macOS
        https://bugs.webkit.org/show_bug.cgi?id=184485
        <rdar://problem/37556535>

        Reviewed by Dan Bernstein.

        This patch builds on the changes from Bug 185526 to add support for a JIT entitlement. It makes the
        following changes:

        1. Adds a new 'WebContent-OSX.entitlements file that unconditionally adds the JIT entitlement for all builds.
        2. Modifies the PluginService.entitlements to unconditionally add the JIT entitlement.

        * Configurations/PluginService.entitlements: Updated to add the JIT entitlement.
        * Configurations/WebContent-OSX.entitlements: Updated to add the JIT entitlement.
        * Configurations/WebContentService.xcconfig: Updated to use the new 'WebContent-OSX.entitlements' file.
        * WebKit.xcodeproj/project.pbxproj:

2018-05-31  Brent Fulgham  <bfulgham@apple.com>

        Don't attempt to extend sandbox when running tests with mock media devices
        https://bugs.webkit.org/show_bug.cgi?id=186150
        <rdar://problem/40690875>

        Reviewed by Alexey Proskuryakov.

        Avoid attempting to issue a sandbox extension to actual media devices when
        running with Mock capture devices.

        Also handle the 'denyNextRequest' test state outside of the USE(APPLE_INTERNAL_SDK)
        guards, since it is needed for Open Source builds as well.

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):

2018-05-31  Antti Koivisto  <antti@apple.com>

        WebKit memory management: Safari jetsams on some websites when zooming and scrolling
        https://bugs.webkit.org/show_bug.cgi?id=186091
        <rdar://problem/36315010>

        Reviewed by Geoff Garen.

        When zooming a page rapidly the visible rect and the page zoom level may get momentarily out of sync.
        When this happens we may generate tiles for a much larger area than needed and run out of memory
        building the next layer tree transaction. Running out of memory is more likely if the page has lots of
        tiled layers in addition to the main content layer.

        We already have code for dealing with the scale mismatch for zoom-out case (where this would cause
        visibly missing tiles). This patch enables the same exact adjustment for zoom-in case (where the
        symptom is creating too many tiles).

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::adjustExposedRectForNewScale):

        Do some renames to make it clear that this can both expand and contract the visible rect.
        Bail out if there is nothing to do.

        (WebKit::WebPage::updateVisibleContentRects):

        Call adjustExposedRectForNewScale directly and unconditionally.

        (WebKit::adjustExposedRectForBoundedScale): Deleted.

2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Pass VM& parameter as much as possible
        https://bugs.webkit.org/show_bug.cgi?id=186085

        Reviewed by Saam Barati.

        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        (WebKit::NPJSObject::hasMethod):
        (WebKit::NPJSObject::construct):
        (WebKit::NPJSObject::invoke):

2018-05-30  Brent Fulgham  <bfulgham@apple.com>

        [macOS] WebProcess needs TCC entitlements for media capture (Take 2)
        https://bugs.webkit.org/show_bug.cgi?id=185526
        <rdar://problem/36674649>

        Reviewed by Alexey Proskuryakov.

        In Bug 181995 I added TCC entitlements for media capture to the macOS entitlements used for
        relocatable builds. These changes also need to apply to system builds of WebKit.

        Previously we had not needed an entitlements file for system builds of WebKit, so only provided
        an entitlements file for our relocatable build targets. Now we need entitlements when building
        on recent macOS targets using internal SDKs.

        Since these various scenarios are beginning to multiple, this patch dynamically generates the
        entitlements file.

        This patch does the following:

        1. Changes the "WebContent-OSX.entitlements" to hold the TCC entitlements needed for media capture, and rename
           to "WebContent-OSX-restricted.entitlements".
        2. Removes the unneeded "com.apple.private.xpc.domain-extension" from WebContent-OSX.entitlement, and dynamically
           adds it using a new build step using the script 'process-webcontent-entitlements.sh'
        3. Updates DebugRelease.xcconfig to use the 'Safari Engineering' signing key for internal builds.
        4. Updates WebContentService.xcconfig to remove the CODE_SIGN_ENTITLEMENTS_OSX_WITH_XPC_DOMAIN_EXTENSION_YES target
           since we no longer need a custom entitlement file for this case.
        5. Updates WebContentService.Development.xcconfig to remove CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO since it is no
           longer needed.
        6. Deletes the file Configurations/WebContent.Development.entitlements since it is no longer needed.
        7. Revises the WebContent process sandbox to allow camera and microphone access without needing TCC
           entitlements, since those cannot be applied without an internal SDK.
        8. Revises the UserMediaProcessManager to not pass dynamic sandbox extensions to the WebContent process
           when building with the public SDK since those entitlements cannot be added or consumed in Open
           Source builds.

        We want to use the TCC entitlements when building with the internal SDK on recent macOS builds.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/WebContent-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX.entitlements.
        * Configurations/WebContent.Development.entitlements: Removed.
        * Configurations/WebContentService.Development.xcconfig:
        * Configurations/WebContentService.xcconfig:
        * Scripts/process-webcontent-entitlements.sh: Added.
        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't bother creating and sending sandbox extensions for
        camera and microphone control for builds that cannot support them.
        * WebKit.xcodeproj/project.pbxproj:

2018-05-30  Daniel Bates  <dabates@apple.com>

        NavigationAction does not need to hold initiating DOM Event
        https://bugs.webkit.org/show_bug.cgi?id=185958
        <rdar://problem/40531539>

        Reviewed by Simon Fraser.

        Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().

        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
        (WebKit::mouseButtonForMouseEventData):
        (WebKit::syntheticClickTypeForMouseEventData):
        (WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
        (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
        (WebKit::mouseEventForNavigationAction): Deleted.
        (WebKit::mouseButtonForMouseEvent): Deleted.
        (WebKit::syntheticClickTypeForMouseEvent): Deleted.
        (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.

2018-05-30  Andy Estes  <aestes@apple.com>

        [Cocoa] Add an SPI to suppress connection termination errors from CFNetwork when network interfaces change
        https://bugs.webkit.org/show_bug.cgi?id=186107
        <rdar://problem/39338957>

        Reviewed by Brady Eidson.

        Added an SPI which configures a process pool's networking process to set the
        kCFStreamPropertyAutoErrorOnSystemChange to NO on its NSURLSessionConfigurations.
        This instructs CFNetwork to not terminate active connections when the system's
        network interfaces change.

        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
        (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-05-30  Youenn Fablet  <youenn@apple.com>

        Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
        https://bugs.webkit.org/show_bug.cgi?id=186082

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCrossOriginResourcePolicyEnabled):
        (WKPreferencesGetCrossOriginResourcePolicyEnabled):
        (WKPreferencesSetFromOriginResponseHeaderEnabled): Deleted.
        (WKPreferencesGetFromOriginResponseHeaderEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

2018-05-30  Youenn Fablet  <youenn@apple.com>

        Rename CrossOriginResourcePolicy same to same-origin
        https://bugs.webkit.org/show_bug.cgi?id=186080

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::shouldCrossOriginResourcePolicyPolicyCancelLoad):

2018-05-30  David Kilzer  <ddkilzer@apple.com>

        [iOS] -[WKFullScreenViewController viewWillAppear:] should call [super viewWillAppeear:]
        <https://webkit.org/b/186103>
        <rdar://problem/40655695>

        Reviewed by Eric Carlson.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
        Drive-by clean up.  For consistency, we always use the same
        variable in the body of the `if` statement that was used in the
        condition.
        (-[WKFullScreenViewController viewWillAppear:]): Call
        [super viewWillAppeear:] to fulfill API contract.

2018-05-30  Chris Dumez  <cdumez@apple.com>

        Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
        https://bugs.webkit.org/show_bug.cgi?id=186097
        <rdar://problem/40651225>

        Reviewed by Dan Bernstein.

        Refactor fix landed in r232298 so that we rely on the existing Callback infrastructure
        to take a background process assertion.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::callAfterNextPresentationUpdate):

2018-05-30  Aditya Keerthi  <akeerthi@apple.com>

        Fix the ENABLE(DATALIST_ELEMENT) build
        https://bugs.webkit.org/show_bug.cgi?id=186105

        Reviewed by Wenson Hsieh.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:

2018-05-30  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a quick build fix for r232276.

        Enabled SecItemShim again as it turns out to be useful for CFNetwork APIs that
        query Keychains underneath us.

        * NetworkProcess/ios/NetworkProcessIOS.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):

2018-05-30  Jer Noble  <jer.noble@apple.com>

        Auto-pip should use main content heuristic.
        https://bugs.webkit.org/show_bug.cgi?id=186065
        <rdar://problem/35862502>

        Reviewed by Eric Carlson.

        Make the m_pipStandbyElement clearable, which will allow the auto-pip mechanism to be torn down. Add
        a WebProcess-side notification when the main content changes, to facilitate this.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
        (WebKit::WebFullScreenManager::setPIPStandbyElement):
        (WebKit::WebFullScreenManager::didEnterFullScreen):
        (WebKit::WebFullScreenManager::willExitFullScreen):
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::videoControlsManagerDidChange):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/cocoa/PlaybackSessionManager.h:
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
        (WebKit::PlaybackSessionManager::clearPlaybackControlsManager):
        (WebKit::PlaybackSessionManager::currentPlaybackControlsElement const):

2018-05-30  Jer Noble  <jer.noble@apple.com>

        Fix a few issues in WKFullScreenViewController
        https://bugs.webkit.org/show_bug.cgi?id=186067
        <rdar://problem/40630944>

        Reviewed by Darin Adler.

        The check in setInterface() is checking the wrong pointer:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):

        The check in -_effectiveFullscreenInsetTop is backwards:
        (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):

2018-05-30  Chris Dumez  <cdumez@apple.com>

        Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
        https://bugs.webkit.org/show_bug.cgi?id=186097
        <rdar://problem/40651225>

        Reviewed by Tim Horton.

        Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate(). Otherwise,
        apps may get stuck on _doAfterNextPresentationUpdate because the WebProcess got suspended.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::callAfterNextPresentationUpdate):

2018-05-29  Tim Horton  <timothy_horton@apple.com>

        Fix the build
        https://bugs.webkit.org/show_bug.cgi?id=186078

        Unreviewed build fix.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _denyNextUserMediaRequest]):

2018-05-29  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
        https://bugs.webkit.org/show_bug.cgi?id=185983
        <rdar://problem/40205486>

        Reviewed by Tim Horton.

        * Configurations/Network-iOS.entitlements:

        Added a needed entitlement.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/WiFiAssertionHolder.h:
        (WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):

        Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.

        * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
        (holdWiFiAssertion):
        (releaseWiFiAssertion):
        (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
        (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):

        Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
        WiFiAssertionHolder as an argument.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

        Added a needed sandbox extension.

        * WebKit.xcodeproj/project.pbxproj:

2018-05-29  Youenn Fablet  <youenn@apple.com>

        Add a consistency check between URL and CFURL
        https://bugs.webkit.org/show_bug.cgi?id=186057
        <rdar://problem/40258457>

        Reviewed by Geoff Garen.

        * Shared/Cocoa/WKNSURLExtras.mm:
        (+[NSURL _web_URLWithWTFString:relativeToURL:]):
        (urlWithWTFString): Deleted.
        (+[NSURL _web_URLWithWTFString:]): Deleted.

2018-05-29  Alex Christensen  <achristensen@webkit.org>

        Remove unused WebPage::dummy
        https://bugs.webkit.org/show_bug.cgi?id=186068

        Reviewed by Sam Weinig.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dummy): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-05-29  Per Arne Vollan  <pvollan@apple.com>

        Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
        https://bugs.webkit.org/show_bug.cgi?id=186056

        Reviewed by Brent Fulgham.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:

2018-05-25  Jiewen Tan  <jiewen_tan@apple.com>

        Tighten sandbox profiles for Networking Processes to restrict accesses to macOS/iOS Keychains
        https://bugs.webkit.org/show_bug.cgi?id=162948
        <rdar://problem/40558894>

        Reviewed by Brent Fulgham.

        The patch conditionally tighten sandbox profiles for Networking Processes to remove Keychain related
        permissions and some security permisssions that are not needed. Also it conditionally remove the
        Process Privilege for Networking Processes to access Credentials.

        In addition, it remove process privilege assertions for SecItemShim as it is supposed to work in processes
        that don't have privileges to access Keychains and delegate all operations to UI Process via IPC. Also,
        the patch disables SecItemShim for Networking Process conditionally.

        * Configurations/Network-iOS.entitlements:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):
        (WebKit::webSecItemCopyMatching):
        (WebKit::webSecItemAdd):
        (WebKit::webSecItemUpdate):
        (WebKit::webSecItemDelete):
        (WebKit::initializeSecItemShim):

2018-05-29  Chris Dumez  <cdumez@apple.com>

        Store 0-lifetime stylesheets / scripts into the disk cache for faster history navigations
        https://bugs.webkit.org/show_bug.cgi?id=186060
        <rdar://problem/40627270>

        Reviewed by Geoffrey Garen.

        Tweak our storeUnconditionallyForHistoryNavigation logic to match resources whose priority
        is High, not just VeryHigh. Per logic in CachedResource::defaultPriorityForResourceType(Type),
        This now matches stylesheets and scripts in addition to main resources.

        I found that in case of a history navigation to apple.com, a significant number of scripts
        and stylesheets had to be loaded from the network because our previous heuristic decided
        not to store them (because their priority was not VeryHigh and because their max-age was
        0).

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::makeStoreDecision):

2018-05-28  Jeff Miller  <jeffm@apple.com>

        Expose additional WKMenuItemIdentifier strings
        https://bugs.webkit.org/show_bug.cgi?id=186041

        Reviewed by Dan Bernstein.

        Expose identifiers for media-related menu items.

        * UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
        Define new identifiers.

        * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
        Declare new identifiers.

        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::menuItemIdentifier):
        Map to new identifiers.

2018-05-29  Geoffrey Garen  <ggaren@apple.com>

        Removed some unused WebSQL trackers
        https://bugs.webkit.org/show_bug.cgi?id=186026

        Reviewed by Dan Bernstein.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::m_nonVisibleProcessCleanupTimer):
        (WebKit::m_webSQLiteDatabaseTracker): Deleted.
        * WebProcess/WebProcess.h:

2018-05-29  Per Arne Vollan  <pvollan@apple.com>

        Follow-up fixes after r228907.
        https://bugs.webkit.org/show_bug.cgi?id=183338

        Reviewed by Brent Fulgham.

        Add screen properties to the WebProcess creation parameters, instead of sending
        them in a message to the WebProcess just after starting it up.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2018-05-29  Sihui Liu  <sihui_liu@apple.com>

        Unable to remove IndexedDB Databases with Cocoa API removeDataOfTypes
        https://bugs.webkit.org/show_bug.cgi?id=185835
        <rdar://problem/39142257>

        Reviewed by Chris Dumez.

        Fix a wrong if condition: databases should be closed and deleted if websiteDataTypes contains 
        WebsiteDataType::IndexedDBDatabases.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::deleteWebsiteDataForOrigins):

2018-05-28  Sam Weinig  <sam@webkit.org>

        Modernize SVGRenderStyleDefs.h
        https://bugs.webkit.org/show_bug.cgi?id=186024

        Reviewed by Daniel Bates.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::applyPropertiesToLayer):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        Update for new enum names.

2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.3 release.

        * gtk/NEWS: Add release notes for 2.21.3.

2018-05-27  Dan Bernstein  <mitz@apple.com>

        Reverted the changes made for https://webkit.org/b/186016

        They broke the USE(APPLE_INTERNAL_SDK) Sierra build.

2018-05-27  David Kilzer  <ddkilzer@apple.com>

        [iOS] Fix warnings about leaks found by clang static analyzer
        <https://webkit.org/b/186009>
        <rdar://problem/40574267>

        Reviewed by Daniel Bates.

        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::WebAutomationSession::platformSimulateKeySequence): Fix
        leak of two WebEvent objects that happened in a loop.
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
        Fix leak of a UIImage.

2018-05-27  Dan Bernstein  <mitz@apple.com>

        [Cocoa] Avoid importing directly from subumbrella frameworks
        https://bugs.webkit.org/show_bug.cgi?id=186016

        Reviewed by Sam Weinig.

        * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
          OTHER_CPLUSPLUSFLAGS.
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
          HIToolbox header.
        * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
        * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
        * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
          header.
        * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
          PDFKit header.
        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
        * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.

2018-05-25  Timothy Hatcher  <timothy@apple.com>

        Setting drawsBackground to YES on a WKView doesn't take effect immediately
        https://bugs.webkit.org/show_bug.cgi?id=185885
        rdar://problem/39706506

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Removed setBackgroundExtendsBeyondPage(true)
        since it is now the default.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setDrawsBackground): Make sure updateLayer gets called on the web view
        by calling setNeedsDisplay:YES.
        (WebKit::WebViewImpl::setBackgroundColor): Ditto.
        (WebKit::WebViewImpl::updateLayer): Removed dead code.
        * UIProcess/WebPageProxy.h: Make m_backgroundExtendsBeyondPage default to true. WebKit was
        always turning this on during WKWebView initializtion, which would cause the scroll
        shadow layer to be created, flash black because of no background, then destroyed soon
        after once WebKit's message to turn it on got delivered.
        * WebProcess/WebPage/WebPage.cpp:
        (WebPage::WebPage): Call setBackgroundExtendsBeyondPage earlier to avoid creating the scroll
        shadow layer, since backgroundShouldExtendBeyondPage defautls to false in WebCore for WK1.
        (WebKit::WebPage::setDrawsBackground): Use updateBackgroundRecursively to propagate the
        correct base background color.

2018-05-25  Youenn Fablet  <youenn@apple.com>

        Migrate From-Origin to Cross-Origin-Resource-Policy
        https://bugs.webkit.org/show_bug.cgi?id=185840

        Reviewed by Chris Dumez.

        Do Cross-Origin-Resource-Policy (CORP) checks in NetworkLoadChecker instead of NetworkResourceLoader directly.
        Make sure CORP only applies to no-cors loads.
        Remove ancestor checks and only consider the document origin making the load.
        This means that in case of cross-origin redirection to same-origin, the redirection will be CORP-checked,
        the final response will not be CORP-checked but will be opaque.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateCrossOriginResourcePolicyPolicy):
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        Send ancestor information for navigation loads only.

2018-05-25  Daniel Bates  <dabates@apple.com>

        NavigationAction should not hold a strong reference to a Document
        https://bugs.webkit.org/show_bug.cgi?id=185712
        <rdar://problem/40320916>

        Reviewed by Brent Fulgham.

        Update code to make use of NavigationAction::requester().

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-05-25  Tim Horton  <timothy_horton@apple.com>

        Ensure that the Web Content process doesn't sleep during initialization
        https://bugs.webkit.org/show_bug.cgi?id=185975
        <rdar://problem/40548159>

        Reviewed by Geoffrey Garen.

        WebProcessPool::warmInitialProcess isn't worth much (or at least, as much
        as it could be) if the Web Content process goes to sleep in the middle
        of initializeWebProcess.

        Keep the Web Content process alive until it has handled all messages
        sent from WebProcessPool::initializeNewWebProcess.

        This is a significant speedup on some benchmarks I've been running
        that involve prewarming a process long before any content is loaded.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):

2018-05-25  Chris Dumez  <cdumez@apple.com>

        WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
        https://bugs.webkit.org/show_bug.cgi?id=185992

        Reviewed by Geoffrey Garen.

        Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
        to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
        flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-05-25  Chris Dumez  <cdumez@apple.com>

        Drop support for NSURLCache in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=185990

        Reviewed by Geoffrey Garen.

        Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        (WebKit::NetworkProcess::clearDiskCache):
        (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
        (WebKit::clearNSURLCache): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (): Deleted.
        (WebKit::NetworkSessionCocoa::setUsesNetworkCache): Deleted.
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
        (WebKit::WebProcessPool::isNetworkCacheEnabled): Deleted.
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::suggestedFilenameForResourceWithURL const):
        (WebKit::WebFrame::mimeTypeForResourceWithURL const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getResourceDataFromFrame):
        (WebKit::WebPage::hasLocalDataForURL):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::accessibilityRemoteObject):
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::cachedResponseForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2018-05-25  Alex Christensen  <achristensen@webkit.org>

        Fix internal iOS builds after r232198
        https://bugs.webkit.org/show_bug.cgi?id=185986

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):

2018-05-25  Alex Christensen  <achristensen@webkit.org>

        URL::host should return a StringView to reduce allocations
        https://bugs.webkit.org/show_bug.cgi?id=185986

        Reviewed by Geoff Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::fetchDiskCacheEntries):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::areFrameAncestorsSameSite):
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::overrideSystemProxies):
        * Shared/API/APIURL.h:
        (API::URL::host const):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::deleteAllCookies):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::pluginDidReceiveUserInteraction):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::populatePluginCache):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::needsHiddenContentEditableQuirk):
        (WebKit::needsPlainTextQuirk):
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):

2018-05-25  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.

        * wpe/NEWS: Add release notes for the 2.21.2 release.

2018-05-25  Chris Dumez  <cdumez@apple.com>

        Minor ApplicationCacheStorage clean up
        https://bugs.webkit.org/show_bug.cgi?id=185984

        Reviewed by Youenn Fablet.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyOriginsWithApplicationCache):

2018-05-25  Chris Dumez  <cdumez@apple.com>

        Avoid triggering network cache speculative revalidation for loads allowing expired content
        https://bugs.webkit.org/show_bug.cgi?id=185985

        Reviewed by Antti Koivisto.

        Avoid triggering network cache speculative revalidation for loads allowing expired content
        (e.g. history loads, restoring pages after crash or safari relaunch). This causes us to do
        unnecessary revalidations, it is both wasteful and bad for performance.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::retrieve):

2018-05-25  David Kilzer  <ddkilzer@apple.com>

        Fix issues with -dealloc methods found by clang static analyzer
        <https://webkit.org/b/185887>

        Reviewed by Joseph Pecoraro.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Drive-by fix
        to use `copy` for `mimeType` property.
        (-[_WKPreviewControllerDataSource initWithMIMEType:]): Drive-by
        fix to use `instancetype` instead of `id`.  Use -copy for
        `mimeType` argument to match property definition.
        (-[_WKPreviewControllerDataSource dealloc]): Add.  Release
        `_completionHandler` and `_mimeType` to fix leaks.
        * UIProcess/ios/WKPasswordView.mm:
        (-[WKPasswordView dealloc]): Add.  Release
        `_userDidEnterPassword` to fix leak.
        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        Drive-by clean-up to make `location` property `copy` instead of
        `retain`.
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController dealloc]): Release `_target` and
        `_location` to fix leaks.
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullscreenAnimationController dealloc]): Add.  Release
        `_viewController` to fix leak.
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        (@property secondaryMaterialOverlayView): Mark explicitly as
        `assign` since this isn't a retained variable.
        (@property secondaryMaterialOverlayViewConstraints): Mark
        explicitly as `retain` since there is nothing to keep this
        object alive.
        (+[WKFullscreenStackView secondaryMaterialOverlayView]): Fix
        leak by autoreleasing the return value.
        (-[WKFullscreenStackView dealloc]): Release retained instance
        variables to fix leaks.  Note that `_stackView` and
        `_visualEffectView` are internally retained despite their
        @property declarations.
        (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
        Retain @property targetViewForSecondaryMaterialOverlay to match
        its declaration.

2018-05-23  Antoine Quint  <graouts@apple.com>

        [Web Animations] Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED for Web Animations experimental features
        https://bugs.webkit.org/show_bug.cgi?id=185919

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2018-05-24  Dan Bernstein  <mitz@apple.com>

        ProcessLauncherMac.mm contains a couple of meaningless #ifndef directives
        https://bugs.webkit.org/show_bug.cgi?id=185973

        Reviewed by Tim Horton.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess): Use #if !ASSERT_DISABLED to guard statements that
          are only needed for an assertion, instead of #ifndef _NDEBUG, which is always true.

2018-05-24  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses
        https://bugs.webkit.org/show_bug.cgi?id=184261

        Reviewed by Carlos Garcia Campos.

        On Linux we had two implementations for getting notifications about memory pressure events:
        - The memory cgroup (called systemd here).
        - The UIProcess memory monitor (which delivered events via a shared eventfd)

        The problem with the first is that it was usually not working on a standard machine due to
        the special permissions or configurations required for memory cgroups, so the second one
        (eventfd) was used as a fall-back in that case.
        But this eventfd method is racy with more than one WebKit child process and it wasn't
        reliably delivering the notifications.

        This patch removes the memory cgroup implementation and modifies the UIProcess memory monitor
        to deliver the events via WebKit IPC. This simplifies the code a lot and allows us to have
        only one implementation that should work in any Linux machine.

        The implementation now also triggers the event with information about the criticalness of it.

        Previously a critical event was triggered always at a 95% of pressure.
        Now a non-critical one is triggered at 90% and critical remains at a 95%.

        Start triggering events early should compensate the fact than triggering the event via WebKit IPC is
        a bit slower than doing that via an eventfd (or than listening on the memory cgroup event controller).

        The events are delivered to all WebKit childs: WebProcess, NetworkProcess, StorageProcess, PluginProcess.

        In the case of the StorageProcess a dummy controller is installed, which currently does nothing,
        but leaves a note for a future implementation and at least allows to trigger platformReleaseMemory()
        that on Linux/glibc should end calling malloc_trim()

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::didReceiveMessage):
        (WebKit::PluginProcess::initializePluginProcess):
        * Shared/ChildProcess.cpp:
        (WebKit::ChildProcess::didReceiveMemoryPressureEvent):
        * Shared/ChildProcess.h:
        * Shared/ChildProcess.messages.in:
        * Shared/Plugins/PluginProcessCreationParameters.cpp:
        (WebKit::PluginProcessCreationParameters::encode const):
        (WebKit::PluginProcessCreationParameters::decode):
        * Shared/Plugins/PluginProcessCreationParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::initializeProcess):
        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::sendMemoryPressureEvent):
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
        (WebKit::PluginProcessProxy::didFinishLaunching):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::sendMemoryPressureEvent):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        (WebKit::WebProcessPool::sendToStorageProcess):
        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::pollIntervalForUsedMemoryPercentage): Fix equation for calculating the interval percentage.
        (WebKit::MemoryPressureMonitor::singleton):
        (WebKit::MemoryPressureMonitor::start):
        * UIProcess/linux/MemoryPressureMonitor.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-05-24  Youenn Fablet  <youenn@apple.com>

        Update plugin search path to look for user installed plugins
        https://bugs.webkit.org/show_bug.cgi?id=185960

        Reviewed by Brent Fulgham.

        Now that UIProcess may be sandboxed, the home directory is no longer the user home directory.
        Update the path to still look for plugins in the user home directory.

        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::pluginsDirectories):

2018-05-24  Jiewen Tan  <jiewen_tan@apple.com>

        Adopt SecKeyProxy SPI in certificate based challenge response code
        https://bugs.webkit.org/show_bug.cgi?id=185848
        <rdar://problem/34586181>

        Reviewed by Alex Christensen.

        This patch adopts SecKeyProxy SPI in HTTPS client certificate authentication code.
        1) SecKeyProxy is a new SPI to relay crypto operations from one process to another. The owner process of the proxy
        will behave like a server, and other owners of the SecKeys created from the proxy's endpoints will then behave
        like clients. This client-server model allows more restricted sandbox for client processes, and meanwhile permits
        them to relay crypto operations to the server process while maintaining the same SecKey interfaces as used for local operations.
        2) Because of the client-server model, the server process, i.e. the UI Process in our case, needs to keep the proxy
        object alive long enough for the client process, i.e. Network Processes in our case, to finish all operations, and then destroy
        the proxy object afterward. The ideal place to hold such a proxy is WebsiteDataStore such that proxies could live with the
        corresponding network session.
        3) A new class called SecKeyProxyStore is then created to bind the lifetime of SecKeyProxy to the WebsiteDataStore while initializing
        it correctly. At the time the authentication process reaches WebPageProxy::didReceiveAuthenticationChallengeProxy where we have
        accesses to the WebsiteDataStore, we haven't yet been able to determine the Credential to authenticate the challenge. Therefore, we
        have to reserve a place in the WebsiteDataStore ahead and then fill it with the right Credential. That's why SecKeyProxyStore exists.
        In WebPageProxy::didReceiveAuthenticationChallengeProxy, we create a strong reference of SecKeyProxyStore which will eventually hold
        a strong reference of the SecKeyProxy, and move it to the WebsiteDataStore. We also create a weak reference to SecKeyProxyStore
        and move it to the AuthenticationChallenge. In this way, we indirectly bind the lifetime of SecKeyProxy to the WebsiteDataStore through
        the strong reference and also we can initialize the proxy through the weak reference while a credential is finally determined.
        4) Endpoints of the SecKeyProxy will be passed to the Network Process for creating the 'remote' SecKey. However, those endpoints are
        of NSXPCListenerEndpoint type, which can only be passed with xpc connections and are not compatible with our IPC mechanism. In order
        to pass endpoints around, this patch reuses the xpc connection that is used to bootstrap Network Processes from the UI Process. To do
        so, it sends xpc messages at the place where original IPC messages are sent and overwrites the boostrap listener of the xpc connection
        when Network Process is initialized. From the listener, it continues the original authentication code path.
        5) Tests, again, are manually covered by tlstestwebkit.org. Noted, the prompting Keychain dialog in macOS should say Safari instead of
        "com.apple.WebKit.Networking*" now.

        * Shared/AuthenticationManagerCocoa.mm: Added.
        (WebKit::AuthenticationManager::initializeConnection):
        * Shared/Authentication/cocoa/AuthenticationManager.h:
        * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
        (WebKit::AuthenticationChallengeProxy::useCredential):
        (WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore):
        * UIProcess/Authentication/AuthenticationChallengeProxy.h:
        * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm: Added.
        (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):
        * UIProcess/Authentication/cocoa/SecKeyProxyStore.h: Added.
        (WebKit::SecKeyProxyStore::create):
        (WebKit::SecKeyProxyStore::isInitialized const):
        (WebKit::SecKeyProxyStore::get const):
        (WebKit::SecKeyProxyStore::weakPtrFactory const):
        * UIProcess/Authentication/cocoa/SecKeyProxyStore.mm: Added.
        (WebKit::SecKeyProxyStore::initialize):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::addSecKeyProxyStore):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-05-24  Megan Gardner  <megan_gardner@apple.com>

        Fix Issues with Loupe Gesture
        https://bugs.webkit.org/show_bug.cgi?id=185926

        Reviewed by Tim Horton.

        The loupe gesture was not giving us the correct selection in some situations.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView setSelectedTextRange:]):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::clearSelection):

2018-05-24  Keith Rollin  <krollin@apple.com>

        Don't track resource load milestones in private sessions
        https://bugs.webkit.org/show_bug.cgi?id=185828
        <rdar://problem/40424197>

        Reviewed by Brent Fulgham.

        Bug 184838 adds the facility for tracing the beginning and ending of
        resources loads and reporting so that historical information can be
        gathered to assess the health of the networking stack. Disable this
        facility for private browsing sessions.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):

2018-05-24  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r224908): [macOS] Media playback not honoring custom caption styles
        https://bugs.webkit.org/show_bug.cgi?id=185955
        <rdar://problem/40339278>

        Reviewed by Eric Carlson.

        In r224908 I removed access to the MediaAccessibility mach port, as well as
        read/write access to various preferences associated with that process, as it
        was no longer needed by modern WebKit media routines.

        Detailed testing reveals that read access is still needed to these preferences
        to properly handle custom caption styles.

        This patch re-enables access to the media accessibility preferences.

        * WebProcess/com.apple.WebProcess.sb.in:

2018-05-24  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r230269): ASSERTION FAILED: sendRightCount == 1 at ProcessLauncherMac.mm(218)
        https://bugs.webkit.org/show_bug.cgi?id=185687
        <rdar://problem/39386361>

        Reviewed by Brady Eidson.

        In r230269 I added an assertion to help identify cases where we were doing bad
        bookkeeping in our port send rights. I assumed that because we were adding
        one send right, that when we went to close down the connection that we should
        have only one send right.
        
        I have since discovered that this assumption is invalid, and that I should
        only be checking that we have AT LEAST ONE send right at the time we attempt
        to remove it.

        This patch changes the assertion to confirm that we have at least one send
        right before we remove the send right.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):

2018-05-24  Chris Dumez  <cdumez@apple.com>

        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
        https://bugs.webkit.org/show_bug.cgi?id=185951

        Reviewed by Geoffrey Garen.

        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
        launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
        should be enabled.

        * Platform/foundation/LoggingFoundation.mm:
        (WebKit::logLevelString):
        * Platform/unix/LoggingUnix.cpp:
        (WebKit::logLevelString):
        * Platform/win/LoggingWin.cpp:
        (WebKit::logLevelString):

2018-05-24  Per Arne Vollan  <pvollan@apple.com>

        Crash under WebKit::PluginProxy::destroy()
        https://bugs.webkit.org/show_bug.cgi?id=185841
        <rdar://problem/39936896>

        Reviewed by Brent Fulgham.

        A release assert in Connection::sencSync is failing since scripts are not allowed in this context,
        and the WebKit process is allowed to process incoming messages while waiting for the sync reply.
        In this context, scripts are disallowed in the method Element::addShadowRoot. To make sure the
        WebContent process will not wait indefinitely for a reply from the Plugin process, use a timeout
        of 1 second when sending the message.

        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::destroy):

2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK+ input method unit tests after r232049.

        Unit tests don't use a WebPageProxy.

        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::isViewFocused const):
        (WebKit::InputMethodFilter::setEnabled):
        * UIProcess/gtk/InputMethodFilter.h:

2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: implement maximize, minimize and fullscreen window commands
        https://bugs.webkit.org/show_bug.cgi?id=180398

        Reviewed by Brian Burg.

        * UIProcess/API/APIAutomationSessionClient.h:
        (API::AutomationSessionClient::requestMaximizeWindowOfPage): Added to allow clients maximize the window.
        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (WindowStateEvent::WindowStateEvent): Struct to handle window state events.
        (WindowStateEvent::~WindowStateEvent): Complete the event.
        (WindowStateEvent::complete): Call the completion handler is not called already.
        (windowStateEventCallback): Handle window state event changes.
        (webkitWebViewMaximizeWindow): Try to maximize the window and wait for the event.
        (webkitWebViewMinimizeWindow): Try to minimize the window and wait for the event.
        (webkitWebViewRestoreWindow): Try to unmaximize or unminimize the window and wait for the event.
        * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
        (webkitWebViewMaximizeWindow):
        (webkitWebViewMinimizeWindow):
        (webkitWebViewRestoreWindow):
        * UIProcess/Automation/Automation.json:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::maximizeWindowOfBrowsingContext): Exit fullscreen, restore the window and then
        maximize it.
        (WebKit::WebAutomationSession::maximizeWindowForPage): Ask the client to maximize the window of page.
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/atoms/EnterFullscreen.js:
        (enterFullscreen): Return early if fullscreen is disabled or if window is already in fullscreen.

2018-05-23  Eric Carlson  <eric.carlson@apple.com>

        Avoid loading AVFoundation to check supported MIME types if possible
        https://bugs.webkit.org/show_bug.cgi?id=185839
        <rdar://problem/40182010>

        Reviewed by Jer Noble.
        
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Encode mediaMIMETypes.
        (WebKit::WebProcessCreationParameters::decode): Decode mediaMIMETypes.
        * Shared/WebProcessCreationParameters.h:

        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::mediaTypeCache): Static Vector of media MIME types.
        (WebKit::WebProcessProxy::cacheMediaMIMETypes): Cache the type list and pass it to every other
        process proxy.
        (WebKit::WebProcessProxy::cacheMediaMIMETypesInternal): Cache the type list and pass it to the
        web process.
        (WebKit::WebProcessProxy::mediaMIMETypes): Return the cached type list.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess): Set parameters.mediaMIMETypes.

        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in: Add CacheMediaMIMETypes.

        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in: Add SetMediaMIMETypes.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Cache the MIME types if the list isn't
        empty, else register with AVFoundationMIMETypeCache to be notified when it loads types.
        AVFoundationMIMETypeCache to 
        (WebKit::WebProcess::platformTerminate): Unregister with AVFoundationMIMETypeCache.
        (WebKit::WebProcess::setMediaMIMETypes): Pass list of types to AVFoundationMIMETypeCache.

2018-05-23  Brian Burg  <bburg@apple.com>

        Web Automation: disable process swap on navigation when an automation session is active
        https://bugs.webkit.org/show_bug.cgi?id=185552

        Reviewed by Tim Horton.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):
        This is not intended to work right now. Opt out to avoid crashing
        later when a process is deallocated unexpectedly.

2018-05-23  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should check cached redirections
        https://bugs.webkit.org/show_bug.cgi?id=185849

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        Set the resource error url as done by WebCore SubresourceLoader.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        Pass the resource request to dispatchWillSendRedirectedRequest now needs it.
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        Make sure that m_networkLoad is not null before cancelling it since we might be checking a cached redirection.
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        Ensure the redirect response is coming from the Network before adding it to the cache.
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        Call willSendRedirectedRequest to make sure the cached redirect is validated.
        * NetworkProcess/NetworkResourceLoader.h:

2018-05-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
        https://bugs.webkit.org/show_bug.cgi?id=185866

        Reviewed by Brian Burg.

        To handle the case of the session being closed by the browser, for example in case of a network process
        crash. This is currently causing WebDriver tests to timeout in the bot.

        * UIProcess/API/glib/WebKitAutomationSession.cpp: Add an implementation of didDisconnectFromRemote() to notify
        the WebContext that the session will be closed.
        * UIProcess/API/glib/WebKitWebContext.cpp: Remove the automation session when closed.
        * UIProcess/API/glib/WebKitWebContextPrivate.h:

2018-05-22  Brent Fulgham  <bfulgham@apple.com>

        Close access to "lsopen" for non-UI process
        https://bugs.webkit.org/show_bug.cgi?id=185890
        <rdar://problem/39686511>

        Reviewed by Alexey Proskuryakov.

        Close down access to 'lsopen' in the iOS sandboxes. These operations are
        performed by the UIProcess on behalf of these helper processes.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

2018-05-22  Dean Jackson  <dino@apple.com>

        Optimized path zoom animation needs a valid UIImage and CGRect
        https://bugs.webkit.org/show_bug.cgi?id=185883
        <rdar://problem/40306056>

        Reviewed by Jon Lee.

        Take the rectangle that was passed into the ResourceRequest and
        use it for the origin of an animation into QuickLook.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceRequest>::encode):
        (IPC::ArgumentCoder<ResourceRequest>::decode):
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
        (-[_WKPreviewControllerDelegate presentingViewController]):
        (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
        (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
        (WebKit::SystemPreviewController::start):
        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.
        * UIProcess/Downloads/DownloadProxy.h:
        (WebKit::DownloadProxy::systemPreviewDownloadRect const):
        * UIProcess/SystemPreviewController.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::syncRootViewToScreen):
        * UIProcess/WebPageProxy.h:

2018-05-22  Sihui Liu  <sihui_liu@apple.com>

        [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies use different files with/without processpool
        https://bugs.webkit.org/show_bug.cgi?id=185831

        Reviewed by Chris Dumez.

        Started to use uiProcessCookieStorageIdentifier for iOS: make sure cookies handled without 
        processpool would use the same storage file as when processpool exists.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-05-22  Chris Dumez  <cdumez@apple.com>

        Regression(AsyncPolicyDelegates): Box.app login Window is blank
        https://bugs.webkit.org/show_bug.cgi?id=185832
        <rdar://problem/40307871>

        Reviewed by Geoffrey Garen.

        Moved WeakObjCPtr.h header from WebKit/ to wtf/ so that it can be used in
        WebKitLegacy code.

        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
        * UIProcess/API/Cocoa/WKConnection.mm:
        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        * UIProcess/API/Cocoa/WKScriptMessage.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        * UIProcess/API/Cocoa/_WKAutomationSession.mm:
        * UIProcess/API/Cocoa/_WKDownload.mm:
        * UIProcess/API/Cocoa/_WKElementAction.mm:
        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/Cocoa/AutomationClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/DiagnosticLoggingClient.h:
        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/FindClient.h:
        * UIProcess/Cocoa/FullscreenClient.h:
        * UIProcess/Cocoa/IconLoadingDelegate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
        * UIProcess/ios/WKScrollView.mm:
        * UIProcess/mac/WKInspectorViewController.mm:
        * UIProcess/mac/WKInspectorWKWebView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:

2018-05-22  Sihui Liu  <sihui_liu@apple.com>

        Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
        https://bugs.webkit.org/show_bug.cgi?id=185715

        Reviewed by Geoffrey Garen.

        Add getter for origins in WKWebsiteDataRecord for testing.

        * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
        (-[WKWebsiteDataRecord _originsString]):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:


2018-05-22  Brady Eidson  <beidson@apple.com>

        Rename the "Web content is visible" process assertion.
        https://bugs.webkit.org/show_bug.cgi?id=185878

        Reviewed by Chris Dumez.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):

2018-05-22  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Drop assertions on process suspension
        https://bugs.webkit.org/show_bug.cgi?id=185844
        <rdar://problem/40352319>

        Reviewed by Daniel Bates.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::processDidResume):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidResume):

2018-05-22  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r229093): Re-enable Network Extension support in the WebContent process (Take 2)
        https://bugs.webkit.org/show_bug.cgi?id=185874
        <rdar://problem/40454404>

        Reviewed by Eric Carlson.

        Add back a necessary XPC connection after locking down the network features in r229093.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * WebProcess/com.apple.WebProcess.sb.in:

2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r232052.

        Breaks internal builds.

        Reverted changeset:

        "Use more C++17"
        https://bugs.webkit.org/show_bug.cgi?id=185176
        https://trac.webkit.org/changeset/232052

2018-05-22  Alberto Garcia  <berto@igalia.com>

        [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
        https://bugs.webkit.org/show_bug.cgi?id=182622
        <rdar://problem/40292317>

        Reviewed by Michael Catanzaro.

        Move the test to determine whether we need to link against
        libatomic to the common file WebKitCompilerFlags.cmake so it can
        also be used for JavaScriptCore.

        * CMakeLists.txt:

2018-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r231843.

        Broke cross build

        Reverted changeset:

        "[CMake] Properly detect compiler flags, needed libs, and
        fallbacks for usage of 64-bit atomic operations"
        https://bugs.webkit.org/show_bug.cgi?id=182622
        https://trac.webkit.org/changeset/231843

2018-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        Crash when loading a SVG image
        https://bugs.webkit.org/show_bug.cgi?id=185819

        Reviewed by Brent Fulgham.

        This is happening in WebLoaderStrategy::scheduleLoad() when getting the value of
        FrameLoaderClient::pageID(). SVGImage uses the empty clients for the loader, and
        EmptyFrameLoaderClient::pageID() returns std::nullopt. The same happens with the frameID. This changed in
        r225934, when pageID() and frameID() were changed to return std::optional, EmptyFrameLoaderClient was updated to
        return std::nullopt instead of 0.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad): Use value_or(0) instead of value() to get pageID and frameID from
        FrameLoaderClient.

2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use more C++17
        https://bugs.webkit.org/show_bug.cgi?id=185176

        Reviewed by JF Bastien.

        * Configurations/Base.xcconfig:
        * DerivedSources.make:

2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][Wayland] UI process crash when closing the window
        https://bugs.webkit.org/show_bug.cgi?id=185818

        Reviewed by Michael Catanzaro.

        This happens when a page containing a text field is loaded but the focus remains in the url bar when the window
        is closed. This is because we are sending a notify-in to the IM context, but the focus is still in the URL
        bar. That confuses the wayland input method manager that tries to free the text of the web view IM context that has
        already been deleted.

        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::setEnabled): Only send notify-in if the view is actually focused.

2018-05-21  Ryosuke Niwa  <rniwa@webkit.org>

        Remove unused and no-op WKContextSetCookieStorageDirectory
        https://bugs.webkit.org/show_bug.cgi?id=185857

        Reviewed by Youenn Fablet.

        Deleted C API which didn't do anything useful, and consequently not used by anyone.

        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCookieStorageDirectory): Deleted.
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/WebProcessPool.h:

2018-05-21  Chris Nardi  <cnardi@chromium.org>

        Remove dead exception in MediaList.appendMedium
        https://bugs.webkit.org/show_bug.cgi?id=185278

        Reviewed by Chris Dumez.

        Remove code pertaining to an exception being thrown by appendMedium().

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
        (webkit_dom_media_list_append_medium):

2018-05-21  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Click events only fire once when editing
        https://bugs.webkit.org/show_bug.cgi?id=185777

        Reviewed by Tim Horton.

        gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
        edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
        This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
        click event.

        Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
        being shown when the node is already being assisted.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):

2018-05-21  Daniel Bates  <dabates@apple.com>

        REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
        https://bugs.webkit.org/show_bug.cgi?id=185789
        <rdar://problem/40380175>

        Reviewed by Andy Estes.

        Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
        console messages, sending CSP reports, and dispatching SecurityPolicyViolation events.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker): Modified to take a reference to the NetworkConnectionToWebProcess,
        the web page ID, the web frame ID, and the resource load identifier. These details are necessary
        in order to implement the ContentSecurityPolicyClient interface.
        (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): Added.
        (WebKit::NetworkLoadChecker::continueCheckingRequest): Write in terms of isAllowedByContentSecurityPolicy().
        (WebKit::NetworkLoadChecker::contentSecurityPolicy): Pass ourself as the client so that we receive
        delegate callbacks.
        (WebKit::NetworkLoadChecker::addConsoleMessage): Added.
        (WebKit::NetworkLoadChecker::sendCSPViolationReport): Added.
        (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Added.
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (NetworkResourceLoader::enqueueSecurityPolicyViolationEvent): Added.
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad): Modified to take a reference to the NetworkConnectionToWebProcess and pass
        this through to the NetworkLoadChecker along with the web page ID, web frame ID and resource load identifier.
        * NetworkProcess/PingLoad.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::enqueueSecurityPolicyViolationEvent): Added.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add message EnqueueSecurityPolicyViolationEvent.

2018-05-21  Brian Burg  <bburg@apple.com>

        Web Automation: always return an empty cookie list if document.cookieURL() is empty
        https://bugs.webkit.org/show_bug.cgi?id=185838
        <rdar://problem/37737526>

        Reviewed by Tim Horton.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
        This crashes in CFNetwork code because an empty cookie URL is not a valid input.
        Just return an empty list since there couldn't be any cookies returned.

2018-05-21  Brian Burg  <bburg@apple.com>

        Web Automation: terminate the automation session if the network or storage process crashes
        https://bugs.webkit.org/show_bug.cgi?id=185827
        <rdar://problem/40424020>

        Reviewed by Tim Horton.

        If one of the processes crashes, the page may be in an undefined state and
        automation will fail in unpredictable ways. It's better to just give up immediately.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessFailedToLaunch):
        (WebKit::WebProcessPool::storageProcessCrashed):

2018-05-21  Sihui Liu  <sihui_liu@apple.com>

        Add a diskCacheSizeOverride accessor function on WKContextConfigurationRef
        https://bugs.webkit.org/show_bug.cgi?id=185826
        <rdar://problem/39732113>

        Reviewed by Alex Christensen.

        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationDiskCacheSizeOverride):
        (WKContextConfigurationSetDiskCacheSizeOverride):
        * UIProcess/API/C/WKContextConfigurationRef.h:

2018-05-21  Jer Noble  <jer.noble@apple.com>

        Complete fix for enabling modern EME by default
        https://bugs.webkit.org/show_bug.cgi?id=185770
        <rdar://problem/40368220>

        Reviewed by Eric Carlson.

        * Configurations/FeatureDefines.xcconfig:

2018-05-21  Sam Weinig  <sam@webkit.org>

        Modernize RenderStyleConstants.h - Part 1
        https://bugs.webkit.org/show_bug.cgi?id=185809

        Reviewed by Yusuke Suzuki.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::rangeForWebSelectionAtPosition):
        (WebKit::WebPage::getPositionInformation):
        Update for new enum names.

2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.

        * gtk/NEWS: Add release notes for 2.21.2.

2018-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed, rolling out r222967.

        It's not ready yet

        Reverted changeset:

        "[GTK][WPE] Add API to configure and enable resource load
        statistics"
        https://bugs.webkit.org/show_bug.cgi?id=177943
        https://trac.webkit.org/changeset/222967

2018-05-18  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r231982.
        https://bugs.webkit.org/show_bug.cgi?id=185793

        Caused layout test failures (Requested by realdawei on
        #webkit).

        Reverted changeset:

        "Complete fix for enabling modern EME by default"
        https://bugs.webkit.org/show_bug.cgi?id=185770
        https://trac.webkit.org/changeset/231982

2018-05-18  Brian Burg  <bburg@apple.com>

        [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate
        https://bugs.webkit.org/show_bug.cgi?id=185791
        <rdar://problem/40279891>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: If there is no dialog shown,
        then the delegate methods to return the dialog text may return a nil NSString.

2018-05-18  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should cancel its content extension retrieval task when being destroyed
        https://bugs.webkit.org/show_bug.cgi?id=185661
        <rdar://problem/39985509>

        Reviewed by Chris Dumez.

        Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive.
        This allows stopping NetworkLoadChecker be ref counted.
        This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well.
        By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::weakPtrFactory):
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        * NetworkProcess/PingLoad.h:

2018-05-18  Per Arne Vollan  <pvollan@apple.com>

        WebProcess fails to launch
        https://bugs.webkit.org/show_bug.cgi?id=185140

        Reviewed by Geoffrey Garen.

        If the NSApplication runloop is not used in the WebContent process, launchServicesCheckIn() needs to be called
        in order for enableSandboxStyleFileQuarantine() to succeed. Determine at runtime if launchServicesCheckIn()
        should be called by checking if the NSApplication event loop is running.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2018-05-18  Jer Noble  <jer.noble@apple.com>

        Complete fix for enabling modern EME by default
        https://bugs.webkit.org/show_bug.cgi?id=185770
        <rdar://problem/40368220>

        Reviewed by Eric Carlson.

        * Configurations/FeatureDefines.xcconfig:

2018-05-18  Brent Fulgham  <bfulgham@apple.com>

        Convert ProcessPrivilege assertions to regular debug-only assertions
        https://bugs.webkit.org/show_bug.cgi?id=185775
        <rdar://problem/40372286>

        Reviewed by Geoffrey Garen.

        In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
        UI-only calls were not being made in the WebContent pro