ChangeLog-2019-06-05   [plain text]


2019-06-05  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Update sandboxes to address iokit-get-property errors
        https://bugs.webkit.org/show_bug.cgi?id=198494
        <rdar://problem/51322072> and <rdar://problem/50602737>

        Reviewed by Alexey Proskuryakov.

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

2019-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Upstream content mode support into open source from WebKitAdditions
        https://bugs.webkit.org/show_bug.cgi?id=198484
        <rdar://problem/51355671>

        Reviewed by Andy Estes.

        Move code for handling WKContentMode into open source. No change in behavior, for internal builds.

        * Shared/API/Cocoa/WebKit.apinotes:
        * Shared/WebContentMode.h: Renamed from Source/WebKit/Shared/WebCompatibilityMode.h.
        * Shared/WebPreferences.yaml:
        * UIProcess/API/APINavigation.h:
        (API::Navigation::setEffectiveContentMode):
        (API::Navigation::effectiveContentMode const):
        (API::Navigation::setEffectiveCompatibilityMode): Deleted.
        (API::Navigation::effectiveCompatibilityMode const): Deleted.
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::shouldBypassContentModeSafeguards const):
        (API::NavigationClient::shouldBypassCompatibilityModeSafeguards const): Deleted.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKNavigation.h:
        * UIProcess/API/Cocoa/WKNavigation.mm:
        (-[WKNavigation effectiveContentMode]):
        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (WebKit::contentMode):
        (WebKit::webContentMode):
        (-[WKWebpagePreferences _allowSiteSpecificQuirksToOverrideCompatibilityMode]):
        (-[WKWebpagePreferences _setAllowSiteSpecificQuirksToOverrideCompatibilityMode:]):
        (-[WKWebpagePreferences setPreferredContentMode:]):
        (-[WKWebpagePreferences preferredContentMode]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::shouldBypassContentModeSafeguards const):
        (WebKit::NavigationState::NavigationClient::shouldBypassCompatibilityModeSafeguards const): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
        (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingSupported):
        (WebKit::webViewSizeIsNarrow):
        (WebKit::desktopClassBrowsingRecommendedForRequest):
        (WebKit::desktopClassBrowsingRecommended):
        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
        * WebKit.xcodeproj/project.pbxproj:

2019-06-05  Tim Horton  <timothy_horton@apple.com>

        Remove some unused selection code
        https://bugs.webkit.org/show_bug.cgi?id=198451

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/UIKitSPI.h:
        * Shared/ios/GestureTypes.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toGestureType):
        (toUIWKGestureType):
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::selectTextWithGranularityAtPoint):
        (WebKit::canShrinkToTextSelection): Deleted.
        (WebKit::hasCustomLineHeight): Deleted.
        (WebKit::WebPage::rangeForWebSelectionAtPosition): Deleted.

2019-06-05  Chris Dumez  <cdumez@apple.com>

        Unreviewed assertion fix for macOS after r246097.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):

2019-06-01  Antoine Quint  <graouts@apple.com>

        [Pointer Events] Add support for chorded button interactions
        https://bugs.webkit.org/show_bug.cgi?id=198462

        Reviewed by Dean Jackson.

        Update to use -2 instead of -1 for NoButton.

        * Shared/API/c/WKEvent.h:
        * Shared/WebEvent.h:

2019-06-05  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r245796): [WPE][GTK] Web process crash on startup
        https://bugs.webkit.org/show_bug.cgi?id=198485

        Reviewed by Chris Dumez.

        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestCreate):

2019-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Re-enable process warming
        https://bugs.webkit.org/show_bug.cgi?id=198526

        Reviewed by Michael Catanzaro.

        It was disabled in r243490 because bubblewrap sandbox needs a valid WebsiteDataStore before launching the web
        process. We can use the default WebsiteDataStore from the WebProcessPool and only use the prewarmed process
        later if the given WebsiteDataStore is the same as the WebProcessPool one.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::tryTakePrewarmedProcess): Do not use the prewarmed process if WebsiteDataStore is
        different than the one used to launch the process when sandboxing is enabled.
        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitialize): Do not disable process warming.
        * UIProcess/glib/WebProcessProxyGLib.cpp:
        (WebKit::WebProcessProxy::platformGetLaunchOptions): Use the WebsiteDataStore from the WebProcessPool if process
        is prewarmed and sandboxing is enabled.

2019-06-04  Chris Dumez  <cdumez@apple.com>

        Cookies set via [WKHTTPCookieStore setCookie:] on store right after constructing WKWebView get lost
        https://bugs.webkit.org/show_bug.cgi?id=198553
        <rdar://problem/51317144>

        Reviewed by Geoffrey Garen.

        If you call [WKHTTPCookieStore setCookie:] right after you construct the WKWebView and before the
        WebContent process has finished launching, then WebsiteDataStore::processPoolForCookieStorageOperations()
        would return null, even though there is already a view/page/WebProcessProxy/WebProcessPool for this data
        store. As a result, the cookie would get added to the WebsiteDataStore's m_pendingCookies but it will
        not be used since we've already previously launched a network process when we constructed the web view.

        The reason processPoolForCookieStorageOperations() would return null is because WebsiteDataStore::processPools()
        relies on WebProcessLifetimeObserver::processes() but processes only register themselves with the
        WebProcessLifetimeObservers when they have pages *and* after they are finished launching.

        This patch updates processPoolForCookieStorageOperations() to fallback to iterating over all process pools
        and find a process pool with a process using the current data store and which has pages. This way, even if
        the process is still launching, we'll properly find its associated process pool.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::processPoolForCookieStorageOperations):

2019-06-04  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fix miscellaneous build warnings
        https://bugs.webkit.org/show_bug.cgi?id=198544

        Reviewed by Don Olmstead.

        Carefully silence -Wsign-compare warnings.

        * NetworkProcess/cache/NetworkCacheData.cpp:
        (WebKit::NetworkCache::readOrMakeSalt):

2019-06-04  Youenn Fablet  <youenn@apple.com>

        getUserMedia requests should be processed sequentially in UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=198430
        <rdar://problem/51311420>

        Reviewed by Eric Carlson.

        Before the patch, we process all incoming gum/gdm requests in parallel.
        We now queueu them and process them one at a time.
        This allows to take into consideration state changes triggered by one request for the next one.
        In particular, if a user grants a request, this might grant the next one as well.

        To implement that, we keep a reference of the current request to process.
        We queue other requests happening whenever another request comes.
        When the request is processed, we look at the next one in the queue.
        To ensure we do not stop processing the queue for no good reason, some refactoring is done:
        - queue processing happens when sending back IPC response to WebProcess.
        - denyRequest/grantRequest are consistently called in the manager proxy.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests):
        Invalidate pregranted requests as well.
        (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
        Renamed from userMediaAccessWasDenied to denyRequest.
        This method is now consistently used whenever the manager proxy wants to deny the request.
        It does the IPC to the WebProcess and triggers processing of the next request.
        (WebKit::UserMediaPermissionRequestManagerProxy::grantRequest):
        Renamed from userMediaAccessWasGranted to grantRequest.
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        This method is now consistently used whenever the manager proxy wants to deny the request.
        It does the IPC to the WebProcess and triggers processing of the next request.
        (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired):
        We now keep a queue of request instead of request IDs to make the deny code path more consistent.
        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
        (WebKit::UserMediaPermissionRequestManagerProxy::processNextUserMediaRequestIfNeeded):
        (WebKit::UserMediaPermissionRequestManagerProxy::startProcessingUserMediaPermissionRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
        To make sure we do not process a different request, we keep a pointer to the request and compare it with the current media request.
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::viewIsBecomingVisible):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
        * UIProcess/UserMediaPermissionRequestProxy.cpp:
        (WebKit::setDeviceAsFirst):
        (WebKit::UserMediaPermissionRequestProxy::allow):
        (WebKit::UserMediaPermissionRequestProxy::deny):
        * UIProcess/UserMediaPermissionRequestProxy.h:

2019-06-04  Commit Queue  <commit-queue@webkit.org>

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

        Causing Internal build failures (Requested by ShawnRoberts on
        #webkit).

        Reverted changeset:

        "Remove some unused selection code"
        https://bugs.webkit.org/show_bug.cgi?id=198451
        https://trac.webkit.org/changeset/246086

2019-06-04  Tim Horton  <timothy_horton@apple.com>

        Turn on background color estimation for all link indicators
        https://bugs.webkit.org/show_bug.cgi?id=198547
        <rdar://problem/51140196>

        Reviewed by Dean Jackson.

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

2019-06-04  Tim Horton  <timothy_horton@apple.com>

        Remove some unused selection code
        https://bugs.webkit.org/show_bug.cgi?id=198451

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/UIKitSPI.h:
        * Shared/ios/GestureTypes.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toGestureType):
        (toUIWKGestureType):
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::selectTextWithGranularityAtPoint):
        (WebKit::canShrinkToTextSelection): Deleted.
        (WebKit::hasCustomLineHeight): Deleted.
        (WebKit::WebPage::rangeForWebSelectionAtPosition): Deleted.

2019-06-04  Sihui Liu  <sihui_liu@apple.com>

        WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
        https://bugs.webkit.org/show_bug.cgi?id=198317
        <rdar://problem/51244662>

        Reviewed by Alex Christensen.

        Use LocalStorageNameSpace instead of SessionStorageNameSpace for localStorage in ephemeral session or 
        websiteDataStore.

        Reland r245943 as test has been fixed in r246012.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::StorageArea::isEphemeral const):
        (WebKit::StorageManager::StorageArea::removeListener):
        (WebKit::StorageManager::StorageArea::setItems):
        (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
        (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
        (WebKit::StorageManager::LocalStorageNamespace::ephemeralOrigins const):
        (WebKit::StorageManager::LocalStorageNamespace::cloneTo):
        (WebKit::StorageManager::StorageManager):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::StorageManager::getValues):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        (WebKit::StorageManager::suspend):
        (WebKit::StorageManager::resume):
        (WebKit::StorageManager::StorageArea::isSessionStorage const): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:
        (): Deleted.
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::dispatchStorageEvent):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::connect):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):

2019-06-04  Alex Christensen  <achristensen@apple.com>

        Uploading third-party applications from /Applications needs additional syscall access
        https://bugs.webkit.org/show_bug.cgi?id=198537
        <rdar://problem/51164741>

        Reviewed by Brent Fulgham.

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

2019-06-04  Chris Dumez  <cdumez@apple.com>

        Lazily construct the NetworkHTTPSUpgradeChecker
        https://bugs.webkit.org/show_bug.cgi?id=198500

        Reviewed by Alex Christensen.

        Lazily construct the NetworkHTTPSUpgradeChecker since the feature is off by default and this
        avoids unnecessarily opening its database in the common case.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):

2019-06-04  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r245913) [ Debug ] ASSERTION FAILED: m_swConnectionsByIdentifier.contains(connection.serverConnectionIdentifier()) Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash
        https://bugs.webkit.org/show_bug.cgi?id=198434
        <rdar://problem/51313917>

        Reviewed by Alex Christensen.

        Iterate through the connectionID-based connection map instead of the sessionID-based map to notify them their connection is lost.

        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didClose):

2019-06-04  Chris Dumez  <cdumez@apple.com>

        [iOS] UIProcess' background task expiration handler may get called after the app is foreground again
        https://bugs.webkit.org/show_bug.cgi?id=198380
        <rdar://problem/49762471>

        Reviewed by Geoff Garen.

        UIProcess' background task expiration handler may get called after the app is foreground again. When
        this happens, we already have a foreground assertion on behalf of the WebContent process, and the view
        is visible. We would send the WillSuspendImminently IPC to the WebContent process, which would freeze
        its layers, even though it is visible on screen.

        To address the issue, we now check if the app is visible in the expiration handler. If it is visible,
        we do not notify clients of imminent suspension. Instead, we end the background task right away and
        call _updateBackgroundTask asynchronously to start a new background task if necessary.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):

2019-06-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash when re-entering AC mode after r245957
        https://bugs.webkit.org/show_bug.cgi?id=198522

        Reviewed by Žan Doberšek.

        When AcceleratedBackingStoreWayland::displayBuffer() is called and we have already left AC mode, we early
        dispatch the image and release it. The problem is that images are reused, so the given image can be the
        committed one. In that case we end up freeing it again in the next AcceleratedBackingStoreWayland::paint()
        call.

        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Do not release the given image if it's the committed one.

2019-06-03  Chris Dumez  <cdumez@apple.com>

        [iOS] Do not prevent app suspension for more than 20 seconds after getting backgrounded
        https://bugs.webkit.org/show_bug.cgi?id=198488
        <rdar://problem/50837208>

        Reviewed by Geoff Garen.

        Do not prevent app suspension for more than 20 seconds after getting backgrounded on iOS. We
        do this by implementing our own expiration handler which notifies our child processes of
        their imminent suspension before ending the background task that was preventing suspension.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (isBackgroundState):
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _scheduleTimeoutTask]):
        (-[WKProcessAssertionBackgroundTaskManager _cancelTimeoutTask]):
        (-[WKProcessAssertionBackgroundTaskManager _backgroundTaskExpired]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

2019-06-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Implement an internal switch to turn idempotent text autosizing and viewport rules off
        https://bugs.webkit.org/show_bug.cgi?id=198460
        <rdar://problem/51324526>

        Reviewed by Tim Horton.

        * Shared/WebPreferences.yaml:

        Add new preferences to control viewport shrink-to-fit-content and idempotent text autosizing.

        * Shared/WebPreferencesDefaultValues.cpp:

        Add the non-iOS implementation of defaultTextAutosizingUsesIdempotentMode, and also wrap these functions in the
        WebKit namespace.

        (WebKit::defaultTextAutosizingUsesIdempotentMode):
        (defaultPassiveTouchListenersAsDefaultOnDocument): Deleted.
        (defaultCustomPasteboardDataEnabled): Deleted.
        * Shared/WebPreferencesDefaultValues.h:

        Move some existing default preference value helper functions into the WebKit namespace.

        * Shared/ios/WebPreferencesDefaultValuesIOS.mm: Copied from Source/WebKit/Shared/WebPreferencesDefaultValues.cpp.

        Add an iOS-specific file for WebPreferencesDefaultValues, so that we can check for the user interface idiom.

        (WebKit::defaultTextAutosizingUsesIdempotentMode):
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::immediatelyShrinkToFitContent):

        Add an early return for the case where shrink-to-fit-content is explicitly disabled via the new preference.

2019-06-03  Rob Buis  <rbuis@igalia.com>

        Implement imagesrcset and imagesizes attributes on link rel=preload
        https://bugs.webkit.org/show_bug.cgi?id=192950

        Reviewed by Youenn Fablet.

        Add a runtime flag for link preload responsive images.

        * Shared/WebPreferences.yaml:

2019-06-03  Darin Adler  <darin@apple.com>

        Finish cleanup of String::number for floating point
        https://bugs.webkit.org/show_bug.cgi?id=198471

        Reviewed by Yusuke Suzuki.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::submitTopList): Use makeString instead of StringBuilder since it
        is more terse and possibly more efficient as well.
        * UIProcess/API/APIUserScript.cpp:
        (API::UserScript::generateUniqueURL): Ditto.
        * UIProcess/API/APIUserStyleSheet.cpp:
        (API::UserStyleSheet::generateUniqueURL): Ditto.

2019-06-03  Fujii Hironori  <Hironori.Fujii@sony.com>

        REGRESSION(r240862) [WinCairo][WK2] position:fixed elements don't show
        https://bugs.webkit.org/show_bug.cgi?id=198478

        Reviewed by Carlos Garcia Campos.

        All position:fixed elements didn't show in WinCairo WebKit2 since
        r240862 which turns acceleratedCompositingEnabled on for WebKit2.
        WinCairo WebKit2 doesn't have accelerated compositing support yet.
        Let's do the same with GTK port.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences): Conditioned out the code
        enabling acceleratedCompositingEnabled for PLATFORM(WIN).

2019-06-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r244182): [CoordinatedGraphics] Related view doesn't receive graphic updates
        https://bugs.webkit.org/show_bug.cgi?id=198418

        Reviewed by Žan Doberšek.

        This is because we need a DisplayRefreshMonitor per drawing area, but the one from the first ThreradedCompositor
        is always reused because they use the same display ID.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use a unique display ID derived from
        WebPage's ID.
        (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode): Use the primary display ID.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::LayerTreeHost): Get the current web page display ID instead of inventing one.
        (WebKit::LayerTreeHost::setIsDiscardable): Do not change display ID.

2019-06-01  Dean Jackson  <dino@apple.com>

        Provide an action to save an image on a link sheet
        https://bugs.webkit.org/show_bug.cgi?id=198464

        Reviewed by Wenson Hsieh.

        When providing the set of default actions for a link
        sheet, if an URL to an image was provided then offer
        the action to save that image to Photos.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):

2019-06-01  Konstantin Tokarev  <annulen@yandex.ru>

        Remove include directives unused since r245186
        https://bugs.webkit.org/show_bug.cgi?id=198463

        Reviewed by Don Olmstead.

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:

2019-05-31  Megan Gardner  <megan_gardner@apple.com>

        Ensure keyboard editing is up to date
        https://bugs.webkit.org/show_bug.cgi?id=198444
        <rdar://problem/36311563>

        Reviewed by Ryosuke Niwa.

        In order for the keyboard cut/copy/undo/redo/etc buttons to be up to date
        based on the state of the selection, we need to let the input delegate know when the
        selection has changed.

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

2019-05-31  Sihui Liu  <sihui_liu@apple.com>

        Remove outdated FIXME in StorageManager
        https://bugs.webkit.org/show_bug.cgi?id=198049

        Reviewed by Geoffrey Garen.

        Previously StorageManager messages were dispatched and handled in the same thread, so we could perform a message
        check. Now they are on different thread, and we would not be able to verify those parameters when dispatching
        the message.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):

2019-05-31  Jiewen Tan  <jiewen_tan@apple.com>

        Teach AuxiliaryProcess about LoadOptimizer
        https://bugs.webkit.org/show_bug.cgi?id=198443
        <rdar://problem/51319120>

        Reviewed by Brent Fulgham.

        * Shared/ios/AuxiliaryProcessIOS.mm:
        (WebKit::AuxiliaryProcess::platformInitialize):
        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::platformInitialize):

2019-05-31  Youenn Fablet  <youenn@apple.com>

        Add an option to mute audio capture automatically when page is not visible
        https://bugs.webkit.org/show_bug.cgi?id=198307

        Reviewed by Eric Carlson.

        Add API to set the new runtime flag.
        Make source proxy factories implement this automatic muting.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _interruptAudioOnPageVisibilityChangeEnabled]):
        (-[WKPreferences _setInterruptAudioOnPageVisibilityChangeEnabled:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::setAudioCapturePageState):
        (WebKit::UserMediaCaptureManager::setVideoCapturePageState):
        * WebProcess/cocoa/UserMediaCaptureManager.h:

2019-05-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Autocorrection menu font is Times New Roman when using font-family: UICTFontTextStyle*
        https://bugs.webkit.org/show_bug.cgi?id=198427
        <rdar://problem/50031825>

        Reviewed by Tim Horton.

        When UICTFontTextStyle* is specified as the font-family in an editable element, text in autocorrection bubbles
        always uses Times New Roman font. This is because we send a font family name, font size, and font attributes to
        the UI process when computing autocorrection data for UIKit, and then assemble this information into a UIFont
        object via +[UIFont fontWithFamilyName:traits:size:]. However, in the case where UICTFontTextStyle* is specified
        as the font-family in CSS, the font family that we send to the UI process ends up being ".AppleSystemUIFont",
        which +fontWithFamilyName:traits:size: fails to map to the system font as intended.

        To fix this, we propagate font information to the UI process by encoding the UIFont itself via IPC, which
        serializes the font descriptor, and then deserializes into a UIFont in the UI process. This allows the system
        font to be returned in -fontForCaretSelection, which is invoked by UIKit when determining the font for the
        autocorrection bubble. See below for more details.

        Test: AutocorrectionTests.FontAtCaretWhenUsingUICTFontTextStyle

        * Shared/ios/WebAutocorrectionData.h: Copied from Source/WebKit/UIProcess/AutoCorrectionCallback.h.
        * Shared/ios/WebAutocorrectionData.mm: Renamed from Source/WebKit/UIProcess/AutoCorrectionCallback.h.
        (WebKit::WebAutocorrectionData::encode const):
        (WebKit::WebAutocorrectionData::decode):

        Introduce WebAutocorrectionData, a struct containing information used to show autocorrection UI on iOS (i.e.
        highlights and the bubble). This consists of a list of rects, along with a UIFont.

        * SourcesCocoa.txt:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        Refactor requestAutocorrectionData to request a WebAutocorrectionData instead, and also use the new async IPC
        reply mechanism.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
        (-[WKContentView fontForCaretSelection]):

        Grab the UIFont directly from the WebAutocorrectionData. Also, address a FIXME by scaling the font size by the
        content scale.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::requestAutocorrectionData):
        (WebKit::WebPageProxy::autocorrectionDataCallback): Deleted.
        (WebKit::WebPageProxy::autocorrectionContextCallback): Deleted.

        Remove some IPC callbacks that are now unused.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestAutocorrectionData):

2019-05-31  Ryosuke Niwa  <rniwa@webkit.org>

        [iOS] Reveal the focused element when it's immediately above software keyboard
        https://bugs.webkit.org/show_bug.cgi?id=198412

        Reviewed by Wenson Hsieh.

        When _zoomToRevealFocusedElement is called with forceScroll set to NO (happens when input type is none or drawing
        or when the platform is iPad), we don't force scrolling to reveal the focused element when it's entirely visible.

        This can be misleading in cases where there is more content right beneath it relevant for editing operations.
        Zoom & scroll to reveal the focused element when the said element is within 50px of the software keyboard.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):

2019-05-31  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r245899.

        Seems to be causing crashes on iosmac

        Reverted changeset:

        "[iOS] UIProcess' background task expiration handler may get
        called after the app is foreground again"
        https://bugs.webkit.org/show_bug.cgi?id=198380
        https://trac.webkit.org/changeset/245899

2019-05-31  Ryosuke Niwa  <rniwa@webkit.org>

        iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
        https://bugs.webkit.org/show_bug.cgi?id=198244

        Reviewed by Simon Fraser.

        This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
        we still need to make it scrollable when the page is pinch zoomed or there is a content inset
        e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
        outside the visual viewport when pinch zoomed or the parts of the page that is not outside
        the visual viewport due to the scrolling caused by the software keyboard being brought up.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):

2019-05-31  Geoffrey Garen  <ggaren@apple.com>

        Some WeakPtr typedef cleanup
        https://bugs.webkit.org/show_bug.cgi?id=198431

        Reviewed by Chris Dumez.

        Use "using" instead of "typedef", since using is preferred in C++ for
        better compatibility with templates.

        * UIProcess/WebAuthentication/AuthenticatorManager.h:

2019-05-31  Commit Queue  <commit-queue@webkit.org>

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

        Broke quip (Requested by rniwa on #webkit).

        Reverted changeset:

        "iOS: Main frame should be scrollable when pinch zoomed or
        software keyboard is up"
        https://bugs.webkit.org/show_bug.cgi?id=198244
        https://trac.webkit.org/changeset/245953

2019-05-31  Tim Horton  <timothy_horton@apple.com>

        Optionally respect device management restrictions when loading from the network
        https://bugs.webkit.org/show_bug.cgi?id=198318
        <rdar://problem/44263806>

        Reviewed by Alex Christensen.

        * Configurations/Network-iOS.entitlements:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        Add some entitlements and sandbox holes required to talk to DeviceManagement.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::wasBlockedByRestrictions):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::wasBlockedByRestrictions):
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::wasBlockedByRestrictions):
        * NetworkProcess/PingLoad.h:
        * Shared/WebErrors.cpp:
        (WebKit::wasBlockedByRestrictionsError):
        * Shared/WebErrors.h:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create):
        (WebKit::NetworkDataTask::failureTimerFired):
        * NetworkProcess/NetworkDataTask.h:
        * Shared/API/APIError.h:
        * Shared/API/c/WKErrorRef.cpp:
        (WKErrorGetErrorCode):
        * Shared/API/c/WKErrorRef.h:
        Plumb a new error for loads that are blocked by device management restrictions.

        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        Plumb a new bit that indicates whether a load is for the main resource of a frame.
        We will only apply device management restrictions to main resources.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        Plumb a new bit indicating whether a network session should respect device mangement
        restrictions.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::resume):
        Defer resuming the load until we have a reply from DeviceManagement framework
        about whether the URL should be blocked. If it is blocked, instead fail the load.

        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (WebKit::NetworkSessionCocoa::deviceManagementPolicyMonitor):
        Cache a single DMFWebsitePolicyMonitor instance per NetworkSession.
        
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::defaultDataStoreConfiguration):
        The default data store is persistent; its configuration should reflect that.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]): Style.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        Make it possible to create a non-persistent WKWebsiteDataStore from a
        configuration, and ensure that it does not have any persistent storage directories set.

        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration init]):
        (-[_WKWebsiteDataStoreConfiguration initWithNonPersistentConfiguration]):
        (-[_WKWebsiteDataStoreConfiguration isPersistent]):
        (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
        (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration deviceManagementRestrictionsEnabled]):
        (-[_WKWebsiteDataStoreConfiguration setDeviceManagementRestrictionsEnabled:]):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::isPersistent const):
        (WebKit::WebsiteDataStoreConfiguration::setPersistent):
        (WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota const):
        (WebKit::WebsiteDataStoreConfiguration::deviceManagementRestrictionsEnabled const):
        (WebKit::WebsiteDataStoreConfiguration::setDeviceManagementRestrictionsEnabled):
        (WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota): Deleted.
        Make it possible to create a _WKWebsiteDataStoreConfiguration that will create a non-persistent
        data store. Add a bit to _WKWebsiteDataStoreConfiguration that controls whether the network 
        session will respect device management restrictions.

        * WebKit.xcodeproj/project.pbxproj:
        * WebKit/NetworkProcess/cocoa/DeviceManagementSoftLink.h:
        * WebKit/NetworkProcess/cocoa/DeviceManagementSoftLink.mm:
        * WebKit/Platform/spi/Cocoa/DeviceManagementSPI.h:
        Add some soft-linking and SPI headers.

2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r245943.

        Caused API test WKWebView.LocalStorageProcessSuspends to fail
        on release bots.

        Reverted changeset:

        "WKWebsiteDataStore API fails to fetch web storage data for
        non-persistent data store"
        https://bugs.webkit.org/show_bug.cgi?id=198317
        https://trac.webkit.org/changeset/245943

2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r245946.

        Breaks the watchOS build.

        Reverted changeset:

        "Add an option to mute audio capture automatically when page
        is not visible"
        https://bugs.webkit.org/show_bug.cgi?id=198307
        https://trac.webkit.org/changeset/245946

2019-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WPERenderer: ensure we complete the last frame when leaving AC mode
        https://bugs.webkit.org/show_bug.cgi?id=198372

        Reviewed by Michael Catanzaro.

        It can happen that we leave AC mode after a new image is received from the web process but before it's
        committed. It can also happen that we receive a new image from the web process right after we have left AC
        mode. In both cases we need to complete the frame to ensure we don't leave the wayland compositor waiting
        forever for a frame to be completed.

        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::update): Complete any pending image when a new surface is used.
        (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Complete the given image and return early if we already
        left AC mode.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:

2019-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [CoordinatedGraphics] WPERenderer: do not release the host file descritor when initializing the render target
        https://bugs.webkit.org/show_bug.cgi?id=198371

        Reviewed by Michael Catanzaro.

        We are assuming that there will always be only one target for a web page. In the GTK port we destroy the render
        target when leaving AC mode, and a new one is created when re-entering AC mode. Since the file descriptor is
        released on the first target and adopted by libwpe, the second target passes -1 as host fd to libwpe, and the
        new surface created by the target is not properly registered in the wayland compositor. That means that frame
        requests for the new target are simply ignored by the wayland compositor, it returns early on surfacxe frame
        when the surface doesn't have a view backend client.

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::hostFileDescriptor const): Rename it and make it const.
        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
        (WebKit::AcceleratedSurfaceLibWPE::initialize): Pass a duplicated file descriptor to
        wpe_renderer_backend_egl_target_create().

2019-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Fix memory leak introduced in r245807
        https://bugs.webkit.org/show_bug.cgi?id=198369

        Reviewed by Michael Catanzaro.

        We should destroy the wpe_view_backend_exportable_fdo created in AcceleratedBackingStoreWayland.

        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland):

2019-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r244182): [GTK] Web view no longer updated after re-entering AC mode
        https://bugs.webkit.org/show_bug.cgi?id=198367

        Reviewed by Sergio Villar Senin.

        This happens because we leave accelerated compositing mode when a rendering update is scheduled in
        RenderingUpdateScheduler. The ThreadedDisplayRefreshMonitor is destroyed without completing the
        frame, so that the RenderingUpdateScheduler is left scheduled forever, ignoring any new schedule request. We
        need to ensure we complete the frame request before destroying the display refresh monitor to leave the
        RenderingUpdateScheduler in a consistent state.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
        (WebKit::ThreadedDisplayRefreshMonitor::invalidate):

2019-05-30  Ryosuke Niwa  <rniwa@webkit.org>

        iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
        https://bugs.webkit.org/show_bug.cgi?id=198244

        Reviewed by Simon Fraser.

        This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
        we still need to make it scrollable when the page is pinch zoomed or there is a content inset
        e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
        outside the visual viewport when pinch zoomed or the parts of the page that is not outside
        the visual viewport due to the scrolling caused by the software keyboard being brought up.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):

2019-05-30  Youenn Fablet  <youenn@apple.com>

        Add an option to mute audio capture automatically when page is not visible
        https://bugs.webkit.org/show_bug.cgi?id=198307

        Reviewed by Eric Carlson.

        Add API to set the new runtime flag.
        Make source proxy factories implement this automatic muting.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _interruptAudioOnPageVisibilityChangeEnabled]):
        (-[WKPreferences _setInterruptAudioOnPageVisibilityChangeEnabled:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::setAudioCapturePageState):
        (WebKit::UserMediaCaptureManager::setVideoCapturePageState):
        * WebProcess/cocoa/UserMediaCaptureManager.h:

2019-05-30  Sihui Liu  <sihui_liu@apple.com>

        WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
        https://bugs.webkit.org/show_bug.cgi?id=198317
        <rdar://problem/51244662>

        Reviewed by Alex Christensen.

        Use LocalStorageNameSpace instead of SessionStorageNameSpace for localStorage in ephemeral session or 
        websiteDataStore.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::StorageArea::isEphemeral const):
        (WebKit::StorageManager::StorageArea::removeListener):
        (WebKit::StorageManager::StorageArea::setItems):
        (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
        (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
        (WebKit::StorageManager::LocalStorageNamespace::ephemeralOrigins const):
        (WebKit::StorageManager::LocalStorageNamespace::cloneTo):
        (WebKit::StorageManager::StorageManager):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::StorageManager::getValues):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        (WebKit::StorageManager::suspend):
        (WebKit::StorageManager::resume):
        (WebKit::StorageManager::StorageArea::isSessionStorage const): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:
        (): Deleted.
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::dispatchStorageEvent):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::connect):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):

2019-05-30  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r245873) [Mac WK2] Layout Test http/wpt/service-workers/update-service-worker.https.html is a flaky crash after running new test
        https://bugs.webkit.org/show_bug.cgi?id=198379
        <rdar://problem/51264361>

        Reviewed by Alex Christensen.

        This case can happen when network process is crashing.
        Given the WebSWClientConnection may be kept alive, it might reregister itself but in that case will never be unregistered.
        Remove the WebSWClientConnection from the NetworkProcessConnection corresponding map on destruction time.
        Covered by no longer crashing tests.

        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::removeSWClientConnection):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::~WebSWClientConnection):

2019-05-30  Chris Dumez  <cdumez@apple.com>

        Network process crash when decoding SecItemResponseData
        https://bugs.webkit.org/show_bug.cgi?id=198388
        <rdar://problem/50408046>

        Reviewed by Alex Christensen.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode):
        When decoding the elements inside a CFArrayRef, if decoding was successful but
        the CFTypeRef element is still null then skip it instead of trying to append it
        to the array. A CFArray container is not allowed to contain null.
        Some of our decoders for CFTypeRef types may not initialize the element even if
        the decode() function returns true. For example, the decoders for CFArrayRef and
        CFDictionaryRef return true if the encoded container was null but do not create
        a container.

        * Shared/mac/SecItemResponseData.cpp:
        (WebKit::SecItemResponseData::SecItemResponseData):
        nit: The wrong parameter was being moved. This is more efficient.

        (WebKit::SecItemResponseData::encode const):
        nit: Drop unnecessary .get().

        * UIProcess/mac/SecItemShimProxy.cpp:
        (WebKit::SecItemShimProxy::secItemRequest):
        nit: Use nullptr instead of 0.

2019-05-30  Sihui Liu  <sihui_liu@apple.com>

        Stop StorageManager when network process is ready to suspend
        https://bugs.webkit.org/show_bug.cgi?id=198201
        <rdar://problem/49683172>

        Reviewed by Youenn Fablet.

        To avoid local storage database operations that can hold lock to database files, suspend thread of
        StorageManager when network process is about to suspend.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::resume):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::~NetworkSession):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::suspend):
        (WebKit::StorageManager::resume):
        * NetworkProcess/WebStorage/StorageManager.h:

2019-05-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        Missing caret when focusing an editable field if the selection was set when WKWebView wasn't first responder
        https://bugs.webkit.org/show_bug.cgi?id=198356
        <rdar://problem/50798593>

        Reviewed by Tim Horton.

        In this bug, the DOM selection is initially set by script in a web view that is not the first responder. Then,
        either the user begins editing by tapping somewhere such that the selection does not change, or an editable
        element is programmatically focused and the client allows programmatic focus to show the keyboard. This is
        because the selection clipping rect used by the UI process when computing the bounds of the caret view is empty,
        causing the entire caret to be clipped.

        This is due to two related issues: first, no updated editor state is sent to the UI process after the element is
        focused, if the selection has not also changed. This means that while the selection geometry is sent over to the
        UI process, the selection clipping rect (a member of the EditorState's PostLayoutData called
        "focusedElementRect") becomes stale in the UI process, since the there was no focused element when the
        previously computed editor state was sent to the UI process. To fix this, we schedule a full editor state update
        when an element is focused, to ensure that the selection is eventually updated in the UI process.

        Secondly, even once the editor state update is sent to the UI process, we will actually avoid updating any text
        selection views, since there is no change in WKSelectionDrawingInfo, which currently consists of a selection
        type, and either a caret rect or a list of selection rects. However, since selection drawing is also affected by
        the selection clipping rect, it seems reasonable to add the selection clipping rect to the drawing info, and
        trigger a selection update if this selection clipping rect has changed.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):

        Add selectionClippingRect to WKSelectionDrawingInfo, and check against it when comparing two drawing infos.

        (WebKit::operator==):
        (WebKit::operator<<):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::elementDidFocus):

        Schedule an editor state update when focusing an element. In many cases, an editor state update has already been
        scheduled when focusing an element, so this becomes a no-op; however, in this scenario, it delivers updated
        selection clipping rects (i.e. the focused element rect) and other updated information to the UI process.

2019-05-30  David Quesada  <david_quesada@apple.com>

        REGRESSION (r245756) [Mac] 2 TestWebKitAPI.DownloadProgress* and TestWebKitAPI._WKDownload.DownloadMonitorCancel are flaky timeouts
        https://bugs.webkit.org/show_bug.cgi?id=198298
        rdar://problem/51182393

        Reviewed by Alexey Proskuryakov.

        When canceling a download, there has always been a race condition between:

         (A) the execution of Download::didCancel() within the block passed to
             -[NSURLSessionDownloadTask cancelByProducingResumeData:] within
             Download::platformCancelNetworkLoad(), and

         (B) the invocation of -[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]

        If A happens before B, the block calls didCancel() on the download, which reports the
        cancellation to the UI process and tears down the download. When B happens, WKNetworkSessionDelegate
        gracefully handles the fact that the Download has been removed from the map, and nothing
        else happens. Life is good.

        If B happens before A, -URLSession:task:didCompleteWithError: invokes Download::didFail(),
        which reports a download failure (*not* a cancellation) to the UI process and tears down
        the Download and DownloadProxy. On release builds, this can leave the tests waiting for a
        cancellation until they time out. When A happens, the block calls Download::didCancel().
        This messages the UI process, which results in a debug assertion failure from an unhandled
        message since the DownloadProxy was torn down when the failure was reported. Meanwhile,
        the network process hits a debug assertion in DownloadManager::downloadFinished() when
        trying to remove the Download *again*.

        r245756 made the bad case (B before A) more likely by adding a delay before didCancel()
        is called.

        Make this race condition impossible by eliminating the didCancel() from the cancellation
        block, and instead relying on -URLSession:task:didCompleteWithError: to report the
        download as canceled. This also effectively coalesces calls to platformCancelNetworkLoad(),
        which, if called multiple times before CFNetwork reports that the download was canceled,
        could cause multiple calls to didCancel(), resulting in the same assertion failures seen
        in the B-before-A case.

        No new tests, as recreating this race condition in the test scenario would require
        additional machinery, and is no longer even possible since we don't depend on the calling
        of the cancellation handler in order to report the Download as canceled.

        * NetworkProcess/Downloads/Download.cpp:
        (WebKit::Download::cancel):
        * NetworkProcess/Downloads/Download.h:
        (WebKit::Download::wasCanceled const):
        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::platformCancelNetworkLoad):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):

2019-05-30  Chris Dumez  <cdumez@apple.com>

        [iOS] UIProcess' background task expiration handler may get called after the app is foreground again
        https://bugs.webkit.org/show_bug.cgi?id=198380
        <rdar://problem/49762471>

        Reviewed by Geoffrey Garen.

        UIProcess' background task expiration handler may get called after the app is foreground again. When
        this happens, we already have a foreground assertion on behalf of the WebContent process, and the view
        is visible. We would send the WillSuspendImminently IPC to the WebContent process, which would freeze
        its layers, even though it is visible on screen.

        To address the issue, we now check if the app is visible in the expiration handler. If it is visible,
        we do not notify clients of imminent suspension. Instead, we end the background task right away and
        call _updateBackgroundTask asynchronously to start a new background task if necessary.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):

2019-05-30  Chris Dumez  <cdumez@apple.com>

        [iOS] Third-party extensions using WKWebView are unable to render anything
        https://bugs.webkit.org/show_bug.cgi?id=198359
        <rdar://problem/51105015>

        Reviewed by Brent Fulgham and Geoff Garen.

        Third-party extensions using WKWebView are unable to render anything because we do not get notified
        when the extension's visibility changes. Because we do not recognize the extension showing the
        WebView to be foreground, we do not take a process assertion on behalf of the child processes and
        they get suspended before they get a chance to render anything.

        The root of the issue is that WebKit was relying on BKSApplicationStateMonitor.handler to get
        notified when the extension's state switches between foreground and background. However, the handler
        never gets called unless the extension has an appropriate entitlement.

        To address the issue, we now use the same logic for extensions and we do for view services.
        I have verified that the _UIViewServiceHostDidEnterBackgroundNotification / _UIViewServiceHostWillEnterForegroundNotification
        notifications get sent to the extensions (even third-party). We also properly detect MobileSafari as
        host application and are able to get MobileSafari's foreground state accurately.

        * UIProcess/ApplicationStateTracker.mm:

2019-05-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        Rare crash under `WebPage::shouldIgnoreMetaViewport const` when shrinking to fit content
        https://bugs.webkit.org/show_bug.cgi?id=198374
        <rdar://problem/51261348>

        Reviewed by Tim Horton.

        This is a speculative fix for the crash; what appears to be happening is that the shrink-to-fit-content timer
        is somehow being scheduled after the page has already been closed. We can probably fix this by bailing when
        scheduling shrink-to-fit-content if m_isClosed is true.

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

2019-05-30  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r245881.

        Broke 13 Layout tests on WK2

        Reverted changeset:

        "WKWebsiteDataStore API fails to fetch web storage data for
        non-persistent data store"
        https://bugs.webkit.org/show_bug.cgi?id=198317
        https://trac.webkit.org/changeset/245881

2019-05-30  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, WPE without a11y support build fix.

        * UIProcess/wpe/WebPageProxyWPE.cpp: Include atk headers only when enabled.

2019-05-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove some logic to suppress the text selection assistant during drop
        https://bugs.webkit.org/show_bug.cgi?id=198354

        Reviewed by Tim Horton.

        This logic was originally added to hide the ranged selection after performing a drop in editable content.
        However, after r245803, we (1) no longer show the keyboard and/or text selection views when dropping, and (2)
        the final selection is now a caret, so it's no longer necessary to suppress the selection assistant.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dropInteraction:performDrop:]):
        (-[WKContentView dropInteraction:concludeDrop:]):

2019-05-29  Sihui Liu  <sihui_liu@apple.com>

        WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
        https://bugs.webkit.org/show_bug.cgi?id=198317

        Reviewed by Alex Christensen.

        Use LocalStorageNameSpace instead of SessionStorageNameSpace for localStorage in ephemeral session or 
        websiteDataStore.

        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::StorageArea::isEphemeral const):
        (WebKit::StorageManager::StorageArea::removeListener):
        (WebKit::StorageManager::StorageArea::setItems):
        (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
        (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
        (WebKit::StorageManager::LocalStorageNamespace::ephemeralOrigins const):
        (WebKit::StorageManager::LocalStorageNamespace::cloneTo):
        (WebKit::StorageManager::StorageManager):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::StorageManager::getValues):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        (WebKit::StorageManager::StorageArea::isSessionStorage const): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:
        (): Deleted.
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::dispatchStorageEvent):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::connect):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
        * WebProcess/WebStorage/StorageNamespaceImpl.h:
        * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):

2019-05-29  Don Olmstead  <don.olmstead@sony.com>

        Remove ENABLE definitions from WebKit config files
        https://bugs.webkit.org/show_bug.cgi?id=197858

        Reviewed by Simon Fraser.

        Remove ENABLE flags that were present in the config files. Add the ENABLE flags
        to FeatureDefines.xcconfig instead.

        * Configurations/FeatureDefines.xcconfig:
        * WebKit2Prefix.h:
        * config.h:

2019-05-29  Youenn Fablet  <youenn@apple.com>

        Reestablish WebSWClientConnection in case of network process crash
        https://bugs.webkit.org/show_bug.cgi?id=198333

        Reviewed by Alex Christensen.

        WebSWClientConnection now takes a RefPtr<IPC::Connection> so that on network process crash, it will set it back to null.
        On the next call that needs the connection, WebSWClientConnection will reinitialize its underlying IPC connection and its own identifier.
        Make sure that all code paths requiring this initialization are covered.

        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didClose):
        (WebKit::NetworkProcessConnection::serviceWorkerConnectionForSession):
        (WebKit::NetworkProcessConnection::isRegisteredActiveSWClientConnection):
        (WebKit::NetworkProcessConnection::initializeSWClientConnection):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::~WebSWClientConnection):
        (WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
        (WebKit::WebSWClientConnection::ensureConnectionAndSend):
        (WebKit::WebSWClientConnection::scheduleJobInServer):
        (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
        (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
        (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
        (WebKit::WebSWClientConnection::matchRegistration):
        (WebKit::WebSWClientConnection::runOrDelayTaskForImport):
        (WebKit::WebSWClientConnection::whenRegistrationReady):
        (WebKit::WebSWClientConnection::getRegistrations):
        (WebKit::WebSWClientConnection::startFetch):
        (WebKit::WebSWClientConnection::cancelFetch):
        (WebKit::WebSWClientConnection::continueDidReceiveFetchResponse):
        (WebKit::WebSWClientConnection::connectionToServerLost):
        (WebKit::WebSWClientConnection::syncTerminateWorker):
        (WebKit::WebSWClientConnection::serverConnectionIdentifier const):
        (WebKit::WebSWClientConnection::updateThrottleState):
        * WebProcess/Storage/WebSWClientConnection.h:

2019-05-29  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] WebPage::positionInformation() may set InteractionInformationAtPosition.isImage to true but leave image unset
        https://bugs.webkit.org/show_bug.cgi?id=198202

        Reviewed by Tim Horton.

        r192037 added the flags isLink and isImage to InteractionInformationAtPosition.
        It also made WebPage::positionInformation() set isImage to true but before 
        ensuring there is a valid image at the position.

        Safari WebKit additions assumes if isImage is true then the image has to
        hold a valid ShareableBitmap pointer. Since WebPage::positionInformation()
        is the only place that sets isImage, the fix is to set isImage to true
        only  after passing all the image validation checks.

        Since WebPage::positionInformation() is a little bit difficult to read
        (182 lines), It was re-factored by splitting it to static functions. 

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::focusedElementPositionInformation):
        (WebKit::linkIndicatorPositionInformation):
        (WebKit::dataDetectorLinkPositionInformation):
        (WebKit::imagePositionInformation):
        (WebKit::boundsPositionInformation):
        (WebKit::elementPositionInformation):
        (WebKit::selectionPositionInformation):
        (WebKit::textInteractionPositionInformation):
        (WebKit::WebPage::positionInformation):

2019-05-29  Geoffrey Garen  <ggaren@apple.com>

        WeakPtr breaks vtables when upcasting to base classes
        https://bugs.webkit.org/show_bug.cgi?id=188799

        Reviewed by Youenn Fablet.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::networkSession):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::suspendedPage const):
        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::suspendedPage const): Deleted. Moved
        functions out of line to avoid #include explosion for .get().

        * UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
        (WebKit::SecKeyProxyStore::get const):
        (WebKit::SecKeyProxyStore::weakPtrFactory const): Deleted. Adopted
        CanMakeWeakPtr.

        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebProcessProxy.cpp: It takes an extra using declaration
        to disambiguate multiple CanMakeWeakPtr base classes now.

        (WebKit::WebProcessProxy::processPool const):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::processPool const): Deleted. Moved
        functions out of line to avoid #include explosion for .get().

2019-05-29  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r245857.

        Breaks internal builds.

        Reverted changeset:

        "WeakPtr breaks vtables when upcasting to base classes"
        https://bugs.webkit.org/show_bug.cgi?id=188799
        https://trac.webkit.org/changeset/245857

2019-05-29  Chris Dumez  <cdumez@apple.com>

        [iOS] The WebContent process needs proper entitlement to do secure drawing
        https://bugs.webkit.org/show_bug.cgi?id=198343
        <rdar://problem/50671257>

        Reviewed by Tim Horton.

        The WebContent process needs proper entitlement to do secure drawing on iOS.

        * Configurations/WebContent-iOS.entitlements:

2019-05-29  Youenn Fablet  <youenn@apple.com>

        UserMediaCaptureManager should remove a source from its map once the source is ended
        https://bugs.webkit.org/show_bug.cgi?id=198337

        Reviewed by Eric Carlson.

        When the source is stopped, for instance using MediaStreamTrack.stop,
        remove the source from UserMediaCaptureManager sources map.
        This makes sure the map will not grow over time.
        Add an if check to ensure that the source is still there before processing an incoming IPC call.

        When UIProcess tells us the capture is finished (typically capture failed), remove the entry on WebProcess side as well.

        * WebProcess/cocoa/UserMediaCaptureManager.cpp:
        (WebKit::UserMediaCaptureManager::createCaptureSource):
        (WebKit::UserMediaCaptureManager::sourceStopped):
        (WebKit::UserMediaCaptureManager::captureFailed):
        (WebKit::UserMediaCaptureManager::sourceMutedChanged):
        (WebKit::UserMediaCaptureManager::sourceSettingsChanged):
        (WebKit::UserMediaCaptureManager::storageChanged):
        (WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged):
        (WebKit::UserMediaCaptureManager::audioSamplesAvailable):
        (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable):
        (WebKit::UserMediaCaptureManager::sourceEnded):
        (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
        (WebKit::UserMediaCaptureManager::applyConstraintsFailed):

2019-05-29  Youenn Fablet  <youenn@apple.com>

        UserMediaCaptureManagerProxy::SourceProxy should directly have access to its IPC connection
        https://bugs.webkit.org/show_bug.cgi?id=198335

        Reviewed by Eric Carlson.

        Previously, SourceProxy was getting its IPC connection by going through its manager, then its process proxy.
        As some calls can be done from a background thread, it is safer to directly make SourceProxy own a Ref of its IPC connection.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy):
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):

2019-05-28  Geoffrey Garen  <ggaren@apple.com>

        WeakPtr breaks vtables when upcasting to base classes
        https://bugs.webkit.org/show_bug.cgi?id=188799

        Reviewed by Youenn Fablet.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::networkSession):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::suspendedPage const):
        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::suspendedPage const): Deleted. Moved
        functions out of line to avoid #include explosion for .get().

        * UIProcess/Authentication/cocoa/SecKeyProxyStore.h:
        (WebKit::SecKeyProxyStore::get const):
        (WebKit::SecKeyProxyStore::weakPtrFactory const): Deleted. Adopted
        CanMakeWeakPtr.

        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebProcessProxy.cpp: It takes an extra using declaration
        to disambiguate multiple CanMakeWeakPtr base classes now.

        (WebKit::WebProcessProxy::processPool const):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::processPool const): Deleted. Moved
        functions out of line to avoid #include explosion for .get().

2019-05-29  Youenn Fablet  <youenn@apple.com>

        Modernize getting proxies of UserMediaCaptureManagerProxy
        https://bugs.webkit.org/show_bug.cgi?id=198336

        Reviewed by Eric Carlson.

        No change of behavior, use HashMap::get instead of find.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::startProducingData):
        (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
        (WebKit::UserMediaCaptureManagerProxy::capabilities):
        (WebKit::UserMediaCaptureManagerProxy::setMuted):
        (WebKit::UserMediaCaptureManagerProxy::applyConstraints):

2019-05-29  Andy Estes  <aestes@apple.com>

        [watchOS] Remove an unneeded #import
        https://bugs.webkit.org/show_bug.cgi?id=198339
        <rdar://problem/51195415>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/forms/WKTimePickerViewController.mm:

2019-05-29  Brent Fulgham  <bfulgham@apple.com>

        Correct flaky WebAuthN test cases
        https://bugs.webkit.org/show_bug.cgi?id=198308
        <rdar://problem/48677219>

        Reviewed by David Kilzer.

        Correct offset math in the MockHidConnection implementation. The write position of
        the payload buffer was computed using the value of 'size()', which is set to the full
        capacity of the vector after a 'grow()' operation.

        Tests: http/wpt/webauthn

        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::feedReports): 

2019-05-28  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] REGRESSION(r245186) Crash in NetworkCache::IOChannel::read in http/tests/IndexedDB some tests
        https://bugs.webkit.org/show_bug.cgi?id=197941

        Reviewed by Don Olmstead.

        http/tests/IndexedDB some tests were crashing in
        NetworkCache::IOChannel::read in order to allocate a buffer with
        std::numeric_limits<size_t>::max() as the size.

        IOChannel::read should check the file size, and calculate the read
        size.

        * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
        (WebKit::NetworkCache::IOChannel::read): Limit the read buffer
        size by calling FileSystem::getFileSize.

2019-05-28  Brent Fulgham  <bfulgham@apple.com>

        Fix sandbox violation when using QuickLook on iOS
        https://bugs.webkit.org/show_bug.cgi?id=198312
        <rdar://problem/51134351>

        Reviewed by Alexey Proskuryakov.

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

2019-05-28  Tim Horton  <timothy_horton@apple.com>

        Horizontal scrollbar flashes after scrolling vertically with keyboard
        https://bugs.webkit.org/show_bug.cgi?id=197942
        <rdar://problem/46169578>

        Reviewed by Dean Jackson.

        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (axesForDelta):
        (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
        Only flash relevant axes.

        * Platform/spi/ios/UIKitSPI.h:

2019-05-28  Alex Christensen  <achristensen@webkit.org>

        Build Fix.

        * UIProcess/WKImagePreviewViewController.mm:
        (-[WKImagePreviewViewController IGNORE_WARNINGS_END]):
        (-[WKImagePreviewViewController previewActionItems]): Deleted.

2019-05-28  Tim Horton  <timothy_horton@apple.com>

        REGRESSION(r245795): causing internal testers to exit early after 50 crashes.
        https://bugs.webkit.org/show_bug.cgi?id=198310
        <rdar://problem/51192535>

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::touchActionsForPoint):
        Initialize hitView to nil.

2019-05-28  Brent Fulgham  <bfulgham@apple.com>

        Remove dead code from sandboxes
        https://bugs.webkit.org/show_bug.cgi?id=198300

        Reviewed by Alexey Proskuryakov.

        SSIA.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
        * WebProcess/com.apple.WebProcess.sb.in:

2019-05-28  Brent Fulgham  <bfulgham@apple.com>

        Update sandbox rules for more News use cases
        https://bugs.webkit.org/show_bug.cgi?id=198236
        <rdar://problem/50054027>

        Reviewed by Alexey Proskuryakov.

        Update the WebContent and Network process sandboxes so that News has the same set of allowed
        service access as regular WebKit views.

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

2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor
        https://bugs.webkit.org/show_bug.cgi?id=197944

        Reviewed by Michael Catanzaro.

        The WPEBackend-fdo implementation is quite similar to our Wayland nested compositor, but more efficient (using
        linux dmabuf, resource caching, etc.). This allows us to share even more code with WPE port too.

        * PlatformGTK.cmake:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::forceRepaint): WPE doesn't support force repaint yet.
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
        (WebKit::WebPageCreationParameters::decode): Ditto.
        * Shared/WebPageCreationParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Ditto.
        (WebKit::WebProcessCreationParameters::decode): Ditto.
        * Shared/WebProcessCreationParameters.h:
        * SourcesGTK.txt:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::hostFileDescriptor): Implement it when using WPE just calling webkitWebViewBaseRenderHostFileDescriptor().
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseCreateWebPage): Initialize the web page after the accelerated backing store is created, since
        it's used now during intialization.
        (webkitWebViewBaseRenderHostFileDescriptor): Return AcceleratedBackingStore::renderHostFileDescriptor()
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters): Use USE(WPE_RENDERER) instead of PLATFORM(WPE).
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess): Remove wayland display name initialization.
        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize wayland display name when not using WPE here
        now. In case of using WPE, initialize hostClientFileDescriptor and implementationLibraryName.
        * UIProcess/glib/WebProcessProxyGLib.cpp:
        (WebKit::WebProcessProxy::platformGetLaunchOptions): Remove unused wayland socket command line process parameter.
        * UIProcess/gtk/AcceleratedBackingStore.h:
        (WebKit::AcceleratedBackingStore::renderHostFileDescriptor): Return -1 by default.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::create): When using WPE call wpe_fdo_initialize_for_egl_display() and
        check we have the required extensions.
        (WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): When using WPE initialize the view backend.
        (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): When using WPE release the EGL images
        still in use and the view texture.
        (WebKit::AcceleratedBackingStoreWayland::renderHostFileDescriptor): Call wpe_view_backend_get_renderer_host_fd().
        (WebKit::AcceleratedBackingStoreWayland::displayBuffer): Create the view texture if needed, save the pending
        image and schedule a redraw.
        (WebKit::AcceleratedBackingStoreWayland::paint): When using WPE commit the pending image and use it as target of
        the view texture.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:
        * UIProcess/gtk/HardwareAccelerationManager.cpp:
        (WebKit::HardwareAccelerationManager::HardwareAccelerationManager): When using WPE disable hardware acceleration
        if wpe_fdo_initialize_for_egl_display() fails.
        * UIProcess/gtk/WaylandCompositor.cpp:
        * UIProcess/gtk/WaylandCompositor.h:
        * WebProcess/WebPage/AcceleratedSurface.cpp:
        (WebKit::AcceleratedSurface::create): Create an AcceleratedSurfaceLibWPE for GTK port when using WPE and shared
        display is Wayland.
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp:
        (WebKit::AcceleratedSurfaceLibWPE::initialize): Use the shared display for compositing instead of shared display.
        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h:
        * WebProcess/WebProcess.h:
        * WebProcess/glib/WebProcessGLib.cpp:
        (WebKit::WebProcess::platformInitializeWebProcess): Initialize the wpe display when using WPE.

2019-05-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Dropping in an editable element should result in a ranged selection
        https://bugs.webkit.org/show_bug.cgi?id=198267
        <rdar://problem/51145977>

        Reviewed by Tim Horton.

        When drag and drop was first implemented for iOS in iOS 11, selection behavior when dropping into editable
        elements matched that of macOS, by leaving the inserted content selected after performing the drop. However, in
        other parts of the platform (e.g. Notes), both the keyboard and selection views are not shown after a drop.

        Instead of matching macOS behavior, WebKit on iOS should match the rest of the platform. This is a little
        tricky, since we use the selection range after a drop to create a TextIndicator snapshot when creating a drag
        preview. To resolve this, we refactor some of the logic introduced in r245778 to remember the DOM range to
        snapshot before collapsing the range to the end of the inserted content.

        Tested by adjusting some existing API tests.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

        Remove some logic that currently presents the keyboard while the user is performing a drop that focuses an
        editable element.

        * WebProcess/WebPage/WebPage.h:

        Add a member variable to keep track of which range should be snapshotted when generating a drop preview.

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

        Collapse the selection range to the end after an edit drag (i.e., a drop in an editable area that inserted
        content).

        (WebKit::WebPage::computeAndSendEditDragSnapshot):

2019-05-27  Chris Dumez  <cdumez@apple.com>

        Unreviewed Win Cairo build fix after r245796.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):

2019-05-27  Chris Dumez  <cdumez@apple.com>

        Unreviewed Win Cairo build fix after r245796.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::decode):

2019-05-27  Chris Dumez  <cdumez@apple.com>

        Use a strongly-typed identifier for pages
        https://bugs.webkit.org/show_bug.cgi?id=198206

        Reviewed by Youenn Fablet.

        * WebKit/*:

2019-05-27  Antoine Quint  <graouts@apple.com>

        [Pointer Events] Test at pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html times out
        https://bugs.webkit.org/show_bug.cgi?id=198275
        <rdar://problem/50618496>

        Reviewed by Antti Koivisto.

        Only WKCompositingView instances may have associated touch-action data, so we should filter out any hit-testing view
        that isn't a WKCompositingView when finding the view that should hit-test when looking for touch-action information.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::touchActionsForPoint):

2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.25.1 release

        * gtk/NEWS: Add release notes for 2.25.1.

2019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK distcheck

        Remove symbols that are not longer present in the library.

        * webkitglib-symbols.map:

2019-05-26  Simon Fraser  <simon.fraser@apple.com>

        Move VelocityData to WebCore
        https://bugs.webkit.org/show_bug.cgi?id=198261

        Reviewed by Antti Koivisto.

        Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll.

        VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as
        the timetamp for the entire update).

        * Shared/VisibleContentRectUpdateInfo.cpp:
        (WebKit::VisibleContentRectUpdateInfo::encode const):
        (WebKit::VisibleContentRectUpdateInfo::decode):
        (WebKit::operator<<):
        * Shared/VisibleContentRectUpdateInfo.h:
        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
        (WebKit::VisibleContentRectUpdateInfo::scrollVelocity const):
        (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView const):
        (WebKit::VisibleContentRectUpdateInfo::timestamp const):
        (WebKit::operator==):
        (WebKit::VisibleContentRectUpdateInfo::horizontalVelocity const): Deleted.
        (WebKit::VisibleContentRectUpdateInfo::verticalVelocity const): Deleted.
        (WebKit::VisibleContentRectUpdateInfo::scaleChangeRate const): Deleted.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<VelocityData>::encode):
        (IPC::ArgumentCoder<VelocityData>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
        (WebKit::HistoricalVelocityData::VelocityData::VelocityData): Deleted.
        (WebKit::HistoricalVelocityData::HistoricalVelocityData): Deleted.
        (WebKit::HistoricalVelocityData::velocityForNewData): Deleted.
        (WebKit::HistoricalVelocityData::clear): Deleted.
        (WebKit::HistoricalVelocityData::append): Deleted.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::viewportConfigurationChanged):
        (WebKit::adjustVelocityDataForBoundedScale):
        (WebKit::WebPage::updateVisibleContentRects):

2019-05-26  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if the page was navigated to with a prevalent resource referrer containing link decoration
        https://bugs.webkit.org/show_bug.cgi?id=198227
        <rdar://problem/51117258>

        Reviewed by Alex Christensen.

        This patch adds a call back to the UI process if the network process finds the navigational
        data transfer was done by a prevalent resource and we need to adjust something for the page.
        Currently, that adjustment is to downgrade document.referrer.

        The patch also removes an unused completion handler.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didCommitCrossSiteLoadWithDataTransfer):
        (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration): Deleted.
            New name since we no longer only look for link decoration but also other means of navigational data transfer.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransfer):
        (WebKit::NetworkProcessProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
        (WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration): Deleted.
            New name since we no longer only look for link decoration but also other means of navigational data transfer.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::checkIfNavigationContainsDataTransfer):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource):
        (WebKit::isNonUniqueNavigationWithLinkDecoration): Deleted.
            New name since we no longer only look for link decoration but also other means of navigational data transfer.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::didCommitCrossSiteLoadWithDataTransfer):
        (WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration): Deleted.
            New name since we no longer only look for link decoration but also other means of navigational data transfer.
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::wasLoadedWithDataTransferFromPrevalentResource):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-05-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Dropped text, attachments, and images should animate into place
        https://bugs.webkit.org/show_bug.cgi?id=198243
        <rdar://problem/35205373>

        Reviewed by Tim Horton.

        Adds support for targeted drop animations on iOS in modern WebKit by adopting UIKit SPI introduced in
        <rdar://problem/31075005> to allow updating the drop preview mid-flight. To get the animation right, we refactor
        and augment existing logic for taking snapshots after performing a drop in an editable content.

        Currently, upon dropping in editable content, we first snapshot the web view and temporarily cover the real web
        view with this snapshot. When the TextIndicator data arrives that contains (1) a snapshot of the visible part of
        the web view ignoring the selection, and (2) a snapshot of just the selected contents after drop, we crossfade
        from the web view snapshot to the snapshot in (1) using a hard-coded time delay (~500ms), and target the drop
        preview to the drag caret rect. During this process, snapshot (2) is completely ignored.

        This was effectively a halfway implemention of the desired effect of animating the dropped content into place
        and crossfading to the final content; before UIKit implemented updateable drag previews, the full implementation
        was not possible in modern WebKit (without using synchronous IPC).

        Now that we're able to update the drag preview in the middle of the drop animation, we can now utilize snapshot
        (2) above and clean up some parts of the drop animation in editable content. See below for more details.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]):

        Add a testing hook to perform the given block after any pending edit drag snapshot has been received. See
        TestWebKitAPI changes for more detail.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        Split up the existing DidConcludeEditDrag IPC message into two messages: WillReceiveEditDragSnapshot and
        DidReceiveEditDragSnapshot. This allows us to defer cleaning up the drag session state during an edit drop,
        until after the final edit drag snapshot has been received.

        * UIProcess/ios/DragDropInteractionState.h:

        Add some new methods to help manage the lifecycle of drop preview provider blocks.

        * UIProcess/ios/DragDropInteractionState.mm:
        (WebKit::createTargetedDragPreview):

        Drive-by fix: make this return a RetainPtr.

        (WebKit::DragDropInteractionState::prepareForDelayedDropPreview):

        Stores a drop preview provider, given to us by UIKit.

        (WebKit::DragDropInteractionState::deliverDelayedDropPreview):

        Invokes the stored drop preview providers with given text indicator data. This is invoked after snapshots are
        taken following an edit drag (this is additionally after all images in the inserted fragment have finished
        loading).

        (WebKit::DragDropInteractionState::clearAllDelayedItemPreviewProviders):

        Invokes all stored drop preview providers with a nil preview. This is invoked in any case where drag session
        cleanup occurs earlier than normal (e.g., if the web process crashes during drop), and ensures that the handlers
        are always invoked when cleaning up the drag session.

        (WebKit::DragDropInteractionState::previewForDragItem const):
        (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):

        Call clearAllDelayedItemPreviewProviders.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::willReceiveEditDragSnapshot):
        (WebKit::PageClientImpl::didReceiveEditDragSnapshot):
        (WebKit::PageClientImpl::didConcludeEditDrag): Deleted.

        More plumbing (see changes to DidConcludeEditDrag above).

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView cleanUpDragSourceSessionState]):
        (-[WKContentView _willReceiveEditDragSnapshot]):
        (-[WKContentView _didReceiveEditDragSnapshot:]):

        Set _waitingForEditDragSnapshot to YES in the gap between when -_willReceiveEditDragSnapshot is invoked, and
        when -_didReceiveEditDragSnapshot is invoked. If _waitingForEditDragSnapshot is YES, we bail out of
        -cleanUpDragSourceSessionState, and instead clean up drag session state after the edit drag snapshot is
        received.

        (-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
        (-[WKContentView _didPerformDragOperation:]):
        (-[WKContentView textEffectsWindow]):

        Drive-by fix to remove a workaround for a deprecation warning.

        (-[WKContentView dropInteraction:item:willAnimateDropWithAnimator:]):
        (-[WKContentView dropInteraction:concludeDrop:]):

        Implement this hook to ensure that the unselected content snapshot view and visible content snapshot view are
        guaranteed to be removed from the view after a drop in editable content, even if the drag edit snapshot arrives
        after the drop is concluded.

        (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
        (-[WKContentView _dropInteraction:delayedPreviewProviderForDroppingItem:previewProvider:]):

        Implement the new UIKit SPI here. UIKit hands us a preview provider here, which we can invoke at a later time
        to update the drop preview. We do this in _didReceiveEditDragSnapshot.

        (-[WKContentView _doAfterReceivingEditDragSnapshotForTesting:]):
        (-[WKContentView _didConcludeEditDrag:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::willReceiveEditDragSnapshot):
        (WebKit::WebPageProxy::didReceiveEditDragSnapshot):
        (WebKit::WebPageProxy::didConcludeDrop):
        (WebKit::WebPageProxy::didConcludeEditDrag): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::didFinishLoadingImageForElement):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didFinishLoadingImageForElement):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::didConcludeDrop):

        If an edit drag has been concluded, there's no need to hang on to pending dropped image elements anymore; clear
        out the set here.

        (WebKit::WebPage::didConcludeEditDrag):

        After concluding an edit drag, we try to deliver two web content snapshots to the UI process, so that the UI
        process can assemble a targeted drop preview for UIKit. One snapshot is of the visible content area, not
        including any selected content. The other snapshot is of the selected content only. However, when dropping
        images (or a text selection containing images), these images may not yet have been loaded. If that is the case,
        these images will appear to be missing from these snapshots.

        To ensure that we don't take this snapshot too early, defer it until all image elements in the dropped content
        range have finished loading. We can tell that all dropped images have finished loading by using a new client
        hook that is invoked when an image has finished loading.

        (WebKit::WebPage::didFinishLoadingImageForElement):
        (WebKit::WebPage::computeAndSendEditDragSnapshot):

        Snapshot the selected content and send it to the UI process.

2019-05-24  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r245715?) [WK2] Layout Test http/wpt/cache-storage/cache-storage-networkprocess-crash.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=198222
        <rdar://problem/51114899>

        Reviewed by Alex Christensen.

        In case a connection gets closed, handle all of its async reply completion handlers.
        This ensures they handlers are called in case the connection does not get destroyed until a much later stage.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::~Connection):
        (IPC::Connection::connectionDidClose):
        (IPC::addAsyncReplyHandler):
        (IPC::clearAsyncReplyHandlers):
        (IPC::CompletionHandler<void):

2019-05-24  Per Arne Vollan  <pvollan@apple.com>

        Remove unused member in WebsiteDataRecord
        https://bugs.webkit.org/show_bug.cgi?id=198231

        Reviewed by Brent Fulgham.

        The data member 'originsWithCredentials' in WebsiteDataRecord is no longer needed since origins
        with credentials are now stored in the 'origins' member.

        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::addOriginWithCredential): Deleted.
        * UIProcess/WebsiteData/WebsiteDataRecord.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):

2019-05-24  David Quesada  <david_quesada@apple.com>

        Crash under WebCore::TimerBase::~TimerBase after a download is canceled
        https://bugs.webkit.org/show_bug.cgi?id=197927
        rdar://problem/50822728

        Reviewed by Ryosuke Niwa.

        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        (WebKit::Download::platformCancelNetworkLoad):
            CFNetwork makes no guarantees about what thread is used to call the completion block
            passed to -[NSURLSessionDownloadTask cancelByProducingResumeData], and in some cases,
            it can be called on a background queue. This eventually causes the Download to be
            deallocated on the background queue, which triggers a release assertion failure in
            ~TimerBase. When CFNetwork finishes canceling the download, we should move to the
            main thread before calling didCancel().

2019-05-24  Youenn Fablet  <youenn@apple.com>

        Update messages_unittest.py after r245715
        https://bugs.webkit.org/show_bug.cgi?id=198214

        Reviewed by Alexey Proskuryakov.

        Update expected results for messages.py output.i
        Small refactoring to messages.py: instead of calling the completionHandler in case of decoding error with AsyncReply errors,
        call cancelReply directly as it does the same thing.

        * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
        (Messages::WebPage::TestAsyncMessage::callReply):
        (Messages::WebPage::TestAsyncMessage::cancelReply):
        (Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply):
        (Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply):
        * Scripts/webkit/messages.py:

2019-05-23  Ross Kirsling  <ross.kirsling@sony.com>

        Socket-based RWI should be able to inspect a JSContext
        https://bugs.webkit.org/show_bug.cgi?id=198197

        Reviewed by Don Olmstead.

        * UIProcess/socket/RemoteInspectorClient.cpp:
        (WebKit::RemoteInspectorClient::inspect):
        * UIProcess/socket/RemoteInspectorClient.h:
        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        (WebKit::RemoteInspectorProtocolHandler::inspect):
        (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
        (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
        * UIProcess/socket/RemoteInspectorProtocolHandler.h:
        Have the RWI client actually pass the debuggableType to WebInspectorUI.

2019-05-22  Stephanie Lewis  <slewis@apple.com>

        release builds of webkit cannot be used to generate a dyld shared cache
        https://bugs.webkit.org/show_bug.cgi?id=198150
        <rdar://problem/50675982>

        Reviewed by Dan Bernstein.

        Restrict the -not_for_dyld_shared_cache linker flag to macosx

        * Configurations/WebKit.xcconfig:


2019-05-23  Zalan Bujtas  <zalan@apple.com>

        [Hittest] Move hittesting from RenderView to Document
        https://bugs.webkit.org/show_bug.cgi?id=198192
        <rdar://problem/51077762>

        Reviewed by Antti Koivisto.

        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):

2019-05-23  Youenn Fablet  <youenn@apple.com>

        CacheStorageConnection callbacks should be completed on network connection close
        https://bugs.webkit.org/show_bug.cgi?id=195757

        Reviewed by Alex Christensen.

        Update according new WebCore CacheStorageConnection interface.
        Use Async IPC replies so that the completion handlers are called on network crash.

        Allow to have specific error handling in case of cancelled reply or badly decoded message.
        This allows to reject the corresponding JS promise.

        * CMakeLists.txt:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::requestSpace):
        (WebKit::CacheStorage::Caches::writeRecord):
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::remove):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
        (WebKit::CacheStorageEngineConnection::putRecords):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheIdentifierOrError>::create):
        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordIdentifiersOrError>::create):
        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::CacheInfosOrError>::create):
        (IPC::AsyncReplyError<WebCore::DOMCacheEngine::RecordsOrError>::create):
        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
        * Platform/IPC/ArgumentCoders.h:
        * Platform/IPC/Connection.h:
        (IPC::AsyncReplyError::create):
        * Scripts/webkit/messages.py:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::open):
        (WebKit::WebCacheStorageConnection::remove):
        (WebKit::WebCacheStorageConnection::retrieveCaches):
        (WebKit::WebCacheStorageConnection::retrieveRecords):
        (WebKit::WebCacheStorageConnection::batchDeleteOperation):
        (WebKit::WebCacheStorageConnection::batchPutOperation):
        (WebKit::WebCacheStorageConnection::engineRepresentation):
        * WebProcess/Cache/WebCacheStorageConnection.h:
        * WebProcess/Cache/WebCacheStorageConnection.messages.in: Removed.
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):

2019-05-23  Sihui Liu  <sihui_liu@apple.com>

        Handling for non-persistent data should be consistent in computeNetworkProcessAccessTypeForDataFetch
        https://bugs.webkit.org/show_bug.cgi?id=198050

        Reviewed by Youenn Fablet.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::computeNetworkProcessAccessTypeForDataFetch):

2019-05-23  Youenn Fablet  <youenn@apple.com>

        Set default WebsiteDataStore storage quota based on StorageQuotaManager
        https://bugs.webkit.org/show_bug.cgi?id=198133
        <rdar://problem/51031436>

        Reviewed by Geoffrey Garen.

        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2019-05-23  Alex Christensen  <achristensen@webkit.org>

        Deprecate more preview API
        https://bugs.webkit.org/show_bug.cgi?id=198152

        Reviewed by Dean Jackson.

        This is working towards <rdar://problem/51003503>

        * UIProcess/API/Cocoa/WKPreviewActionItem.h:
        * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
        * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
        * UIProcess/API/Cocoa/WKPreviewActionItemInternal.h:
        * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
        * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (previewIdentifierForElementAction):
        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
        (-[WKContentView _presentedViewControllerForPreviewItemController:]):
        (-[WKContentView _previewItemController:commitPreview:]):

2019-05-23  Antoine Quint  <graouts@apple.com>

        [tvOS] Build broken by r245639
        https://bugs.webkit.org/show_bug.cgi?id=198172
        <rdar://problem/51048991>

        Unreviewed build fix.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::touchWithIdentifierWasRemoved): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::touchWithIdentifierWasRemoved):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::touchWithIdentifierWasRemoved): Deleted.

2019-05-23  Antoine Quint  <graouts@apple.com>

        [tvOS] Build broken by r245639
        https://bugs.webkit.org/show_bug.cgi?id=198172
        <rdar://problem/51048991>

        Unreviewed build fix.

        * WebProcess/WebPage/WebPage.messages.in:

2019-05-23  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Build fails with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
        https://bugs.webkit.org/show_bug.cgi?id=198125

        Reviewed by Philippe Normand.

        * UIProcess/glib/WebProcessPoolGLib.cpp: Guard the inclusion of GStreamerCommon.h with USE(GSTREAMER).
        * WebProcess/glib/WebProcessGLib.cpp: Ditto.

2019-05-22  Antoine Quint  <graouts@apple.com>

        [tvOS] Build broken by r245639
        https://bugs.webkit.org/show_bug.cgi?id=198172
        <rdar://problem/51048991>

        Unreviewed build fix.

        * UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
        (-[WKSyntheticTapGestureRecognizer reset]):
        (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):

2019-05-22  Youenn Fablet  <youenn@apple.com>

        Use modern async IPC for EngineRepresentationCompleted and ClearMemoryRepresentationCompleted
        https://bugs.webkit.org/show_bug.cgi?id=198134

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
        (WebKit::CacheStorageEngineConnection::engineRepresentation):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
        (WebKit::WebCacheStorageConnection::engineRepresentation):
        (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted): Deleted.
        (WebKit::WebCacheStorageConnection::engineRepresentationCompleted): Deleted.
        * WebProcess/Cache/WebCacheStorageConnection.h:
        * WebProcess/Cache/WebCacheStorageConnection.messages.in:

2019-05-22  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r245148): Removing inputmode="none" does not bring up software keyboard
        https://bugs.webkit.org/show_bug.cgi?id=198141

        Reviewed by Geoffrey Garen.

        r245148 changed _requiresKeyboardWhenFirstResponder to return NO when shouldShowAutomaticKeyboardUI
        returns NO with regards to software keyboard. This introduced a regression that removing inputmode="none"
        no longer brings up the software keyboard. Fixed the bug by making it return YES when inputmode="none"
        is present on an editable element in shouldShowAutomaticKeyboardUI, partially restoring the old behavior.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView shouldShowAutomaticKeyboardUI]):
        (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
        (-[WKContentView _requiresKeyboardWhenFirstResponder]):

2019-05-22  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r240552): PDF contents are not exposed to Accessibility (VO, etc.)
        https://bugs.webkit.org/show_bug.cgi?id=198146
        <rdar://problem/50698533>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::updateMockAccessibilityElementAfterCommittingLoad):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
        (-[WKAccessibilityWebPageObjectBase setWebPage:]):
        (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
        In r240552, we changed to only defer to the main frame PluginView's
        accessibility tree if the cached "has a plugin" bit is true. That bit
        was only updated in WebPage::platformInitialize, which is long before
        we've actually loaded anything or have any clue if we're going to have
        a plugin.

        Instead, push updates every time we commit a load, which coincides
        with when we make other decisions based on having a plugin or not.
        Also, just use the existence of a PluginDocument to make the decision,
        instead of actually digging in to see if there's a PluginView, since
        PluginView comes in asynchronously.

2019-05-22  Ryosuke Niwa  <rniwa@webkit.org>

        Crash in WebFrame::jsContext() when m_coreFrame is null
        https://bugs.webkit.org/show_bug.cgi?id=198067

        Reviewed by Alex Christensen.

        Added missing null checks. Unfortunately no new tests since we don't have a reproducible test case.

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::jsContext):
        (WebKit::WebFrame::jsContextForWorld):

2019-05-22  Sihui Liu  <sihui_liu@apple.com>

        API Test landed in r245540 [Mac WK2] TestWebKitAPI.WKWebView.LocalStorageProcessCrashes is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=198090
        <rdar://problem/51003644>

        Reviewed by Youenn Fablet.

        We used to dispatch StorageManager message to StorageManager's work queue, which required message handler to be
        added to queue before receiving first StorageManager message, otherwise network process would not know how to
        decode the message.

        After r245540, when netork process crashes and dom storage is accessed from web process after that, web process 
        re-establishes its connection to network process, asks network process to add message handler, and then sends 
        StorageManager message immediately. Because work queue message receiver is added on a background thread in 
        network process, it is possible the StorageManager message is received before that.

        A safe and easy resolution is to not dispatch StorageManager message to work queue, so that we don't need to 
        wait for the message receiver to be added. Handling message on the main thread also allows us to untying the 
        knot that binds StorageManager and connection, which may be a preferred design in the future.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::webPageWasAdded):
        * NetworkProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::processDidCloseConnection):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::didGetValues):
        (WebKit::StorageManager::getValues):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::setItems):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        (WebKit::StorageManager::processWillOpenConnection): Deleted.
        (WebKit::StorageManager::dispatchMessageToQueue): Deleted.
        (WebKit::StorageManager::dispatchSyncMessageToQueue): Deleted.
        * NetworkProcess/WebStorage/StorageManager.h:

2019-05-22  Antoine Quint  <graouts@apple.com>

        [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
        https://bugs.webkit.org/show_bug.cgi?id=198124
        <rdar://problem/50410863>

        Reviewed by Tim Horton.

        In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault()
        called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process
        and into the resulting PlatformMouseEvent.

        This means we need to identify the touch identifier, which is the same as the PointerID used for Pointer Events, in the single tap gesture
        recognizer, an instance of WKSyntheticTapGestureRecognizer. To do this, we subclass the -[UIResponder touchesEnded:withEvent:] method and
        track the touch identifier as the lastActiveTouchIdentifier, a new public property of WKSyntheticTapGestureRecognizer. To allow for this,
        we need the support of the content view's UIWebTouchEventsGestureRecognizer which is exposed to the WKSyntheticTapGestureRecognizer as its
        supportingWebTouchEventsGestureRecognizer property. This lastActiveTouchIdentifier property is cleared as the gesture recognizer is reset.

        This allows the content view to pass the PointerID down to the Web process starting from -[WKContentView _singleTapRecognized:], going
        through WebPageProxy::commitPotentialTap() and eventually WebPage::completeSyntheticClick().

        While we used to tell the PointerCaptureController that a PointerID was no longer active when a given touch ended or was canceled (in
        WebKitAdditions code), we can no longer do this as the dispatch of a synthetic tap is performed asynchronously and will happen past the
        dispatch of "pointerup" and "pointercancel" Pointer Events. To clear inactive PointerIDs from the PointerCaptureController, we add a new
        touchWithIdentifierWasRemoved() method on the WebPage and its proxy. When the WKSyntheticTapGestureRecognizer resets and -[WKContentView _singleTapDidReset:]
        is called, we call that method which allows for only active PointerIDs to be tracked by the PointerCaptureController.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _singleTapDidReset:]):
        (-[WKContentView _singleTapRecognized:]):
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
        (-[WKSyntheticTapGestureRecognizer reset]):
        (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::touchWithIdentifierWasRemoved):
        (WebKit::WebPageProxy::commitPotentialTap):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::dispatchSyntheticMouseMove):
        (WebKit::WebPage::handleSyntheticClick):
        (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
        (WebKit::WebPage::completeSyntheticClick):
        (WebKit::WebPage::commitPotentialTap):
        (WebKit::WebPage::touchWithIdentifierWasRemoved):

2019-05-22  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Support Attestation Conveyance Preference
        https://bugs.webkit.org/show_bug.cgi?id=192722
        <rdar://problem/49939647>

        Reviewed by Brent Fulgham.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
        (WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):
        * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
        (WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived):

2019-05-22  Zalan Bujtas  <zalan@apple.com>

        [Paste] Add support for preferred presentation size when pasting an image
        https://bugs.webkit.org/show_bug.cgi?id=198132
        <rdar://problem/50886917>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (addToReadingList):
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
        (-[WKActionSheetAssistant defaultActionsForImageSheet:]):

2019-05-22  Youenn Fablet  <youenn@apple.com>

        Implement Feature policy self/none/* parsing
        https://bugs.webkit.org/show_bug.cgi?id=198078

        Reviewed by Eric Carlson.

        Fix a case where completion handler might not always be called.

        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):

2019-05-22  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed fix for non-unified build after r245320.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::convertRectFromFrameClientToRootView):
        (WebKit::convertPointFromFrameClientToRootView):
        (WebKit::WebAutomationSessionProxy::computeElementLayout):

2019-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK unit tests after r245565

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDispose): Null check accessible before calling webkitWebViewAccessibleSetWebView().

2019-05-21  Ross Kirsling  <ross.kirsling@sony.com>

        [PlayStation] Don't call fcntl.
        https://bugs.webkit.org/show_bug.cgi?id=197961

        Reviewed by Fujii Hironori.

        * Platform/IPC/unix/ConnectionUnix.cpp:
        (IPC::Connection::open):
        Use WTF::setNonBlock.

2019-05-21  Chris Dumez  <cdumez@apple.com>

        [PSON] Assertion hit when navigating back after a process swap forced by the client
        https://bugs.webkit.org/show_bug.cgi?id=198006

        Reviewed by Alex Christensen.

        After r245198, we construct a SuspendedPageProxy when a process-swap is forced by the client
        and we delay to closing of the WebPage in the old WebProcess until it is safe to do so without
        flashing (by calling SuspendedPageProxy::closeWithoutFlashing()). The issue is that our logic
        deciding if we should reuse a SuspendedPageProxy's WebPage relied on the SuspendedPageProxy's
        m_suspensionState not being set to FailedToSuspend. In the case of a process-swap forced by the
        client with delayed page closing, the suspended state may be suspended but is still not usable
        because it is about to get closed. We would wrongly believe there is a WebPage to be reused so
        the ProvisionalPageProxy would construct a proxy for the main frame in its constructor, we would
        then hit the ASSERT(!m_mainFrame) assertion in ProvisionalPageProxy::didCreateMainFrame() when
        the WebContent process would unexpectedly create a main frame.

        To address the issue, stop relying on the suspended state to determine if we can reuse a WebPage
        or not and introduce a new pageIsClosedOrClosing() getter on the SuspendedPageProxy instead
        which indicates if the WebPage in the WebContent process has been closed or is about to be.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
        (WebKit::SuspendedPageProxy::pageIsClosedOrClosing const):
        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):

2019-05-21  Per Arne Vollan  <pvollan@apple.com>

        Sandbox violation is making the WebContent process crash
        https://bugs.webkit.org/show_bug.cgi?id=198089
        <rdar://problem/50999499>

        Reviewed by Brent Fulgham.

        A new syscall rule needs to be added to the sandbox on iOS and macOS.

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

2019-05-21  Alex Christensen  <achristensen@webkit.org>

        Mark WKUIDelegate webView:shouldPreviewElement: and webView:previewingViewControllerForElement:defaultActions: as deprecated
        https://bugs.webkit.org/show_bug.cgi?id=198083
        <rdar://problem/50735687>

        Reviewed by Geoffrey Garen.

        * UIProcess/API/Cocoa/WKUIDelegate.h:

2019-05-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        The cost of WebViewImpl::hasMarkedTextWithCompletionHandler should not increase with document size
        https://bugs.webkit.org/show_bug.cgi?id=198075
        <rdar://problem/37560103>

        Reviewed by Tim Horton.

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

        Refactor hasMarkedTextWithCompletionHandler to use Editor::hasComposition, instead of computing the actual
        marked text range. The latter is more expensive and unnecessary, since it uses TextIterator from the document
        root to find editing offsets. This makes the cost of determining whether there is marked text proportional to
        the document size.

        This matches behavior in legacy WebKit, as well as iOS.

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

2019-05-21  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Make WebAuthN default on only on macOS
        https://bugs.webkit.org/show_bug.cgi?id=198068
        <rdar://problem/50971874>

        Reviewed by Brent Fulgham.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-05-21  Pablo Saavedra  <psaavedra@igalia.com>

        Undefined reference platformCloseFrontendPageAndWindow() linking against libWPEWebKit-1.0.so after r245536
        https://bugs.webkit.org/show_bug.cgi?id=198069

        Reviewed by Ross Kirsling.

        * UIProcess/RemoteWebInspectorProxy.cpp:

2019-05-21  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION(r245540): ASSERTION FAILED: identifier.isNull() || RunLoop::isMain()
        https://bugs.webkit.org/show_bug.cgi?id=198074

        Reviewed by Youenn Fablet.

        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::databasePath const):

2019-05-21  Antti Koivisto  <antti@apple.com>

        RTL/overflow scroll tests fail with async overflow enabled
        https://bugs.webkit.org/show_bug.cgi?id=196013
        <rdar://problem/49066649>

        Reviewed by Simon Fraser.

        Add missing scroll offset <-> scroll position conversions.

        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):

2019-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Add initial accessibility support using ATK
        https://bugs.webkit.org/show_bug.cgi?id=197413

        Reviewed by Michael Catanzaro.

        Rename WebKitWebViewBaseAccessible as WebKitWebViewAccessible and move it to glib removing its dependency on
        GTK. WPEView now implements get_accessible to return its associated WebKitWebViewAccessible.

        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitWebViewAccessible.cpp: Added.
        (webkitWebViewAccessibleInitialize):
        (webkitWebViewAccessibleRefStateSet):
        (webkitWebViewAccessibleGetIndexInParent):
        (webkit_web_view_accessible_class_init):
        (webkitWebViewAccessibleNew):
        (webkitWebViewAccessibleSetWebView):
        * UIProcess/API/glib/WebKitWebViewAccessible.h: Added.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDispose):
        (webkitWebViewBaseGetAccessible):
        * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: Removed.
        * UIProcess/API/gtk/WebKitWebViewBaseAccessible.h: Removed.
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::accessible):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend):
        (WKWPE::View::~View):
        (WKWPE::View::accessible):
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebPageProxy::bindAccessibilityTree): Call atk_socket_embed() with the given plug ID.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:
        (WebKit::WebPage::platformInitialize): Create the WebKitWebPageAccessibilityObject and send
        BindAccessibilityTree message to the UI process.
        * WebProcess/wpe/WebProcessMainWPE.cpp:
        (WebKit::initializeAccessibility): Implement AtkUtil interface and initialize the atk bridge.

2019-05-20  Alex Christensen  <achristensen@webkit.org>

        Revert r245501
        https://bugs.webkit.org/show_bug.cgi?id=198007

        That change did not fix <rdar://problem/49808949> but it caused <rdar://problem/50967271> so out it goes.

        * Shared/API/Cocoa/WKMain.h: Added.
        * Shared/API/Cocoa/WKMain.mm: Added.
        (WKXPCServiceMain):
        * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added.
        (main):
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (main): Deleted.
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * WebKit.xcodeproj/project.pbxproj:

2019-05-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Layout viewport size on google.com increases after rotating to landscape and back
        https://bugs.webkit.org/show_bug.cgi?id=198062
        <rdar://problem/50547895>

        Reviewed by Maciej Stachowiak.

        During an animated resize (e.g. when rotating the device on iOS), we currently immediately trigger the new
        shrink-to-fit content size heuristic in the middle of dynamicViewportSizeUpdate, after the new view layout size
        has been applied to the viewport configuration but before we've issued a resize event to the page.

        Thus, on pages that use listen to the resize event and adjust their content accordingly to fit within the new
        layout width, we prematurely declare that the page has horizontally overflowed, and try to lay out at a larger
        width and scale down. This causes the page to unnecessarily shrink after rotating to landscale orientation and
        back.

        To fix this, we simply move the call to shrink-to-fit-content to the end of the dynamic viewport size update,
        such that the page has had a chance to adjust to the new layout size.

        Test: fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html

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

2019-05-20  Ross Kirsling  <ross.kirsling@sony.com>

        Make lossy LayoutUnit constructors explicit
        https://bugs.webkit.org/show_bug.cgi?id=191811

        Reviewed by Antti Koivisto.

        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        Make usage of LayoutUnit(float) explicit.

2019-05-20  Per Arne Vollan  <pvollan@apple.com>

        [iOS] WebKit crash loop
        https://bugs.webkit.org/show_bug.cgi?id=198061
        <rdar://problem/50967271>

        Reviewed by Brent Fulgham.

        A new syscall rule needs to be added to the sandbox on iOS.

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

2019-05-20  Sihui Liu  <sihui_liu@apple.com>

        Move Web Storage to Network Process
        https://bugs.webkit.org/show_bug.cgi?id=197636

        Reviewed by Youenn Fablet.

        * CMakeLists.txt:
        * DerivedSources.make:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage):
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::webPageWasAdded):
        (WebKit::NetworkConnectionToWebProcess::webPageWasRemoved):
        (WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::networkSessionByConnection const):
        (WebKit::NetworkProcess::hasLocalStorage):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::filterForRegistrableDomains):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::webPageWasAdded):
        (WebKit::NetworkProcess::webPageWasRemoved):
        (WebKit::NetworkProcess::webProcessWasDisconnected):
        (WebKit::NetworkProcess::webProcessSessionChanged):
        (WebKit::NetworkProcess::getLocalStorageOriginDetails):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        (WebKit::NetworkSession::~NetworkSession):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::storageManager):
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabase.cpp.
        (WebKit::LocalStorageDatabase::create):
        (WebKit::LocalStorageDatabase::LocalStorageDatabase):
        (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
        (WebKit::LocalStorageDatabase::openDatabase):
        (WebKit::LocalStorageDatabase::tryToOpenDatabase):
        (WebKit::LocalStorageDatabase::migrateItemTableIfNeeded):
        (WebKit::LocalStorageDatabase::importItems):
        (WebKit::LocalStorageDatabase::setItem):
        (WebKit::LocalStorageDatabase::removeItem):
        (WebKit::LocalStorageDatabase::clear):
        (WebKit::LocalStorageDatabase::close):
        (WebKit::LocalStorageDatabase::itemDidChange):
        (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
        (WebKit::LocalStorageDatabase::updateDatabase):
        (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
        (WebKit::LocalStorageDatabase::databaseIsEmpty):
        * NetworkProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabase.h.
        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp.
        (WebKit::LocalStorageDatabaseTracker::create):
        (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::databasePath const):
        (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
        (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
        (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
        (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
        (WebKit::LocalStorageDatabaseTracker::origins const):
        (WebKit::LocalStorageDatabaseTracker::originDetails):
        * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h.
        * NetworkProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.cpp.
        (WebKit::StorageManager::StorageArea::securityOrigin const):
        (WebKit::StorageManager::StorageArea::isSessionStorage const):
        (WebKit::StorageManager::LocalStorageNamespace::storageManager const):
        (WebKit::StorageManager::TransientLocalStorageNamespace::create):
        (WebKit::StorageManager::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
        (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::StorageManager::TransientLocalStorageNamespace::origins const):
        (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::StorageManager::TransientLocalStorageNamespace::clearAllStorageAreas):
        (WebKit::StorageManager::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
        (WebKit::StorageManager::StorageArea::create):
        (WebKit::StorageManager::StorageArea::StorageArea):
        (WebKit::StorageManager::StorageArea::~StorageArea):
        (WebKit::StorageManager::StorageArea::addListener):
        (WebKit::StorageManager::StorageArea::removeListener):
        (WebKit::StorageManager::StorageArea::hasListener const):
        (WebKit::StorageManager::StorageArea::clone const):
        (WebKit::StorageManager::StorageArea::setItem):
        (WebKit::StorageManager::StorageArea::removeItem):
        (WebKit::StorageManager::StorageArea::clear):
        (WebKit::StorageManager::StorageArea::items const):
        (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded const):
        (WebKit::StorageManager::StorageArea::dispatchEvents const):
        (WebKit::StorageManager::LocalStorageNamespace::create):
        (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
        (WebKit::StorageManager::LocalStorageNamespace::~LocalStorageNamespace):
        (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
        (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
        (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
        (WebKit::StorageManager::SessionStorageNamespace::isEmpty const):
        (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
        (WebKit::StorageManager::SessionStorageNamespace::origins const):
        (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
        (WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
        (WebKit::StorageManager::SessionStorageNamespace::create):
        (WebKit::StorageManager::SessionStorageNamespace::SessionStorageNamespace):
        (WebKit::StorageManager::SessionStorageNamespace::~SessionStorageNamespace):
        (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
        (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
        (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
        (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
        (WebKit::StorageManager::create):
        (WebKit::StorageManager::StorageManager):
        (WebKit::StorageManager::~StorageManager):
        (WebKit::StorageManager::createSessionStorageNamespace):
        (WebKit::StorageManager::destroySessionStorageNamespace):
        (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
        (WebKit::StorageManager::cloneSessionStorageNamespace):
        (WebKit::StorageManager::processWillOpenConnection):
        (WebKit::StorageManager::processDidCloseConnection):
        (WebKit::StorageManager::getSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageOrigins):
        (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
        (WebKit::StorageManager::getLocalStorageOrigins):
        (WebKit::StorageManager::getLocalStorageOriginDetails):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
        (WebKit::StorageManager::createLocalStorageMap):
        (WebKit::StorageManager::createTransientLocalStorageMap):
        (WebKit::StorageManager::createSessionStorageMap):
        (WebKit::StorageManager::destroyStorageMap):
        (WebKit::StorageManager::getValues):
        (WebKit::StorageManager::setItem):
        (WebKit::StorageManager::removeItem):
        (WebKit::StorageManager::clear):
        (WebKit::StorageManager::applicationWillTerminate):
        (WebKit::StorageManager::findStorageArea const):
        (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
        (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
        * NetworkProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.h.
        * NetworkProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/WebStorage/StorageManager.messages.in.
        * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm.
        (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/curl/NetworkSessionCurl.cpp:
        (WebKit::NetworkSessionCurl::NetworkSessionCurl):
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::NetworkSessionSoup):
        * PlatformMac.cmake:
        * PlatformWin.cmake:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::ownerProcess):
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
        (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
        (WKKeyValueStorageManagerDeleteEntriesForOrigin):
        (WKKeyValueStorageManagerDeleteAllEntries):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::hasLocalStorage):
        (WebKit::NetworkProcessProxy::getLocalStorageDetails):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::createNewPage):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        (WebKit::WebsiteDataStore::platformInitialize):
        (WebKit::WebsiteDataStore::platformDestroy):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::WebsiteDataStore):
        (WebKit::computeNetworkProcessAccessTypeForDataFetch):
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
        (WebKit::WebsiteDataStore::parameters):
        (WebKit::WebsiteDataStore::getLocalStorageDetails):
        (WebKit::m_client): Deleted.
        (WebKit::WebsiteDataStore::cloneSessionData): Deleted.
        (WebKit::WebsiteDataStore::webPageWasAdded): Deleted.
        (WebKit::WebsiteDataStore::webPageWasInvalidated): Deleted.
        (WebKit::WebsiteDataStore::webProcessWillOpenConnection): Deleted.
        (WebKit::WebsiteDataStore::webPageWillOpenConnection): Deleted.
        (WebKit::WebsiteDataStore::webPageDidCloseConnection): Deleted.
        (WebKit::WebsiteDataStore::webProcessDidCloseConnection): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::resolvedLocalStorageDirectory const):
        (WebKit::WebsiteDataStore::storageManager): Deleted.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createWindow):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::createWebPage):
        (WebKit::WebProcess::removeWebPage):
        (WebKit::WebProcess::ensureNetworkProcessConnection):
        (WebKit::WebProcess::networkProcessConnectionClosed):
        (WebKit::WebProcess::registerStorageAreaMap):
        (WebKit::WebProcess::unregisterStorageAreaMap):
        (WebKit::WebProcess::storageAreaMap const):
        (WebKit::WebProcess::enablePrivateBrowsingForTesting):
        * WebProcess/WebProcess.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::StorageAreaMap):
        (WebKit::StorageAreaMap::~StorageAreaMap):
        (WebKit::StorageAreaMap::setItem):
        (WebKit::StorageAreaMap::removeItem):
        (WebKit::StorageAreaMap::clear):
        (WebKit::StorageAreaMap::loadValuesIfNeeded):
        (WebKit::StorageAreaMap::connect):
        (WebKit::StorageAreaMap::disconnect):
        * WebProcess/WebStorage/StorageAreaMap.h:
        (WebKit::StorageAreaMap::identifier const):

2019-05-20  Ross Kirsling  <ross.kirsling@sony.com>

        [WinCairo] Implement Remote Web Inspector Client.
        https://bugs.webkit.org/show_bug.cgi?id=197434

        Reviewed by Don Olmstead.

        * PlatformWin.cmake:
        * UIProcess/RemoteWebInspectorProxy.cpp:
        * UIProcess/RemoteWebInspectorProxy.h:
        * UIProcess/socket/RemoteInspectorClient.cpp: Added.
        * UIProcess/socket/RemoteInspectorClient.h: Added.
        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: Added.
        * UIProcess/socket/RemoteInspectorProtocolHandler.h: Added.
        * UIProcess/win/RemoteWebInspectorProxyWin.cpp: Added.
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::WebView):

2019-05-20  Per Arne Vollan  <pvollan@apple.com>

        [macOS] STP can't launch any WebContent processes
        https://bugs.webkit.org/show_bug.cgi?id=198045
        <rdar://problem/50931110>

        Reviewed by Brent Fulgham.

        This is caused by a syscall sandbox violation.

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

2019-05-20  Zhifei Fang  <zhifei_fang@apple.com>

        Allow WebContent mach-lookup AGXCompilerService
        https://bugs.webkit.org/show_bug.cgi?id=198031
        <rdar://problem/50552974>

        Reviewed by Per Arne Vollan.

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

2019-05-20  Sihui Liu  <sihui_liu@apple.com>

        [ Mac WK2 iOS Sim] Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=196307
        <rdar://problem/49345360>

        Reviewed by Alex Christensen.

        Delay dumping statistics if there is data being removed.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved const):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::dumpResourceLoadStatistics):
        (WebKit::WebResourceLoadStatisticsStore::tryDumpResourceLoadStatistics):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:

2019-05-20  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [WPE][Qt] Use C++17 instead of C++14
        https://bugs.webkit.org/show_bug.cgi?id=197415

        Reviewed by Philippe Normand.

        There was a regression introduced with the commit https://bugs.webkit.org/show_bug.cgi?id=197131
        The WPE Qt port was not updated to C++17 and this leaded to a compilation error.

        * PlatformWPE.cmake:

2019-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Use a repeating timer to populate emoji chooser
        https://bugs.webkit.org/show_bug.cgi?id=197984

        Reviewed by Michael Catanzaro.

        It ensures the emoji chooser popover is shown as soon as it's requested.

        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        (webkitEmojiChooserSetupSectionBox):
        (webkitEmojiChooserSetupRecent):
        (webkitEmojiChooserSetupEmojiSections):
        (webkitEmojiChooserConstructed):

2019-05-19  Antoine Quint  <graouts@apple.com>

        [Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS
        https://bugs.webkit.org/show_bug.cgi?id=197882
        <rdar://problem/50769116>

        Reviewed by Dean Jackson.

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

2019-05-19  Alex Christensen  <achristensen@webkit.org>

        Revert r240956
        https://bugs.webkit.org/show_bug.cgi?id=198007
        <rdar://problem/49808949>

        Reviewed by Alexey Proskuryakov.

        r240956 made SafariForWebKitDevelopment crash when using WebKit nightly builds.
        Since it's not needed and the binary reduction wasn't too big, just revert that revision.

        * Shared/API/Cocoa/WKMain.h: Removed.
        * Shared/API/Cocoa/WKMain.mm: Removed.
        * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Removed.
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (main):
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-05-18  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP fails in authenticatorGetAssertion
        https://bugs.webkit.org/show_bug.cgi?id=197974
        <rdar://problem/50879746>

        Reviewed by Brent Fulgham.

        Authenticators that support both CTAP and U2F protocols can be used in a U2F enabled browser to create a credential in
        U2F format. When such authenticator is used to login in WebKit, it will be treated as a CTAP authenticator. Since the
        previous credential is in U2F format, the authenticator will not consider that as a valid credential when CTAP requests
        come along for that U2F credential. Therefore the previous created U2F credential will not be asked at all, and users
        will not be able to login. This situation is not well documented in the CTAP/WebAuthN spec yet.

        To workaround the above issue, an authenticator that supports both protocols will be downgraded to a U2F authenticator
        to ask a potential U2F credential once a valid error is returned regarding to the first CTAP request.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
        * UIProcess/WebAuthentication/Authenticator.h:
        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::downgrade):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
        (WebKit::MockHidConnection::parseRequest):
        (WebKit::MockHidConnection::feedReports):
        * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
        * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
        (WebKit::CtapHidAuthenticator::makeCredential):
        (WebKit::CtapHidAuthenticator::getAssertion):
        (WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapHidAuthenticator::tryDowngrade):
        (WebKit::CtapHidAuthenticator::continueGetAssertionAfterResponseReceived const): Deleted.
        * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h:

2019-05-17  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use builtin FindICU
        https://bugs.webkit.org/show_bug.cgi?id=197934

        Reviewed by Michael Catanzaro.

        Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.

        * CMakeLists.txt:

2019-05-17  Alex Christensen  <achristensen@webkit.org>

        Enable legacy EME for iOS WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=197964
        <rdar://problem/50625666>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):

2019-05-17  Antoine Quint  <graouts@apple.com>

        Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
        https://bugs.webkit.org/show_bug.cgi?id=197943
        <rdar://problem/49078202>

        Reviewed by Brent Fulgham.

        * Shared/WebsiteLegacyOverflowScrollingTouchPolicy.h: Added.
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-05-17  Alex Christensen  <achristensen@webkit.org>

        Add SPI to set a list of hosts to which to send custom header fields cross-origin
        https://bugs.webkit.org/show_bug.cgi?id=197397

        Reviewed by Geoff Garen.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::decode):
        * Shared/WebsitePoliciesData.h:
        * SourcesCocoa.txt:
        * UIProcess/API/APICustomHeaderFields.h: Added.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::WebsitePolicies):
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        (WKWebsitePoliciesCopyCustomHeaderFields):
        (WKWebsitePoliciesSetCustomHeaderFields):
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _customHeaderFields]):
        (-[WKWebpagePreferences _setCustomHeaderFields:]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
        (-[_WKCustomHeaderFields init]):
        (-[_WKCustomHeaderFields dealloc]):
        (-[_WKCustomHeaderFields fields]):
        (-[_WKCustomHeaderFields setFields:]):
        (-[_WKCustomHeaderFields thirdPartyDomains]):
        (-[_WKCustomHeaderFields setThirdPartyDomains:]):
        (-[_WKCustomHeaderFields _apiObject]):
        * UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies customHeaderFields]): Deleted.
        (-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::takeFocus):
        (WebKit::WebViewImpl::accessibilityAttributeValue):
        * WebKit.xcodeproj/project.pbxproj:

2019-05-17  Brady Eidson  <beidson@apple.com>

        Avoid races in taking networking assertions for downloads by having both Networking and UIProcess do it.
        <rdar://problem/50564630> and https://bugs.webkit.org/show_bug.cgi?id=197995

        Reviewed by Chris Dumez.

        There's a fairly indeterminant time gap between when the UIProcess decides a load becomes a download
        and when the NetworkProcess Download object is created, and therefore the download assertion to be taken.

        The time gap can be long enough for the Networking process to suspend before the download actually starts.

        There's the reverse race when the UIProcess tells a download to stop, as well.

        By having both the UIProcess and NetworkProcess take an assertion on behalf of the NetworkProcess we
        avoid the race.

        * NetworkProcess/Downloads/DownloadMap.cpp:
        (WebKit::DownloadMap::add):
        (WebKit::DownloadMap::remove):

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::convertToDownload):

        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::createDownloadProxy):
        (WebKit::DownloadProxyMap::downloadFinished):
        (WebKit::DownloadProxyMap::invalidate):
        * UIProcess/Downloads/DownloadProxyMap.h:

2019-05-17  Keith Rollin  <krollin@apple.com>

        Re-enable generate-xcfilelists
        https://bugs.webkit.org/show_bug.cgi?id=197933
        <rdar://problem/50831677>

        Reviewed by Jonathan Bedard.

        The following two tasks have been completed, and we can re-enable
        generate-xcfilelists:

        Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
        Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)

        * Scripts/check-xcfilelists.sh:

2019-05-17  Commit Queue  <commit-queue@webkit.org>

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

        Causing internal build failures (Requested by ShawnRoberts on
        #webkit).

        Reverted changeset:

        "Add SPI to set a list of hosts to which to send custom header
        fields cross-origin"
        https://bugs.webkit.org/show_bug.cgi?id=197397
        https://trac.webkit.org/changeset/245401

2019-05-17  Commit Queue  <commit-queue@webkit.org>

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

        New API test causing crashes on Mojave testers (Requested by
        ShawnRoberts on #webkit).

        Reverted changeset:

        "Add a unit test for client certificate authentication"
        https://bugs.webkit.org/show_bug.cgi?id=197800
        https://trac.webkit.org/changeset/245418

2019-05-17  Antti Koivisto  <antti@apple.com>

        [iOS] Respect scrolling="no" on composited frames
        https://bugs.webkit.org/show_bug.cgi?id=197972
        <rdar://problem/50252398>

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

        Disallow scrolling based on canHaveScrollbars, similar to main frame.

        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollView const):

        Factor into a function.

2019-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix variations shown in GTK emoji chooser after r245460.

        We are tno showing the variations in the sub-popover because of a missing parameter in
        webkitEmojiChooserAddEmoji() call.

        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        (webkitEmojiChooserShowVariations): Pass prepend parameter to webkitEmojiChooserAddEmoji().

2019-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Need WebKitContextMenuItemType to open emoji picker
        https://bugs.webkit.org/show_bug.cgi?id=176760

        Reviewed by Michael Catanzaro.

        Add a default implementation to show the emoji chooser when requested by the application, either using the
        context menu or keyboard shortcuts. GtkEmojiChooser is private in GTK, so we include our own copy, adapted to
        the WebKit coding style. The emoji chooser is always shown by default when using GTK >= 3.24 for any editable
        content. I'm going to add public API in a follow up patch to be able to use your own chooser, or even prevent
        the default chooser from being shown, similar to what we do for other UI elements like file chooser, color
        chooser, print dialog, etc.

        * Shared/API/glib/WebKitContextMenuActions.cpp:
        (webkitContextMenuActionGetActionTag): Handle insert emoji action.
        (webkitContextMenuActionGetForContextMenuItem): Ditto.
        (webkitContextMenuActionGetLabel): Ditto.
        * SourcesGTK.txt:
        * UIProcess/API/gtk/WebKitContextMenuActions.h:
        * UIProcess/API/gtk/WebKitEmojiChooser.cpp: Added.
        (webkitEmojiChooserAddEmoji):
        (webkitEmojiChooserAddRecentItem):
        (emojiActivated):
        (emojiDataHasVariations):
        (webkitEmojiChooserShowVariations):
        (emojiLongPressed):
        (emojiPressed):
        (emojiPopupMenu):
        (verticalAdjustmentChanged):
        (webkitEmojiChooserSetupSectionBox):
        (scrollToSection):
        (webkitEmojiChooserSetupSectionButton):
        (webkitEmojiChooserSetupRecent):
        (webkitEmojiChooserEnsureEmptyResult):
        (webkitEmojiChooserSearchChanged):
        (webkitEmojiChooserSetupFilters):
        (webkitEmojiChooserInitializeEmojiMaxWidth):
        (webkitEmojiChooserConstructed):
        (webkitEmojiChooserShow):
        (webkit_emoji_chooser_class_init):
        (webkitEmojiChooserNew):
        * UIProcess/API/gtk/WebKitEmojiChooser.h: Added.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate): Add a timer to release the emoji chooser if not used
        after 2 minutes.
        (_WebKitWebViewBasePrivate::releaseEmojiChooserTimerFired): Destroy the emoji chooser.
        (emojiChooserEmojiPicked): Complete the operation using the given emoji text.
        (emojiChooserClosed): Complete the operation if needed using an empty string.
        (webkitWebViewBaseShowEmojiChooser): Create the emoji chooser if needed and show it.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/WebPageProxy.h: Add showEmojiPicker().
        * UIProcess/WebPageProxy.messages.in: Add ShowEmojiPicker message.
        * UIProcess/gtk/KeyBindingTranslator.cpp:
        (WebKit::insertEmojiCallback): Add GtkInsertEmoji command.
        (WebKit::KeyBindingTranslator::KeyBindingTranslator): Connect to insert-emoji signal.
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::showEmojiPicker): Call webkitWebViewBaseShowEmojiChooser().
        * WebProcess/WebCoreSupport/WebContextMenuClient.h: Override insertEmoji() for GTK port.
        * WebProcess/WebCoreSupport/WebEditorClient.h: Add insertEmoji() for GTK port.
        * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
        (WebKit::WebContextMenuClient::insertEmoji): Call WebPage::showEmojiPicker().
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        (WebKit::WebEditorClient::handleGtkEditorCommand): Call WebPage::showEmojiPicker() if command is GtkInsertEmoji.
        (WebKit::WebEditorClient::executePendingEditorCommands): Handle Gtk specific commands.
        (WebKit::WebEditorClient::handleKeyboardEvent): Use a reference instead of a pointer for Frame.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::showEmojiPicker): Send ShowEmojiPicker message to the UI process.

2019-05-16  John Wilander  <wilander@apple.com>

        Storage Access API: Call completion handlers in NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess() when feature is off
        https://bugs.webkit.org/show_bug.cgi?id=197967
        <rdar://problem/50753129>

        Reviewed by Brent Fulgham.

        NetworkConnectionToWebProcess::hasStorageAccess() and NetworkConnectionToWebProcess::requestStorageAccess()
        should call their completion handlers when there is no Resource Load Statistics object, i.e. when Resource
        Load Statistics is off. This happens for ephemeral sessions which made code for federated login providers
        hang, waiting for the result to document.hasStorageAccess().

        The existing layout test case was augmented to use an ephemeral session.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):

2019-05-16  Alex Christensen  <achristensen@webkit.org>

        Add a unit test for client certificate authentication
        https://bugs.webkit.org/show_bug.cgi?id=197800

        Reviewed by Youenn Fablet.

        * Shared/cf/ArgumentCodersCF.cpp:
        Move SPI declarations to SecuritySPI.h.

2019-05-16  Alex Christensen  <achristensen@webkit.org>

        Add SPI to set a list of hosts to which to send custom header fields cross-origin
        https://bugs.webkit.org/show_bug.cgi?id=197397

        Reviewed by Geoff Garen.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::decode):
        * Shared/WebsitePoliciesData.h:
        * SourcesCocoa.txt:
        * UIProcess/API/APICustomHeaderFields.h: Added.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::WebsitePolicies):
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        (WKWebsitePoliciesCopyCustomHeaderFields):
        (WKWebsitePoliciesSetCustomHeaderFields):
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _customHeaderFields]):
        (-[WKWebpagePreferences _setCustomHeaderFields:]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
        (-[_WKCustomHeaderFields init]):
        (-[_WKCustomHeaderFields dealloc]):
        (-[_WKCustomHeaderFields fields]):
        (-[_WKCustomHeaderFields setFields:]):
        (-[_WKCustomHeaderFields thirdPartyDomains]):
        (-[_WKCustomHeaderFields setThirdPartyDomains:]):
        (-[_WKCustomHeaderFields _apiObject]):
        * UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies customHeaderFields]): Deleted.
        (-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::takeFocus):
        (WebKit::WebViewImpl::accessibilityAttributeValue):
        * WebKit.xcodeproj/project.pbxproj:

2019-05-16  Ryan Walklin  <ryan@testtoast.com>

        [WPE] Rendering on a HiDPI display looks scaled up instead of rendered at 2x
        https://bugs.webkit.org/show_bug.cgi?id=185764

        Reviewed by Carlos Garcia Campos.

        Add a function to the wpe_view_backend_client struct which accepts a device scale factor
        configured through wpe_view_backend_dispatch_set_device_scale_factor() and calls
        setIntrinsicDeviceScaleFactor for the the current View.Page object. The
        function definition has been added in libwpe 1.3.

        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend): Add set_device_scale_factor implementation declared by libwpe.

2019-05-15  Devin Rousso  <drousso@apple.com>

        Web Inspector: user gesture toggle should also force user interaction flag
        https://bugs.webkit.org/show_bug.cgi?id=197269

        Reviewed by Joseph Pecoraro.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::userIsInteracting const): Added.
        (WebKit::WebChromeClient::setUserIsInteracting): Added.

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::userIsInteracting const): Added.
        (WebKit::WebPage::setUserIsInteracting): Added.

2019-05-15  Brent Fulgham  <bfulgham@apple.com>

        Revise sandbox to allow IOKit properties needed by Metal and LaunchServices
        https://bugs.webkit.org/show_bug.cgi?id=197924
        <rdar://problem/50823976>

        Reviewed by Per Arne Vollan.

        Update sandbox to allow access to some IOKit properties to avoid sandbox violations that could
        lower performance or increase launch times:

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

2019-05-15  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix assertion introduced in r245339.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::CachedProcess::CachedProcess):

2019-05-15  Sihui Liu  <sihui_liu@apple.com>

        Add assertions to help diagnose crash at WebProcessProxy::processPool()
        https://bugs.webkit.org/show_bug.cgi?id=197856
        <rdar://problem/49341366>

        Reviewed by Chris Dumez.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::CachedProcess::CachedProcess):
        * UIProcess/WebProcessLifetimeObserver.cpp:
        (WebKit::WebProcessLifetimeObserver::addWebPage):
        (WebKit::WebProcessLifetimeObserver::removeWebPage):
        * UIProcess/WebProcessLifetimeObserver.h:
        (WebKit::WebProcessLifetimeObserver::hasProcess const):

2019-05-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
        https://bugs.webkit.org/show_bug.cgi?id=197916
        <rdar://problem/50815427>

        Reviewed by Timothy Hatcher.

        Use UIKeyboardTypeNumberPad instead of UIKeyboardTypeNumbersAndPunctuation when presenting a keyboard for a
        field with inputmode="numeric". While the WhatWG specification merely requires the UA to display a keyboard
        "capable of numeric input", it suggests that the keyboard should be "useful for PIN entry", which loosely
        implies a number pad.

        This is also generally in line with feedback from web developers.

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

2019-05-15  Don Olmstead  <don.olmstead@sony.com>

        Add USE(LIBWPE) for AcceleratedSurface
        https://bugs.webkit.org/show_bug.cgi?id=197918

        Reviewed by Michael Catanzaro.

        Renamed AcceleratedSurfaceWPE to AcceleratedSurfaceLibWPE since it just uses the
        libwpe APIs.

        * PlatformWPE.cmake:
        * SourcesWPE.txt:
        * WebProcess/WebPage/AcceleratedSurface.cpp:
        (WebKit::AcceleratedSurface::create):
        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.cpp: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp.
        (WebKit::AcceleratedSurfaceLibWPE::create):
        (WebKit::AcceleratedSurfaceLibWPE::AcceleratedSurfaceLibWPE):
        (WebKit::AcceleratedSurfaceLibWPE::~AcceleratedSurfaceLibWPE):
        (WebKit::AcceleratedSurfaceLibWPE::initialize):
        (WebKit::AcceleratedSurfaceLibWPE::finalize):
        (WebKit::AcceleratedSurfaceLibWPE::window const):
        (WebKit::AcceleratedSurfaceLibWPE::surfaceID const):
        (WebKit::AcceleratedSurfaceLibWPE::clientResize):
        (WebKit::AcceleratedSurfaceLibWPE::willRenderFrame):
        (WebKit::AcceleratedSurfaceLibWPE::didRenderFrame):
        * WebProcess/WebPage/libwpe/AcceleratedSurfaceLibWPE.h: Renamed from Source/WebKit/WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h.

2019-05-15  Youenn Fablet  <youenn@apple.com>

        getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
        https://bugs.webkit.org/show_bug.cgi?id=197851

        Reviewed by Alex Christensen.

        Before the patch, stopping capture in a document and quickly triggering a new capture
        might fail as the UIProcess would grant access and revoke sandbox access based on the fact
        the page is no longer capturing.
        To fix that issue, keep a state in the UIProcess to not revoke sandbox extensions in case of
        capture being started.
        Add an IPC message back to tell UIProcess when an allowed capture is finished.
        Just after doing that, make sure the document is updating the media state to UIProcess, which will trigger proper sandbox extension handling.

        This should also trigger the case of an allowed getUserMedia call that fails to start for some reason.
        In that case, the patch will automatically trigger a document media state refresh which will trigger a sandbox revokation.

        Covered by added test that exercise a newly added debug assertion.
        This assertion ensures that we revoke extensions while a document is not capturing.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
        (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
        (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):
        (WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):
        * UIProcess/UserMediaProcessManager.h:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isCapturingAudio const):
        (WebKit::WebPageProxy::isCapturingVideo const):
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted):
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::userMediaAccessWasGranted):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::checkDocumentsCaptureStateConsistency):
        (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):

2019-05-15  Chris Dumez  <cdumez@apple.com>

        [WK2][iOS] UIProcess may get killed because it is taking too long to release its background task after expiration
        https://bugs.webkit.org/show_bug.cgi?id=197893
        <rdar://problem/50234105>

        Reviewed by Alex Christensen.

        The UIProcess may get killed because it is taking too long to release its background task after its expiration handler
        was called. The reason is that the background task's expiration handler was sequentially sending a ProcessWillSuspendImminently
        synchronous IPC to each of its child processes and only then ends the background task. By the time we receive the response from
        all child processes, it may be too late and we get killed.

        To address the issue, we now:
        1. Send the ProcessWillSuspendImminently asynchronously so that all processes can do their processing in parallel
        2. After 2 seconds, the UIProcess releases the background task (We get killed after ~5 seconds)

        Also, to make sure that the UIProcess supends promptly, we now make sure we never start a new background task *after*
        the app has been backgrounded. The intention of our background task is too finish critical work (like releasing locked
        files) after the app gets backgrounded, not to start new work and delay process suspension.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processWillSuspendImminently):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _scheduleReleaseTask]):
        (-[WKProcessAssertionBackgroundTaskManager _cancelPendingReleaseTask]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::didReceiveSyncMessage):
        (WebKit::WebProcess::processWillSuspendImminently):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-05-15  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Make WebAuthN default on
        https://bugs.webkit.org/show_bug.cgi?id=197805
        <rdar://problem/50683699>

        Reviewed by Darin Adler.

        * Shared/WebPreferences.yaml:

2019-05-15  Youenn Fablet  <youenn@apple.com>

        Reuse existing WebPageProxy quota handler for NetworkProcessProxy quota requests
        https://bugs.webkit.org/show_bug.cgi?id=197463
        <rdar://problem/47403621>

        Reviewed by Alex Christensen.

        Add a getter to know whether websitedatastore client implements the quota delegate.
        If not, find the most visible page that is the same origin as the quota request
        and reuse the existing exceededDatabasQuota delegate.
        This approach allows to call the delegate even if the quota request comes from a service worker.
        If no such page is found, the quota will not be increased.

        Refactoring to make sure we are calling the delegate once a previous call to that delegate is completed.
        Covered by API test.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::requestStorageSpace):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::StorageRequests::add):
        (WebKit::StorageRequests::processNext):
        (WebKit::StorageRequests::areBeingProcessed const):
        (WebKit::StorageRequests::setAreBeingProcessed):
        (WebKit::StorageRequests::StorageRequests):
        (WebKit::StorageRequests::~StorageRequests):
        (WebKit::StorageRequests::singleton):
        (WebKit::WebPageProxy::forMostVisibleWebPageIfAny):
        (WebKit::WebPageProxy::didChangeMainDocument):
        (WebKit::WebPageProxy::exceededDatabaseQuota):
        (WebKit::WebPageProxy::requestStorageSpace):
        (WebKit::WebPageProxy::makeStorageSpaceRequest):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::forWebPages):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
        (WebKit::WebsiteDataStoreClient::implementsRequestStorageSpaceHandler const):

2019-05-15  Youenn Fablet  <youenn@apple.com>

        Constant crashes under WebPage::isThrottleable() after r245299
        https://bugs.webkit.org/show_bug.cgi?id=197902
        <rdar://problem/50793796>

        Reviewed by Alex Christensen.

        Update throttle state after a run loop iteration when page state changes to make sure the pageMap does not have null pages.
        Add appNapEnabled preference that is used by added API test.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateThrottleState):
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setAppNapEnabled:]):
        (-[WKPreferences _appNapEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2019-05-15  Alex Christensen  <achristensen@webkit.org>

        Allow NSFileCoordinator to be called from WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=197895
        <rdar://problem/50107679>

        Reviewed by Brent Fulgham.

        * WebProcess/com.apple.WebProcess.sb.in:
        Expand sandbox to allow use of com.apple.FileCoordination mach service like we do on iOS.

2019-05-15  Devin Rousso  <drousso@apple.com>

        Web Automation: elements larger than the viewport have incorrect in-view center point
        https://bugs.webkit.org/show_bug.cgi?id=195696
        <rdar://problem/48737122>

        Reviewed by Simon Fraser.

        Original patch by Brian Burg <bburg@apple.com>.

        This seems to be an omission in the specification. While it does mention that the in-view
        center point (IVCP) must be within the viewport, the algorithm never intersects the element
        bounding box with the viewport rect.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        This code is incorrect. For `CoordinateSystem::LayoutViewport`, coordinates should be in
        root view coordinates so that it can be later converted to screen and synthesized as a HID
        event in screen coordinates. Intersect the element rect and the viewport rect before finding
        the center point of the part of the element that's visible in the viewport.

        (WebKit::convertRectFromFrameClientToRootView): Added.
        (WebKit::convertPointFromFrameClientToRootView): Added.
        Added helpers to properly account for scroll contents position on iOS.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
        Now that we determine whether the element is inside the viewport much earlier, if the
        element has no `inViewCenterPoint`, we can return a `TargetOutOfBounds` instead of a more
        "generic" `ElementNotInteractable`.

        (WebKit::WebAutomationSession::simulateMouseInteraction):
        Rename `locationInView` -> `locationInViewport`.

        (WebKit::WebAutomationSession::simulateTouchInteraction):
        This code is incorrect. The `unobscuredContentRect` is in screen coordinates, but
        we are trying to see if (x, y) is outside the size of the viewport assumed to be at (0, 0).
        Grab the visual viewport rect and see if the location exceeds the viewport size.

        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::operator<<):
        Add logging helper for `TouchInteraction` enum.

        (WebKit::WebAutomationSession::platformSimulateTouchInteraction):
        Move local variable.

        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        Fix a typo in logging.

        * UIProcess/Automation/Automation.json:
        Simplify enum name.

        * Platform/Logging.h:
        Add logging channel to dump fully resolved interaction details.

2019-05-14  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed restoration of non-unified build.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        * UIProcess/WebProcessProxy.cpp:

2019-05-14  Youenn Fablet  <youenn@apple.com>

        A service worker process should app nap when all its clients app nap
        https://bugs.webkit.org/show_bug.cgi?id=185626
        <rdar://problem/46785908>

        Reviewed by Alex Christensen.

        Compute whether a given web process can be throttled on every page throttling change.
        Send that information to network process which stores that information in WebSWServerConnection.
        Every WebSWServerToContextConnection throttle state is then computed based on all WebSWServerConnection
        that have a client that matches the registrable domain of the context connection.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
        (WebKit::WebSWServerConnection::hasMatchingClient const):
        (WebKit::WebSWServerConnection::computeThrottleState const):
        (WebKit::WebSWServerConnection::setThrottleState):
        (WebKit::WebSWServerConnection::updateThrottleState):
        (WebKit::WebSWServerConnection::serverToContextConnectionCreated):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        (WebKit::WebSWServerConnection::isThrottleable const):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::setThrottleState):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        (WebKit::WebSWServerToContextConnection::isThrottleable const):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        * UIProcess/ServiceWorkerProcessProxy.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        (WebKit::WebSWClientConnection::updateThrottleState):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::setThrottleState):
        (WebKit::WebSWContextManagerConnection::isThrottleable const):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateUserActivity):
        (WebKit::WebPage::isThrottleable const):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::arePagesThrottleable const):
        * WebProcess/WebProcess.h:

2019-05-14  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit::WebProcessProxy::didBecomeUnresponsive()
        https://bugs.webkit.org/show_bug.cgi?id=197883
        <rdar://problem/50665984>

        Reviewed by Alex Christensen.

        Protect |this| in didBecomeUnresponsive() and didExceedCPULimit() since we call client
        delegates and those may cause |this| to get destroyed.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didBecomeUnresponsive):
        (WebKit::WebProcessProxy::didExceedCPULimit):

2019-05-14  Chris Dumez  <cdumez@apple.com>

        The network process tries to take a process assertion when NetworkProcess::processWillSuspendImminently() is called
        https://bugs.webkit.org/show_bug.cgi?id=197888

        Reviewed by Geoffrey Garen.

        When actualPrepareToSuspend() in the Network process is called set the 'IsSuspended' flag on the SQLite database tracker and unset
        the flag when the process resume. This is consistent with what we already do in the WebProcess and makes sure that
        the network process does not try and take on a new assertion due to locked files when getting notified it is about to get
        suspended.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::processWillSuspendImminently):
        (WebKit::NetworkProcess::resume):

2019-05-14  Chris Dumez  <cdumez@apple.com>

        Update TBA macros for API / SPI that has already shipped
        https://bugs.webkit.org/show_bug.cgi?id=197841
        <rdar://problem/50698499>

        Reviewed by Geoffrey Garen.

        * Configurations/WebKit.xcconfig:
        Disable header postprocessing when building for macOS Mojave

        * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
        * UIProcess/API/C/WKPage.h:
        * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextController.h:
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
        * UIProcess/API/Cocoa/WKBrowsingContextHistoryDelegate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
        * UIProcess/API/Cocoa/WKConnection.h:
        * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKProcessGroup.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKView.h:
        (WK_CLASS_DEPRECATED_WITH_REPLACEMENT):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
        * UIProcess/API/Cocoa/_WKDownload.h:
        * UIProcess/API/Cocoa/_WKFormInputSession.h:
        * UIProcess/API/Cocoa/_WKInspector.h:
        * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * WebProcess/API/Cocoa/WKWebProcess.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:

2019-05-14  Commit Queue  <commit-queue@webkit.org>

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

        Broke API Test TestWebKitAPI.Challenge.ClientCertificate
        (Requested by aakashjain on #webkit).

        Reverted changeset:

        "Add a unit test for client certificate authentication"
        https://bugs.webkit.org/show_bug.cgi?id=197800
        https://trac.webkit.org/changeset/245281

2019-05-14  Daniel Bates  <dabates@apple.com>

        [iOS] Cannot scroll to beginning of document after scrolling to end of document and vice versa via key commands
        https://bugs.webkit.org/show_bug.cgi?id=197848
        <rdar://problem/49523065>

        Reviewed by Brent Fulgham.

        Following the fix for <rdar://problem/49523065>, UIKit no longer emits a keyup event for a Command-
        modified key. This breaks WebKit's own implementation of key command handling for scrolling to the
        beginning or end of the document (triggered using Command + Arrow Up and Command + Arrow Down,
        respectively) because it watches for keyup events to reset state after initiating a scroll. If state
        is not reset then the scroll key command logic becomes confused and may not perform a subsequent scroll.
        It seems like we can actually get away with supporting these key commands and future Command modified
        commands by preemptively reseting state on keydown if the Command modifier is held down. If this does
        not work out then we can do something more complicated.

        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator handleKeyEvent:]):

2019-05-14  Brent Fulgham  <bfulgham@apple.com>

        Protect current WebFrame during form submission
        https://bugs.webkit.org/show_bug.cgi?id=197459
        <rdar://problem/50368618>

        Reviewed by Alex Christensen.

        The 'continueWillSubmitForm' method calls a completion handler that
        might affect the state of the current frame. Ensure the frame is valid
        for the scope of the function.

        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::continueWillSubmitForm):

2019-05-14  Daniel Bates  <dabates@apple.com>

        [iOS] Cannot tab or shift + tab out of address bar on google.com
        https://bugs.webkit.org/show_bug.cgi?id=197859
        <rdar://problem/46651565>

        Reviewed by Darin Adler.

        Non-editable elements can participate in tab cycling via the HTML tabindex attribute.
        We should allow setting the initial focus to such an element when transitioning from
        the chrome (e.g. address bar) to the web page.

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

2019-05-14  Alex Christensen  <achristensen@webkit.org>

        Add a unit test for client certificate authentication
        https://bugs.webkit.org/show_bug.cgi?id=197800

        Reviewed by Youenn Fablet.

        * Shared/cf/ArgumentCodersCF.cpp:
        Move SPI declarations to SecuritySPI.h.

2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Followup to r245267: fix some more deprecated uses of -[UIApplication interfaceOrientation]
        https://bugs.webkit.org/show_bug.cgi?id=197867
        <rdar://problem/50743963>

        Reviewed by Simon Fraser.

        Add a helper method on WKContentView that asks the view's window's scene for an interface orientation; then,
        use this helper from various places in WebKit instead of invoking -[UIApplication interfaceOrientation]
        directly. No change in behavior.

        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView interfaceOrientation]):
        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
        (-[WKDataListSuggestionsPicker initWithInformation:inView:]):
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorPicker initWithView:]):
        * UIProcess/ios/forms/WKFormInputControl.mm:
        (-[WKDateTimePicker initWithView:datePickerMode:]):
        * UIProcess/ios/forms/WKFormSelectPicker.mm:
        (-[WKMultipleSelectPicker initWithView:]):
        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        (-[WKSelectPopover initWithView:hasGroups:]):

2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] When running layout tests that tap in the same location, subsequent tests fail to fire click handlers
        https://bugs.webkit.org/show_bug.cgi?id=197821
        <rdar://problem/50700512>

        Reviewed by Tim Horton.

        After r244775, when running back-to-back layout tests on iOS that simulate taps in the same location, the double
        tap gesture recognizer for recognizing double clicks ends up recognizing instead of the single tap gesture
        recognizer in the subsequent test. This means that click handlers in the subsequent test will fail to recognize,
        unless the element with the click handler is also accompanied by a dblclick handler.

        To avoid this, we reset the double click gesture recognizer when navigating; this has the additional effect of
        making it such that the second page doesn't end up observing a dblclick when the first click was only sent to
        the first page.

        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _didStartProvisionalLoadForMainFrame]):

2019-05-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix some deprecation warnings when using a recent SDK

        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
        (-[WKDataListSuggestionsPicker initWithInformation:inView:]):

2019-05-13  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] InvalidStateError should be reported to sites
        https://bugs.webkit.org/show_bug.cgi?id=193269
        <rdar://problem/48298264>

        Reviewed by Brent Fulgham.

        This patch implements step 20 about InvalidStateError of the spec:
        https://www.w3.org/TR/webauthn/#createCredential.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::respondReceived):
        * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
        (WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const):

2019-05-13  Jer Noble  <jer.noble@apple.com>

        Take out MediaPlayback UI assertion when any WebProcess is playing audible media
        https://bugs.webkit.org/show_bug.cgi?id=197798

        Reviewed by Chris Dumez.

        To keep the system from suspending the UIProcess (and all the other constellation of processes that
        are necessary to play media), take a UIProcess assertion with the MediaPlayback reason whenever there
        is a WebContent process that is playing audible media.

        * Platform/spi/ios/AssertionServicesSPI.h:
        * UIProcess/ProcessAssertion.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updatePlayingMediaDidChange):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
        (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::webPageMediaStateDidChange):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::toBKSProcessAssertionReason):
        (WebKit::ProcessAssertion::ProcessAssertion):
        * WebProcess/WebProcess.h:

2019-05-13  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Crash when trying to QuickLook
        https://bugs.webkit.org/show_bug.cgi?id=197853
        <rdar://problem/49795964>

        Reviewed by Brent Fulgham.

        This is caused by a syscall sandbox violation.

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

2019-05-13  Brent Fulgham  <bfulgham@apple.com>

        Correct the sandbox to allow loading libraries from /Library/Apple 
        https://bugs.webkit.org/show_bug.cgi?id=197844

        Reviewed by Per Arne Vollan.

        Grant access to '/Library/Apple' as an appropriate place to load
        system frameworks.

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

2019-05-13  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r245240.

        Broke the build

        Reverted changeset:

        "Update TBA macros for API / SPI that has already shipped"
        https://bugs.webkit.org/show_bug.cgi?id=197841
        https://trac.webkit.org/changeset/245240

2019-05-13  Youenn Fablet  <youenn@apple.com>

        Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
        https://bugs.webkit.org/show_bug.cgi?id=197802

        Reviewed by Eric Carlson.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::registerMDNSName):

2019-05-13  Don Olmstead  <don.olmstead@sony.com>

        decidePolicyForInstallMissingMediaPluginsPermissionRequest requires GStreamer
        https://bugs.webkit.org/show_bug.cgi?id=197843

        Reviewed by Alex Christensen.

        * UIProcess/API/wpe/PageClientImpl.cpp:
        ENABLE(VIDEO) && USE(GSTREAMER)
        * UIProcess/WebPageProxy.h:
        Cleanup the declaration.

2019-05-13  Don Olmstead  <don.olmstead@sony.com>

        Move StorageManager.cpp into WebKit/Sources.txt
        https://bugs.webkit.org/show_bug.cgi?id=197842

        Reviewed by Michael Catanzaro.

        StorageManager.cpp is used by all ports so it should just go into Sources.txt.

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

2019-05-13  Chris Dumez  <cdumez@apple.com>

        Update TBA macros for API / SPI that has already shipped
        https://bugs.webkit.org/show_bug.cgi?id=197841
        <rdar://problem/50698499>

        Reviewed by Alex Christensen.

        * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
        * UIProcess/API/C/WKPage.h:
        * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextController.h:
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
        * UIProcess/API/Cocoa/WKBrowsingContextHistoryDelegate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h:
        * UIProcess/API/Cocoa/WKConnection.h:
        * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKProcessGroup.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKView.h:
        (WK_CLASS_DEPRECATED_WITH_REPLACEMENT):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
        * UIProcess/API/Cocoa/_WKDownload.h:
        * UIProcess/API/Cocoa/_WKFormInputSession.h:
        * UIProcess/API/Cocoa/_WKInspector.h:
        * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * WebProcess/API/Cocoa/WKWebProcess.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:

2019-05-13  Chris Fleizach  <cfleizach@apple.com>

        AX: Need an entitlement for WebContent to send accessibility notifications
        https://bugs.webkit.org/show_bug.cgi?id=197832

        Reviewed by Brent Fulgham.

        In order to send accessibility notifications on iOS, we need to be able to look up this port.

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

2019-05-13  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix unused variable warnings in release builds

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::clearWebProcessHasUploads):

2019-05-12  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.
        https://bugs.webkit.org/show_bug.cgi?id=197650

        Reviewed by Fujii Hironori.

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

2019-05-10  Chris Dumez  <cdumez@apple.com>

        [PSON] Prevent flashing when the process-swap is forced by the client
        https://bugs.webkit.org/show_bug.cgi?id=197799

        Reviewed by Geoffrey Garen.

        When the process-swap is forced by the client, we would not construct a SuspendedPageProxy for
        the previous page, which would cause a white/black flash upon navigation on macOS. The reason
        we did not construct a SuspendedPageProxy is that it would be unsafe to keep the page around
        in this case because other windows might have an opener link to the page when the swap is forced
        and we need those opener / openee links to get severed.

        The new approach to maintain the Web facing behavior without flashing is to create a suspended
        page proxy for the previous page when the process swap is forced by the client. We then close
        the page as soon as we can do so without flashing (when pageEnteredAcceleratedCompositingMode()
        has been called).

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::close):
        (WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
        (WebKit::SuspendedPageProxy::closeWithoutFlashing):
        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        (WebKit::WebPageProxy::commitProvisionalPage):
        * UIProcess/WebPageProxy.h:

2019-05-10  Brent Fulgham  <bfulgham@apple.com>

        Streamline test-and-clear operation for ContextMenu
        https://bugs.webkit.org/show_bug.cgi?id=197795
        <rdar://problem/50473746>

        Reviewed by Wenson Hsieh.

        Rather than performing a check when entering the function, doing work,
        then clearing the member variable, perform the check and clear in
        a single operation. Only perform the selection if the menu exists.

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

2019-05-10  Megan Gardner  <megan_gardner@apple.com>

        Returning incorrect marked text rects
        https://bugs.webkit.org/show_bug.cgi?id=197758
        <rdar://problem/46548586>

        Reviewed by Tim Horton.

        We are not returning marked text rects in the correct view coordinate space.
        This is the same translation we are applying to the caret rects. 

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

2019-05-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        Let WebKit clients supply an application name for user agent in modern compatibility mode
        https://bugs.webkit.org/show_bug.cgi?id=197782
        <rdar://problem/50646747>

        Reviewed by Beth Dakin.

        Add plumbing for a new private property on WKWebpagePreferences.

        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _applicationNameForUserAgentWithModernCompatibility]):
        (-[WKWebpagePreferences _setApplicationNameForUserAgentWithModernCompatibility:]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:

2019-05-10  Chris Dumez  <cdumez@apple.com>

        The active tab sometimes app naps even though it should not
        https://bugs.webkit.org/show_bug.cgi?id=197791
        <rdar://problem/48460054>

        Reviewed by Geoffrey Garen.

        The WebPage constructor was initializing m_activityState but not calling updateThrottleState().
        As a result, we would not take a UserActivity even when warranted by the initial activity state.

        * WebProcess/WebPage/WebPage.cpp:

2019-05-10  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] storage/indexeddb tests are timing out
        https://bugs.webkit.org/show_bug.cgi?id=196289

        Reviewed by Alex Christensen.

        storage/indexeddb tests were timing out for WinCairo port because
        WebKit::NetworkCache classes were not implemented yet for Windows.

        Implement WebKit::NetworkCache classes by using WTF::FileSystem
        functions.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::readFile): Use
        IOChannel::isOpened() to check the channel is opened instead of
        checking the file descriptor.
        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::add):
        (WebKit::NetworkCache::BlobStorage::remove):
        * NetworkProcess/cache/NetworkCacheData.cpp:
        (WebKit::NetworkCache::Data::mapToFile const):
        (WebKit::NetworkCache::mapFile):
        (WebKit::NetworkCache::adoptAndMapFile):
        (WebKit::NetworkCache::makeSalt):
        (WebKit::NetworkCache::readOrMakeSalt):
        * NetworkProcess/cache/NetworkCacheData.h:
        (WebKit::NetworkCache::Data::isEmpty const):
        (WebKit::NetworkCache::Data::size const):
        * NetworkProcess/cache/NetworkCacheDataCurl.cpp:
        (WebKit::NetworkCache::Data::Data):
        (WebKit::NetworkCache::Data::empty):
        (WebKit::NetworkCache::Data::data const):
        (WebKit::NetworkCache::Data::isNull const):
        (WebKit::NetworkCache::Data::apply const):
        (WebKit::NetworkCache::Data::subrange const):
        (WebKit::NetworkCache::concatenate):
        (WebKit::NetworkCache::Data::adoptMap): Deleted.
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::traverseDirectory):
        (WebKit::NetworkCache::fileTimes):
        (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        * NetworkProcess/cache/NetworkCacheIOChannel.h:
        (WebKit::NetworkCache::IOChannel::isOpened const):
        (WebKit::NetworkCache::IOChannel::fileDescriptor const): Deleted.
        * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
        (WebKit::NetworkCache::IOChannel::IOChannel):
        (WebKit::NetworkCache::IOChannel::~IOChannel):
        (WebKit::NetworkCache::runTaskInQueue):
        (WebKit::NetworkCache::IOChannel::read):
        (WebKit::NetworkCache::IOChannel::write):

2019-05-10  Chris Dumez  <cdumez@apple.com>

        Do not wait until requestPermission() is called to fire deviceorientation events if permission was already granted
        https://bugs.webkit.org/show_bug.cgi?id=197750

        Reviewed by Geoffrey Garen.

        The UIProcess remembers previous device orientation permission decisions per origin for the duration of the browsing
        session. However, the WebContent process was not aware of previous decisions and would therefore not fire any
        deviceorientation / devicemotion events until the JS has called requestPermission(). This patches addresses this
        problem by having the UIProcess communicate any previous permission decision for the origin via WebSitePolicies.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        * UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.cpp:
        (WebKit::WebDeviceOrientationAndMotionAccessController::shouldAllowAccess):
        (WebKit::WebDeviceOrientationAndMotionAccessController::cachedDeviceOrientationPermission const):
        (WebKit::WebDeviceOrientationAndMotionAccessController::deviceOrientationPermission const): Deleted.
        * UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.h:

2019-05-10  Chris Dumez  <cdumez@apple.com>

        Add WKWebViewConfiguration._canShowWhileLocked SPI
        https://bugs.webkit.org/show_bug.cgi?id=197777
        <rdar://problem/50065100>

        Reviewed by Tim Horton.

        * Platform/mac/LayerHostingContext.h:
        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const):
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::canShowWhileLocked const):
        (API::PageConfiguration::setCanShowWhileLocked):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration _setCanShowWhileLocked:]):
        (-[WKWebViewConfiguration _canShowWhileLocked]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
        (WebKit::RemoteLayerTreeContext::canShowWhileLocked const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_canShowWhileLocked):
        (WebKit::m_shrinkToFitContentTimer): Deleted.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::canShowWhileLocked const):

2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fix a bunch of compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=197785

        Reviewed by Don Olmstead.

        Guard Cocoa-specific format modifier to avoid -Wformat warning.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::fireConversionRequest):

2019-05-10  Chris Fleizach  <cfleizach@apple.com>

        AX: Crash at WebKit: WebKit::WebSpeechSynthesisClient::speak
        https://bugs.webkit.org/show_bug.cgi?id=197761
        <rdar://problem/50237614>

        Reviewed by Per Arne Vollan.

        It's valid for the incoming voice to be nil, so we need to protect against that.

        Tests: fast/speechsynthesis/speech-synthesis-real-client-version.html

        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp:
        (WebKit::WebSpeechSynthesisClient::speak):

2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Add webkit_frame_get_id() API
        https://bugs.webkit.org/show_bug.cgi?id=197270

        Reviewed by Carlos Garcia Campos.

        It's as simple as can be: just an API to return the ID of a frame.

        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
        (webkit_frame_get_id):
        * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
        * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt:

2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls
        https://bugs.webkit.org/show_bug.cgi?id=197271

        Reviewed by Youenn Fablet.

        * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkit_web_page_class_init):
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
        * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
        (API::InjectedBundle::FormClient::didAssociateFormControls):
        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
        (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
        * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::didAssociateFormControls):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2019-05-09  Rob Buis  <rbuis@igalia.com>

        Limit number of prefetches of a given page
        https://bugs.webkit.org/show_bug.cgi?id=197736

        Reviewed by Darin Adler.

        Limit prefetches for same url to 1.

        * NetworkProcess/cache/PrefetchCache.cpp:
        (WebKit::PrefetchCache::store):

2019-05-09  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out most of r245151.

        Caused assertions in High Sierra

        Reverted most of changeset:

        "Remove now-unnecessary Connection::sendMessageWithReply"
        https://bugs.webkit.org/show_bug.cgi?id=197747
        https://trac.webkit.org/changeset/245151

2019-05-09  Daniel Bates  <dabates@apple.com>

        [iOS] Lazily request keyboard on first hardware keydown when a non-editable element is focused
        https://bugs.webkit.org/show_bug.cgi?id=197746
        <rdar://problem/50630406>

        Reviewed by Brent Fulgham.

        Be even lazier. We only need to create a keyboard if an editable element is focused or on
        the first hardware keydown when a non-editable element is focused. We currently do the former.
        Let's also do the latter.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]): Reset bookkeeping.
        (-[WKContentView _requiresKeyboardWhenFirstResponder]): Further condition the result on
        whether we have seen a hardware keydown event in a non-editable element.
        (-[WKContentView _handleKeyUIEvent:]): If this is the first hardware key event we've seen then
        update state and call -reloadInputView. -reloadInputView will call us back in -_requiresKeyboardWhenFirstResponder
        and we will now return YES. So, it will create the keyboard.
        (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reset bookkeeping.

2019-05-08  Dean Jackson  <dino@apple.com>

        Guard long press link preview with a USE macro rather than complicated includes
        https://bugs.webkit.org/show_bug.cgi?id=197728
        <rdar://problem/50604700>

        Reviewed by Wenson Hsieh.

        It was getting complicated to manage the coordination between WebKitAdditions
        and WebKit without having to split up the includes into multiple files
        or have lots of duplication.

        Instead, WebKitAdditions will now define a USE macro which can be used
        in various places through WebKit.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dragInteraction:itemsForBeginningSession:]):
        (-[WKContentView _contentsOfUserInterfaceItem:]):
        (previewIdentifierForElementAction):
        (-[WKContentView shouldUsePreviewForLongPress]):
        (-[WKContentView _registerPreview]):
        (-[WKContentView _unregisterPreview]):
        (shouldUsePreviewForLongPress): Deleted.
        (-[WKContentView _registerPreviewLongPress]): Deleted.
        (-[WKContentView _unregisterPreviewLongPress]): Deleted.

2019-05-09  Alex Christensen  <achristensen@webkit.org>

        Remove now-unnecessary Connection::sendMessageWithReply
        https://bugs.webkit.org/show_bug.cgi?id=197747

        Reviewed by Tim Horton.

        The WebProcess messages that use it already do the right thing with CompletionHandlers and can be replaced by sendWithAsyncReply.
        The SecItemShim message that uses it can be replaced by sendSync.

        This patch only increases responsiveness when clearing website data and removes the need for a WorkQueue dedicated entirely to the SecItemShim.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::invalidate):
        (IPC::Connection::processIncomingSyncReply):
        (IPC::Connection::connectionDidClose):
        (IPC::Connection::sendMessageWithReply): Deleted.
        * Platform/IPC/Connection.h:
        (IPC::Connection::send):
        (IPC::Connection::sendWithReply): Deleted.
        * Shared/mac/SecItemResponseData.h:
        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):
        (WebKit::workQueue): Deleted.
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::fetchWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
        * WebProcess/WebProcess.messages.in:

2019-05-09  Dean Jackson  <dino@apple.com>

        Build fix for iOS.

        * UIProcess/WKImagePreviewViewController.mm:

2019-05-09  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary test SPI after r244883
        https://bugs.webkit.org/show_bug.cgi?id=197575

        Reviewed by Tim Horton.

        We now have two ways of doing the same thing.  Let's remove the one that's only for testing,
        and make the tests clean up like an application would.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removeCredential): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::removeCredential): Deleted.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _removeCredential:forProtectionSpace:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::removeCredential): Deleted.
        * UIProcess/WebProcessPool.h:

2019-05-09  Daniel Bates  <dabates@apple.com>

        REGRESSION (r241734): 1% slower PLT on iPad
        https://bugs.webkit.org/show_bug.cgi?id=197745
        <rdar://problem/50457731>

        Reviewed by Per Arne Vollan.

        For now, only create a keyboard when WKContentView becomes first responder if a hardware keyboard
        is attached or an editable element is focused to recover the 1% loss when a keyboard is not attached.
        We can do better and by that I mean be lazier. We'll do this <https://bugs.webkit.org/show_bug.cgi?id=197746>.

        In r241734 we unified the key event handling code paths so we use exactly one for both software and
        hardware key events. We took a simple approach of always requesting UIKit to create a keyboard when
        the WKContentView becomes first responder. We did this so that we could continue listening for hardware
        key events even when a non-editable element is focused and dispatch DOM events. As it turns out, always
        creating a keyboard is expensive and caused a ~1% slowdown in page load time on iPad.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _requiresKeyboardWhenFirstResponder]): Only create a keyboard if a hardware keyboard is
        attached or an editable element is focused.
        (-[WKContentView _hardwareKeyboardAvailabilityChanged]): Reload all input view (this will cause keyboard
        creation) if -_requiresKeyboardWhenFirstResponder returns YES.

2019-05-09  Daniel Bates  <dabates@apple.com>

        [iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key (hardware or software keyboard)
        https://bugs.webkit.org/show_bug.cgi?id=197632
        <rdar://problem/47902054>

        Reviewed by Brent Fulgham.

        Fixes an issue where it is not possible to submit a <form> with target = "_blank": a form that
        opens a new window.

        By default we only allow popups to open if they were user initiated (like when a person clicks
        on a link). We achieve this by putting a token on the stack, called the UserGestureToken when
        WebCore processes an event from WebKit. So long as this token is on the stack we consider
        all requests to open a popup to be user initiated. And we implicitly submit a form when pressing
        the Return key in an HTML input element during the processing of a TextInputEvent dispatched as
        part of inserting a '\n' into the field. On Mac, the keydown dispatches a TextInputEvent synchronously.
        However on iOS text insertion, and hence a dispatch of a TextInputEvent event, occurs asynchronously
        with respect to the keydown event. So, by the time the UI process calls back to the WebProcess
        to perform the text insertion of '\n' we have long since popped the UserGestureToken off the stack
        and hence we disallow opening a popup. To fix this, when -insertText is called we query the keyboard
        to determine if it's being called by the keyboard. If it is then we can assume that this is
        part of key event handling and hence was initiated by the user. We can pass along this detail
        to the WebProcess for it to push a new UserGestureToken onto the stack.

        For now we only track whether text inserted by the keyboard was user initiated or not. In
        <https://bugs.webkit.org/show_bug.cgi?id=197721> we will fix this up for all editing commands.

        * Platform/spi/ios/UIKitSPI.h: Expose SPI.
        * Shared/Cocoa/InsertTextOptions.cpp:
        (IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode):
        (IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode):
        Encode and decode whether we are processing a user gesture.

        * Shared/Cocoa/InsertTextOptions.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView insertText:]): Query the keyboard to determine whether it called us or
        the embedding client did. We only want to privilege user initiated actions (the keyboard).
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::insertTextAsync): Push a UserGestureToken onto the stack that is initialized
        depending on whether we are or are not processing a user gesture.

2019-05-09  Antoine Quint  <graouts@apple.com>

        pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html is a timeout
        https://bugs.webkit.org/show_bug.cgi?id=197738
        <rdar://problem/50588613>

        Reviewed by Antti Koivisto.

        We clear the touch actions for a given touch identifier when the matching touch is released in -[WKContentViewInteraction _handleTouchActionsForTouchEvent:].
        This happens before -[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:] is called and thus, which we correctly
        respected the touch actions during the panning gesture, we would not be able to respect them during the deceleration animation. This caused the test to fail
        because it would check that no scrolling happened after the panning gesture completed, ie. during the deceleration animation.

        To work around this, we now store the touch actions for a given UIScrollView interaction in the ScrollingTreeScrollingNodeDelegateIOS object when the interaction
        starts.

        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActions const):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::clearActiveTouchActions):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const): Deleted.

2019-05-08  Antoine Quint  <graouts@apple.com>

        [iOS] Correctly handle overlapping regions for elements with a touch-action property
        https://bugs.webkit.org/show_bug.cgi?id=194813
        <rdar://problem/48194708>

        Reviewed by Antti Koivisto.

        We now use WebKit::touchActionsForPoint() to determine the touch actions for a given touch using its location in -[WKContentViewInteraction
        _handleTouchActionsForTouchEvent:]. We then record these touch actions for the touch's identifier on the RemoteScrollingCoordinatorProxy.

        Then, as we interact with a UIScrollView, we get its gesture recognizer and get its active touch identifier through the new
        -[WKContentViewInteraction activeTouchIdentifierForGestureRecognizer:] method, and query the RemoteScrollingCoordinatorProxy for the touch
        actions matching that touch identifier.

        Tests: pointerevents/ios/touch-action-none-overlap.html
               pointerevents/ios/touch-action-pan-x-overlap.html
               pointerevents/ios/touch-action-pan-y-overlap.html
               pointerevents/ios/touch-action-pinch-zoom-overlap.html

        * UIProcess/PageClient.h:
        (WebKit::PageClient::activeTouchIdentifierForGestureRecognizer):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Maintain a touch identifier to touch actions map.
        (WebKit::RemoteScrollingCoordinatorProxy::activeTouchActionsForTouchIdentifier const):
        (WebKit::RemoteScrollingCoordinatorProxy::setTouchActionsForTouchIdentifier):
        (WebKit::RemoteScrollingCoordinatorProxy::clearTouchActionsForTouchIdentifier):
        (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataAtPoint const): Deleted.
        (WebKit::RemoteScrollingCoordinatorProxy::touchActionDataForScrollNodeID const): Deleted.
        (WebKit::RemoteScrollingCoordinatorProxy::setTouchDataForTouchIdentifier): Deleted.
        (WebKit::RemoteScrollingCoordinatorProxy::clearTouchDataForTouchIdentifier): Deleted.
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::activeTouchActionsForGestureRecognizer const):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::touchActionData const): Deleted.
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::activeTouchIdentifierForGestureRecognizer):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
        (-[WKContentView _handleTouchActionsForTouchEvent:]):

2019-05-08  Megan Gardner  <megan_gardner@apple.com>

        Add quirks to emulate undo and redo in hidden editable areas on some websites
        https://bugs.webkit.org/show_bug.cgi?id=197452

        Reviewed by Alex Christensen.

        We need to make our own undo manager to allow undo even when 
        the manager is empty. This is to interface with rich editing 
        websites that don't actually interface with our undo abilities.
        Then we need to generate synthetic undo and redo in the web process.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::isCurrentURLHost const):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKNSUndoManager initWithContentView:]):
        (-[WKNSUndoManager canUndo]):
        (-[WKNSUndoManager canRedo]):
        (-[WKNSUndoManager undo]):
        (-[WKNSUndoManager redo]):
        (-[WKContentView undoManager]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView generateSyntheticUndoRedo:]):
        (-[WKContentView hasHiddenContentEditable]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::generateSyntheticUndoRedo):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleEditingKeyboardEvent):
        (WebKit::WebPage::generateSyntheticUndoRedo):

2019-05-08  Alex Christensen  <achristensen@webkit.org>

        Add SPI to set HSTS storage directory
        https://bugs.webkit.org/show_bug.cgi?id=197259
        <rdar://problem/48797895>

        Reviewed by Brady Eidson.

        It is with great sadness that I lament the design of this SPI, which is necessitated by the process-global nature of the SPI that
        I must call and the time at which I must call it (before any networking calls have been made).
        I'm also not thrilled about the fact that the unit test infrastructure I developed for this in r244594 cannot be used because
        the SPI that I must call does not work on iOS simulator or Mac.  I have verified the SPI is being called and that when called on iOS,
        and that CFNetwork does the right thing with it.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
        (-[_WKProcessPoolConfiguration hstsStorageDirectory]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-05-08  Daniel Bates  <dabates@apple.com>

        Pass insertTextAsync options as a struct
        https://bugs.webkit.org/show_bug.cgi?id=197710

        Reviewed by Brent Fulgham.

        WebPageProxy::insertTextAsync() is becoming unwieldy to work with given the large number of
        optional arguments that can be passed to it. Let's pass a struct instead.

        * Shared/Cocoa/InsertTextOptions.cpp: Added.
        (IPC::ArgumentCoder<WebKit::InsertTextOptions>::encode):
        (IPC::ArgumentCoder<WebKit::InsertTextOptions>::decode):
        * Shared/Cocoa/InsertTextOptions.h: Added.
        * Shared/EditingRange.h: Add EnumTrait so that we can encode the EditingRangeIsRelativeTo
        enumeration.
        * SourcesCocoa.txt: Add a new file.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::insertText): Update code now that we pass a struct.
        (WebKit::WebViewImpl::setMarkedText): Ditto.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::insertTextAsync): Ditto.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView insertText:]): Ditto.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::insertDictatedTextAsync): Ditto.
        * WebKit.xcodeproj/project.pbxproj: Add new files.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::insertTextAsync): Ditto.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Ditto.

2019-05-08  Timothy Hatcher  <timothy@apple.com>

        Add plumbing for inactive system colors in RenderTheme cache.
        https://bugs.webkit.org/show_bug.cgi?id=197699
        rdar://problem/49406936

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::effectiveAppearanceIsInactive):
        * UIProcess/PageClient.h:
        (WebKit::PageClient::effectiveAppearanceIsInactive const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::useInactiveAppearance const):
        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::effectiveAppearanceIsInactive const):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetUseDarkAppearance):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_shrinkToFitContentTimer):
        (WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance.

2019-05-08  Chris Dumez  <cdumez@apple.com>

        Regression: Crash at WebKit: PAL::HysteresisActivity::start
        https://bugs.webkit.org/show_bug.cgi?id=197666
        <rdar://problem/50037153>

        Reviewed by Geoffrey Garen.

        We've recently made it so that the WebContent process destroys its WebSQLiteDatabaseTracker when preparing
        for process suspension and then re-constructs it when resuming. The issue is that the WebSQLiteDatabaseTracker
        internal implementation was calling callOnMainThread() and capturing |this| to start/stop its HysteresisActivity.
        As a result, |this| could be dead by the time we're on the main thread and we'd crash.

        To address the issue, we no longer destroy the WebSQLiteDatabaseTracker when preparing to suspend. Instead, we
        set a 'isSuspended' flag on the WebSQLiteDatabaseTracker so that it stops notifying the WebProcess of changes.

        Also clean up the class a bit so that:
        1. The constructor takes in a WTF::Function instead of a NetworkProcess / WebProcess reference. This is provides
           better layering. The WebSQLiteDatabaseTracker should not need to know anything about those objects.
        2. Use RunLoop::main().dispatch() instead of callOnMainThread() since we're in WebKit2 code.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        * Shared/WebSQLiteDatabaseTracker.cpp:
        (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
        (WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
        (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
        (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
        (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated): Deleted.
        * Shared/WebSQLiteDatabaseTracker.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::m_nonVisibleProcessCleanupTimer):
        (WebKit::WebProcess::initializeSQLiteDatabaseTracker):
        (WebKit::WebProcess::cancelPrepareToSuspend):
        (WebKit::WebProcess::processDidResume):
        (WebKit::m_webSQLiteDatabaseTracker): Deleted.
        * WebProcess/WebProcess.h:

2019-05-08  Tim Horton  <timothy_horton@apple.com>

        iOS: Selection is dismissed even if click is preventDefault()'d
        https://bugs.webkit.org/show_bug.cgi?id=197686
        <rdar://problem/49398824>

        Reviewed by Wenson Hsieh.

        We currently unconditionally dismiss the selection on any tap; however
        if a site preventDefault()s on click, we shouldn't perform the default
        action of dismissing the selection.

        Instead of clearing the selection in the UI process, clear it in the
        Web content process if we don't dispatch a synthetic click; the normal
        WebCore machinery will handle it in the case that we do.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _singleTapRecognized:]):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::commitPotentialTapFailed):
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::clearSelection):
        (WebKit::WebPage::selectTextWithGranularityAtPoint):

2019-05-08  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Support navigation gesture on touchscreens
        https://bugs.webkit.org/show_bug.cgi?id=197690

        Reviewed by Michael Catanzaro.

        Touch events generate scroll events that are handled in webkitWebViewBaseHandleWheelEvent(),
        bypassing webkitWebViewBaseScrollEvent(). Because of that, ViewGestureController never receives
        them. Hence pass scroll events to ViewGestureController in webkitWebViewBaseHandleWheelEvent()
        instead.

        For touch events, gesture progress calculation has to take window width into account to make
        the page perfectly follow finger, and deltas are additionally divided by Scrollbar::pixelsPerLineStep(),
        so compensate for that.

        For touchpad events, change delta multiplier to 10 to match GTK behavior, and introduce a 400px
        base width so the swipe speed doesn't change from the previous behavior.

        Because of the multiplier change, threshold for triggering the gesture with touchpad is now 4
        times larger.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseHandleWheelEvent): Move ViewGestureController bits here.
        (webkitWebViewBaseScrollEvent): Removed ViewGestureController bits.
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe):
        Allow events from touchscreen devices.
        (WebKit::isTouchEvent): Added.
        (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas):
        Change delta multipliers.
        (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent):
        Change delta multipliers, account for view width for touchscreen events.

2019-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Add a quirk to synthesize mouse events when modifying the selection
        https://bugs.webkit.org/show_bug.cgi?id=197683
        <rdar://problem/48003980>

        Reviewed by Tim Horton.

        Introduces support for dispatching synthetic mouse events when modifying the selection on some websites. See
        below for more details.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::selectAll):
        * UIProcess/WebPageProxy.h:

        Instead of executing a "SelectAll" editing command using the generic WebPage::executeEditCommand method,
        introduce a separate method for selectAll that executes the "SelectAll" edit command and then does some
        platform-specific work. See platformDidSelectAll.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView selectAllForWebView:]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::selectAll):
        (WebKit::WebPage::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):

        Add a helper method to determine whether the quirk should be enabled.

        (WebKit::WebPage::platformDidSelectAll):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::elementRectInRootViewCoordinates):

        Move this function closer to the top of the file so that it can be used in
        dispatchSyntheticMouseEventsForSelectionGesture.

        (WebKit::WebPage::clearSelection):
        (WebKit::WebPage::dispatchSyntheticMouseEventsForSelectionGesture):

        Add a helper method to dispatch a synthetic mouse event for a given selection gesture type. Used in several
        places in WebPageIOS to synthesize and dispatch mouse events during selection.

        (WebKit::WebPage::updateSelectionWithTouches):

        When changing the selection with selection handles, fake mousedown when the user first touches down on the
        selection handle; mousemove as the user is moving the handle around; and finally, mouseup when the user lets go.

        (WebKit::WebPage::extendSelection):
        (WebKit::WebPage::platformDidSelectAll):

        When tapping "Select All" and/or "Select" in the callout menu, fake a mousedown at the selection start, then a
        mousemove at selection end, and finally, a mouseup at selection end.

        (WebKit::WebPage::getFocusedElementInformation):

2019-05-08  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Pinch Zooming has no maximum
        https://bugs.webkit.org/show_bug.cgi?id=194865

        Reviewed by Michael Catanzaro.

        Set maximum zoom to 3.0, reflecting the value on macOS and iOS.

        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::ZoomGesture::scaleChanged):

2019-05-08  Rob Buis  <rbuis@igalia.com>

        Link prefetch not useful for top-level navigation
        https://bugs.webkit.org/show_bug.cgi?id=195623

        Reviewed by Youenn Fablet.

        Cache cross-domain top-level prefetches in a dedicated cache. When a navigation
        to the same url is done within a threshold (5 seconds), reuse the
        prefetch cache entry, move it to the disk cache and navigate to
        the url, meaning no extra network trip is needed. When not used within
        the threshold period, the prefetch entry will be erased using a timer.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didReceiveBuffer):
        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
        (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::prefetchCache):
        (WebKit::NetworkSession::clearPrefetchCache):
        * NetworkProcess/cache/PrefetchCache.cpp: Added.
        (WebKit::PrefetchCache::Entry::Entry):
        (WebKit::PrefetchCache::PrefetchCache):
        (WebKit::PrefetchCache::~PrefetchCache):
        (WebKit::PrefetchCache::clear):
        (WebKit::PrefetchCache::take):
        (WebKit::PrefetchCache::store):
        (WebKit::PrefetchCache::clearExpiredEntries):
        * NetworkProcess/cache/PrefetchCache.h: Added.
        (WebKit::PrefetchCache::Entry::releaseBuffer):
        * Shared/WebPreferences.yaml:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-05-07  Chris Dumez  <cdumez@apple.com>

        Simplify logic to prevent App Nap in WebPage
        https://bugs.webkit.org/show_bug.cgi?id=197674

        Reviewed by Geoff Garen.

        Simplify logic to prevent App Nap in WebPage. We do not need both m_userActivityHysteresis and
        m_userActivity since UserActivity is already a HysteresisActivity. We had 2 levels of
        HysteresisActivity stacked on top of one another. Also rename "process suppression" to "app nap" as
        I find it clearer.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateThrottleState):
        (WebKit::WebPage::mouseEvent):
        (WebKit::WebPage::wheelEvent):
        (WebKit::WebPage::keyEvent):
        (WebKit::WebPage::updatePreferences):
        (WebKit::m_userActivityHysteresis): Deleted.
        (WebKit::WebPage::updateUserActivity): Deleted.
        * WebProcess/WebPage/WebPage.h:

2019-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r244230): Web Automation: use null instead of empty string as success result of scripts when alert is open
        https://bugs.webkit.org/show_bug.cgi?id=197655

        Reviewed by Devin Rousso.

        This regressed in r244230, the case of an alert open while running a script is now handled in WebKit side, but
        an empty string is returned as a result, which is not a valid JSON serialized string. That made all user prompts
        tests to fail.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::willShowJavaScriptDialog): Use null as script result instead of an empty string.

2019-05-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r245038.

        Breaks internal builds.

        Reverted changeset:

        "Add SPI to set a list of hosts to which to send custom header
        fields cross-origin"
        https://bugs.webkit.org/show_bug.cgi?id=197397
        https://trac.webkit.org/changeset/245038

2019-05-07  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] A new request should always suppress the pending request if any
        https://bugs.webkit.org/show_bug.cgi?id=191517
        <rdar://problem/46888222>

        Reviewed by Brent Fulgham.

        Previously we blocked new WebAuthN requests whenever a pending request was in progress
        to prevent background tabs from DoS foreground tabs. However, in r244938, the WebAuthN
        API was changed to restrict request handling to the focused document. Therefore, we no
        longer have a risk of DoS.

        Apart from the vanished benefit, this behavoir actually blocks new pages to use
        WebAuthN API in the period between [the previous initating page is closed, the pending
        request is hanedled/timeout].

        Also, it makes sense to have the current focused document preempt the pending request.
        Therefore, the policy will be to always cancel any pending requests whenever a new
        request is made. This will enforce the policy of handling only one request at a time.

        Note that the current implementation doesn't explicitly cancel pending requests in the
        Authenticators, which means that we could receive responses from the Authenticator that
        were meant for a previous (now cancelled) request. A follow-up patch (see Bug 191523)
        will implement an Authenticator feature to support immediate cancellation.

        In the meantime, to protect the atomicity of the request/response pair, i.e., preventing an old
        response being used for a new request, there are two safeguards:
        1) In web process, each request to UI process is paired with an incremental ID, and therefore an old
        response from UI process would have a different ID than the current request, which will then be ignored.
        2) In UI process, all responses from authenticators will be piped to the main run loop for processing.
        Therefore, when the new request comes in, the old response is either processed or waiting in the pipe.
        To prevent the latter being processed, the new request will immediately destroy any authenticators bound
        to the old response in the current run loop. Hence, in the next run loop when dealing the old response,
        the lambda will have no where to hand the response over.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::makeCredential):
        (WebKit::AuthenticatorManager::getAssertion):
        (WebKit::AuthenticatorManager::clearStateAsync):
        (WebKit::AuthenticatorManager::clearState):
        (WebKit::AuthenticatorManager::timeOutTimerFired):
        * UIProcess/WebAuthentication/AuthenticatorManager.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        (WebKit::WebAuthenticatorCoordinatorProxy::requestReply):
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in:
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):
        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in:

2019-05-07  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Crash with sandbox error
        https://bugs.webkit.org/show_bug.cgi?id=197675
        <rdar://problem/50473330>

        Reviewed by Geoffrey Garen.

        This crash is caused by missing syscall rules in the sandbox.

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

2019-05-07  Alex Christensen  <achristensen@webkit.org>

        Add SPI to set a list of hosts to which to send custom header fields cross-origin
        https://bugs.webkit.org/show_bug.cgi?id=197397

        Reviewed by Geoff Garen.

        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::decode):
        * Shared/WebsitePoliciesData.h:
        * SourcesCocoa.txt:
        * UIProcess/API/APICustomHeaderFields.h: Added.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::WebsitePolicies):
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        (WKWebsitePoliciesCopyCustomHeaderFields):
        (WKWebsitePoliciesSetCustomHeaderFields):
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _customHeaderFields]):
        (-[WKWebpagePreferences _setCustomHeaderFields:]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.h: Added.
        * UIProcess/API/Cocoa/_WKCustomHeaderFields.mm: Added.
        (-[_WKCustomHeaderFields init]):
        (-[_WKCustomHeaderFields dealloc]):
        (-[_WKCustomHeaderFields fields]):
        (-[_WKCustomHeaderFields setFields:]):
        (-[_WKCustomHeaderFields thirdPartyDomains]):
        (-[_WKCustomHeaderFields setThirdPartyDomains:]):
        (-[_WKCustomHeaderFields _apiObject]):
        * UIProcess/API/Cocoa/_WKCustomHeaderFieldsInternal.h: Added.
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies customHeaderFields]): Deleted.
        (-[_WKWebsitePolicies setCustomHeaderFields:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::takeFocus):
        (WebKit::WebViewImpl::accessibilityAttributeValue):
        * WebKit.xcodeproj/project.pbxproj:

2019-05-07  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Cannot build documentation with gtk-doc
        https://bugs.webkit.org/show_bug.cgi?id=197663

        Reviewed by Philippe Normand.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init): Escape content which gets wrongly interpreted as
        SGML tags by gtk-doc as Markdown preformatted content, which fits well for the
        tag names in the documentation for the WebKitSettings:enable-media property.

2019-05-07  John Wilander  <wilander@apple.com>

        Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
        https://bugs.webkit.org/show_bug.cgi?id=197648
        <rdar://problem/50527493>

        Reviewed by Chris Dumez.

        Developers have requested two minor changes to the Storage Access API:
        - Only consume the user gesture when the user explicitly denies access.
        - Make document.hasStorageAccess() return true instead of false when the feature is off.

        In addition to this, we have refactoring and cleanup to do. Namely:
        - Make use of WebCore::RegistrableDomain all the way.
        - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess.
        - Introduce boolean enums for state handling.
        - Break out the Storage Access API functionality into a supplement of WebCore::Document.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt const):
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown.
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted): Deleted.
            This function is now no longer exposed and its functionality could be folded into
            the existing WebResourceLoadStatisticsStore::requestStorageAccess() which is more
            clearly named.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::hasStorageAccessForFrame): Deleted.
        (WebKit::NetworkProcess::hasStorageAccess): Deleted.
        (WebKit::NetworkProcess::requestStorageAccess): Deleted.
        (WebKit::NetworkProcess::requestStorageAccessGranted): Deleted.
        (WebKit::NetworkProcess::grantStorageAccess): Deleted.
        (WebKit::NetworkProcess::removeAllStorageAccess): Deleted.
            These functions were left behind in the move of ITP to the network process.
            This communication goes through WebKit::NetworkConnectionToWebProcess since a while back.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Scripts/webkit/messages.py:
            Instructions for derived IPC code on how to include the new enums
            WebCore::StorageAccessWasGranted and WebCore::StorageAccessPromptWasShown.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::hasStorageAccessForFrame): Deleted.
        (WebKit::NetworkProcessProxy::hasStorageAccess): Deleted.
        (WebKit::NetworkProcessProxy::requestStorageAccess): Deleted.
        (WebKit::NetworkProcessProxy::grantStorageAccess): Deleted.
        (WebKit::NetworkProcessProxy::removeAllStorageAccess): Deleted.
            These functions were left behind in the move of ITP to the network process.
            This communication goes through WebKit::NetworkConnectionToWebProcess since a while back.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::hasStorageAccess): Deleted.
        (WebKit::WebsiteDataStore::requestStorageAccess): Deleted.
        (WebKit::WebsiteDataStore::grantStorageAccess): Deleted.
            These functions were left behind in the move of ITP to the network process.
            This communication goes through WebKit::NetworkConnectionToWebProcess since a while back.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::hasStorageAccess):
        (WebKit::WebChromeClient::requestStorageAccess):
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown. They also receive WebCore::RegistrableDomain
            objects instead of Strings now.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::hasStorageAccess):
        (WebKit::WebPage::requestStorageAccess):
            These changes are due to the new enums WebCore::StorageAccessWasGranted and
            WebCore::StorageAccessPromptWasShown. They also receive WebCore::RegistrableDomain
            objects instead of Strings now.
        * WebProcess/WebPage/WebPage.h:

2019-05-07  John Wilander  <wilander@apple.com>

        Change IsITPFirstPartyWebsiteDataRemovalEnabled from DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to true.
        https://bugs.webkit.org/show_bug.cgi?id=197667
        <rdar://problem/50549288>

        Reviewed by Brent Fulgham.

        * Shared/WebPreferences.yaml:

2019-05-07  Tim Horton  <timothy_horton@apple.com>

        iOSMac Share Sheet shows up at the wrong place
        https://bugs.webkit.org/show_bug.cgi?id=197649
        <rdar://problem/49922942>

        Reviewed by Megan Gardner.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showShareSheet:inRect:completionHandler:]):
        (-[WKContentView _hoverGestureRecognizerChanged:]):
        Pass the last mouse-over location as the presentation location for the 
        share sheet, if we don't have a rect to present from. Centering the popover
        like we do on iPad doesn't work so well (at all) with a macOS context menu.

2019-05-07  Chris Dumez  <cdumez@apple.com>

        Rename ConnectionMac.mm to ConnectionCocoa.mm since it is used on both macOS and iOS
        https://bugs.webkit.org/show_bug.cgi?id=197661

        Reviewed by Alexey Proskuryakov.

        * Platform/IPC/cocoa/ConnectionCocoa.mm: Renamed from Source/WebKit/Platform/IPC/mac/ConnectionMac.mm.
        (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
        (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
        (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
        (IPC::Connection::platformInvalidate):
        (IPC::Connection::cancelReceiveSource):
        (IPC::Connection::terminateSoon):
        (IPC::Connection::platformInitialize):
        (IPC::Connection::open):
        (IPC::Connection::sendMessage):
        (IPC::Connection::platformCanSendOutgoingMessages const):
        (IPC::Connection::sendOutgoingMessage):
        (IPC::Connection::initializeSendSource):
        (IPC::Connection::resumeSendSource):
        (IPC::createMessageDecoder):
        (IPC::readFromMachPort):
        (IPC::Connection::receiveSourceEventHandler):
        (IPC::Connection::identifier const):
        (IPC::Connection::getAuditToken):
        (IPC::Connection::kill):
        (IPC::AccessibilityProcessSuspendedNotification):
        (IPC::Connection::willSendSyncMessage):
        (IPC::Connection::didReceiveSyncReply):
        (IPC::Connection::remoteProcessID const):
        * Platform/IPC/cocoa/ImportanceAssertion.h: Renamed from Source/WebKit/Platform/IPC/mac/ImportanceAssertion.h.
        (IPC::ImportanceAssertion::ImportanceAssertion):
        (IPC::ImportanceAssertion::~ImportanceAssertion):
        * Platform/IPC/cocoa/MachMessage.cpp: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.cpp.
        (IPC::MachMessage::create):
        (IPC::MachMessage::MachMessage):
        (IPC::MachMessage::~MachMessage):
        (IPC::MachMessage::messageSize):
        (IPC::MachMessage::leakDescriptors):
        * Platform/IPC/cocoa/MachMessage.h: Renamed from Source/WebKit/Platform/IPC/mac/MachMessage.h.
        (IPC::MachMessage::size const):
        (IPC::MachMessage::header):
        (IPC::MachMessage::messageReceiverName const):
        (IPC::MachMessage::messageName const):
        * Platform/IPC/cocoa/MachPort.h: Renamed from Source/WebKit/Platform/IPC/mac/MachPort.h.
        (IPC::MachPort::MachPort):
        (IPC::MachPort::encode const):
        (IPC::MachPort::decode):
        (IPC::MachPort::port const):
        (IPC::MachPort::disposition const):
        * PlatformMac.cmake:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-05-07  Antti Koivisto  <antti@apple.com>

        <body> with overflow:hidden shouldn't be keyboard scrollable on iOS
        https://bugs.webkit.org/show_bug.cgi?id=197659
        <rdar://problem/50541453>

        Reviewed by Antoine Quint.

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

        Disable also keyboard scrolling when touch scrolling is disabled.

2019-05-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Avoid crashing the UI process when writing empty data to the pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=197644
        <rdar://problem/50526364>

        Reviewed by Tim Horton.

        Test: WebKit.WKWebProcessPlugInDoNotCrashWhenCopyingEmptyClientData

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::setBufferForType):

        Make this function robust by not attempting to create a shared memory buffer in the case where the given data
        buffer is empty.

2019-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash in webkitWebViewBaseSetEnableBackForwardNavigationGesture
        https://bugs.webkit.org/show_bug.cgi?id=197653

        Reviewed by Žan Doberšek.

        We still need to null-check the ViewGestureController there, since it can be called with a running process but
        not yet attached when using a related view.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSetEnableBackForwardNavigationGesture):

2019-05-07  Antti Koivisto  <antti@apple.com>

        <body> with overflow:hidden CSS is scrollable on iOS
        https://bugs.webkit.org/show_bug.cgi?id=153852
        <rdar://problem/38715356>

        Reviewed by Antoine Quint.

        Disable touch scrolling of the main scroll view when <body> has overflow:hidden.

        This already works for subframes where we don't create a scrollview in the first place.
        The patch also adds a test for that.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):

        Update scrollability after scrolling tree commits.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):

        Base the decision on root ScrollingTreeScrollingNode::canHaveScrollbars() which is computed from overflow.
        This matches Mac where wheel event dispatch is similarly blocked based on this property.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:

2019-05-06  James Savage  <james.savage@apple.com>

        Improve coordination for creating UIWindow instances.
        https://bugs.webkit.org/show_bug.cgi?id=197578.
        <rdar://problem/50456965>.

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (makeWindowFromView): Pull out window creation.
        (-[WKFullScreenWindowController enterFullScreen]): Call new helper function.

2019-05-06  Tim Horton  <timothy_horton@apple.com>

        _overrideViewportWithArguments does not work when called before loading
        https://bugs.webkit.org/show_bug.cgi?id=197638
        <rdar://problem/50505111>

        Reviewed by Wenson Hsieh.

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

2019-05-06  Chris Dumez  <cdumez@apple.com>

        ASSERT at WebKit::NetworkCache::makeSafeToUseMemoryMapForPath under Storage::StoreBodyAsBlob when running WebDriver tests
        https://bugs.webkit.org/show_bug.cgi?id=197635
        <rdar://problem/50473149>

        Reviewed by Geoffrey Garen.

        We need to make sure the the path at blobPathString exists before calling FileSystem::makeSafeToUseMemoryMapForPath().
        If the blob does not already exist when BlobStorage::add() is called, what will create it is the call to Data::mapToFile().

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::add):

2019-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Occasional crashes in layout tests when firing the shrink-to-fit-content timer
        https://bugs.webkit.org/show_bug.cgi?id=197629
        <rdar://problem/50514382>

        Reviewed by Tim Horton.

        Fixes several crashing layout tests by stopping the shrink-to-fit-content timer when the page closes.

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

2019-05-04  Per Arne Vollan  <pvollan@apple.com>

        -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
        https://bugs.webkit.org/show_bug.cgi?id=197510

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):

2019-05-06  Keith Rollin  <krollin@apple.com>

        Temporarily disable generate-xcfilelists
        https://bugs.webkit.org/show_bug.cgi?id=197619
        <rdar://problem/50507392>

        Reviewed by Alex Christensen.

        We need to perform a significant update to the generate-xcfilelist
        scripts. This work involves coordinated work with another facility. If
        the work does not occur in tandem, the build will be broken. To avoid
        this, disable the invoking of the scripts during the transition. The
        checking will be restored once the new scripts are in place.

        * Scripts/check-xcfilelists.sh:

2019-05-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed build fix after r244984.

        * WebProcess/cocoa/WebProcessCocoa.mm:

2019-05-06  Chris Dumez  <cdumez@apple.com>

        Prewarmed WebContent processes never app nap
        https://bugs.webkit.org/show_bug.cgi?id=197630

        Reviewed by Geoffrey Garen.

        Do not require actually having a WebPage in the WebContent process to App Nap.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateThrottleState):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2019-05-06  Daniel Bates  <dabates@apple.com>

        Fix the build after r244975
        (https://bugs.webkit.org/show_bug.cgi?id=197474)

        Actually make use of the Keyboard Event when building with USE(UIKIT_KEYBOARD_ADDITIONS)
        and substitute -> for . since it's now passed by reference.

        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::handleInputMethodKeydown):

2019-05-06  Jer Noble  <jer.noble@apple.com>

        Adopt AVStreamDataParser.audiovisualMIMETypes
        https://bugs.webkit.org/show_bug.cgi?id=197581
        <rdar://problem/50458981>

        Reviewed by Eric Carlson.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::platformTerminate):
        (WebKit::WebProcess::setMediaMIMETypes):

2019-05-06  Chris Dumez  <cdumez@apple.com>

        Terminate service workers that use too much CPU / power
        https://bugs.webkit.org/show_bug.cgi?id=197626
        <rdar://problem/50374707>

        Reviewed by Geoffrey Garen.

        Terminate service worker processes that use over 50% CPU on average over the last 8 minutes,
        similarly to what we do for background WebContent processes.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didExceedCPULimit):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updateCPULimit):
        (WebKit::WebProcess::updateCPUMonitorState):

2019-05-06  Daniel Bates  <dabates@apple.com>

        Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard
        https://bugs.webkit.org/show_bug.cgi?id=197474
        <rdar://problem/47219324>

        Reviewed by Ryosuke Niwa.

        Adopt UIKit SPI (added in <rdar://problem/50181162>) to ask the Input Manager to handle
        the key event. If the Input Manager handled it then we pass along this information to
        WebCore, just as we do for Mac, so that it can alter its event handling logic. Otherwise,
        we handle the event as we do now.

        A large part of this patch is fixing up #if defs to compile more Mac code when building
        on iOS.

        * Platform/spi/ios/UIKitSPI.h: Expose more SPI.
        * Shared/NativeWebKeyboardEvent.h:
        * Shared/WebEvent.h:
        * Shared/WebEventConversion.cpp:
        (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
        * Shared/WebKeyboardEvent.cpp:
        (WebKit::WebKeyboardEvent::WebKeyboardEvent):
        (WebKit::WebKeyboardEvent::encode const):
        (WebKit::WebKeyboardEvent::decode):
        * Shared/ios/NativeWebKeyboardEventIOS.mm:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
        * Shared/ios/WebIOSEventFactory.h:
        * Shared/ios/WebIOSEventFactory.mm:
        (WebIOSEventFactory::createWebKeyboardEvent):
        Compile more Mac code on iOS. Just like on Mac we maintain some bookkeeping on
        whether an event was handled by the Input Manager.

        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::WebAutomationSession::sendSynthesizedEventsToPage): Pass NativeWebKeyboardEvent::HandledByInputMethod::No
        to keep the behavior we have now.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView shouldSuppressUpdateCandidateView]): Added. Used to tell UIKit whether to
        suppress updating/showing the candidate view.
        (-[WKContentView setMarkedText:selectedRange:]):
        Bookkeeping to track whether we need to delay showing/updating the inline candidate view.
        The concept in UIKit is deferment, but at the time of writing its simply a request to delay
        the update for 0.4 seconds. We opt into this delay only for the first key that begins
        marked text (i.e. the transition from no marked text to marked text). We do this because we
        may not have up-to-date editor state at the time UIKit is ready to show/update the inline
        candidate view for us to answer -textFirstRect and -textLastRect, which UIKit calls as part
        of computing the frame rect for the inline candidate view on screen. Once we receive up-to-date
        editor state, in -selectionChanged, we tell UIKit to layout the keyboard, which ultimately
        causes it to re-compute the frame rect for the inline candidate view and show it.

        (-[WKContentView handleKeyWebEvent:]): Pass NativeWebKeyboardEvent::HandledByInputMethod::No
        to keep the behavior we have now. 
        (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): Ask the keyboard to handle the
        event using the Input Manager. If it was handled then there is no need to delay calling the
        completion handler, call it, then tell the web process about the key event and that it was
        already handled by the Input Manager.
        (-[WKContentView _selectionChanged]): Tell the keyboard to update the candidate view, if needed.
        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::handleInputMethodKeydown): Mark the event as default handled if
        the UI process told us that the event was handled by the Input Manager just like we do on Mac.

2019-05-06  Alex Christensen  <achristensen@webkit.org>

        Null check m_mainFrame in WebPageProxy.cpp
        https://bugs.webkit.org/show_bug.cgi?id=197618
        <rdar://problem/47463054>

        Reviewed by Geoffrey Garen.

        It's already null checked in some places, and the places where it isn't are causing crashes.
        Let's fix all of them.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
        (WebKit::WebPageProxy::createNewPage):

2019-05-06  Brent Fulgham  <bfulgham@apple.com>

        Use more efficient path resolution logic
        https://bugs.webkit.org/show_bug.cgi?id=197389
        <rdar://problem/50268491>

        Reviewed by Maciej Stachowiak.

        The code in SandboxExtensionsCocoa.mm 'resolveSymlinksInPath' is pretty inefficient, and tries to reproduce (badly)
        logic that is already provided by the operating system.

        To make matters worse, 'resolvePathForSandboxExtension' was effectively performing the work of fully resolving
        symlinks twice, since NSString's 'stringByStandardizingPath' method does some of this already.

        Instead, we should just use NSString's 'stringByResolvingSymlinksInPath', which does the symlink resolution
        using more efficient logic than our 'resolveSymlinksInPath' code.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::resolveSymlinksInPath): Removed.
        (WebKit::resolvePathForSandboxExtension): Remove redundant call to 'resolveSymlinksInPath', and switches from
        'stringByStandardizingPath' to 'stringByResolvingSymlinksInPath', which can take the place of both calls.
        (WebKit::stringByResolvingSymlinksInPath): Switch to call 'stringByResolvingSymlinksInPath'.

2019-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Introduce SPI to request modern compatibility mode but defer to site-specific quirks
        https://bugs.webkit.org/show_bug.cgi?id=197614
        <rdar://problem/50208577>

        Reviewed by Tim Horton.

        Add plumbing for a new _allowSiteSpecificQuirksToOverrideCompatibilityMode SPI property on
        WKWebpagePreferences.

        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (-[WKWebpagePreferences _allowSiteSpecificQuirksToOverrideCompatibilityMode]):
        (-[WKWebpagePreferences _setAllowSiteSpecificQuirksToOverrideCompatibilityMode:]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h:
        * UIProcess/WebPageProxy.cpp:

        Use currentRequest instead of originalRequest; see internal change for more details.

        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

2019-05-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r244917.

        Caused
        TestWebKitAPI.WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog
        failure on debug bots.

        Reverted changeset:

        "Use more efficient path resolution logic"
        https://bugs.webkit.org/show_bug.cgi?id=197389
        https://trac.webkit.org/changeset/244917

2019-05-04  Alex Christensen  <achristensen@webkit.org>

        Revert r244953 and r244954 because they broke internal builds.
        https://bugs.webkit.org/show_bug.cgi?id=197534

        * Platform/spi/ios/PDFKitSPI.h:
        * Platform/spi/ios/UIKitSPI.h: Added.
        (currentUserInterfaceIdiomIsPad):
        * Shared/DocumentEditingContext.mm:
        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        * Shared/ios/NativeWebKeyboardEventIOS.mm:
        * Shared/ios/NativeWebTouchEventIOS.mm:
        * Shared/ios/WebIconUtilities.mm:
        * UIProcess/API/Cocoa/NSAttributedString.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/ApplicationStateTracker.mm:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
        * UIProcess/Cocoa/WKShareSheet.mm:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        * UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        * UIProcess/WKImagePreviewViewController.mm:
        * UIProcess/_WKTouchEventGenerator.mm:
        * UIProcess/ios/DragDropInteractionState.h:
        * UIProcess/ios/InputViewUpdateDeferrer.mm:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/SmartMagnificationController.mm:
        * UIProcess/ios/TextCheckerIOS.mm:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        * UIProcess/ios/WKActionSheet.mm:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        * UIProcess/ios/WKContentView.mm:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        * UIProcess/ios/WKPDFPageNumberIndicator.mm:
        * UIProcess/ios/WKPDFView.mm:
        * UIProcess/ios/WKPasswordView.mm:
        * UIProcess/ios/WKScrollView.h:
        * UIProcess/ios/WKScrollView.mm:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
        * UIProcess/ios/WKWebEvent.mm:
        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        * UIProcess/ios/forms/WKFocusedFormControlView.h:
        * UIProcess/ios/forms/WKFormColorControl.mm:
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        * UIProcess/ios/forms/WKFormInputControl.mm:
        * UIProcess/ios/forms/WKFormPopover.mm:
        * UIProcess/ios/forms/WKFormSelectControl.h:
        * UIProcess/ios/forms/WKFormSelectControl.mm:
        * UIProcess/ios/forms/WKFormSelectPicker.mm:
        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        * UIProcess/ios/forms/WKNumberPadViewController.mm:
        * UIProcess/ios/forms/WKQuickboardListViewController.h:
        * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2019-05-04  Alex Christensen  <achristensen@webkit.org>

        Merge the three UIKitSPI.h files into a single one in PAL
        https://bugs.webkit.org/show_bug.cgi?id=197534

        Reviewed by Darin Adler.

        * Platform/spi/ios/PDFKitSPI.h:
        * Platform/spi/ios/UIKitSPI.h: Removed.
        * Shared/DocumentEditingContext.mm:
        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        * Shared/ios/NativeWebKeyboardEventIOS.mm:
        * Shared/ios/NativeWebTouchEventIOS.mm:
        * Shared/ios/WebIconUtilities.mm:
        * UIProcess/API/Cocoa/NSAttributedString.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/ApplicationStateTracker.mm:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
        * UIProcess/Cocoa/WKShareSheet.mm:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        * UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        * UIProcess/WKImagePreviewViewController.mm:
        * UIProcess/_WKTouchEventGenerator.mm:
        * UIProcess/ios/DragDropInteractionState.h:
        * UIProcess/ios/InputViewUpdateDeferrer.mm:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/SmartMagnificationController.mm:
        * UIProcess/ios/TextCheckerIOS.mm:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        * UIProcess/ios/WKActionSheet.mm:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        * UIProcess/ios/WKContentView.mm:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        * UIProcess/ios/WKPDFPageNumberIndicator.mm:
        * UIProcess/ios/WKPDFView.mm:
        * UIProcess/ios/WKPasswordView.mm:
        * UIProcess/ios/WKScrollView.h:
        * UIProcess/ios/WKScrollView.mm:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
        * UIProcess/ios/WKWebEvent.mm:
        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        * UIProcess/ios/forms/WKFocusedFormControlView.h:
        * UIProcess/ios/forms/WKFormColorControl.mm:
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        * UIProcess/ios/forms/WKFormInputControl.mm:
        * UIProcess/ios/forms/WKFormPopover.mm:
        * UIProcess/ios/forms/WKFormSelectControl.h:
        * UIProcess/ios/forms/WKFormSelectControl.mm:
        * UIProcess/ios/forms/WKFormSelectPicker.mm:
        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        * UIProcess/ios/forms/WKNumberPadViewController.mm:
        * UIProcess/ios/forms/WKQuickboardListViewController.h:
        * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2019-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r244897): Caret may appear wider than normal after zooming to focus an editable element
        https://bugs.webkit.org/show_bug.cgi?id=197579

        Reviewed by Tim Horton.

        Fixes a couple of flaky tests (CaretSelectionRectAfterRestoringFirstResponderWithRetainActiveFocusedState and
        CaretSelectionRectAfterRestoringFirstResponder) that began failing after r244897. These tests both begin by
        focusing an editable element, which causes the web view to zoom in. The tests subsequently check that the caret
        rect is {{ 16, 13 }, { 2, 15 }}. While the specified caret rect (coming from EditorState) is {{ 16, 13 }, { 3,
        15 }}, the narrower caret rect is used because we take measures to preserve the width of the caret relative to
        the view (see the inverse scaling logic in -[WKContentView selectedTextRange] for more details).

        See below for more details.

        * UIProcess/ios/WKContentViewInteraction.h:

        Remove _isZoomingToRevealFocusedElement, now that we don't need it anymore (see -observeValueForKeyPath:).

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):

        Stop bailing from a selection update when changing scale, while zooming to reveal the focused element. This
        check was added in r239441 to prevent UIWKTextInteractionAssistant's selection scrolling logic from interfering
        with WKContentView-driven logic for zooming to the focused element. However, since r244141, this is no longer
        necessary since selection scrolling is only driven by code in the web process.

        This new update while zooming to reveal the focused element ensures that the WKTextRange returned by
        -selectedTextRange after zooming will have a width that is inversely scaled using the content view's current
        scale, such that it has a consistent width (relative to the web view) across different scales.

        (-[WKContentView _zoomToRevealFocusedElement]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::layerTreeCommitComplete):

        Remove any attempt here to notify PageClient about editor states after focus. This logic was actually incorrect,
        since it didn't ensure that the layer tree commit that is being completed actually contained an editor state; as
        such, the "editor state" received here could be stale.

2019-05-03  Zalan Bujtas  <zalan@apple.com>

        [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
        https://bugs.webkit.org/show_bug.cgi?id=197573
        <rdar://problem/48008441>

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::adjustLayoutSizeIfNeeded):
        (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::immediatelyShrinkToFitContent):

2019-05-03  Dean Jackson  <dino@apple.com>

        Make imageForElementActionType a class method on _WKElementAction
        https://bugs.webkit.org/show_bug.cgi?id=197588
        <rdar://problem/50463157>

        Reviewed by Wenson Hsieh.

        Make this helper function a class method, so that it can
        be more easily detected.

        * UIProcess/API/Cocoa/_WKElementAction.h:
        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]):
        (_WKUIImageForElementActionType): Deleted.

2019-05-03  Chris Dumez  <cdumez@apple.com>

        Unresponsive Service Worker processes should get killed
        https://bugs.webkit.org/show_bug.cgi?id=197580
        <rdar://problem/50458239>

        Reviewed by Geoffrey Garen.

        Enable the background responsiveness logic for service worker processes so that they get
        killed if they becomes unresponsive. The logic was previously not enabling the timer for
        service worker processes because it required having a page.

        * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
        (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didBecomeUnresponsive):
        (WebKit::WebProcessProxy::didFinishLaunching):

2019-05-03  Youenn Fablet  <youenn@apple.com>

        [iOS] set the default maximum camera count to 1 for enumerateDevices
        https://bugs.webkit.org/show_bug.cgi?id=197566

        Reviewed by Eric Carlson.

        The previous number for iOS was 2 as there is a front and a back camera.
        Since we are by default setting deviceIds to "", it is better to just have one,
        as it might confuse applications to have two devices with the same ID.

        Covered by updated test.

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

2019-05-03  Daniel Bates  <dabates@apple.com>

        Pass KeyboardEvent by reference in more places
        https://bugs.webkit.org/show_bug.cgi?id=197480

        Reviewed by Wenson Hsieh.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::handleKeyboardEvent):
        (WebKit::WebEditorClient::handleInputMethodKeydown):
        * WebProcess/WebCoreSupport/WebEditorClient.h:
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        (WebKit::WebEditorClient::handleKeyboardEvent):
        (WebKit::WebEditorClient::handleInputMethodKeydown):
        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::handleKeyboardEvent):
        (WebKit::WebEditorClient::handleInputMethodKeydown):
        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        (WebKit::WebEditorClient::handleKeyboardEvent):
        (WebKit::WebEditorClient::handleInputMethodKeydown):
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        (WebKit::WebEditorClient::handleKeyboardEvent):
        (WebKit::WebEditorClient::handleInputMethodKeydown):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleEditingKeyboardEvent):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::handleEditingKeyboardEvent):
        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::handleEditingKeyboardEvent):

2019-05-03  Youenn Fablet  <youenn@apple.com>

        Enable Fetch Keep Alive by default
        https://bugs.webkit.org/show_bug.cgi?id=197331

        Reviewed by Geoffrey Garen.

        * Shared/WebPreferences.yaml:

2019-05-03  Devin Rousso  <drousso@apple.com>

        REGRESSION(r230367): a "." is prepended before cookies set without an explicit domain
        https://bugs.webkit.org/show_bug.cgi?id=197268
        <rdar://problem/49767847>

        Reviewed by Alex Christensen.

        RFC 2965 states "If an explicitly specified value does not start with a dot, the user agent
        supplies a leading dot.", so we should only be adding a leading "." if a `domain` is provided.

        In order to not regress r230367, also delete all cookies for the non-"."-prefixed domain.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::deleteAllCookies):

        * UIProcess/WebCookieManagerProxy.h:
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::deleteCookiesForHostnames): Added.
        (WebKit::WebCookieManagerProxy::deleteCookiesForHostname): Deleted.
        * UIProcess/API/C/WKCookieManager.cpp:
        (WKCookieManagerDeleteCookiesForHostname):
        * NetworkProcess/Cookies/WebCookieManager.messages.in:
        * NetworkProcess/Cookies/WebCookieManager.h:
        * NetworkProcess/Cookies/WebCookieManager.cpp:
        (WebKit::WebCookieManager::deleteCookiesForHostnames): Added.
        (WebKit::WebCookieManager::deleteCookiesForHostname): Deleted.
        Since the underlying `NetworkStorageSession` accepts a list of domains, extend that support
        to allow the IPC to send a list of domains as well, but still keep the C API the same.

2019-05-03  Sihui Liu  <sihui_liu@apple.com>

        Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
        https://bugs.webkit.org/show_bug.cgi?id=197390
        <rdar://problem/42685773>

        Reviewed by Geoffrey Garen.

        Move data protection check to WebCore so it can be applied to database files.

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::add):
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::makeSafeToUseMemoryMapForPath): Deleted.
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm: Removed.
        * SourcesCocoa.txt:
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::openAndMapOrCopyContentRuleList):
        (API::compiledToFile):

2019-05-03  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: [weakThis->m_view window] == weakThis->m_targetWindowForMovePreparation
        https://bugs.webkit.org/show_bug.cgi?id=197574
        <rdar://problem/50453181>

        Reviewed by Tim Horton.

        Tweak the assertion so that it holds even if the WebView gets closed because the completion
        handler has been called.

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

2019-05-03  Brent Fulgham  <bfulgham@apple.com>

        Use more efficient path resolution logic
        https://bugs.webkit.org/show_bug.cgi?id=197389
        <rdar://problem/50268491>

        Reviewed by Maciej Stachowiak.

        The code in SandboxExtensionsCocoa.mm 'resolveSymlinksInPath' is pretty inefficient, and tries to reproduce (badly)
        logic that is already provided by the operating system.

        To make matters worse, 'resolvePathForSandboxExtension' was effectively performing the work of fully resolving
        symlinks twice, since NSString's 'stringByStandardizingPath' method does some of this already.

        Instead, we should just use NSString's 'stringByResolvingSymlinksInPath', which does the symlink resolution
        using more efficient logic than our 'resolveSymlinksInPath' code.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::resolveSymlinksInPath): Removed.
        (WebKit::resolvePathForSandboxExtension): Remove redundant call to 'resolveSymlinksInPath', and switches from
        'stringByStandardizingPath' to 'stringByResolvingSymlinksInPath', which can take the place of both calls.
        (WebKit::stringByResolvingSymlinksInPath): Switch to call 'stringByResolvingSymlinksInPath'.

2019-05-02  Dean Jackson  <dino@apple.com>

        Need additional UIPreviewAction information in WKImagePreviewViewController
        https://bugs.webkit.org/show_bug.cgi?id=197540
        <rdar://problem/50430510>

        Reviewed by Wenson Hsieh.

        Include a WebKitAdditions file to provide a macro for
        additional UIPreviewAction information.

        While here, take the opportunity to move from the deprecated
        UIViewControllerPreviewAction to the newer UIPreviewAction.

        * UIProcess/WKImagePreviewViewController.mm:
        (-[WKImagePreviewViewController previewActionItems]):

2019-05-02  Dean Jackson  <dino@apple.com>

        Provide UIImages for element actions
        https://bugs.webkit.org/show_bug.cgi?id=197539
        <rdar://problem/50430363>

        Reviewed by Wenson Hsieh.

        Use an additions include to export a function that
        relates a UIImage to a _WKElementAction.

        * UIProcess/API/Cocoa/_WKElementAction.h:
        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (_WKUIImageForElementActionType):

2019-05-03  Jay Mulani  <jmulani@apple.com>

        Expose full screen controller SPI to check if full screen is open and close full screen
        https://bugs.webkit.org/show_bug.cgi?id=197263

        Reviewed by Jer Noble.

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

2019-05-03  Youenn Fablet  <youenn@apple.com>

        LayoutTest imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=182849
        <rdar://problem/50353372>

        Reviewed by Alex Christensen.

        In case of restarting the load after a redirection, which now happens in case
        of following cross origin redirections with same-origin credentials, make sure to
        update the request as would do NetworkLoad.
        This is in particular important to preserve the request body.

        Covered by WPT updated test.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::updateRequest):
        (WebKit::NetworkLoad::updateRequestAfterRedirection const):
        (WebKit::NetworkLoad::continueWillSendRequest):
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRequest):

2019-05-03  Commit Queue  <commit-queue@webkit.org>

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

        Breaks compilation of jsconly on linux, breaking compilation
        for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
        guijemont on #webkit).

        Reverted changeset:

        "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
        WEBKIT_COPY_FILES"
        https://bugs.webkit.org/show_bug.cgi?id=197174
        https://trac.webkit.org/changeset/244881

2019-05-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION: Layout test editing/selection/ios/selection-after-changing-text-with-callout-menu.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=197532
        <rdar://problem/50177144>

        Reviewed by Ryosuke Niwa.

        Fixes layout tests that began failing after r244546. See below for details.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

        Partially reverts a change in r244546, after which we commit the layer tree and scroll before updating the
        page's editor state. The purpose of this change was to ensure that UI process-side element focus scrolling logic
        would not conflict with web-process-driven scrolling logic.

        Instead, we split the existing logic in WebPageProxy::editorStateChanged into two pieces: one that updates the
        editor state (by setting m_editorState), and a second that dispatches updates to PageClient when the first
        editor state is received after focusing an element. During a layer tree commit in the UI process, we first
        update the editor state, then commit the layer tree and apply scroll position changes, and finally scroll to
        reveal the focused element if necessary.

        When an editor state is delivered to the UI process in an out-of-band update (i.e. not in a layer tree commit),
        simply dispatch the initial editor state for a focused element immediately.

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

        Add an IPC message to schedule an editor state update in the next remote layer tree commit. See below for more
        details.

        (WebKit::WebPageProxy::editorStateChanged):
        (WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus):
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::updateEditorState):
        (WebKit::WebPageProxy::editorStateChanged): Deleted.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):

        Additionally ensure that an editor state update is scheduled. This addresses a potential source of flakiness in
        the layout test editing/selection/ios/selection-after-changing-text-with-callout-menu.html, where an editor
        state update may only be scheduled after the next layout timer fires (this is the case in custom callout menu
        actions that change the DOM but do not otherwise trigger any editing commands).

        In the problematic scenario, the client could make a change that triggers layout soon; but before the layout
        timer fires, the timer for the next remote layer tree commit could fire, such that the next layer tree commit
        would not contain the relevant editor state.

        This extra step ensures that we always *schedule* an editor state update when performing a callout menu action
        that does not automatically dismiss, so that we can prevent the callout bar from dismissing during the correct
        scope.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::layerTreeCommitComplete):
        (WebKit::WebPageProxy::updateEditorState):

        Rename editorStateChanged to updateEditorState, and make the editorStateChanged codepath only executed when an
        out-of-band editor state update is delivered to the UI process.

        (WebKit::WebPageProxy::dispatchDidReceiveEditorStateAfterFocus):

        Notify the UI process that the initial editor state has been received; this prompts us to scroll to reveal the
        focused element, if needed.

        (WebKit::WebPageProxy::editorStateChanged): Deleted.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::updateEditorState):
        (WebKit::WebPageProxy::editorStateChanged): Deleted.
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::updateEditorState):
        (WebKit::WebPageProxy::editorStateChanged): Deleted.
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebPageProxy::updateEditorState):
        (WebKit::WebPageProxy::editorStateChanged): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-05-02  Timothy Hatcher  <timothy@apple.com>

        NSAttributedString conversion in a loop returns nil and WKUnknownError every other time.
        https://bugs.webkit.org/show_bug.cgi?id=197523

        Reviewed by Darin Adler.

        Caching the WKWebView was loading about:blank to unload the previous content.
        This was causing subsequent rapid conversions to fail since the blank load
        would be confused with the real content loading. Loading a blank page wasn't
        really needed, it just helped keep the cached view in a cleaner state. Instead
        of adding complexity to track the extra navigation, we can eliminate the blank load.
        Ultimately a process swap will likely happen on the next navigation, and unused
        cached views are closed quickly -- so stale content isn't held around too long.
        This also avoids extra work and speeds up conversions a bit.

        * UIProcess/API/Cocoa/NSAttributedString.mm:
        (+[_WKAttributedStringWebViewCache cacheWebView:]): Don't load about:blank when caching.
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::getContentsAsAttributedString): Use rangeOfContents() for a fail
        safe way to get the range needed.

2019-05-02  John Wilander  <wilander@apple.com>

        Make both filterForRegistrableDomains() in WebKit::NetworkProcess use WebCore::RegistrableDomain::uncheckedCreateFromHost()
        https://bugs.webkit.org/show_bug.cgi?id=197521
        <rdar://problem/49651503>

        Reviewed by Brent Fulgham.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::filterForRegistrableDomains):

2019-05-02  Per Arne Vollan  <pvollan@apple.com>

        -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
        https://bugs.webkit.org/show_bug.cgi?id=197510
        <rdar://problem/50372338>

        Reviewed by Alex Christensen.

        When asked to delete persistent credentials for a set of origins, send a message to the network process with the
        list of origins. The network process will then delete all persistent credentials from these origins from
        NSURLCredentialStorage.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removeCredentialsWithOrigins):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::removeCredentialsWithOrigins):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::removeData):

2019-05-02  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
        https://bugs.webkit.org/show_bug.cgi?id=197174

        Reviewed by Alex Christensen.

        Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies
        for framework headers explicit.

        * CMakeLists.txt:
        * PlatformWin.cmake:

2019-05-02  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix syscall sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=197517
        <rdar://problem/49945031>

        Reviewed by Brent Fulgham.

        A syscall needs to be added to the sandbox on macOS.

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

2019-05-02  Alex Christensen  <achristensen@webkit.org>

        Safe browsing warning should update colors when a user switches between light and dark appearance
        https://bugs.webkit.org/show_bug.cgi?id=197443
        <rdar://problem/49883917>

        Reviewed by Tim Horton.

        We draw the WKSafeBrowsingExclamationPoint ourselves, so we need to call setNeedsDisplay when viewDidChangeEffectiveAppearance is called.
        Instead of setting NSView.layer.backgroundColor we need to make an NSView subclass I call WKSafeBrowsingBox and we need to set its layer's
        backgroundColor in updateLayer, otherwise the CGColor isn't updated from the NSColor.

        * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
        (colorForItem):
        (-[WKSafeBrowsingExclamationPoint viewDidChangeEffectiveAppearance]):
        (-[WKSafeBrowsingBox setSafeBrowsingBackgroundColor:]):
        (-[WKSafeBrowsingBox updateLayer]):
        (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
        (-[WKSafeBrowsingWarning addContent]):
        (-[WKSafeBrowsingWarning showDetailsClicked]):
        (setBackground): Deleted.

2019-05-02  Frederic Wang  <fwang@igalia.com>

        [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime
        https://bugs.webkit.org/show_bug.cgi?id=196142

        This patch introduces some experimental runtime flag to let users
        disable MathML features that are removed from MathML Core [1]. For now,
        these features are only disabled on GTK and WPE ports.

        [1] https://mathml-refresh.github.io/mathml-core/

        Reviewed by Rob Buis.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add the ability to import WebKitAdditions snippets in WebKit.apinotes
        https://bugs.webkit.org/show_bug.cgi?id=197487
        <rdar://problem/50389085>

        Reviewed by Tim Horton.

        * Shared/API/Cocoa/WebKit.apinotes: Import a new WebKitAdditions file.

        * WebKit.xcodeproj/project.pbxproj: Check all files in Headers/ and PrivateHeaders/ that need replacement, not
        simply anything ending with ".h".

        * mac/replace-webkit-additions-includes.py:
        (main): Teach the replacement script to handle files in Headers/ or PrivateHeaders/ that don't end in ".h".

2019-05-01  Alex Christensen  <achristensen@webkit.org>

        Protect against null crash in fetchDiskCacheEntries
        https://bugs.webkit.org/show_bug.cgi?id=197399
        <rdar://problem/47759337>

        Reviewed by Antti Koivisto.

        If the call to Entry::decodeStorageRecord returns nullptr in Storage::traverse, do not call the traverseHandler, which expects
        that when it is called with nullptr that is the end of the traversal.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::traverse):

2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
        https://bugs.webkit.org/show_bug.cgi?id=197342
        <rdar://problem/50063091>

        Reviewed by Tim Horton.

        This patch introduces a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a
        larger width in order to shrink content to fit the viewport. This is similar to existing shrink-to-fit behaviors
        used for viewport sizing in multitasking mode, except that it not only scales the view, but additionally expands
        the layout size, such that the overall layout of the page is preserved. In fact, the reason we ended up
        reverting the existing flavor of shrink-to-fit in all cases except for multitasking was that page layout was not
        preserved, which caused elements that poke out of the viewport to make the rest of the page look out of
        proportion — see <rdar://problem/23818102> and related radars.

        Covered by 5 new layout tests, and by adjusting a couple of existing layout tests. See comments below for more
        details.

        * Platform/Logging.h:

        Add a new ViewportSizing logging channel. This will only log on pages that overflow the viewport and shrink to
        fit as a result.

        * Shared/WebPreferences.yaml:

        Turn IgnoreViewportScalingConstraints off by default. This preference currently controls whether we allow
        shrink-to-fit behaviors, and is only used by Safari when it is in multitasking mode. The value of this
        preference is currenly *on* by default, and is turned off almost immediately during every page load after the
        first visible content rect update, wherein visibleContentRectUpdateInfo.allowShrinkToFit() is false.

        However, this sometimes causes a brief jitter during page load; to fix this, make the default value for
        IgnoreViewportScalingConstraints false, and change the logic in WebPage::updateVisibleContentRects to
        setCanIgnoreScalingConstraints to true if either the IgnoreViewportScalingConstraints preference (not only
        affected by an internal debug switch) is true, or WKWebView SPI is used to enable the behavior.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):

        Add a new hook for WebFrameLoaderClient to call into WebPage when document load finishes. Also, tweak
        dispatchDidFinishLoad to take a WebFrame& instead of a WebFrame* in a drive-by fix (the frame is assumed to be
        non-null anyways).

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::didFinishDocumentLoad):
        (WebKit::WebPage::didFinishLoad):

        When finishing document load or finishing the overall load, kick off the shrink-to-fit timer; when committing a
        load, cancel the timer.

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

        Don't allow the minimum effective device width from the client to stomp over any minimum effective device width
        set as a result of the new shrink-to-fit heuristic; on some pages that load quickly, this can result in a race
        where the minimum effective device width (i.e. a value that lower-bounds the minimum layout width) is first set
        by the shrink-to-fit heuristic, and then set to an incorrect value by the client.

        In the near future, web view SPI used to set the minimum effective device width should actually be removed
        altogether, since the new shrink-to-fit heuristic supersedes any need for the client to fiddle with the minimum
        effective device width.

        (WebKit::WebPage::dynamicViewportSizeUpdate):

        When performing a dynamic viewport size update, additionally re-run the shrink-to-fit heuristic. This allows
        the minimum layout size of the viewport to be updated, if necessary. An example of where this matters is when a
        web page is *below* a tablet/desktop layout breakpoint in portrait device orientation, but then exceeds this
        layout breakpoint in landscape orientation. In this scenario, rotating the device should swap between these two
        page layouts.

        (WebKit::WebPage::resetViewportDefaultConfiguration):
        (WebKit::WebPage::scheduleShrinkToFitContent):
        (WebKit::WebPage::shrinkToFitContentTimerFired):
        (WebKit::WebPage::immediatelyShrinkToFitContent):

        Leverage the existing capability for a viewport to have a "minimum effective device width" to grant the viewport
        a larger layout size than it would normally have, and then scale down to fit within the bounds of the view. One
        challenge with this overall approach is that laying out at a larger width may cause the page to lay out even
        wider in response, which may actually worsen horizontal scrolling. To mitigate this, we only attempt to lay out
        at the current content width once; if laying out at this width reduced the amount of horizontal scrolling by any
        amount, then proceed with this layout width; otherwise, revert to the previous layout width.

        (WebKit::WebPage::shouldIgnoreMetaViewport const):

        Pull some common logic out into a readonly getter.

        (WebKit::WebPage::updateVisibleContentRects):

        See the comment below WebPreferences.yaml, above.

2019-05-01  Dean Jackson  <dino@apple.com>

        Link Previews that use WKImagePreviewViewController are not always scaled correctly
        https://bugs.webkit.org/show_bug.cgi?id=197450
        <rdar://problem/50357695>

        Reviewed by Wenson Hsieh.

        Tell the UIImageView that we create in WKImagePreviewViewController to use
        a filling scaling method.

        * UIProcess/WKImagePreviewViewController.mm:
        (-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]):

2019-05-01  Darin Adler  <darin@apple.com>

        WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
        https://bugs.webkit.org/show_bug.cgi?id=195535

        Reviewed by Alexey Proskuryakov.

        * Shared/API/APIString.h: Removed uneeded includes and also switched to #pragma once.

        * Shared/API/c/WKString.cpp: Moved include of UTF8Conversion.h here.
        (WKStringGetUTF8CStringImpl): Updated for changes to return values.

2019-05-01  Shawn Roberts  <sroberts@apple.com>

        Unreviewed, rolling out r244821.

        Causing

        Reverted changeset:

        "WebKit has too much of its own UTF-8 code and should rely
        more on ICU's UTF-8 support"
        https://bugs.webkit.org/show_bug.cgi?id=195535
        https://trac.webkit.org/changeset/244821

2019-05-01  Youenn Fablet  <youenn@apple.com>

        Kept alive loaders should use the redirected request in case of redirections
        https://bugs.webkit.org/show_bug.cgi?id=197337

        Reviewed by Alex Christensen.

        Instead of using the request, the redirected request should be used in case of redirection.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):

2019-04-29  Darin Adler  <darin@apple.com>

        WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
        https://bugs.webkit.org/show_bug.cgi?id=195535

        Reviewed by Alexey Proskuryakov.

        * Shared/API/APIString.h: Removed uneeded includes and also switched to #pragma once.

        * Shared/API/c/WKString.cpp: Moved include of UTF8Conversion.h here.
        (WKStringGetUTF8CStringImpl): Updated for changes to return values.

2019-04-30  Chris Dumez  <cdumez@apple.com>

        Regression(PSON) URL scheme handlers can no longer respond asynchronously
        https://bugs.webkit.org/show_bug.cgi?id=197426
        <rdar://problem/50256169>

        Reviewed by Brady Eidson.

        The issue was that when committing the provisional process, we would call WebPageProxy::processDidTerminate()
        which would call WebPageProxy::stopAllURLSchemeTasks(). This would terminate all URL scheme tasks associated
        with the page, including the one associated with the provisisional page / process.

        To address the issue, pass m_process to stopAllURLSchemeTasks() in processDidTerminate() and only stop the
        tasks associated with the m_process (which is the process we're about to swap away from).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::stopAllURLSchemeTasks):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::processForTaskIdentifier):
        (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
        * UIProcess/WebURLSchemeHandler.h:
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::process const):

2019-04-30  John Wilander  <wilander@apple.com>

        Add logging of Ad Click Attribution errors and events to a dedicated channel
        https://bugs.webkit.org/show_bug.cgi?id=197332
        <rdar://problem/49918800>

        Reviewed by Youenn Fablet.

        This patch adds an experimental Ad Click Attribution debug mode which
        logs information. Most changes are just log output in the various
        functions in WebKit::AdClickAttributionManager.

        The constructor to WebKit::AdClickAttributionManager now takes a
        PAL::SessionID so that the log functions can make sure they don't
        output anything in ephemeral sessions.

        WebProcessPool::platformInitializeNetworkProcess() now picks up the
        debug mode setting from the incoming
        WebKit::NetworkProcessCreationParameters object.

        NetworkResourceLoader::handleAdClickAttributionConversion() was
        moved to AdClickAttributionManager::handleConversion() to keep all
        the logging in one file.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::storeUnconverted):
        (WebKit::AdClickAttributionManager::handleConversion):
        (WebKit::AdClickAttributionManager::convert):
        (WebKit::AdClickAttributionManager::fireConversionRequest):
        (WebKit::AdClickAttributionManager::firePendingConversionRequests):
        (WebKit::AdClickAttributionManager::clearExpired):
        (WebKit::AdClickAttributionManager::debugModeEnabled const):
        * NetworkProcess/AdClickAttributionManager.h:
        (WebKit::AdClickAttributionManager::AdClickAttributionManager):
        (WebKit::AdClickAttributionManager::m_sessionID):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::handleAdClickAttributionConversion): Deleted.
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        (WebKit::NetworkSession::handleAdClickAttributionConversion):
        (WebKit::NetworkSession::convertAdClickAttribution): Deleted.
        * NetworkProcess/NetworkSession.h:
        * Platform/Logging.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2019-04-30  Devin Rousso  <drousso@apple.com>

        Crash when running test wpt/tests/element_click/bubbling.py::test_element_disappears_during_click
        https://bugs.webkit.org/show_bug.cgi?id=197361
        <rdar://problem/49861407>

        Reviewed by Brian Burg.

        Don't assume that all elements have client rects (e.g. `getClientRects`). If the container
        element isn't visible, then the child won't be either.

        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::resolveLocation):
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):

2019-04-30  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r244802.

        Caused an API test failure

        Reverted changeset:

        "Regression(PSON) URL scheme handlers can no longer respond
        asynchronously"
        https://bugs.webkit.org/show_bug.cgi?id=197426
        https://trac.webkit.org/changeset/244802

2019-04-30  Chris Dumez  <cdumez@apple.com>

        Regression(PSON) URL scheme handlers can no longer respond asynchronously
        https://bugs.webkit.org/show_bug.cgi?id=197426
        <rdar://problem/50256169>

        Reviewed by Brady Eidson.

        The issue was that when committing the provisional process, we would call WebPageProxy::processDidTerminate()
        which would call WebPageProxy::stopAllURLSchemeTasks(). This would terminate all URL scheme tasks associated
        with the page, including the one associated with the provisisional page / process.

        To address the issue, pass m_process to stopAllURLSchemeTasks() in processDidTerminate() and only stop the
        tasks associated with the m_process (which is the process we're about to swap away from).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::stopAllURLSchemeTasks):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::processForTaskIdentifier):
        (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
        * UIProcess/WebURLSchemeHandler.h:
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::process const):

2019-04-30  Chris Dumez  <cdumez@apple.com>

        Only use a related page's process if that page has not been closed yet
        https://bugs.webkit.org/show_bug.cgi?id=197393
        <rdar://problem/50302423>

        Reviewed by Tim Horton.

        We should not attempt to use a related page's process if that related page has already been closed.
        Once closed, a page's process is invalid and trying to launch a new process for the closed page
        leads to crashes such as the one in the radar.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2019-04-30  Tim Horton  <timothy_horton@apple.com>

        Long-standing rare crash under -[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal...]
        https://bugs.webkit.org/show_bug.cgi?id=197404
        <rdar://problem/24589331>

        Reviewed by Wenson Hsieh.

        * UIProcess/mac/WKImmediateActionController.mm:
        (-[WKImmediateActionController _updateImmediateActionItem]):
        (-[WKImmediateActionController menuItem:previewItemAtPoint:]):
        (-[WKImmediateActionController menuItem:itemFrameForPoint:]):
        (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
        Add some null checks; _webHitTestResult can be null if we (somehow) get
        an immediate action gesture without having previously gotten a
        mouseDidMoveOverElement from the Web Content process. Cover all our bases.

2019-04-30  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix crash caused by sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=197416
        <rdar://problem/50266257>

        Reviewed by Brent Fulgham.

        Add syscall to the iOS sandbox.

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

2019-04-30  Zalan Bujtas  <zalan@apple.com>

        [iOS] Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
        https://bugs.webkit.org/show_bug.cgi?id=197347
        <rdar://problem/49393423>

        Reviewed by Wenson Hsieh.

        This patch adds support for dispatching dblclick event as the result of the double tap gesture.

        1. The new double tap gesture recognizer always fires regardless of what type of action the other, existing double gesture recognizers (double-tap to zoom) trigger.
        2. The dblclick event is dispatched on the node with registered dblclick event handler unless the node prohibits double tap gesture (touch-action != auto).

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):

2019-04-30  Antti Koivisto  <antti@apple.com>

        Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode
        https://bugs.webkit.org/show_bug.cgi?id=197414

        Reviewed by Frédéric Wang.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:

2019-04-30  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r244750): [GTK][WPE] Network process is crashing in all layout tests
        https://bugs.webkit.org/show_bug.cgi?id=197406

        Reviewed by Žan Doberšek.

        Do not trasnfer ownership of cachePath to traverseDirectory() lambda, since it's passed also as first argument
        and it can be passed as a reference.

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

2019-04-29  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r244755.

        Casued several test failures on iOS

        Reverted changeset:

        "Double-tapping a post to like doesn't work on Instagram.com
        (needs 'dblclick' event)"
        https://bugs.webkit.org/show_bug.cgi?id=197347
        https://trac.webkit.org/changeset/244755

2019-04-29  Chris Dumez  <cdumez@apple.com>

        [iOS] The UIProcess may get killed for trying to stay runnable in the background for more than 30 seconds
        https://bugs.webkit.org/show_bug.cgi?id=197385
        <rdar://problem/50001505>

        Reviewed by Geoffrey Garen.

        If the UIProcess holds a background assertion for itself for 30 seconds, the assertion's invalidation handler
        will get called and it is our responsibility to release this assertion or the UIProcess will get killed by the
        system. The logic in ProcessAssertion would normally do that but it would also happily try and re-take another
        background process assertion shortly after the previous one expired (and before the UIProcess got suspended).
        When doing so, the new background assertion would expire right away and we would get killed without its
        invalidation handler getting called.

        To address the issue, the logic in ProcessAssertion will now prevent taking a new background assertion after
        one expires and until the application becomes foreground again.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):

2019-04-29  Alex Christensen  <achristensen@webkit.org>

        <rdar://problem/50299396> Fix internal High Sierra build
        https://bugs.webkit.org/show_bug.cgi?id=197388

        * Configurations/Base.xcconfig:

2019-04-29  Zalan Bujtas  <zalan@apple.com>

        [iOS] Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
        https://bugs.webkit.org/show_bug.cgi?id=197347
        <rdar://problem/49393423>

        Reviewed by Wenson Hsieh.

        This patch adds support for dispatching dblclick event as the result of the double tap gesture.

        1. The new double tap gesture recognizer always fires regardless of what type of action the other, existing double gesture recognizers (double-tap to zoom) trigger.
        2. The dblclick event is dispatched on the node with registered dblclick event handler unless the node prohibits double tap gesture (touch-action != auto).

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView _doubleTapRecognizedForDoubleClick:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint):

2019-04-29  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r244142): Fandango accounts tab crashes under Color()
        https://bugs.webkit.org/show_bug.cgi?id=197380
        <rdar://problem/50186175>

        Reviewed by Megan Gardner.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (baseScrollViewBackgroundColor):
        We now call -_updateScrollViewBackground from -setBackgroundColor:.
        -setBackgroundColor: can be called from -[UIView initWithCoder:]; if it
        is, WKWebView's _page is not yet initialized, so we crash. Return an invalid color.
        Then, the caller falls back to WKContentView's backgroundColor. But WKContentView
        isn't initialized yet either. So add a further fallback.

2019-04-29  Dean Jackson  <dino@apple.com>

        Add InteractionIsHappening to SuppressSelectionAssistantReason
        https://bugs.webkit.org/show_bug.cgi?id=197375
        <rdar://problem/50304986>

        Reviewed by Megan Gardner.

        Add a new reason for suppressing the selection assistant, to
        be used in a follow-up patch.

        * UIProcess/ios/WKContentViewInteraction.h: Add InteractionIsHappening.

2019-04-29  Alex Christensen  <achristensen@webkit.org>

        Storage::deleteOldVersions does not need to retain Storage
        https://bugs.webkit.org/show_bug.cgi?id=197336
        <rdar://problem/48679972>

        Reviewed by Darin Adler.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::deleteOldVersions):
        Something is wrong with the lifetime of Storage, but we only need a String, not the whole Storage.

2019-04-29  Brent Fulgham  <bfulgham@apple.com>

        [Cocoa] Move common sandbox files from Shared/mac to Shared/Cocoa
        https://bugs.webkit.org/show_bug.cgi?id=197376
        <rdar://problem/50305272>

        Reviewed by Dean Jackson.

        The Apple sandboxing logic currently lives in the inappropriate 'Shared/mac' directory. This is
        confusing because the code is used by all Apple ports, not just macOS.

        This patch just moves the relevant files from 'Shared/mac' to 'Shared/Cocoa' to avoid this confusion.

        * Shared/Cocoa/SandboxExtensionCocoa.mm: Renamed from Source/WebKit/Shared/mac/SandboxExtensionMac.mm.
        * Shared/Cocoa/SandboxInitialiationParametersCocoa.mm: Renamed from Source/WebKit/Shared/mac/SandboxInitialiationParametersMac.mm.
        * Shared/Cocoa/SandboxUtilities.h: Renamed from Source/WebKit/Shared/mac/SandboxUtilities.h.
        * Shared/Cocoa/SandboxUtilities.mm: Renamed from Source/WebKit/Shared/mac/SandboxUtilities.mm.
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-29  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Back/forward gesture snapshot always times out
        https://bugs.webkit.org/show_bug.cgi?id=197233

        Reviewed by Michael Catanzaro.

        Delaying web process launch caused a regression where we create ViewGestureController when the
        web process doesn't yet exist. The controller immediately tries to connect to it and fails,
        and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
        snapshot always stays until timeout after performing the gesture.

        To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
        webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
        ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
        and immediately apply it when creating the controller.

        Since there is now a point where controller is null, make webkitWebViewBaseViewGestureController()
        return null and add null checks everywhere.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (enableBackForwardNavigationGesturesChanged):
        Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Add a null check.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDraw): Ditto.
        (webkitWebViewBaseScrollEvent): Ditto.
        (webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
        WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
        for the case ViewGestureController doesn't exist yet.
        (webkitWebViewBaseViewGestureController): Return a pointer instead of reference.
        (webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
        (webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
        immediately call setSwipeGestureEnabled() with the stored value.
        (webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Add a null check.
        (webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame):Ditto.
        (webkitWebViewBaseDidFinishLoadForMainFrame): Ditto.
        (webkitWebViewBaseDidFailLoadForMainFrame): Ditto.
        (webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Ditto.
        (webkitWebViewBaseDidRestoreScrollPosition): Ditto.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

2019-04-29  Chris Dumez  <cdumez@apple.com>

        User-facing strings should use curly quotes instead of straight
        https://bugs.webkit.org/show_bug.cgi?id=197370

        Reviewed by Geoffrey Garen.

        Update localizable alert text that was recently added to use curly quotes instead of
        straight ones, as per our guidelines.

        * UIProcess/Cocoa/WKOrientationAccessAlert.mm:
        (WebKit::presentOrientationAccessAlert):
        * UIProcess/Cocoa/WKStorageAccessAlert.mm:
        (WebKit::presentStorageAccessAlert):

2019-04-29  Alex Christensen  <achristensen@webkit.org>

        Build fix.

        * UIProcess/ios/WKActionSheet.mm:
        (-[WKActionSheet updateSheetPosition]):

2019-04-29  Commit Queue  <commit-queue@webkit.org>

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

         Lots of tests  are crashing (Requested by KaL on #webkit).

        Reverted changeset:

        "[GTK] Back/forward gesture snapshot always times out"
        https://bugs.webkit.org/show_bug.cgi?id=197233
        https://trac.webkit.org/changeset/244648

2019-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] window-object-cleared documentation should reference webkit_frame_get_js_context_for_script_world()
        https://bugs.webkit.org/show_bug.cgi?id=197357

        Reviewed by Carlos Garcia Campos.

        We should recommend using the non-deprecated replacement for
        webkit_frame_get_javascript_context_for_script_world().

        * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:

2019-04-27  Chris Dumez  <cdumez@apple.com>

        Improve safety of MachMessage class
        https://bugs.webkit.org/show_bug.cgi?id=197323
        <rdar://problem/44291920>

        Reviewed by Darin Adler.

        Improve safety of MachMessage class and clean things up a bit.

        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::sendOutgoingMessage):
        - Pass MessageReceiverName / MessageName when constructing the MachMessage rather
          than setting them afterwards since they never change for a given MachMessage.
        - Set header->msgh_id to the right value right away instead of setting it first
          to inlineBodyMessageID and then later fixing it to be outOfLineBodyMessageID
          when the body is out of line.
        - When messageBodyIsOOL was true, we would call getDescriptorAndSkip() which
          would advance the pointer by sizeof(mach_msg_port_descriptor_t), even though
          the descriptor type is mach_msg_ool_descriptor_t. This would not matter in
          the end because we would not use the messageData pointer after this but
          still.

        * Platform/IPC/mac/MachMessage.cpp:
        (IPC::MachMessage::create):
        Use fastZeroedMalloc() instead of fastMalloc() for safety, given that this class
        has a mach_msg_header_t flexible array member. This is what is recommended by the
        mach documentation. It is much safer because it otherwize relies on the user
        (Connection::sendOutgoingMessage()) to initialize ALL the message members
        correctly. I suspect this was the cause of <rdar://problem/44291920> because
        Connection::sendOutgoingMessage() would fail to initialize header->msgh_voucher_port
        and the MachMessage destructor would then call mach_msg_destroy(header()), which
        would mach_msg_destroy_port(header->msgh_voucher_port).

        (IPC::MachMessage::MachMessage):
        Pass MessageReceiverName / MessageName when constructing the MachMessage rather
        than setting them afterwards since they never change for a given MachMessage.

        (IPC::MachMessage::messageSize):
        Drop if checks for portDescriptorCount and memoryDescriptorCount since the logic
        will do the right thing even if they are 0.

        * Platform/IPC/mac/MachMessage.h:
        (IPC::MachMessage::header):
        (IPC::MachMessage::messageReceiverName const):
        (IPC::MachMessage::messageName const):

2019-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        Rename m_LayerTreeFreezeReasons to m_layerTreeFreezeReasons
        https://bugs.webkit.org/show_bug.cgi?id=197343

        Reviewed by Antti Koivisto.

        No change in behavior.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::freezeLayerTree):
        (WebKit::WebPage::unfreezeLayerTree):
        (WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState):
        * WebProcess/WebPage/WebPage.h:

2019-04-26  Keith Rollin  <krollin@apple.com>

        Enable new build rule for post-processing headers when using XCBuild
        https://bugs.webkit.org/show_bug.cgi?id=197340
        <rdar://problem/50226685>

        Reviewed by Brent Fulgham.

        In Bug 197116, we conditionally disabled the old method for
        post-processing header files when we are using the new XCBuild build
        system. This check-in conditionally enables the new post-processing
        facility. Note that the old system is disabled and the new system
        enabled only when the USE_NEW_BUILD_SYSTEM environment variable is set
        to YES.

        * Configurations/WebKit.xcconfig:

2019-04-26  Jessie Berlin  <jberlin@webkit.org>

        Add new mac target numbers
        https://bugs.webkit.org/show_bug.cgi?id=197313

        Reviewed by Alex Christensen.

        * Configurations/Version.xcconfig:
        * Configurations/WebKitTargetConditionals.xcconfig:

2019-04-26  Youenn Fablet  <youenn@apple.com>

        Use kDNSServiceFlagsKnownUnique to speed up mdns name registration for ICE candidates
        https://bugs.webkit.org/show_bug.cgi?id=197328

        Reviewed by Eric Carlson.

        This allows skipping the probing step of MDNS name registration.
        We can do that as registered names are random UUIDs.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::registerMDNSName):

2019-04-26  Chris Dumez  <cdumez@apple.com>

        [iOS] Our process assertion should not allow idle sleep
        https://bugs.webkit.org/show_bug.cgi?id=197317
        <rdar://problem/50137740>

        Reviewed by Geoffrey Garen.

        Our process assertion should not allow idle sleep. This is bad for power because the device
        may switch between sleep and awake state frequently, as it get woken up by network packages.

        * UIProcess/ios/ProcessAssertionIOS.mm:

2019-04-26  Eric Carlson  <eric.carlson@apple.com>

        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
        https://bugs.webkit.org/show_bug.cgi?id=197171
        <rdar://problem/47454979>

        Reviewed by Youenn Fablet.

        * Shared/ios/WebIconUtilities.mm:
        (WebKit::iconForVideoFile):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::clone const):

2019-04-26  Commit Queue  <commit-queue@webkit.org>

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

        Causing crash on iOS Simulator and EWS failures (Requested by
        sroberts on #webkit).

        Reverted changeset:

        "[iOS] Add internal setting to force -webkit-text-size-adjust
        to "auto""
        https://bugs.webkit.org/show_bug.cgi?id=197275
        https://trac.webkit.org/changeset/244683

2019-04-26  Youenn Fablet  <youenn@apple.com>

        Use normal loading path for ping loads
        https://bugs.webkit.org/show_bug.cgi?id=196807

        Reviewed by Alex Christensen.

        In case a NetworkResourceLoader has the keepAlive option we do the following:
        - Always use NetworkLoadChecker as we might need it to do checks after the Web context is gone.
        - In case of aborting a KeepAlive loader, remove it from NetworkConnectionToWebProcess map
        and add it to a kept-alive NetworkSession load set. The loader is only kept alive if it
        has not yet received a response. Mark the loader as kept-alive.
        - In case loader is kept-alive, cancel the load as soon as a response is gathered.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::transferKeptAliveLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::addKeptAliveLoad):
        (WebKit::NetworkProcess::removeKeptAliveLoad):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoadMap.cpp:
        (WebKit::NetworkResourceLoadMap::remove):
        (WebKit::NetworkResourceLoadMap::take):
        * NetworkProcess/NetworkResourceLoadMap.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
        (WebKit::NetworkResourceLoader::cleanup):
        (WebKit::NetworkResourceLoader::abort):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::maximumBufferingTime):
        (WebKit::WebLoaderStrategy::usePingLoad const):
        * WebProcess/Network/WebLoaderStrategy.h:

2019-04-26  Alex Christensen  <achristensen@webkit.org>

        Fix internal High Sierra build after r244653
        https://bugs.webkit.org/show_bug.cgi?id=197131

        * DerivedSources.make:
        -std=gnu++17 didn't exist yet.  -std=gnu++1z did.

2019-04-26  Alex Christensen  <achristensen@webkit.org>

        Fix an internal High Sierra build after r244653
       ​https://bugs.webkit.org/show_bug.cgi?id=197131

        * DerivedSources.make:
        Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.

2019-04-26  Sihui Liu  <sihui_liu@apple.com>

        Stop IDB transactions to release locked database files when network process is ready to suspend
        https://bugs.webkit.org/show_bug.cgi?id=196372
        <rdar://problem/48930116>

        Reviewed by Brady Eidson.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processWillSuspendImminently):
        (WebKit::NetworkProcess::prepareToSuspend):
        (WebKit::NetworkProcess::resume):

2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>

        [iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
        https://bugs.webkit.org/show_bug.cgi?id=197275
        <rdar://problem/50211019>

        Reviewed by Simon Fraser.

        * Shared/WebPreferences.yaml:
        * UIProcess/WebPreferences.h:

2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>

        [iOS] Implement idempotent mode for text autosizing
        https://bugs.webkit.org/show_bug.cgi?id=197250
        <rdar://problem/50211034>

        Reviewed by Jon Lee.

        Push the initial scale down into the page.

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

2019-04-25  Alex Christensen  <achristensen@webkit.org>

        Make NetworkCache blobs safe for mmap instead of not using blobs
        https://bugs.webkit.org/show_bug.cgi?id=197264
        <rdar://problem/49564348>

        Reviewed by Antti Koivisto.

        This does what r244597 did for WKContentRuleLists but for the NetworkCache's blobs.
        Those are the two cases where we were calling mmap and seeing crashes in apps with
        default file protection of NSFileProtectionComplete.

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::add):
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath): Deleted.
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm:
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::Storage):
        (WebKit::NetworkCache::Storage::synchronize):
        (WebKit::NetworkCache::Storage::mayContainBlob const):
        (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
        (WebKit::NetworkCache::estimateRecordsSize): Deleted.
        * NetworkProcess/cache/NetworkCacheStorage.h:

2019-04-25  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
        https://bugs.webkit.org/show_bug.cgi?id=188357
        <rdar://problem/42986633>

        Reviewed by Dean Jackson.
        
        DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
        tests would fall into low memory mode and have different behavior.
        
        Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
        to Internals, so it's shared by DRT and WTR.
        
        We no longer need the WK2 C SPI glue.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetEventThrottlingBehaviorOverride):
        (WKBundlePageSetCompositingPolicyOverride): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2019-04-25  Chris Dumez  <cdumez@apple.com>

        Trying to load a main resource outside the sandbox should not crash the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=197299
        <rdar://problem/49808042>

        Reviewed by Geoffrey Garen.

        Trying to load a main resource outside the sandbox should not crash the WebContent process. We should
        simply ignore the load and log an error message.

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

2019-04-25  Timothy Hatcher  <timothy@apple.com>

        Only send a synthetic mouse out event if synthetic mouse move events were sent.
        https://bugs.webkit.org/show_bug.cgi?id=197295
        rdar://problem/49040233

        Reviewed by Zalan Bujtas.

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

2019-04-25  Timothy Hatcher  <timothy@apple.com>

        Disable date and time inputs on iOSMac.
        https://bugs.webkit.org/show_bug.cgi?id=197287
        rdar://problem/46794376

        Reviewed by Wenson Hsieh.

        * Configurations/FeatureDefines.xcconfig:

2019-04-25  Brady Eidson  <beidson@apple.com>

        REGRESSION (243388): WebProcess::shouldFreezeOnSuspension() decision is flipped
        <rdar://problem/49755494> and https://bugs.webkit.org/show_bug.cgi?id=197284

        Reviewed by Chris Dumez.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::shouldFreezeOnSuspension const): If any non-suspended pages are in the process it should
          be eligible. Only if all pages are suspended should it be jetsam-able.

2019-04-25  Alex Christensen  <achristensen@webkit.org>

        Start using C++17
        https://bugs.webkit.org/show_bug.cgi?id=197131

        Reviewed by Darin Adler.

        * Configurations/Base.xcconfig:
        * DerivedSources.make:

2019-04-25  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Back/Forward gesture interferes with scrolling
        https://bugs.webkit.org/show_bug.cgi?id=197168

        Reviewed by Michael Catanzaro.

        When the gesture is released with 0 velocity close to an edge of the webview,
        the finishing animation is way too long, and in some cases it can look like the
        gesture is already over, when it's still animating. By scrolling vertically while
        that happens, it's possible to reset animation over and over again.

        To reduce the duration in this case, instead of using maximum possible duration
        (400ms), introduce a base velocity and use it for calculating the duration if
        the actual velocity, relative to the end point, is equal to or less than 0.

        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation):

2019-04-25  Alexander Mikhaylenko  <exalm7659@gmail.com>

        [GTK] Back/forward gesture snapshot always times out
        https://bugs.webkit.org/show_bug.cgi?id=197233

        Reviewed by Michael Catanzaro.

        Delaying web process launch caused a regression where we create ViewGestureController when the
        web process doesn't yet exist. The controller immediately tries to connect to it and fails,
        and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
        snapshot always stays until timeout after performing the gesture.

        To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
        webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
        ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
        and immediately apply it when creating the controller.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (enableBackForwardNavigationGesturesChanged):
        Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
        WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
        for the case ViewGestureController doesn't exist yet.
        (webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
        (webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
        immediately call setSwipeGestureEnabled() with the stored value.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

2019-04-25  Youenn Fablet  <youenn@apple.com>

        [Mac iOS WK2] Layout Test http/wpt/cache-storage/cache-quota-after-restart.any.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=197040
        <rdar://problem/49997641>

        Reviewed by Antti Koivisto.

        Delay write operations in case synchronize is ongoing.
        This is restricted to AvoidRandomness mode which is always used by CacheAPI
        and is also used by network cache for layout tests.

        Tested by cache-quota-after-restart.any.html no longer exhibiting write disk errors.

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

2019-04-25  Commit Queue  <commit-queue@webkit.org>

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

        Causing internal build failures (Requested by ShawnRoberts on
        #webkit).

        Reverted changeset:

        "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
        https://bugs.webkit.org/show_bug.cgi?id=197171
        https://trac.webkit.org/changeset/244627

2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Hardcoded text color in input fields
        https://bugs.webkit.org/show_bug.cgi?id=126907

        Reviewed by Michael Catanzaro.

        Implement PageClient::effectiveAppearanceIsDark() for GTK port.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::effectiveAppearanceIsDark const): Check if gtk-application-prefer-dark-theme setting is
        enabled, or the theme name contains the -dark suffix or the GTK_THEME environment variable contains the :dark suffix.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (themeChanged): Notify the WebPageProxy that the theme has changed.
        (webkitWebViewBaseSetToplevelOnScreenWindow): Connect to notify::gtk-application-prefer-dark-theme and notify::gtk-theme-name.
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::setUseDarkAppearance): Set gtk-application-prefer-dark-theme setting accordingly.

2019-04-24  Zalan Bujtas  <zalan@apple.com>

        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
        https://bugs.webkit.org/show_bug.cgi?id=196948
        <rdar://problem/49927131>

        Reviewed by Tim Horton.

        Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
        after r244291 there's no reason to have it in DrawingArea.

        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::didUpdateGeometry):
        (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
        * UIProcess/DrawingAreaProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChangeIntrinsicContentSize):
        (WebKit::WebPageProxy::setViewLayoutSize):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::intrinsicContentsSizeChanged const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
        (WebKit::WebPage::dispatchDidReachLayoutMilestone):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
        (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.

2019-04-24  Commit Queue  <commit-queue@webkit.org>

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

        Causes compat issues (Requested by smfr on #webkit).

        Reverted changeset:

        "Unreviewed test gardening for Windows."
        https://trac.webkit.org/changeset/244228

2019-04-24  Eric Carlson  <eric.carlson@apple.com>

        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
        https://bugs.webkit.org/show_bug.cgi?id=197171
        <rdar://problem/47454979>

        Reviewed by Youenn Fablet.

        * Shared/ios/WebIconUtilities.mm:
        (WebKit::iconForVideoFile):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::clone const):

2019-04-24  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix syscall sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=197247
        <rdar://problem/50026580>

        Reviewed by Brent Fulgham.

        A missing syscall in the sandbox of the WebContent process is causing a crash.

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

2019-04-24  John Wilander  <wilander@apple.com>

        Age out unconverted Ad Click Attributions after one week.
        https://bugs.webkit.org/show_bug.cgi?id=197238
        <rdar://problem/50177349>

        Reviewed by Chris Dumez.

        AdClickAttributionManager::storeUnconverted() and
        AdClickAttributionManager::convert() now start by calling the new
        AdClickAttributionManager::clearExpired() function to remove any
        expired, unconverted attributions before continuing.

        The rest of the patch is infrastructure to allow tests to expire
        all unconverted attributions early.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::storeUnconverted):
        (WebKit::AdClickAttributionManager::convert):
        (WebKit::AdClickAttributionManager::clearExpired):
        (WebKit::AdClickAttributionManager::markAllUnconvertedAsExpiredForTesting):
        * NetworkProcess/AdClickAttributionManager.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::markAdClickAttributionsAsExpiredForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::markAdClickAttributionsAsExpiredForTesting):
        * NetworkProcess/NetworkSession.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetAdClickAttributionConversionURLForTesting):
        (WKPageMarkAdClickAttributionsAsExpiredForTesting):
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::markAdClickAttributionsAsExpiredForTesting):
        * UIProcess/WebPageProxy.h:

2019-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        Plumb the navigation's request when determining recommended compatibility mode
        https://bugs.webkit.org/show_bug.cgi?id=197225
        <rdar://problem/48389965>

        Reviewed by Alex Christensen.

        Adds a new argument to effectiveCompatibilityModeAfterAdjustingPolicies.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
        * UIProcess/WebPageProxy.h:

2019-04-24  Tim Horton  <timothy_horton@apple.com>

        Clean up WKActionSheetAssistant's use of LaunchServices
        https://bugs.webkit.org/show_bug.cgi?id=194645
        <rdar://problem/47707952>

        Reviewed by Andy Estes.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (applicationHasAppLinkEntitlements):
        (-[WKActionSheetAssistant _appendAppLinkOpenActionsForURL:actions:elementInfo:]):
        (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
        (appLinkForURL): Deleted.
        Make this function much more early-returny and flat.
        Adopt LS sync SPI instead of using a semaphore ourselves.
        Adopt modern open SPI.

2019-04-24  Simon Fraser  <simon.fraser@apple.com>

        Make it possible to control the renderTreeAsText output by setting options on testRunner
        https://bugs.webkit.org/show_bug.cgi?id=197133

        Reviewed by Sam Weinig.

        Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
        that make sense in testing (those that don't dump unstable data like addresses), and plumb
        these flags through the various framework layers.

        Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.

        Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
        and hand-code DumpRenderTree bindings.

        Some cleanup of the TestRunners, using member initializers.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyRenderTreeExternalRepresentation):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::toRenderAsTextFlags):
        (WebKit::WebPage::renderTreeExternalRepresentation const):
        (WebKit::WebPage::renderTreeExternalRepresentationForPrinting const):
        * WebProcess/WebPage/WebPage.h:

2019-04-24  Alex Christensen  <achristensen@webkit.org>

        WKContentRuleLists should have a maximum FileProtection of CompleteUnlessOpen
        https://bugs.webkit.org/show_bug.cgi?id=197078
        <rdar://problem/49564348>

        Reviewed by Geoff Garen.

        r242735 was a fix for crashes when using mmap'd memory in apps with default FileProtection of NSFileProtectionComplete.
        It is more memory efficient and just as secure to reduce the FileProtection of these files to NSFileProtectionCompleteUnlessOpen.

        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        (WebKit::NetworkCache::makeSafeToUseMemoryMapForPath):
        (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting): Deleted.
        (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting): Deleted.
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * NetworkProcess/cache/NetworkCacheFileSystemCocoa.mm: Added.
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        (WebKit::NetworkCache::makeSafeToUseMemoryMapForPath):
        * Shared/WebCompiledContentRuleList.cpp:
        (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
        (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
        (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
        (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
        (WebKit::WebCompiledContentRuleList::actions const):
        (WebKit::WebCompiledContentRuleList::usesCopiedMemory const): Deleted.
        * Shared/WebCompiledContentRuleList.h:
        * Shared/WebCompiledContentRuleListData.cpp:
        (WebKit::WebCompiledContentRuleListData::encode const):
        (WebKit::WebCompiledContentRuleListData::decode):
        (WebKit::WebCompiledContentRuleListData::size const): Deleted.
        (WebKit::WebCompiledContentRuleListData::dataPointer const): Deleted.
        * Shared/WebCompiledContentRuleListData.h:
        (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
        * SourcesCocoa.txt:
        * UIProcess/API/APIContentRuleList.cpp:
        (API::ContentRuleList::usesCopiedMemory const): Deleted.
        * UIProcess/API/APIContentRuleList.h:
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::openAndMapOrCopyContentRuleList):
        (API::compiledToFile):
        (API::createExtension):
        (API::ContentRuleListStore::getContentRuleListSource):
        (API::ContentRuleListStore::readContentsOfFile): Deleted.
        (API::MappedOrCopiedData::dataPointer const): Deleted.
        * UIProcess/API/APIContentRuleListStore.h:
        * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
        (API::ContentRuleListStore::readContentsOfFile): Deleted.
        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]): Deleted.
        * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
        * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
        (-[_WKUserContentFilter usesCopiedMemory]): Deleted.
        * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-24  David Kilzer  <ddkilzer@apple.com>

        Fix build due to missing SPI declaration of kAXSFullKeyboardAccessEnabledNotification

        * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Import
        AccessibilitySupportSPI.h.

2019-04-24  Chris Dumez  <cdumez@apple.com>

        URL set by document.open() is communicated with the WebPageProxy but not the WebFrameProxy
        https://bugs.webkit.org/show_bug.cgi?id=197214
        <rdar://problem/49237544>

        Reviewed by Alex Christensen.

        URL set by document.open() is communicated with the WebPageProxy (since r244361) but not the
        WebFrameProxy. This patch fixes this.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _mainFrameURL]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/FrameLoadState.cpp:
        (WebKit::FrameLoadState::didExplicitOpen):
        * UIProcess/FrameLoadState.h:
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::didExplicitOpen):
        * UIProcess/WebFrameProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didExplicitOpenForFrame):

2019-04-24  Chris Dumez  <cdumez@apple.com>

        X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
        https://bugs.webkit.org/show_bug.cgi?id=197226
        <rdar://problem/50155649>

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):

2019-04-24  Dean Jackson  <dino@apple.com>

        Rename _highlightLongPressCanClick and only add gesture recognizer when necessary
        https://bugs.webkit.org/show_bug.cgi?id=197231
        <rdar://problem/50164234>

        Reviewed by Antoine Quint.

        Rename _highlightLongPressCanClick to _longPressCanClick since it will be
        used in other places.

        Only attach the _highlightLongPressGestureRecognizer when we're not
        using long presses for preview. This might revert in the future, if we
        can set up an appropriate gesture resolution between the two.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _webTouchEvent:preventsNativeGestures:]):
        (-[WKContentView _highlightLongPressRecognized:]):
        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
        (-[WKContentView _presentedViewControllerForPreviewItemController:]):
        (-[WKContentView _previewItemControllerDidCancelPreview:]):

2019-04-24  chris fleizach  <cfleizach@apple.com>

        AX: Remove deprecated Accessibility Object Model events
        https://bugs.webkit.org/show_bug.cgi?id=197073
        <rdar://problem/50027819>

        Reviewed by Ryosuke Niwa.

        * Platform/spi/ios/AccessibilitySupportSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView dealloc]):
        (accessibilityEventsEnabledChangedCallback): Deleted.
        (-[WKWebView _updateAccessibilityEventsEnabled]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateAccessibilityEventsEnabled): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateAccessibilityEventsEnabled): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-04-23  John Wilander  <wilander@apple.com>

        Move Ad Click Attribution from internal feature to experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=197218
        <rdar://problem/47651691>

        Reviewed by Brent Fulgham.

        * Shared/WebPreferences.yaml:

2019-04-23  Keith Rollin  <krollin@apple.com>

        Add Xcode version check for Header post-processing scripts
        https://bugs.webkit.org/show_bug.cgi?id=197116
        <rdar://problem/50058968>

        Reviewed by Brent Fulgham.

        There are several places in our Xcode projects that post-process
        header files after they've been exported. Because of XCBuild, we're
        moving to a model where the post-processing is performed at the same
        time the header files are exported, rather than as a distinct
        post-processing step. This patch disables the distinct step when the
        inline processing is available.

        In practice, this means prefixing appropriate post-processing Custom
        Build phases with:

        if [ "${XCODE_VERSION_MAJOR}" -ge "1100" -a "${USE_NEW_BUILD_SYSTEM}" = "YES" ]; then
            # In this configuration, post-processing is performed at the same time as copying in the postprocess-header-rule script, so there's no need for this separate step.
            exit 0
        fi

        * WebKit.xcodeproj/project.pbxproj:

2019-04-23  John Wilander  <wilander@apple.com>

        Remove Ad Click Attribution data when removing website data
        https://bugs.webkit.org/show_bug.cgi?id=197215
        <rdar://problem/47668988>

        Reviewed by Chris Dumez.

        This patch adds a new WebsiteDataType called AdClickAttributions and flags
        it as owned by the network process.

        The new website data type is added to the Cocoa API layer for
        website data records management.

        When either of the two WebsiteDataStore::removeData() functions calls
        NetworkProcess::deleteWebsiteData() or
        NetworkProcess::deleteWebsiteDataForOrigins() over IPC, the network
        process now calls into AdClickAttributionManager::clear() and
        AdClickAttributionManager::clearForRegistrableDomain() respectively,
        if the website datatypes include WebsiteDataType::AdClickAttributions.

        The patch removes a couple of completion handlers in NetworkSession function
        calls are because those are not asynchronous.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::clear):
        (WebKit::AdClickAttributionManager::clearForRegistrableDomain):
        (WebKit::AdClickAttributionManager::toString const):
        * NetworkProcess/AdClickAttributionManager.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::clearAdClickAttribution):
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::clearAdClickAttribution):
        (WebKit::NetworkSession::clearAdClickAttributionForRegistrableDomain):
        * NetworkProcess/NetworkSession.h:
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::ownerProcess):
        * Shared/WebsiteData/WebsiteDataType.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreClearAdClickAttributionsThroughWebsiteDataRemoval):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
        (dataTypesToString):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
        (WebKit::toWebsiteDataType):
        (WebKit::toWKWebsiteDataTypes):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]):

2019-04-23  Tim Horton  <timothy_horton@apple.com>

        Return annotated text checking strings via UIWKDocumentContext
        https://bugs.webkit.org/show_bug.cgi?id=197177
        <rdar://problem/49064839>

        Reviewed by Ryosuke Niwa.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):
        Respect the UIWKDocumentRequestAnnotation flag, returning an attributed
        string containing the platform text checking annotations.

2019-04-23  Commit Queue  <commit-queue@webkit.org>

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

        Causing build failures on multiple builders (Requested by
        ShawnRoberts on #webkit).

        Reverted changeset:

        "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
        https://bugs.webkit.org/show_bug.cgi?id=197171
        https://trac.webkit.org/changeset/244556

2019-04-23  Remy Demarest  <rdemarest@apple.com>

        Build fix after r244545.

        Reviewed by Tim Horton.

        * Platform/spi/mac/AppKitSPI.h:
        The SPI was an IPI in High Sierra.

2019-04-23  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Input field on ddg.gg is auto focused when url is entered with the software keyboard
        https://bugs.webkit.org/show_bug.cgi?id=196740

        Reviewed by Megan Gardner.

        When an url for a page with an autofocused input field  is entered with the software keyboard,
        the input field is auto selected, and the software keyboard reappears. This does not happen
        when picking the url from favorites. After using the software keyboard to enter the url, the
        activity state is being changed to focused. The method '_elementDidFocus' checks whether the
        activity state changed, and allows the software keyboard to be shown in this case. To avoid
        showing the software keyboard in this case, send the changing activity state bitfield to the
        UI process, and check if the focus flag is the only flag set.
  
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

2019-04-23  Guy Lewin  <guy@lewin.co.il>

        Multiple File Input Icon Set Regardless of File List
        https://bugs.webkit.org/show_bug.cgi?id=195537

        Reviewed by Alexey Proskuryakov.

        Add WKOpenPanelResultListenerChooseMediaFiles() to choose files with
        icon and display string on iOS file open panels

        * UIProcess/API/C/WKOpenPanelResultListener.cpp:
        (WKOpenPanelResultListenerChooseMediaFiles):
        * UIProcess/API/C/WKOpenPanelResultListener.h:

2019-04-23  Eric Carlson  <eric.carlson@apple.com>

        Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
        https://bugs.webkit.org/show_bug.cgi?id=197171
        <rdar://problem/47454979>

        Reviewed by Youenn Fablet.

        * Shared/ios/WebIconUtilities.mm:
        (WebKit::iconForVideoFile):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::clone const):

2019-04-22  Dean Jackson  <dino@apple.com>

        Use additional members and protocols from WebKitAdditions in WKContentViewInteraction
        https://bugs.webkit.org/show_bug.cgi?id=197184
        <rdar://problem/50113848>

        Reviewed by Wenson Hsieh.

        WebKitAdditions defines some macros to include additional members
        and protocols for WKContentViewInteraction.

        It also defines some new functions. Provide empty version
        of those functions when WebKitAdditions is not available.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _registerPreview]):
        (-[WKContentView _unregisterPreview]):

2019-04-23  Tim Horton  <timothy_horton@apple.com>

        Action sheet shares a stringified URL instead of a URL object
        https://bugs.webkit.org/show_bug.cgi?id=197185
        <rdar://problem/49962249>

        Reviewed by Darin Adler.

        * UIProcess/Cocoa/WKShareSheet.h:
        * UIProcess/Cocoa/WKShareSheet.mm:
        (-[WKShareSheet presentWithParameters:inRect:completionHandler:]):
        (-[WKShareSheet presentWithParameters:completionHandler:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::showShareSheet):
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::showShareSheet):
        Make it possible to optionally provide WKShareSheet with
        a rect to present relative to.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showShareSheet:inRect:completionHandler:]):
        (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
        (-[WKContentView _showShareSheet:completionHandler:]): Deleted.
        Instead of stringifying the URL and using the text selection assistant's
        share method, hand WKShareSheet a proper URL.

2019-04-23  Ryosuke Niwa  <rniwa@webkit.org>

        [iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
        https://bugs.webkit.org/show_bug.cgi?id=197188

        Reviewed by Wenson Hsieh.

        Commit the scroll tree update before revealing the keyboard via editor state update.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

2019-04-23  Remy Demarest  <rdemarest@apple.com>

        Fix layout issues occuring when entering full screen mode.
        https://bugs.webkit.org/show_bug.cgi?id=197086
        <rdar://problem/47733671>.

        Reviewed by Darin Adler.

        This issue is the result of changing the style mask of the window after entering
        full screen mode. Safari adds an invisible toolbar to display the URL of the page
        which ends up breaking the layout. Having that window use a style that includes a
        titlebar fixes the bug.

        * Platform/spi/mac/AppKitSPI.h:
        Declare an SPI to be used in WKFullScreenWindowController.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::fullScreenWindow): Make the full screen window show a titlebar
        and make the content view underlap the titlebar to match the current behavior.
        Remove NSWindowStyleMaskBorderless which has no effects since it is equal to zero.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController initWithWindow:webView:page:]): Hide the titlebar
        before beginning the animation to full screen.
        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Show the title
        bar when in full screen instead of a blank bar.
        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Hide the title
        bar to restore the initial setting.

2019-04-23  John Wilander  <wilander@apple.com>

        Ad Click Attribution redirects to well-known location should not trigger a conversion if they are blocked by content blockers
        https://bugs.webkit.org/show_bug.cgi?id=197183
        <rdar://problem/47763188>

        Reviewed by Alex Christensen.

        Ad Click Attribution conversions are picked up in the redirect handler
        in WebKit::NetworkResourceLoader. Content blocking typically happens in
        the continued redirect request handling in the web content process and
        a blocked request comes back empty.

        We need to call the WebKit::NetworkLoadChecker in the network process
        for these specific redirects, just like we do for Ping.

        The change makes use of the existing function
        NetworkLoadChecker::enableContentExtensionsCheck() for this purpose.

        In essence, this change makes it possible to block all conversions made
        to a "/.well-known/ad-click-attribution/" URL.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::handleAdClickAttributionConversion):
            New convenience function.
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
            Now calls NetworkLoadChecker::enableContentExtensionsCheck() if
            an Ad Click Attribution conversion was found in the redirect URL.
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
            If the request was not blocked, it will store any found conversion here.
        * NetworkProcess/NetworkResourceLoader.h:

2019-04-23  Don Olmstead  <don.olmstead@sony.com>

        [CMake][Win] Use target oriented design for WebKit
        https://bugs.webkit.org/show_bug.cgi?id=197173

        Reviewed by Alex Christensen.

        Enumerate public framework headers for WinCairo's WebKit implementation and copy them.
        Migrate to use WebKit_DERIVED_SOURCES_DIR.

        * CMakeLists.txt:
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:

2019-04-23  Chris Dumez  <cdumez@apple.com>

        [Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
        https://bugs.webkit.org/show_bug.cgi?id=197097
        <rdar://problem/50048318>

        Reviewed by Alex Christensen.

        The issue is that when doing a history navigation with form data, we try to resubmit the form.
        We initially use the ReturnCacheDataDontLoad cache policy without prompting the user to get
        cached data. If this fails, we sent a DidFailProvisionalLoadForFrame IPC to the UIProcess but
        the WebContent process actually retries the load with ReturnCacheDataElseLoad cache policy.
        This new load triggers a new decidePolicyForNavigationAction.

        This would cause trouble with process-swapping because we normally destroy the
        ProvisionalPageProxy as soon as we receive a DidFailProvisionalLoadForFrame IPC from the
        provisional process. As a result, the provisional process would not be able to retry.

        To address the issue, we add pass a flag with the DidFailProvisionalLoadForFrame IPC to
        if the load will continue or not. When this flag is set, the UIProcess does not destroy
        the provisional page.

        * Scripts/webkit/messages.py:
        Minor IPC message handler build fix.

        * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
        (-[WKURLSchemeTaskImpl _onlyIfCached]):
        * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
        Add new _onlyIfCached SPI to WKURLSchemeTaskPrivate to allow for API testing.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::cancel):
        Pass WillContinueLoading flag.

        (WebKit::ProvisionalPageProxy::validateInput):
        Consider IPC with a navigationID of 0 as valid. When the navigation is triggered by the
        WebContent process, it sends us a DecidePolicyForNavigationActionAsync IPC with a navigationID
        of 0, until the UIProcess can generate a valid identifier.

        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):

        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
        When the WebPageProxy has generated a navigationID for the new WebContent process-initiated
        navigation, update m_navigationID so that follow-up IPC is considered valid.

        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2019-04-22  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Some dropdown menus may close without user gesture on americanexpress.com
        https://bugs.webkit.org/show_bug.cgi?id=197175
        <rdar://problem/49613013>

        Reviewed by Simon Fraser.

        Do not generate additional synthetic mouse events (e.g. mouseout in this case) when the content handles the click event. This helps cases when the synthetic mouseout ended up dismissing the dropdown menus.
        However it won't regress cases like youtube.com, where sending mouseout is required to have the control bar dismissed on play. 

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

2019-04-22  Alex Christensen  <achristensen@webkit.org>

        Deprecate WKContextCreateWithInjectedBundlePath
        https://bugs.webkit.org/show_bug.cgi?id=197169

        Reviewed by Youenn Fablet.

        * UIProcess/API/C/WKContext.h:

2019-04-22  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r230681) Do not use stored credentials if WKBundlePageResourceLoadClient.shouldUseCredentialStorage returns false
        https://bugs.webkit.org/show_bug.cgi?id=197093
        <rdar://problem/49708268>

        Reviewed by Chris Dumez.

        Only get the StoredCredentialsPolicy from the NetworkLoadChecker if we haven't already been told not to use credentials.
        Also add some test infrastructure for clearing persistent credentials added by the test.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removeCredential):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::removeCredential):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _removeCredential:forProtectionSpace:completionHandler:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::removeCredential):
        * UIProcess/WebProcessPool.h:

2019-04-22  Chris Dumez  <cdumez@apple.com>

        Delayed WebProcessLaunch may break the _relatedWebView SPI
        https://bugs.webkit.org/show_bug.cgi?id=197160

        Reviewed by Alex Christensen.

        Delayed WebProcessLaunch may break the _relatedWebView SPI. The breakage would happen if the client
        would relate a WebView to another which has not launched its initial process yet.

        To address the issue, when we need a running process for a WebView which has a related view, we need
        to make sure the related view has a running process and use that process. Previously, we would share
        the "dummy" process instead.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcess):
        (WebKit::WebPageProxy::ensureRunningProcess):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2019-04-22  David Quesada  <david_quesada@apple.com>

        Remove linked-on-or-after check for download attribute handling
        https://bugs.webkit.org/show_bug.cgi?id=197176
        rdar://problem/48459714

        Reviewed by Alex Christensen.

        There are no apps linked prior to this SDK version that are using the _WKDownload SPI,
        so it doesn't make sense to preserve the old behavior of forcing download-attribute
        links to start downloads.

        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):

2019-04-22  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r244502.

        Caused crashes on the bots

        Reverted changeset:

        "Delayed WebProcessLaunch may break the _relatedWebView SPI"
        https://bugs.webkit.org/show_bug.cgi?id=197160
        https://trac.webkit.org/changeset/244502

2019-04-22  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r244437.

        Still breaks internal tests.

        Reverted changeset:

        "InjectedBundle parameters often need initialization function
        called before unarchiving"
        https://bugs.webkit.org/show_bug.cgi?id=189709
        https://trac.webkit.org/changeset/244437

2019-04-22  Chris Dumez  <cdumez@apple.com>

        Delayed WebProcessLaunch may break the _relatedWebView SPI
        https://bugs.webkit.org/show_bug.cgi?id=197160

        Reviewed by Alex Christensen.

        Delayed WebProcessLaunch may break the _relatedWebView SPI. The breakage would happen if the client
        would relate a WebView to another which has not launched its initial process yet.

        To address the issue, when we need a running process for a WebView which has a related view, we need
        to make sure the related view has a running process and use that process. Previously, we would share
        the "dummy" process instead.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcess):
        (WebKit::WebPageProxy::ensureRunningProcess):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2019-04-22  Ludovico de Nittis  <ludovico.denittis@collabora.com>

        [GTK] fix gtk_style_context_set_background deprecation
        https://bugs.webkit.org/show_bug.cgi?id=196912

        Reviewed by Carlos Garcia Campos.

        Since gtk 3.18 gtk_style_context_set_background has been deprecated.
        Backgrounds are not rendered in the UI process, so it can be
        simply removed.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRealize):

2019-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        Defer EditorState updates until the next layer tree flush in a few additional circumstances
        https://bugs.webkit.org/show_bug.cgi?id=197145
        <rdar://problem/50078170>

        Reviewed by Darin Adler.

        Gets rid of sendPartialEditorStateAndSchedulePostLayoutUpdate(), in favor of always scheduling a full editor
        state update after the next compositing flush.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateEditorStateAfterLayoutIfEditabilityChanged):
        (WebKit::WebPage::setNeedsFontAttributes):
        (WebKit::WebPage::didChangeOverflowScrollPosition):
        (WebKit::WebPage::didChangeSelection):
        (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
        (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformEditorState const):
        (WebKit::WebPage::updateVisibleContentRects):

2019-04-21  Chris Dumez  <cdumez@apple.com>

        Regression(r243767) WebFrame::m_navigationIsContinuingInAnotherProcess flag is never reset
        https://bugs.webkit.org/show_bug.cgi?id=197144

        Reviewed by Darin Adler.

        WebFrame::m_navigationIsContinuingInAnotherProcess flag is never reset since it was introduced in
        r243767. This leads to leaking Navigation objects in the UIProcess when reusing a previously
        suspended process because such process will no longer send the DidDestroyNavigation IPC.

        It turns out that resetting the flags causes API tests such as ProcessSwap.QuickBackForwardNavigationWithPSON
        to ASSERT. This is because when the UIProcess quickly navigate back and forth without waiting for policy
        decisions, we may end up getting the policy decision for a particular navigation *after* we've sent the
        DidDestroyNavigation.

        As a result, this patch reverts r243767 and fixes in the assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
        another way. We initially assumed that the logic in WebPageProxy::didDestroyNavigation() was failing to
        ignore the DidDestroyNavigation from the previous process after a swap due to a race, maybe because it was
        sometimes received too late and m_provisionalPage was already cleared. However, this would not make sense
        since the test is crashing consistently and the page would no longer be able to receive IPC from the
        previous process *after* we've committed the provisional process/page.

        The real issue was that the DidDestroyNavigation IPC was received *before* we could construct the
        provisional page, which is why the logic in WebPageProxy::didDestroyNavigation() was failing to ignore
        the bad IPC. In WebPageProxy::receivedNavigationPolicyDecision(), we were calling receivedPolicyDecision()
        (which would send the DidReceivePolicyDecision to the previous WebProcess) and then continueNavigationInNewProcess()
        in order to construct the provisional page. I personally did not expect we could receive IPC between the
        calls to receivedNavigationPolicyDecision() and receivedPolicyDecision(), since we are not yielding and since
        the DidReceivePolicyDecision IPC is asynchronous. However, this is exactly what was happening in the context
        of this test. The reason is that the DidReceivePolicyDecision IPC was getting wrapped in a synchronous message
        and sent as synchronous message due to the Connection::m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting
        flag which seems to get set in the test due to some EventSender IPC. I believe this is because the test uses
        EventSender to do a click on a link which triggers the navigation.

        To address the issue, I now call receivedNavigationPolicyDecision() *after* continueNavigationInNewProcess()
        to make sure that we always start the provisional load in the new process before we tell the previous process
        to stop loading. This way, there is no way we get IPC from the previous process about the current navigation
        before we have a provisional page.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        (WebKit::WebPageProxy::didDestroyNavigation):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::didReceivePolicyDecision):
        (WebKit::WebFrame::documentLoaderDetached):
        * WebProcess/WebPage/WebFrame.h:

2019-04-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix iOS build with recent SDKs.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (deviceOrientation):
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController initWithWebView:]):
        (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
        (-[WKFullScreenViewController _statusBarFrameDidChange:]):

2019-04-19  John Wilander  <wilander@apple.com>

        Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
        https://bugs.webkit.org/show_bug.cgi?id=197108
        <rdar://problem/49918702>

        Reviewed by Alex Christensen.

        This patch introduces a new NSURLSession in WebKit::NetworkSessionCocoa called
        m_ephemeralStatelessCookielessSession. As its name implies, it's ephemeral, 
        stateless, and has a NSHTTPCookieAcceptPolicyNever cookie policy.

        The new session can be invoked with the new enum value of
        WebCore::StoredCredentialsPolicy called EphemeralStatelessCookieless.

        WebKit::AdClickAttributionManager::fireConversionRequest() makes use of
        the new session for its conversion requests.

        This patch also makes sure that Ad Click Attributions cannot be stored in
        ephemeral sessions and already stored attributions cannot be converted in
        ephemeral sessions.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::fireConversionRequest):
        (WebKit::AdClickAttributionManager::toString const):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            Calls NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession() lazily.
        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession):
        (WebKit::NetworkSessionCocoa::invalidateAndCancel):
        * Shared/WebCoreArgumentCoders.h:

2019-04-19  Daniel Bates  <dabates@apple.com>

        Use RetainPtr and rename +autocorrectionRectsWithRects:lastRect: to +autocorrectionRectsWithFirstCGRect:lastCGRect:
        https://bugs.webkit.org/show_bug.cgi?id=197122

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Renamed; formerly named +autocorrectionRectsWithRects:lastRect:.
        While I am here use else-branch to initialize firstRect and lastRect just to make the code closer to the optimal
        assembly. Also use Vector::{isEmpty, first, last}() instead of using the index operator overload and size() for
        emptiness checks. The code is more readable at the cost being ever so slightly slower (due to the overflow checks
        in first() and last()), but this code is likely not hot enough for it to matter.
        (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): Update for renaming.
        (+[WKAutocorrectionRects autocorrectionRectsWithFirstCGRect:lastCGRect:]): Ditto.
        (+[WKAutocorrectionRects autocorrectionRectsWithRects:lastRect:]): Deleted.

2019-04-19  Daniel Bates  <dabates@apple.com>

        -[WKAutocorrectionContext emptyAutocorrectionContext:] generates invalid empty context
        https://bugs.webkit.org/show_bug.cgi?id=197119

        Reviewed by Wenson Hsieh.

        Use the existing EditingRange type to represent the location and length of the marked text
        range for an autocorrection instead of managing integers. This type avoid the need to handle
        the special case for an empty range represented as NSMakeRange(NSNotFound, 0). Currently
        WKAutocorrectionContext incorrectly represents the empty range as NSMakeRange(WTF::notFound, 0).

        While I am here, simplify the existing WebAutocorrectionContext encoder/decoder code and rename
        +[WKAutocorrectionContext autocorrectionContextWithContext:] to +autocorrectionContextWithWebContext
        to better reflect the expected source of the conversion: a Web-type.

        * Shared/ios/WebAutocorrectionContext.h:
        (WebKit::WebAutocorrectionContext::encode const): Reformat while I am here to make this logic easy
        to amend without losing SVN history.
        (WebKit::WebAutocorrectionContext::decode): Simplify the code while I am here.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleAutocorrectionContext:]): Update for renaming.
        (+[WKAutocorrectionContext emptyAutocorrectionContext]): Update for renaming.
        (+[WKAutocorrectionContext autocorrectionContextWithWebContext:]): Renamed; formerly named autocorrectionContextWithContext.
        (+[WKAutocorrectionContext autocorrectionContextWithContext:]): Deleted.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::autocorrectionContext): Update to make use of EditingRange. Also instantiate
        the struct and return it, initializing its fields individually instead of using the constructor to
        make this code less error prone. It's easy to introduce an error with the constructor notation when
        amending the the struct because so many of the arguments are of the same data type. Individually
        initializing the struct fields makes it less likely for an ordering mistake to be introduced.

2019-04-19  Dean Jackson  <dino@apple.com>

        Add more _WKElementActionTypes and provide API to create with custom types
        https://bugs.webkit.org/show_bug.cgi?id=197117
        <rdar://problem/50059548>

        Reviewed by Tim Horton.

        We were missing a few obvious types that are well-known
        browser actions, and/or should be visible in share sheets.
        Also, clean up the API for constructing new types.

        * UIProcess/API/Cocoa/_WKElementAction.h: Add new types for opening
        in new tabs, windows and downloading.
        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction elementActionWithType:title:actionHandler:]): New constructor
        with type, title and action.
        (+[_WKElementAction elementActionWithType:]): Call new method.

2019-04-18  Daniel Bates  <dabates@apple.com>

        Use existing KeyEventCodesIOS constants instead of duplicating them
        https://bugs.webkit.org/show_bug.cgi?id=197081

        Rubber-stamped by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _interpretKeyEvent:isCharEvent:]): While I am here, remove the case for the space key
        as it is identical to the default switch case.

2019-04-19  Keith Rollin  <krollin@apple.com>

        Add postprocess-header-rule scripts
        https://bugs.webkit.org/show_bug.cgi?id=197072
        <rdar://problem/50027299>

        Reviewed by Brent Fulgham.

        Several projects have post-processing build phases where exported
        headers are tweaked after they've been copied. This post-processing is
        performed via scripts called postprocess-headers.sh. For reasons
        related to XCBuild, we are now transitioning to a build process where
        the post-processing is performed at the same time as the
        exporting/copying. To support this process, add similar scripts named
        postprocess-header-rule, which are geared towards processing a single
        file at a time rather than all exported files at once. Also add a
        build rule that makes use of these scripts. These scripts and build
        rules are not used at the moment; they will come into use in an
        imminent patch.

        Note that I've named these postprocess-header-rule rather than
        postprocess-header-rule.sh. Scripts in Tools/Scripts do not have
        suffixes indicating how the tool is implemented. Scripts in
        per-project Scripts folders appear to be mixed regarding the use of
        suffixes. I'm opting here to follow the Tools/Scripts convention, with
        the expectation that over time we completely standardize on that.

        * Scripts/postprocess-header-rule: Added.
        * WebKit.xcodeproj/project.pbxproj:

2019-04-19  Brady Eidson  <beidson@apple.com>

        Deprecate WebKit2 plug-in support.
        <rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences encodeWithCoder:]):
        (-[WKPreferences initWithCoder:]):
        (-[WKPreferences javaEnabled]):
        (-[WKPreferences setJavaEnabled:]):
        (-[WKPreferences plugInsEnabled]):
        (-[WKPreferences setPlugInsEnabled:]):

2019-04-19  Chris Dumez  <cdumez@apple.com>

        Minor PSON release logging improvements
        https://bugs.webkit.org/show_bug.cgi?id=197104

        Reviewed by Darin Adler.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::continueNavigationInNewProcess):

2019-04-19  Tim Horton  <timothy_horton@apple.com>

        YouTube and Twitter embeds don't load in News
        https://bugs.webkit.org/show_bug.cgi?id=197111
        <rdar://problem/50010081>

        Reviewed by Timothy Hatcher.

        * WebProcess/com.apple.WebProcess.sb.in:
        Adjust this sandbox exception to include both platforms.

2019-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
        https://bugs.webkit.org/show_bug.cgi?id=197102
        <rdar://problem/49864669>

        Reviewed by Ryosuke Niwa.

        If the quirk for disabling autocorrection and autocapitalization in hidden editable areas is active, then check
        whether the focused element is hidden, and turn off autocorrection and autocapitalization if needed.

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

2019-04-19  Commit Queue  <commit-queue@webkit.org>

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

        Caused build failures with Internal and Opensource builders
        (Requested by ShawnRoberts on #webkit).

        Reverted changeset:

        "Deprecate WebKit2 plug-in support."
        https://bugs.webkit.org/show_bug.cgi?id=197080
        https://trac.webkit.org/changeset/244447

2019-04-18  Brady Eidson  <beidson@apple.com>

        Deprecate WebKit2 plug-in support.
        <rdar://problem/43812306> and https://bugs.webkit.org/show_bug.cgi?id=197080

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences encodeWithCoder:]):
        (-[WKPreferences initWithCoder:]):
        (-[WKPreferences javaEnabled]):
        (-[WKPreferences setJavaEnabled:]):
        (-[WKPreferences plugInsEnabled]):
        (-[WKPreferences setPlugInsEnabled:]):

2019-04-18  Commit Queue  <commit-queue@webkit.org>

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

        caused 1 API test failure (Requested by zalan on #webkit).

        Reverted changeset:

        "Regression (r244291): Broken API Test
        AutoLayoutRenderingProgressRelativeOrdering"
        https://bugs.webkit.org/show_bug.cgi?id=196948
        https://trac.webkit.org/changeset/244434

2019-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add new compatibility mode API on WKNavigation
        https://bugs.webkit.org/show_bug.cgi?id=197069
        <rdar://problem/50025800>

        Reviewed by Tim Horton.

        Adds a new property on WKNavigation.

        * Shared/WebCompatibilityMode.h:

        Drive-by fix: make this enum class 8 bits wide.

        * UIProcess/API/APINavigation.h:
        (API::Navigation::setEffectiveCompatibilityMode):
        (API::Navigation::effectiveCompatibilityMode const):

        Add a new member variable to API::Navigation.

        * UIProcess/API/Cocoa/WKNavigation.h:
        * UIProcess/API/Cocoa/WKNavigation.mm:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:

        Add various hooks into WebKitAdditions.

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

        Set API::Navigation's effective compatibility mode.

        (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):

        Renamed and refactored this method to return the effective compatibility mode, chosen while adjusting website
        policies.

        (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode): Deleted.
        * UIProcess/WebPageProxy.h:

2019-04-18  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Make WebCore headers copies
        https://bugs.webkit.org/show_bug.cgi?id=182512
        <rdar://problem/37510435>

        Reviewed by Alex Christensen.

        WebCore now uses WebCore_PRIVATE_INCLUDE_DIRECTORIES for all ports. This revealed
        problems with WebKit's usage of WebCore headers. All include directories directly
        referencing the WebCore source tree we're removed from the CMake files. Any includes
        of WebCore headers using "*.h" were modified to <WebCore/*.h>

        Removed generation of forwarding headers for WebCore using the perl script.

        * CMakeLists.txt:
        * NetworkProcess/curl/NetworkDataTaskCurl.h:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:
        * Scripts/generate-forwarding-headers.pl:
        * UIProcess/API/glib/WebKitUserContentFilterStore.cpp:
        * UIProcess/API/wpe/WebKitColorPrivate.h:
        * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp:
        * UIProcess/win/PageClientImpl.cpp:

2019-04-18  Chris Dumez  <cdumez@apple.com>

        [iOS] Improve detection of when web views go to background / foreground
        https://bugs.webkit.org/show_bug.cgi?id=197035
        <rdar://problem/45281182>

        Reviewed by Tim Horton.

        Improve detection of when web views go to background / foreground on iOS.

        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker): Deleted.
        (WebKit::ApplicationStateTracker::~ApplicationStateTracker): Deleted.
        (WebKit::ApplicationStateTracker::applicationDidEnterBackground): Deleted.
        (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): Deleted.
        (WebKit::ApplicationStateTracker::applicationWillEnterForeground): Deleted.

2019-04-18  Jer Noble  <jer.noble@apple.com>

        Refactoring: Pull all fullscreen code out of Document and into its own helper class
        https://bugs.webkit.org/show_bug.cgi?id=197017

        Reviewed by Eric Carlson.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::willEnterFullScreen):
        (WebKit::WebFullScreenManager::didEnterFullScreen):
        (WebKit::WebFullScreenManager::willExitFullScreen):
        (WebKit::WebFullScreenManager::didExitFullScreen):
        (WebKit::WebFullScreenManager::setAnimatingFullScreen):
        (WebKit::WebFullScreenManager::requestExitFullScreen):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        (webkit_dom_document_webkit_cancel_fullscreen):
        (webkit_dom_document_webkit_exit_fullscreen):
        (webkit_dom_document_get_webkit_is_fullscreen):
        (webkit_dom_document_get_webkit_fullscreen_keyboard_input_allowed):
        (webkit_dom_document_get_webkit_current_fullscreen_element):
        (webkit_dom_document_get_webkit_fullscreen_element):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createWindow):

2019-04-18  Megan Gardner  <megan_gardner@apple.com>

        Update UIKit when a cut causes a selection change
        https://bugs.webkit.org/show_bug.cgi?id=197047
        <rdar://problem/36311563>

        Reviewed by Wenson Hsieh.

        We need to let UIKit know when a cut causes a selection change (always),
        so that is can appropriately update the button on the keyboard bar.

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

2019-04-18  Brent Fulgham  <bfulgham@apple.com>

        InjectedBundle parameters often need initialization function called before unarchiving
        https://bugs.webkit.org/show_bug.cgi?id=189709
        <rdar://problem/44573653>

        Reviewed by Ryosuke Niwa.

        Handle the case where the InjectedBundle parameters do not successfully decode because they contain
        an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
        after the bundle initialiation function runs, which gives the embedding program the opportunity to
        register additional classes that are safe for serialization.

        Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
        to be serialized by the InjectedBundle.
        
        Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
        Revise 'initialize' to call this new method.

        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::initialize): Use the new method.
        (WebKit::InjectedBundle::decodeBundleParameters): Added.
        (WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
        'classesForCoder' method to unarchive the passed bundle parameters, rather than the
        NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
        NSDictionary object may itself hold other kinds of objects.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
        (WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.

2019-04-18  Zalan Bujtas  <zalan@apple.com>

        Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
        https://bugs.webkit.org/show_bug.cgi?id=196948
        <rdar://problem/49927131>

        Reviewed by Tim Horton.

        Move intrinsicContentSizeDidChange out of DrawingArea. Intrinsic content size is a layout concept and
        after r244291 there's no reason to have it in DrawingArea.

        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::didUpdateGeometry):
        (WebKit::DrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
        * UIProcess/DrawingAreaProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChangeIntrinsicContentSize):
        (WebKit::WebPageProxy::setViewLayoutSize):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange): Deleted.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::intrinsicContentSizeDidChange): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
        (WebKit::WebPage::dispatchDidReachLayoutMilestone):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
        (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded): Deleted.

2019-04-18  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r244299.

        Breaks internal tests.

        Reverted changeset:

        "InjectedBundle parameters often need initialization function
        called before unarchiving"
        https://bugs.webkit.org/show_bug.cgi?id=189709
        https://trac.webkit.org/changeset/244299

2019-04-18  Shawn Roberts  <sroberts@apple.com>

        Unreviewed manual rollout of r244248 and r244409
        Causing assertion failures on Mac WK2 Debug builds
        https://bugs.webkit.org/show_bug.cgi?id=195623

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::prefetchCache): Deleted.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didReceiveBuffer):
        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
        (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const): Deleted.
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/PrefetchCache.cpp: Removed.
        * NetworkProcess/cache/PrefetchCache.h: Removed.
        * Shared/WebPreferences.yaml:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-18  Devin Rousso  <drousso@apple.com>

        Web Inspector: Canvas: enable WebGL2 for inspector page
        https://bugs.webkit.org/show_bug.cgi?id=196932
        <rdar://problem/49916213>

        Reviewed by Timothy Hatcher.

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

2019-04-17  Devin Rousso  <drousso@apple.com>

        Web Inspector: InspectorFrontendHost::inspectionLevel returns wrong value for inspector3
        https://bugs.webkit.org/show_bug.cgi?id=197044

        Reviewed by Joseph Pecoraro.

        * UIProcess/WebInspectorUtilities.h:
        * UIProcess/WebInspectorUtilities.cpp:
        (WebKit::trackInspectorPage):
        (WebKit::untrackInspectorPage):
        Determine the level of the inspector page by looking to see if the page being inspected is
        in the inspector page map. If so, we must be inspecting an inspector page and should use
        that inspector page's inspection level as the value to increment.

        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::createFrontendPage):
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):

2019-04-17  Tim Horton  <timothy_horton@apple.com>

        Adopt different scroll view flashing SPI
        https://bugs.webkit.org/show_bug.cgi?id=197043
        <rdar://problem/49996476>

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):

2019-04-17  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r241988): Switching tabs is slow
        https://bugs.webkit.org/show_bug.cgi?id=197037
        <rdar://problem/49951473>

        Reviewed by Simon Fraser.

        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
        r241988 changed to wait for a WebPageProxy message to a given DrawingArea ID,
        but WebPageProxy messages are identified by their WebPageProxy ID.
        Revert that one change. The rest of the patch looks OK.

2019-04-17  Rob Buis  <rbuis@igalia.com>

        Link prefetch not useful for top-level navigation
        https://bugs.webkit.org/show_bug.cgi?id=195623

        Reviewed by Alex Christensen.

        Fix macOS and iOS Debug WK2 bots ASSERTS after r367404, by simply
        not sending the DidReceiveResponse message.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):

2019-04-17  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r244400.

        Caused testing to exit early with assertionon Debug WK2

        Reverted changeset:

        "UI↔Web deadlock when printing with a JavaScript alert
        visible"
        https://bugs.webkit.org/show_bug.cgi?id=196839
        https://trac.webkit.org/changeset/244400

2019-04-17  Brady Eidson  <beidson@apple.com>

        Link clicks in PDFs shouldn't send referrer headers.
        <rdar://problem/21142581> and https://bugs.webkit.org/show_bug.cgi?id=196980

        Reviewed by Tim Horton.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::clickedLink):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):

2019-04-17  Andy Estes  <aestes@apple.com>

        [iOS] Support multiple file selection in UIDocumentPickerViewController
        https://bugs.webkit.org/show_bug.cgi?id=197014
        <rdar://problem/49963514>

        Reviewed by Tim Horton.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _showDocumentPickerMenu]):
        Allowed multiple file selection in our UIDocumentPickerViewController when
        _allowMultipleFiles is YES.

        (displayStringForDocumentsAtURLs):
        (-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
        Changed to support multiple file selection. When more than one file is selected, use
        WebCore::multipleFileUploadText() as the display string.

2019-04-17  Alex Christensen  <achristensen@webkit.org>

        Make WebCompiledContentRuleListData non-default-constructible, move its nonserialized member to API::ContentRuleList
        https://bugs.webkit.org/show_bug.cgi?id=197033

        Reviewed by Tim Horton.

        This is just cleanup that makes the code nicer without changing behavior.

        * Shared/WebCompiledContentRuleListData.cpp:
        (WebKit::WebCompiledContentRuleListData::encode const):
        (WebKit::WebCompiledContentRuleListData::decode):
        * Shared/WebCompiledContentRuleListData.h:
        (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
        * UIProcess/API/APIContentRuleList.h:
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::createExtension):

2019-04-17  John Wilander  <wilander@apple.com>

        Add prioritization of ad click conversions and cleaning of sent ad click conversions
        https://bugs.webkit.org/show_bug.cgi?id=196934
        <rdar://problem/49917773>

        Reviewed by Chris Dumez.

        In this description, by "pair" I mean { AdClickAttribution::Source, AdClickAttribution::Destination }.

        This patch adds handling of prioritization of conversions according to these rules:
        - If we have a matching unconverted attribution, convert it. This consumes the conversion.
        - If we have no previously converted attribution for this pair, just store.
        - If we have a previously converted attribution for this pair, replace it if the new one has higher priority.
        - If we had no matching unconverted attribution but do have a previously converted attribution for this
        pair, re-convert the previously converted attribution to make sure the highest priority gets set.

        This handling is in part done by dividing the previous m_adClickAttributionMap into 
        m_unconvertedAdClickAttributionMap and m_convertedAdClickAttributionMap, which now use a std::pair
        as key instead of a nested HashMap.

        This patch also changes AdClickAttributionManager::firePendingConversionRequests() so that it now
        removes attributions which have been sent out.

        Finally, AdClickAttributionManager::clear() no longer clears m_conversionBaseURLForTesting and
        m_isRunningTest since doing so caused test flakiness. It is now up to the test case that sets these
        members to also clear them when done.

        * NetworkProcess/AdClickAttributionManager.cpp:
        (WebKit::AdClickAttributionManager::storeUnconverted):
        (WebKit::AdClickAttributionManager::convert):
        (WebKit::AdClickAttributionManager::firePendingConversionRequests):
        (WebKit::AdClickAttributionManager::clear):
        (WebKit::AdClickAttributionManager::toString const):
        (WebKit::AdClickAttributionManager::setConversionURLForTesting):
        (WebKit::AdClickAttributionManager::ensureDestinationMapForSource): Deleted.
        (WebKit::AdClickAttributionManager::store): Deleted.
        * NetworkProcess/AdClickAttributionManager.h:
        (WebKit::AdClickAttributionManager::AdClickAttributionManager):
        (WebKit::AdClickAttributionManager::setConversionURLForTesting): Deleted.
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::storeAdClickAttribution):

2019-04-17  Tim Horton  <timothy_horton@apple.com>

        UI↔Web deadlock when printing with a JavaScript alert visible
        https://bugs.webkit.org/show_bug.cgi?id=196839
        <rdar://problem/49157642>

        Reviewed by Andy Estes.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
        (IPC::Connection::sendSyncReply):
        (IPC::Connection::dispatchSyncMessage):
        * Platform/IPC/Connection.h:
        (IPC::Connection::hasOutstandingOutgoingSynchronousReplies const):
        Keep track of whether we owe the other side of the connection any
        delayed sync replies.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _webViewPrintFormatter]):
        Most actions one can take with a _WKWebViewPrintFormatter involve
        synchronously messaging the Web Content process with an infinite timeout.
        Doing so while the Web Content process is awaiting a reply to a deferred-reply
        synchronous message (like, say, an alert()) results in an app-destroying deadlock.
        Instead of that, return a nil _WKWebViewPrintFormatter, indicating to the client
        that we can't print right now.

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_pageCountForPrintFormatter:]):
        (-[WKContentView _wk_printedDocument]):
        The above isn't sufficient, though, because a sync message could arrive and
        be handled between creation and use of the _WKWebViewPrintFormatter.
        So, we also bail with a zero page count and null CGPDFDocument immediately
        before we would send a sync message to the Web Content process. Clients
        handle this less gracefully (e.g. showing a zero page PDF), but it is
        very rare compared to the above case.

2019-04-17  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
        https://bugs.webkit.org/show_bug.cgi?id=196988
        <rdar://problem/49955328>

        Reviewed by Simon Fraser.

        Tapping on elements with cretain aria role attributes should trigger synthetic click the same way it does on form control elements. 

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::isAriaRoleForImmediateClick):
        (WebKit::nodeAlwaysRequiresClick):
        (WebKit::WebPage::handleSyntheticClick):

2019-04-17  Alex Christensen  <achristensen@webkit.org>

        WKRetainPtr's adoption constructor should be private
        https://bugs.webkit.org/show_bug.cgi?id=197019

        Reviewed by Tim Horton.

        RefPtr and RetainPtr have already done this.  It makes us use nicer syntax.

        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetDownloadClient):
        * UIProcess/API/cpp/WKRetainPtr.h:
        (WebKit::WKRetainPtr::WKRetainPtr):
        (WebKit::adoptWK):

2019-04-17  Alex Christensen  <achristensen@webkit.org>

        Fix crash during teardown of PingLoad
        https://bugs.webkit.org/show_bug.cgi?id=197024
        <rdar://problem/49973077>

        Reviewed by Jer Noble.

        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::initialize):
        Early return if weakThis is null.

2019-04-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r243926): [iOS] Release assertion when computing editor state during an overflow scroll triggered by layout
        https://bugs.webkit.org/show_bug.cgi?id=197012
        <rdar://problem/49908848>

        Reviewed by Simon Fraser.

        We hit the release assertion due to the following sequence of events:
        - Dispatch a queued event (in this case, a scroll event)
        - Invoke the scroll event listener, which modifies layout in some way
        - This scrolls an overflow scrollable container under the scope of layout
        - Overflow scrolling then calls didChangeSelection and triggers an editor state update, which updates layout

        In the case where the selection is in the main frame, we bail early due to the check for recursive layout (i.e.
        frameView->layoutContext().isInRenderTreeLayout()). However, in the case where the selection is inside a
        subframe, we end up skipping past this check, since the subframe's FrameView isn't currently laying out, and so
        we end up hitting the release assertion underneath the early return.

        To fix this, simply defer editor state updates due to overflow scrolling until the next remote layer tree commit
        instead of computing and sending the information immediately. While this only defers editor state updates during
        overflow scrolling, <rdar://problem/47258878> tracks making editor state updates deferred in the general case.

        Test: editing/selection/overflow-scroll-while-selecting-text.html

        * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
        (WebKit::WebEditorClient::overflowScrollPositionChanged):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didChangeOverflowScrollPosition):
        (WebKit::WebPage::didChangeSelection):
        (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition):
        * WebProcess/WebPage/WebPage.h:

2019-04-17  Chris Dumez  <cdumez@apple.com>

        Remember device orientation permission for the duration of the browsing session
        https://bugs.webkit.org/show_bug.cgi?id=196992
        <rdar://problem/49946067>

        Reviewed by Alex Christensen.

        Implement caching of device orientation permission decisions on the WebDeviceOrientationAndMotionAccessController,
        which is owned by the WebsiteDataStore. This way, if we already prompted the user of a given origin, we will
        remember the previous decision for the duration of the session and not prompt again.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        (toDeviceOrientationOrMotionPermissionState):
        (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
        (toWKWebsiteDeviceOrientationAndMotionAccessPolicy):
        (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.cpp: Added.
        (WebKit::WebDeviceOrientationAndMotionAccessController::shouldAllowDeviceOrientationAndMotionAccess):
        (WebKit::WebDeviceOrientationAndMotionAccessController::deviceOrientationPermission const):
        * UIProcess/WebsiteData/WebDeviceOrientationAndMotionAccessController.h: Copied from Source/WebCore/dom/DeviceOrientationAndMotionAccessController.h.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::deviceOrientationAndMotionAccessController):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
        * WebProcess/WebPage/WebPage.h:

2019-04-16  Andy Estes  <aestes@apple.com>

        [iOSMac] Use UIDocumentPickerViewController for picking files
        https://bugs.webkit.org/show_bug.cgi?id=196999
        <rdar://problem/49961414>

        Reviewed by Tim Horton.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _showDocumentPickerMenu]):
        Changed to present a UIDocumentPickerViewController on iOSMac.

        (-[WKFileUploadPanel documentPicker:didPickDocumentsAtURLs:]):
        (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
        Replaced a deprecated delegate method implementation.

2019-04-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] [WebKit2] Add support for honoring -[UIMenuItem dontDismiss]
        https://bugs.webkit.org/show_bug.cgi?id=196919
        <rdar://problem/41630459>

        Reviewed by Tim Horton.

        Adds modern WebKit support for -dontDismiss by implementing a couple of new platform hooks. Covered by a new
        layout test: editing/selection/ios/selection-after-changing-text-with-callout-menu.html.

        * Platform/spi/ios/UIKitSPI.h:

        Declare the private -dontDismiss property of UIMenuItem.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):

        Additionally teach the web view (not just the content view) to respond to the hook. This matters in the case
        where the WebKit client (most notably, Mail) overrides WKWebView methods to define custom actions in the menu
        controller. This scenario is exercised by the new layout test.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView willFinishIgnoringCalloutBarFadeAfterPerformingAction]):

        If an action was performed where callout bar fading was ignored, then in WebKit, don't allow selection changes
        to fade the callout bar until after the next remote layer tree commit.

        (-[WKContentView _updateChangedSelection:]):

        Stop suppressing selection updates when showing B/I/U controls, now that we can properly honor the -dontDismiss
        property. This was originally introduced in <rdar://problem/15199925>, presumably to ensure that B/I/U buttons
        (which have -dontDismiss set to YES) don't trigger selection change and end up dismissing themselves; however,
        if triggering B/I/U actually changes the selection rects, this also means that the selection rects on-screen
        would be stale after triggering these actions. This effect is most noticeable when bolding text.

        (-[WKContentView shouldAllowHidingSelectionCommands]):

2019-04-16  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed non-unified build fix after r244307.

        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

2019-04-16  Megan Gardner  <megan_gardner@apple.com>

        Allow sharing from imageSheet on an image document
        https://bugs.webkit.org/show_bug.cgi?id=196891
        <rdar://problem/25377386>

        Reviewed by Tim Horton.

        Allow sharing from an image sheet generated from an image document
        by storing the image URL and using it as a fallback for the URL.
        Store it as an image on WKElementAction to not accidentally trigger
        any actions that should actually be associated with pure URLs.

        * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
        (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:]):
        (-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:]):
        (-[_WKActivatedElementInfo _initWithType:URL:imageURL:location:title:ID:rect:image:userInfo:]):
        (-[_WKActivatedElementInfo imageURL]):
        (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]): Deleted.
        (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): Deleted.
        * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant showImageSheet]):
        (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
        (-[WKActionSheetAssistant showLinkSheet]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showAttachmentSheet]):
        (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
        (-[WKContentView _presentedViewControllerForPreviewItemController:]):

2019-04-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Cocoa] Add a way for Apple-internal clients to opt into recommended compatibility mode
        https://bugs.webkit.org/show_bug.cgi?id=196977
        <rdar://problem/49871194>

        Reviewed by Tim Horton.

        Add a helper method to query whether the navigation client should bypass policy safeguards when determining the
        recommended compatibility mode. We bypass policy safeguards in Cocoa platforms if the navigation delegate
        implements the new navigation delegate API.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::shouldBypassCompatibilityModeSafeguards const):
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::shouldBypassCompatibilityModeSafeguards const):

2019-04-16  Per Arne Vollan  <pvollan@apple.com>

        -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
        https://bugs.webkit.org/show_bug.cgi?id=196991
        <rdar://problem/45507423>

        Reviewed by Brent Fulgham.

        The credentials are stored in the Network process. To enable fetching credentials from the Network process,
        a proper process access type needs to be set for the credential Website data type.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::computeNetworkProcessAccessTypeForDataFetch):

2019-04-16  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
        https://bugs.webkit.org/show_bug.cgi?id=196995

        Reviewed by Brady Eidson.

        Always call CompletionHandlers.  Otherwise things hang or assert.
        I added an API test that asserts without this change so we don't regress this again.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):

2019-04-16  Chris Dumez  <cdumez@apple.com>

        URL set by document.open() is not communicated to the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=196941
        <rdar://problem/49237544>

        Reviewed by Geoff Garen.

        Whenever the UIProcess is notified of an explicit document.open() call, update the
        PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
        knows it committed a load (i.e. It is no longer showing the initially empty document).

        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::didExplicitOpen):
        * UIProcess/PageLoadState.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didExplicitOpenForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2019-04-16  Chris Dumez  <cdumez@apple.com>

        Show prompt for device orientation access if the client does not implement the corresponding API delegate
        https://bugs.webkit.org/show_bug.cgi?id=196971
        <rdar://problem/49945840>

        Reviewed by Alex Christensen.

        Show prompt for device orientation access if the client does not implement the corresponding
        API delegate, instead of rejecting access by default.

        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/Cocoa/WKOrientationAccessAlert.h: Added.
        * UIProcess/Cocoa/WKOrientationAccessAlert.mm: Added.
        (WebKit::presentOrientationAccessAlert):
        * WebKit.xcodeproj/project.pbxproj:

2019-04-16  Zalan Bujtas  <zalan@apple.com>

        REGRESSION(r243557)[ContentChangeObserver] Need to double tap text formatting elements in MS Word web app
        https://bugs.webkit.org/show_bug.cgi?id=196975
        <rdar://problem/49489849>

        Reviewed by Simon Fraser.

        This patch ensures that we always proceed with synthetic click on form elements.

        Covered by existing tests.

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

2019-04-16  Timothy Hatcher  <timothy@apple.com>

        FrameView base background color always starts white.
        https://bugs.webkit.org/show_bug.cgi?id=196976

        Reviewed by Beth Dakin.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage): Set m_backgroundColor before calling
        WebFrame::createWithCoreMainFrame so the call to create the FrameView
        for the empty page in transitionToCommittedForNewPage() gets
        the correct color from WebPage.

2019-04-16  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, fix the build with recent SDKs.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::WKWebViewState::store):

2019-04-16  Commit Queue  <commit-queue@webkit.org>

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

        Causing all WK2 Debug builds to exit early after Assertion
        failures. (Requested by ShawnRoberts on #webkit).

        Reverted changeset:

        "URL set by document.open() is not communicated to the
        UIProcess"
        https://bugs.webkit.org/show_bug.cgi?id=196941
        https://trac.webkit.org/changeset/244321

2019-04-15  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: CRASH when reopening tab with docked inspector on crashed page
        https://bugs.webkit.org/show_bug.cgi?id=196954
        <rdar://problem/48716433>

        Reviewed by Ryosuke Niwa.

        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):

2019-04-15  Chris Dumez  <cdumez@apple.com>

        URL set by document.open() is not communicated to the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=196941
        <rdar://problem/49237544>

        Reviewed by Geoffrey Garen.

        Whenever the UIProcess is notified of an explicit document.open() call, update the
        PageLoadState to make sure the URL is up-to-date. Also make sure the page / process
        knows it committed a load (i.e. It is no longer showing the initially empty document).

        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::didExplicitOpen):
        * UIProcess/PageLoadState.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didExplicitOpenForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2019-04-15  Alex Christensen  <achristensen@webkit.org>

        Stop using hyphenationFactor
        https://bugs.webkit.org/show_bug.cgi?id=196949
        <rdar://problem/49779594>

        Reviewed by Geoffrey Garen.

        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
        (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]):
        I added this use of hyphenationFactor in r241124 but the other changes in that revision make the use of hyphenationFactor redundant.
        There is a reason to remove it in the radar.

2019-04-15  Alex Christensen  <achristensen@webkit.org>

        Forward declare WKWebView in _WKDiagnosticLoggingDelegate.h

        * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
        This fixes builds where _WKDiagnosticLoggingDelegate.h is the only WebKit header included, such as my work on rdar://problem/35175989

2019-04-15  Jer Noble  <jer.noble@apple.com>

        Add a DiagnosticLogging method taking an arbitrary dictionary of values.
        https://bugs.webkit.org/show_bug.cgi?id=196773

        Reviewed by Alex Christensen.

        In addition to adding the new logging delegate method (and piping everything into it), 
        add a new APIObject class to represent a signed integer.

        * Shared/API/APINumber.h:
        * Shared/API/APIObject.h:
        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):
        * Shared/Cocoa/WKNSNumber.mm:
        (-[WKNSNumber dealloc]):
        (-[WKNSNumber objCType]):
        (-[WKNSNumber getValue:]):
        (-[WKNSNumber longLongValue]):
        (-[WKNSNumber _apiObject]):
        * Shared/UserData.cpp:
        (WebKit::UserData::encode):
        (WebKit::UserData::decode):
        * UIProcess/API/APIDiagnosticLoggingClient.h:
        * UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
        * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
        * UIProcess/Cocoa/DiagnosticLoggingClient.h:
        * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
        (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::didReceiveMessage):
        * UIProcess/WebPageDiagnosticLoggingClient.cpp:
        (WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
        * UIProcess/WebPageDiagnosticLoggingClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::logDiagnosticMessageWithValueDictionary):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
        (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValueDictionary):
        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

2019-04-15  Dean Jackson  <dino@apple.com>

        Provide option to not create a longpress gesture recognizer
        https://bugs.webkit.org/show_bug.cgi?id=196937
        <rdar://problem/49918278>

        Build fix for iOS platforms that don't have link preview.

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

2019-04-15  Brent Fulgham  <bfulgham@apple.com>

        InjectedBundle parameters often need initialization function called before unarchiving
        https://bugs.webkit.org/show_bug.cgi?id=189709
        <rdar://problem/44573653>

        Reviewed by Ryosuke Niwa.

        Handle the case where the InjectedBundle parameters do not successfully decode because they contain
        an unexpected class from the embedding program. If this happens, try decoding the bundle parameters
        after the bundle initialiation function runs, which gives the embedding program the opportunity to
        register additional classes that are safe for serialization.

        Extend WKWebProcessPlugIn with a method that returns the names of any custom classes that need
        to be serialized by the InjectedBundle.
        
        Create a new 'decodeBundleParameters' method that contains the logic that used to live in 'initialize'.
        Revise 'initialize' to call this new method.

        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::initialize): Use the new method.
        (WebKit::InjectedBundle::decodeBundleParameters): Added.
        (WebKit::InjectedBundle::setBundleParameters): Use 'decodeObjectOfClasses' with the more complete
        'classesForCoder' method to unarchive the passed bundle parameters, rather than the
        NSDictionary-specific method, since InjectedBundles often encode other types of objects, and the
        NSDictionary object may itself hold other kinds of objects.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
        (WebKit::WKWebProcessPlugIn::additionalClassesForParameterCoder): Added.

2019-04-15  Dean Jackson  <dino@apple.com>

        Provide option to not create a longpress gesture recognizer
        https://bugs.webkit.org/show_bug.cgi?id=196937
        <rdar://problem/49918278>

        Reviewed by Antoine Quint.

        A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.

        Add a property to toggle if we should add a long press gesture
        recognizer.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (shouldUsePreviewForLongPress):
        (-[WKContentView shouldUsePreviewForLongPress]):

2019-04-15  Don Olmstead  <don.olmstead@sony.com>

        [CMake] WebCore derived sources should only be referenced inside WebCore
        https://bugs.webkit.org/show_bug.cgi?id=196904

        Reviewed by Konstantin Tokarev.

        Remove reference to DERIVED_SOURCES_WEBCORE_DIR in PlatformMac.cmake.

        * PlatformMac.cmake:

2019-04-15  Zalan Bujtas  <zalan@apple.com>

        DrawingArea should only capture painting related milestones
        https://bugs.webkit.org/show_bug.cgi?id=196926
        <rdar://problem/48003845>

        Reviewed by Tim Horton.

        While dispatching layout milestones (mixture of layout and painting items), the associated drawing areas should only capture the painting related milestones.
        These captured milestones get dispatched later in the commit handler to ensure that they are not forwarded prematurely.
        However the truly layout related milestones (e.g. DidFirstVisuallyNonEmptyLayout) should be dispatched right away with no delay.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::newlyReachedPaintingMilestones const):
        (WebKit::RemoteLayerTreeTransaction::setNewlyReachedPaintingMilestones):
        (WebKit::RemoteLayerTreeTransaction::newlyReachedLayoutMilestones const): Deleted.
        (WebKit::RemoteLayerTreeTransaction::setNewlyReachedLayoutMilestones): Deleted.
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::encode const):
        (WebKit::RemoteLayerTreeTransaction::decode):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::addMilestonesToDispatch):
        (WebKit::DrawingArea::dispatchDidReachLayoutMilestone): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        (WebKit::RemoteLayerTreeDrawingArea::addMilestonesToDispatch):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): Deleted.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dispatchDidReachLayoutMilestone):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        (WebKit::TiledCoreAnimationDrawingArea::addMilestonesToDispatch):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedPaintingMilestones):
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
        (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Deleted.
        (WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): Deleted.

2019-04-15  John Wilander  <wilander@apple.com>

        Send delayed Ad Click Attribution conversion requests to the click source
        https://bugs.webkit.org/show_bug.cgi?id=196838
        <rdar://problem/47650157>

        Reviewed by Chris Dumez and Youenn Fablet.

        This patch schedules a conversion request with appropriate data going to the
        click source as a result of an ad click conversion.

        WebKit::AdClickAttributionManager makes use of existing WebKit::PingLoad
        infrastructure to make the request. This will probably be reworked into a
        dedicated load class further on.

        New test infrastructure allows for an override of both the conversion URL
        and the 24-48 hour timer.

        * NetworkProcess/AdClickAttributionManager.cpp: Added.
        (WebKit::AdClickAttributionManager::ensureDestinationMapForSource):
        (WebKit::AdClickAttributionManager::store):
        (WebKit::AdClickAttributionManager::startTimer):
            Convenience function to support test override.
        (WebKit::AdClickAttributionManager::convert):
            This function now sets the timer.
        (WebKit::AdClickAttributionManager::fireConversionRequest):
            Fire an individual request.
        (WebKit::AdClickAttributionManager::firePendingConversionRequests):
            This is the timer function that iterates over all pending attributions.
        (WebKit::AdClickAttributionManager::clear):
            Now clears the two new test settings members.
        (WebKit::AdClickAttributionManager::toString const):
        * NetworkProcess/AdClickAttributionManager.h: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.h.
        (WebKit::AdClickAttributionManager::AdClickAttributionManager):
        (WebKit::AdClickAttributionManager::setPingLoadFunction):
        (WebKit::AdClickAttributionManager::setOverrideTimerForTesting):
        (WebKit::AdClickAttributionManager::setConversionURLForTesting):
        * NetworkProcess/NetworkAdClickAttribution.cpp: Renamed from Source/WebKit/NetworkProcess/NetworkAdClickAttribution.cpp.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::storeAdClickAttribution):
        (WebKit::NetworkProcess::dumpAdClickAttribution):
        (WebKit::NetworkProcess::clearAdClickAttribution):
        (WebKit::NetworkProcess::setAdClickAttributionOverrideTimerForTesting):
        (WebKit::NetworkProcess::setAdClickAttributionConversionURLForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
        (WebKit::NetworkSession::setAdClickAttributionOverrideTimerForTesting):
        (WebKit::NetworkSession::setAdClickAttributionConversionURLForTesting):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::m_blobFiles):
        (WebKit::PingLoad::initialize):
            The PingLoad constructor is now split in two to allow for construction
            without a WebKit::NetworkConnectionToWebProcess object. The body of
            the constructor was moved into the new initialize() function which is
            shared between constructors.
        * NetworkProcess/PingLoad.h:
        * Sources.txt:
            Removed NetworkProcess/NetworkAdClickAttribution.cpp and added
            NetworkProcess/NetworkAdClickAttribution.cpp.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetAdClickAttributionOverrideTimerForTesting):
        (WKPageSetAdClickAttributionConversionURLForTesting):
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::dumpAdClickAttribution): Deleted.
        (WebKit::NetworkProcessProxy::clearAdClickAttribution): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dumpAdClickAttribution):
        (WebKit::WebPageProxy::clearAdClickAttribution):
        (WebKit::WebPageProxy::setAdClickAttributionOverrideTimerForTesting):
        (WebKit::WebPageProxy::setAdClickAttributionConversionURLForTesting):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::dumpAdClickAttribution): Deleted.
        (WebKit::WebProcessPool::clearAdClickAttribution): Deleted.
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-15  Devin Rousso  <drousso@apple.com>

        WebDriver: Set Cookie endpoint does not correctly set subdomain cookies
        https://bugs.webkit.org/show_bug.cgi?id=196872
        <rdar://problem/49233240>

        Reviewed by Joseph Pecoraro.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):
        Rather than try to "force" the cookie to be set on the current active URL, use the cookie
        itself to figure out which domain it should be set on.

2019-04-15  Philippe Normand  <pnormand@igalia.com>

        [GTK][WPE] Add enable-media websetting
        https://bugs.webkit.org/show_bug.cgi?id=196863

        Reviewed by Michael Catanzaro.

        It can be useful for headless browsers, for instance. The setting is enabled by default.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty):
        (webKitSettingsGetProperty):
        (webkit_settings_class_init):
        (webkit_settings_get_enable_media):
        (webkit_settings_set_enable_media):
        * UIProcess/API/gtk/WebKitSettings.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitSettings.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2019-04-14  Rob Buis  <rbuis@igalia.com>

        Link prefetch not useful for top-level navigation
        https://bugs.webkit.org/show_bug.cgi?id=195623

        Reviewed by Youenn Fablet.

        Cache cross-domain top-level prefetches in a dedicated cache. When a navigation
        to the same url is done within a threshold (5 seconds), reuse the
        prefetch cache entry, move it to the disk cache and navigate to
        the url, meaning no extra network trip is needed. When not used within
        the threshold period, the prefetch entry will be erased using a timer.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::lowMemoryHandler):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::prefetchCache):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didReceiveBuffer):
        (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
        (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/PrefetchCache.cpp: Added.
        (WebKit::PrefetchCache::Entry::Entry):
        (WebKit::PrefetchCache::PrefetchCache):
        (WebKit::PrefetchCache::~PrefetchCache):
        (WebKit::PrefetchCache::clear):
        (WebKit::PrefetchCache::take):
        (WebKit::PrefetchCache::store):
        (WebKit::PrefetchCache::sessionPrefetchMap const):
        (WebKit::PrefetchCache::clearExpiredEntries):
        * NetworkProcess/cache/PrefetchCache.h: Added.
        (WebKit::PrefetchCache::Entry::response const):
        (WebKit::PrefetchCache::Entry::releaseBuffer):
        * Shared/WebPreferences.yaml:
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-14  Andy Estes  <aestes@apple.com>

        [Cocoa] WKCustomProtocolLoader should store a WeakPtr to its LegacyCustomProtocolManagerProxy
        https://bugs.webkit.org/show_bug.cgi?id=196893
        <rdar://problem/48318983>

        Reviewed by Anders Carlsson.

        In addition to manually invalidating each WKCustomProtocolLoader's _customProtocolManagerProxy
        pointer when the LegacyCustomProtocolManagerClient is invalidated, use a WeakPtr in case the
        LegacyCustomProtocolManagerProxy is ever destroyed without first invalidating the client.
        Also add null pointer checks to NSURLConnectionDelegate methods, which might be called after
        the LegacyCustomProtocolManagerProxy has been destroyed.

        * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
        (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
        (-[WKCustomProtocolLoader cancel]):
        (-[WKCustomProtocolLoader connection:didFailWithError:]):
        (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
        (-[WKCustomProtocolLoader connection:didReceiveData:]):
        (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
        (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
        (WebKit::LegacyCustomProtocolManagerClient::startLoading):
        (WebKit::LegacyCustomProtocolManagerClient::invalidate):
        (-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Deleted.
        * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:

2019-04-14  Don Olmstead  <don.olmstead@sony.com>

        [CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=196742

        Reviewed by Konstantin Tokarev.

        Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.

        * CMakeLists.txt:
        * PlatformWin.cmake:
        
        Remove use of DERIVED_SOURCES_JAVASCRIPTCORE_DIR.

2019-04-13  Chris Dumez  <cdumez@apple.com>

        [ Mac Debug ] TestWebKitAPI.ProcessSwap.ReuseSuspendedProcessForRegularNavigationRetainBundlePage is a flaky crash
        https://bugs.webkit.org/show_bug.cgi?id=196548
        <rdar://problem/49567254>

        Reviewed by Darin Adler.

        Update ProvisionalPageProxy methods to more consistently ignore unexpected IPC from the process. Previously,
        some of the methods were doing this, but some other like didFailProvisionalLoadForFrame() weren't and this
        was leading to this flaky crash. The issue is that if we do the load in an existing process that was recently
        doing, there may be leftover IPC for the same pageID and this IPC gets received by the ProvisionalPageProxy
        even though it is from a previous navigation. For this reason, the ProvisionalPageProxy should ignore all
        incoming IPC that is not for its associated navigation.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
        (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
        (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
        (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        (WebKit::ProvisionalPageProxy::didPerformServerRedirect):
        (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
        (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):

2019-04-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, try to fix the internal build after r244239

        Force the bots to regenerate WKWebpagePreferences.h by touching the file. Adds a `Foundation/Foundation.h`
        import that was missing anyways.

        * UIProcess/API/Cocoa/WKWebpagePreferences.h:

2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        Enable modern compatibility mode by default in WKWebView on some devices
        https://bugs.webkit.org/show_bug.cgi?id=196883
        <rdar://problem/49864527>

        Reviewed by Tim Horton.

        Make some minor adjustments to new API.

        * Shared/WebCompatibilityMode.h:

        Rename WebCompatibilityMode::Default to WebCompatibilityMode::Recommended.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

        Now that the role of the UseModernCompatibilityModeByDefault debug preference is limited to bypassing linked-on-
        or-after and app bundle compatibility hacks, we no longer make this default to true in iOSMac.

        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKNavigationDelegate.h:

        Rename the withPreferences: label to just preferences:.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/ios/WebPageProxyIOS.mm:

2019-04-12  Brian Burg  <bburg@apple.com>

        WebDriver: fix typo in EnterFullscreen.js in error-handling code
        https://bugs.webkit.org/show_bug.cgi?id=196882
        <rdar://problem/49867122>

        Reviewed by Devin Rousso.

        * UIProcess/Automation/atoms/EnterFullscreen.js:
        (enterFullscreen):

2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed fix for non-unified build.

        * Shared/PrintInfo.cpp:
        Add missing include from r244202.

2019-04-12  Saam barati  <sbarati@apple.com>

        Sometimes we need to user fewer CPUs in our threading calculations
        https://bugs.webkit.org/show_bug.cgi?id=196794
        <rdar://problem/49389497>

        Reviewed by Yusuke Suzuki.

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

2019-04-12  Devin Rousso  <drousso@apple.com>

        WebDriver: evaluating javascript shouldn't fail if a dialog is shown
        https://bugs.webkit.org/show_bug.cgi?id=196847
        <rdar://problem/49609396>

        Reviewed by Brian Burg.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::willShowJavaScriptDialog):

2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>

        WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
        https://bugs.webkit.org/show_bug.cgi?id=196845

        Reviewed by Ryosuke Niwa.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        * NetworkProcess/NetworkDataTask.cpp:
        * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
        * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Include wtf/Forward.h for String and CompletionHandler fwd decls.
        * NetworkProcess/NetworkProcess.cpp:
        * NetworkProcess/NetworkResourceLoadMap.cpp:
        * NetworkProcess/NetworkResourceLoadMap.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/PingLoad.h:
        * Shared/WebCompiledContentRuleListData.cpp:
        * Shared/gtk/WebEventFactory.cpp:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        * UIProcess/InspectorTargetProxy.cpp:
        * UIProcess/PageClient.h:
        * UIProcess/ProcessAssertion.cpp:
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageInspectorTargetAgent.h:
        * UIProcess/geoclue/GeoclueGeolocationProvider.cpp:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetDatabaseQuota):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
        Add missing includes / forward declarations to address compiler errors on GTK / WinCairo.

2019-04-12  Eric Carlson  <eric.carlson@apple.com>

        Update AudioSession route sharing policy
        https://bugs.webkit.org/show_bug.cgi?id=196776
        <rdar://problem/46501611>

        Reviewed by Jer Noble.

        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
        (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]):

2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebsitePolicies doesn't copy its media source policy in WebsitePolicies::copy
        https://bugs.webkit.org/show_bug.cgi?id=196862

        Reviewed by Darin Adler.

        Add a missing bit of code to copy m_mediaSourcePolicy over when making a copy of WebsitePolicies. This doesn't
        have any observable effect, since m_mediaSourcePolicy isn't currently exposed as SPI on WKWebpagePreferences.

        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):

2019-04-12  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Make -webkit-overflow-scrolling be a no-op
        https://bugs.webkit.org/show_bug.cgi?id=196803
        rdar://problem/49078202

        Reviewed by Antti Koivisto.

        Flip LegacyOverflowScrollingTouchEnabled to false.

        * Shared/WebPreferences.yaml:

2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Software keyboard is shown too frequently on some websites
        https://bugs.webkit.org/show_bug.cgi?id=195856
        <rdar://problem/49191395>

        Reviewed by Darin Adler.

        On some websites, hidden editable elements are very frequently focused upon user interaction. Currently, this
        causes the software keyboard to pop in and out unexpectedly; luckily, these same sites also apply
        inputmode="none" to the hidden editable element, which ought to ensure that the software keyboard doesn't appear
        when the element is focused.

        However, since we disabled support for inputmode="none" in r240497, the software keyboard is no longer
        suppressed, and becomes a big nuissance. r240497 removed support for this feature because, when using a hardware
        keyboard, pressing the globe key no longer showed UI for switching languages. However, support for inputmode
        none makes a much larger impact when a software keyboard is used (since the entire software keyboard animates in
        and out), whereas a hardware keyboard only displays an input accessory view. For this reason, we can mitigate
        this bug without reintroducing <rdar://problem/47406553> by re-enabling inputmode="none", but only when a
        hardware keyboard is not attached.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (hardwareKeyboardAvailabilityChangedCallback):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView shouldShowAutomaticKeyboardUI]):

        Don't show the keyboard if inputmode is none and a hardware keyboard is not attached.

        (-[WKContentView _hardwareKeyboardAvailabilityChanged]):

        Reload input views if the inputmode is none to ensure that if a hardware keyboard is attached while editing an
        element with inputmode="none", we'll show the input accessory view once again.

2019-04-12  Antoine Quint  <graouts@apple.com>

        Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
        https://bugs.webkit.org/show_bug.cgi?id=196830
        <rdar://problem/49124313>

        Reviewed by Wenson Hsieh.

        We add a new policy to determine whether simulated mouse events dispatch are allowed.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * Shared/WebsitePoliciesData.h:
        * Shared/WebsiteSimulatedMouseEventsDispatchPolicy.h: Added.
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-12  Chris Dumez  <cdumez@apple.com>

        [iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websocket/tests/hybi/network-process-crash-error.html is a flaky crash
        https://bugs.webkit.org/show_bug.cgi?id=196781
        <rdar://problem/49789381>

        Reviewed by Darin Adler.

        When the network process gets terminated by the client, the NetworkProcessProxy object (and thus its DownloadProxyMap member) get
        destroyed right away, before we get a call to didClose(IPC::Connection&). As a result, if there are ongoing downloads at the time
        of the termination, we will hit the assertion above. To address the issue, update the NetworkProcessProxy destructor to invalidate
        its DownloadProxyMap member, similator to what it does in didClose(IPC::Connection&).

        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::invalidate):
        (WebKit::DownloadProxyMap::processDidClose): Deleted.
        * UIProcess/Downloads/DownloadProxyMap.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::didClose):

2019-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] REGRESSION(r243860): Many tests failing
        https://bugs.webkit.org/show_bug.cgi?id=196791

        Reviewed by Joanmarie Diggs.

        Calling updateAccessibilityTree() on document loaded was causing a re-layout because of the backing store update
        that confused all those tests. We shouldn't need to update the accessibility tree on document load, it should
        happen automatically when root object is attached/detached. This patch emits children-changed::add when the root
        object wrapper is attached and children-changed::remove when the root object is detached. That way ATs are
        notified of the changes in the accessibility tree.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Remove call to WebPage::updateAccessibilityTree().
        * WebProcess/WebPage/WebPage.h: Remove updateAccessibilityTree().
        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
        (coreRootObjectWrapperDetachedCallback): Emit children-changed::remove.
        (rootWebAreaWrapper): Helper to get the root WebArea wrapper.
        (accessibilityRootObjectWrapper): Set the parent here when root object is created and emit children-changed::add.
        (webkitWebPageAccessibilityObjectRefChild): Dot no set the parent here, it's now set when the root object is created.
        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Remove webkitWebPageAccessibilityObjectRefresh().
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:

2019-04-11  Megan Gardner  <megan_gardner@apple.com>

        Update 'Save Image' to more clear instructions
        https://bugs.webkit.org/show_bug.cgi?id=196833
        <rdar://problem/47446845>

        Reviewed by Wenson Hsieh.

        Just updating to a new string.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):

2019-04-11  Chris Dumez  <cdumez@apple.com>

        Unable to run system Safari with trunk WebKit
        https://bugs.webkit.org/show_bug.cgi?id=196777
        <rdar://problem/49784574>

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        Add a linkedOnAfter check so that throwing exceptions when related web views use a different
        data store only happens for apps rebuilt using recent SDK.

        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/Cocoa/VersionChecks.mm:
        (WebKit::linkedOnOrAfter):
        - By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
          use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
          be controlled by the caller.
        - In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
          non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
          true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
          0 value for sdkVersion.

2019-04-11  Zalan Bujtas  <zalan@apple.com>

        Add @page margin support
        https://bugs.webkit.org/show_bug.cgi?id=196680
        <rdar://problem/45217707>

        Reviewed by Tim Horton.

        * Shared/PrintInfo.cpp:
        (WebKit::PrintInfo::encode const):
        (WebKit::PrintInfo::decode):
        * Shared/PrintInfo.h:
        * Shared/WebPreferences.yaml:
        * Shared/gtk/PrintInfoGtk.cpp:
        (WebKit::PrintInfo::PrintInfo):
        * Shared/mac/PrintInfoMac.mm:
        (WebKit::PrintInfo::PrintInfo):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageComputePagesForPrinting):
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetPageAtRuleSupportEnabled):
        (WKPreferencesGetPageAtRuleSupportEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/GenericCallback.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::computedPagesCallback):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/WKPrintingView.mm:
        (pageDidComputePageRects):
        (-[WKPrintingView _askPageToComputePageRects]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::beginPrinting):
        (WebKit::WebPage::computePagesForPrinting):
        (WebKit::WebPage::computePagesForPrintingImpl):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):

2019-04-11  Dean Jackson  <dino@apple.com>

        Extract UTI mapping and allow for additions
        https://bugs.webkit.org/show_bug.cgi?id=196822
        <rdar://problem/49822339>

        Reviewed by Tim Horton.

        Use the new helper to map MIME type to UTI.

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


2019-04-11  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION (r244182): RemoteLayerTreeDrawingArea::flushLayers() should not be reentrant
        https://bugs.webkit.org/show_bug.cgi?id=196825

        Reviewed by Simon Fraser.

        Ensure the layer transactions IDs are sequential. So bail out of
        RemoteLayerTreeDrawingArea::flushLayers() if reentrancy is detected.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):

2019-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Allow the MediaSource API to be enabled via website policy
        https://bugs.webkit.org/show_bug.cgi?id=196429
        <rdar://problem/48774333>

        Reviewed by Tim Horton.

        Adds support for using WebsitePolicies to determine whether to enable the MediaSource API.

        * Shared/WebPreferences.yaml:

        Disengage the mediaSourceEnabled internal preference from the corresponding WebCore setting; to ensure that
        setting the preference to `true` still results in enabling the MediaSource API, we instead make it such that
        turning on mediaSourceEnabled causes WebsitePolicies to set its WebsiteMediaSourcePolicy to Enable.

        In the future, we should deprecate and remove this preference, in favor of simply setting preferred
        compatibility mode on WKWebpagePreferences.

        * Shared/WebPreferences.yaml:
        * Shared/WebsiteMediaSourcePolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):

        Add plumbing for m_mediaSourcePolicy in the set of website policies.

        (WebKit::WebsitePoliciesData::applyToDocumentLoader):

        Update the document loader with the given media source policy. There are two possibilities when applying the set
        of policies to the document loader; either the document loader is already attached to a Frame, or the document
        loader is yet to be attached to a Frame.

        In the first case, we update Frame's settings on the spot, by calling the new applyPoliciesToSettings helper
        method. In the second scenario, we stash the policy state on DocumentLoader; when the DocumentLoader is attached
        to a Frame, we'll then update the Frame's settings using DocumentLoader's policy.

        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageNavigationClient):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

        Move code that adjusts website policies after deciding policies for the navigation action from NavigationClient
        ::decidePolicyForNavigationAction to the completion handler of the policy listener. This allows us to respect
        default website policies on the web view configuration, even when using the C API to set the navigation client,
        and also allows us to have a single call site for adjustPoliciesForCompatibilityMode. This also enables our
        layout tests to opt into modern compatibility mode by default, when specifying modern compatibility mode on
        webpage preferences.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-11  Antti Koivisto  <antti@apple.com>

        REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations()
        https://bugs.webkit.org/show_bug.cgi?id=196813
        <rdar://problem/49393264>

        Reviewed by Simon Fraser.

        No test, can't repro.

        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

        Null check the nodes.

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

        Regression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
        https://bugs.webkit.org/show_bug.cgi?id=196784

        Reviewed by Antti Koivisto.

        When we enter accelerated compositing mode in the new process, we supposed to *close* the last
        SuspendedPageProxy, not destroy it. This was causing flakiness in the test because it was testing
        that we were using the SuspendedPageProxy's process for a cross-site link navigation, which is
        an optimization. This optimization was partly broken by r244144 as the SuspendedPageProxy would
        not sometimes be gone by the time we need it.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):

2019-04-10  Alex Christensen  <achristensen@webkit.org>

        WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
        https://bugs.webkit.org/show_bug.cgi?id=196809
        <rdar://49800762>

        Reviewed by Brady Eidson.

        * UIProcess/API/Cocoa/WKNavigationResponse.mm:
        (-[WKNavigationResponse _downloadAttribute]):

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

        REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
        https://bugs.webkit.org/show_bug.cgi?id=196797
        <rdar://problem/48484715>

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
        Validate the set of modifier keys pressed when handling a key event for scrolling:
        Ignore key events with multiple modifier keys pressed.
        Ignore key events with an invalid modifier key pressed for a given primary key.

2019-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>

        requestAnimationFrame should execute before the next frame
        https://bugs.webkit.org/show_bug.cgi?id=177484

        Reviewed by Simon Fraser.

        Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
        a single call to Page::updateRendering(). This new function implements 
        "Update the rendering" step of the HTML Event Loop specification
        <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
        (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
        (WebKit::DrawingAreaCoordinatedGraphics::display):
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::layerFlushTimerFired):

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        -- Call Page::updateRendering() to make sure that "Update the rendering"
           happens immediately before updating the page.

        -- Move the call to RemoteLayerBackingStoreCollection::willFlushLayers()
           to be exactly before flushing the layers. This fixes the assertion
           ASSERT(m_inLayerFlush) which was firing when running a layout test.
           RemoteLayerTreeDrawingArea::flushLayers() now can call itself through
           TestRunner::notifyDone(). flushLayers() was calling willFlushLayers()
           twice before calling didFlushLayers().

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::layoutIfNeeded):
        (WebKit::WebPage::updateRendering):
        (WebKit::WebPage::willDisplayPage): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):

2019-04-10  Devin Rousso  <drousso@apple.com>

        Web Inspector: save sheet should be anchored underneath the tab bar when detached
        https://bugs.webkit.org/show_bug.cgi?id=196722
        <rdar://problem/49613280>

        Reviewed by Timothy Hatcher.

        * WebProcess/WebPage/WebInspectorUI.h:
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::changeSheetRect): Added.
        * UIProcess/WebInspectorProxy.messages.in:
        * UIProcess/WebInspectorProxy.h:
        (WebKit::WebInspectorProxy::sheetRect const): Added.
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::setSheetRect): Added.
        (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (-[WKWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
        (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformSetSheetRect): Added.
        * UIProcess/wpe/WebInspectorProxyWPE.cpp:
        (WebKit::WebInspectorProxy::platformSetSheetRect): Added.

        * WebProcess/WebPage/RemoteWebInspectorUI.h:
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::changeSheetRect): Added.
        * UIProcess/RemoteWebInspectorProxy.messages.in:
        * UIProcess/RemoteWebInspectorProxy.h:
        (WebKit::RemoteWebInspectorProxy::sheetRect const): Added.
        * UIProcess/RemoteWebInspectorProxy.cpp:
        (WebKit::RemoteWebInspectorProxy::setSheetRect): Added.
        (WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
        * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
        (-[WKRemoteWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
        (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
        (WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.

2019-04-10  Andy Estes  <aestes@apple.com>

        [iOS] Let PDFHostViewController specify the background color to use for WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=196785
        <rdar://problem/48240051>

        Reviewed by Tim Horton.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_initWithFrame:webView:mimeType:]):

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

        Unreviewed, rolling out r244146.

        Caused a few DeviceOrientation API test failures on iOS

        Reverted changeset:

        "Unable to run system Safari with trunk WebKit"
        https://bugs.webkit.org/show_bug.cgi?id=196777
        https://trac.webkit.org/changeset/244146

2019-04-10  Devin Rousso  <drousso@apple.com>

        Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
        https://bugs.webkit.org/show_bug.cgi?id=196725
        <rdar://problem/49669810>

        Reviewed by Timothy Hatcher.

        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::showMainResourceForFrame):

2019-04-10  Youenn Fablet  <youenn@apple.com>

        Clear Cache Storage structures before removing all related files
        https://bugs.webkit.org/show_bug.cgi?id=196650

        Reviewed by Alex Christensen.

        Previously, we were clearing files in parallel to clearing the internal CacheStorage structures.
        To make things more deterministic, clear files/folders directly
        after CachesStorage structures have finished being cleared.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):

2019-04-10  Alex Christensen  <achristensen@webkit.org>

        Add SPI WKNavigationResponse._downloadAttribute
        https://bugs.webkit.org/show_bug.cgi?id=196755
        <rdar://49587365>

        Reviewed by Brady Eidson.

        * UIProcess/API/APINavigationResponse.h:
        * UIProcess/API/Cocoa/WKNavigationResponse.mm:
        (-[WKNavigationResponse _downloadAttribute]):
        * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2019-04-10  Youenn Fablet  <youenn@apple.com>

        SWClientConnection should not double hop to fire some events
        https://bugs.webkit.org/show_bug.cgi?id=196735

        Reviewed by Alex Christensen.

        Removed unnecessary method.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        * WebProcess/Storage/WebSWClientConnection.h:

2019-04-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix iokit-get-properties sandbox violations
        https://bugs.webkit.org/show_bug.cgi?id=196782
        <rdar://problem/49497720>

        Reviewed by Brent Fulgham.

        Add iokit properties to the WebContent sandbox on iOS.

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

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

        Add modern API for overriding the page's specified viewport configuration
        https://bugs.webkit.org/show_bug.cgi?id=167734
        <rdar://problem/30331795>

        Reviewed by Simon Fraser.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        Plumb overrideViewportArguments in WebPageCreationParameters, so that
        if the process crashes (or swaps) they are maintained.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (viewportArgumentsFromDictionary):
        (-[WKWebView _overrideViewportWithArguments:]):
        Add SPI to set override viewport arguments. Parse them into a ViewportArguments
        object and use the existing (now improved) overrideViewportArguments mechanism
        to take over the page's viewport arguments.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setOverrideViewportArguments):
        * WebProcess/WebPage/WebPage.cpp:
        Plumb overrideViewportArguments around more.

2019-04-10  Jiewen Tan  <jiewen_tan@apple.com>

        Add runJavaScriptInFrame for WebPageProxy/WebPage
        https://bugs.webkit.org/show_bug.cgi?id=196750
        <rdar://problem/49755738>

        Reviewed by Youenn Fablet.

        Tests of the new method will be covered by the internal counterpart.

        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::loadData):
        * UIProcess/WebFrameProxy.h:
        Add a comment.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrame):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        Merge the above two runJavaScriptInMainFrame*.
        (WebKit::WebPageProxy::runJavaScriptInFrame):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadDataInFrame):
        Add an assertion.
        (WebKit::WebPage::runJavaScript):
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPage::runJavaScriptInFrame):
        (WebKit::WebPage::runJavaScriptInMainFrame): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        Unable to run system Safari with trunk WebKit
        https://bugs.webkit.org/show_bug.cgi?id=196777
        <rdar://problem/49784574>

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        Add a linkedOnAfter check so that throwing exceptions when related web views use a different
        data store only happens for apps rebuilt using recent SDK.

        * UIProcess/Cocoa/VersionChecks.h:
        * UIProcess/Cocoa/VersionChecks.mm:
        (WebKit::linkedOnOrAfter):
        - By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
          use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
          be controlled by the caller.
        - In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
          non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
          true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
          0 value for sdkVersion.

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

        Regression(r240562) Audio sometimes keeps playing in previous process after a process-swap
        https://bugs.webkit.org/show_bug.cgi?id=196774
        <rdar://problem/49460572>

        Reviewed by Alex Christensen.

        r240562 added logic to prevent flashing on navigation. When we receive the DidFailToSuspendAfterProcessSwap
        IPC from the previous process, we would delay closing the WebPage in that process until EnterAcceleratedCompositingMode
        IPC is received from the new process. The issue is that this was racy as we would receive the EnterAcceleratedCompositingMode
        IPC from the new process *before* receiving the DidFailToSuspendAfterProcessSwap IPC from the previous process, which which
        case we would fail to close the WebPage and audio could keep playing.

        To address the issue, the WebPageProxy keeps track of its last suspended page and notifies it whenever it receives the
        EnterAcceleratedCompositingMode IPC. If the suspended page already received the DidFailToSuspendAfterProcessSwap IPC, it
        will close the page. Otherwise, it will set a boolean data member indicating that we should not delay page closing when
        the DidFailToSuspendAfterProcessSwap is eventually received.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):
        (WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        * UIProcess/WebProcessPool.h:

2019-04-10  Timothy Hatcher  <timothy@apple.com>

        WKScrollView background color does not match WKWebView before content is loaded.
        https://bugs.webkit.org/show_bug.cgi?id=196745
        rdar://problem/49750810

        Reviewed by Megan Gardner.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (scrollViewBackgroundColor): Default to _contentView.backgroundColor on invalid base color.
        (-[WKWebView _processDidExit]): Reset to _contentView.backgroundColor.
        (-[WKWebView setBackgroundColor:]): Call _updateScrollViewBackground since it can use
        _contentView.backgroundColor and it has changed.

2019-04-10  Megan Gardner  <megan_gardner@apple.com>

        Fix text autoscrolling when typing in modern webkit
        https://bugs.webkit.org/show_bug.cgi?id=196718
        <rdar://problem/49225507>

        Reviewed by Tim Horton.

        For staging only. We need to turn off UIKit's scrolling behavior to land
        the changes we are making. To keep from the build ever breaking,
        I am temporarily circumventing the changes in UIKit. This will be removed
        once the next UIKit submission happens.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKUIWKTextInteractionAssistant scrollSelectionToVisible]):
        (-[WKContentView setUpTextSelectionAssistant]):

2019-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOSMac] Opt into modern compatibility mode by default
        https://bugs.webkit.org/show_bug.cgi?id=196763
        <rdar://problem/49038732>

        Reviewed by Tim Horton.

        Achieve this by limiting legacy compatibility mode by default to non-iOSMac iOS only.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-04-10  Alex Christensen  <achristensen@webkit.org>

        RemoteObjectRegistry message receiver should be removed when WebPage::close is called instead of waiting until dealloc
        https://bugs.webkit.org/show_bug.cgi?id=196744
        <rdar://49415309>

        Reviewed by Chris Dumez.

        This is a similar problem to the one I fixed in r241306 so I piggy-backed on the same test.
        When you do a cross site navigation but the previous page is in a suspended process then you navigate back,
        you can get two WebPage objects in the same process with the same IDs.  WebPage::close has been called
        on the old one which is supposed to make it so all the message receivers associated with it have been removed
        so we don't have any loss of communication, but we missed the RemoteObjectRegistry messages, which are owned
        by the ObjC bundle object wrapping the WebPage (which can keep it alive if a strong reference to it is held).
        To fix the assertion that happens in this case and the resulting communication breakage, teach the WebPage about
        these messages so it can tear down the message receiver with the others it removes at close time.

        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController dealloc]):
        (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::addRemoteObjectRegistry):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):
        * WebProcess/WebPage/WebPage.h:

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

        Unreviewed, drop SuspendedPageProxy data member that is unused after r244075.

        * UIProcess/SuspendedPageProxy.h:

2019-04-10  Antoine Quint  <graouts@apple.com>

        Enable Pointer Events on watchOS
        https://bugs.webkit.org/show_bug.cgi?id=196771
        <rdar://problem/49040909>

        Reviewed by Dean Jackson.

        * Configurations/FeatureDefines.xcconfig:

2019-04-10  Brady Eidson  <beidson@apple.com>

        Background tabs are not fully reactivated after a link is opened from an external application.
        <rdar://problem/49533278> and https://bugs.webkit.org/show_bug.cgi?id=196705

        Reviewed by Chris Dumez.

        If an app unparents a WKWebView right after activation but before the "applicationWillEnterForeground" notification
        is dispatched, then that WKWebView is in a broken state with a frozen layer tree.

        The WKApplicationStateTrackingView logic needs to be a little more resilient.

        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView willMoveToWindow:]): When clearing the window, remember the current background state.
        (-[WKApplicationStateTrackingView didMoveToWindow]): If our last observed background state doesn't match the current
          background state then fake the relevant notification.
        (-[WKApplicationStateTrackingView _applicationDidEnterBackground]): Remember that we've observed a backgrounding.
        (-[WKApplicationStateTrackingView _applicationWillEnterForeground]): Remember that we've observed a foregrounding.

2019-04-10  Diego Pino Garcia  <dpino@igalia.com>

        Unreviewed, build fix for r244097

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::resume):
        Added guards for ENABLE(SERVICE_WORKER)

2019-04-09  Keith Rollin  <krollin@apple.com>

        Unreviewed build maintenance -- update .xcfilelists.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:

2019-04-09  Zalan Bujtas  <zalan@apple.com>

        [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
        https://bugs.webkit.org/show_bug.cgi?id=196743
        <rdar://problem/43897551>

        Reviewed by Tim Horton.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setViewLayoutSize):

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

        Close service worker database on network process suspension
        https://bugs.webkit.org/show_bug.cgi?id=196623
        <rdar://problem/48930869>

        Reviewed by Alex Christensen.

        Close service worker database when preparing to suspend.
        On resume, push changes if any is needed.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::cancelPrepareToSuspend):
        (WebKit::NetworkProcess::processDidResume):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _sendNetworkProcessWillSuspendImminently]):
        (-[WKProcessPool _sendNetworkProcessDidResume]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminently):
        (WebKit::WebProcessPool::sendNetworkProcessDidResume):
        * UIProcess/WebProcessPool.h:

2019-04-09  Daniel Bates  <dabates@apple.com>

        [iPad] Should open popover when the spacebar is pressed
        https://bugs.webkit.org/show_bug.cgi?id=196360
        <rdar://problem/49389129>

        Reviewed by Brent Fulgham.

        Pressing the spacebar should open the popover for a focused popup button (e.g. <select>) on iOS
        just like it does on the Mac.

        For now, we keep the iPhone behavior of blurring the element when the Done button is pressed and
        hence pressing spacebar does nothing (because there is no focused element).

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView accessoryOpen]): Added. Extracted the logic from -_elementDidFocus to scroll to
        the focused element, update the accessory and then tell the accessory to begin editing.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        Write in terms of -accessoryOpen.
        * UIProcess/ios/forms/WKFormPeripheralBase.mm:
        (-[WKFormPeripheralBase handleKeyEvent:]): Interpret the spacebar when the peripheral is closed (!_editing)
        and call -accessoryOpen to ultimately call back to this peripheral to tell it to begin editing,
        which will cause the popover to appear again.

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

        Unreviewed, fix webkitpy failure after r244085.

        Use a list instead of a set for header includes so that the order is
        maintained.

        * Scripts/webkit/messages.py:

2019-04-09  Andy Estes  <aestes@apple.com>

        [Apple Pay] Add release logging to PaymentCoordinator
        https://bugs.webkit.org/show_bug.cgi?id=196738

        Reviewed by Alex Christensen.

        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::isAlwaysOnLoggingAllowed const):
        * WebProcess/ApplePay/WebPaymentCoordinator.h:

2019-04-09  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Awaken UIProcess if WebContent process is awakened from suspensions unexpectedly.
        https://bugs.webkit.org/show_bug.cgi?id=196659

        Reviewed by Chris Dumez.

        * Platform/IPC/Connection.h:
        (IPC::Connection::sendWithAsyncReply):
        * Platform/spi/ios/AssertionServicesSPI.h:
        * Shared/Cocoa/ProcessTaskStateObserver.h: Added.
        (WebKit::ProcessTaskStateObserver::setClient):
        (WebKit::ProcessTaskStateObserver::client):
        (WebKit::ProcessTaskStateObserver::taskState const):
        * Shared/Cocoa/ProcessTaskStateObserver.mm: Added.
        (-[WKProcessTaskStateObserverDelegate process:taskStateDidChange:]):
        (WebKit::toProcessTaskStateObserverTaskState):
        (WebKit::ProcessTaskStateObserver::ProcessTaskStateObserver):
        (WebKit::ProcessTaskStateObserver::~ProcessTaskStateObserver):
        (WebKit::ProcessTaskStateObserver::setTaskState):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
        * UIProcess/ProcessAssertion.h:
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::updateAssertion):
        * UIProcess/ProcessThrottler.h:
        (WebKit::ProcessThrottler::shouldBeRunnable const):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::reasonForState):
        (WebKit::toBKSProcessAssertionReason):
        (WebKit::ProcessAssertion::ProcessAssertion):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::cancelPrepareToSuspend):
        (WebKit::WebProcess::processDidResume):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::processTaskStateDidChange):

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

        Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
        https://bugs.webkit.org/show_bug.cgi?id=196665
        <rdar://45115669>

        Reviewed by Geoff Garen.

        It is insufficient to just not navigate the subframe.  We must leave the page that contained it.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::showSafeBrowsingWarning):

2019-04-09  John Wilander  <wilander@apple.com>

        Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
        https://bugs.webkit.org/show_bug.cgi?id=196558
        <rdar://problem/47650245>

        Reviewed by Youenn Fablet.

        So called pixel requests have traditionally been used to send ad click
        attribution data to click sources. The privacy implications of such
        pixel requests are severe which is in part why browsers have started to
        block cookies from being sent in such third-party requests.

        To allow for a smooth transition to more privacy-friendly ad click
        attribution, we should allow servers to make a redirect to
        https://click-source.example/.well-known/ad-click-attribution/ to
        trigger a so called conversion.

        This patch checks for the well-known location in the path component of
        the redirect URL. If the request indeed goes to the well-known location,
        we parse the conversion data and send it to the storage in the network
        session.

        * NetworkProcess/NetworkAdClickAttribution.cpp:
        (WebKit::NetworkAdClickAttribution::convert):
            Reporting function.
        * NetworkProcess/NetworkAdClickAttribution.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
            Now checks for the well-known location through a call to
            WebCore::AdClickAttribution::parseConversionRequest().
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::convertAdClickAttribution):
            Piping to WebKit::NetworkAdClickAttribution::convert().
        * NetworkProcess/NetworkSession.h:

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

        [iOS] WebContent processes should be marked as "Foreground Running" when their view is visible
        https://bugs.webkit.org/show_bug.cgi?id=196695
        <rdar://problem/48073787>

        Reviewed by Tim Horton.

        In order for WebContent processes to get marked as "Foreground Running" when their view
        is visible on iOS, we now construct a _UILayerHostView in the UIProcess and add it as
        a subview of the WKContentView. The _UILayerHostView's visibility target is the
        WebContent process currently associated with the view.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/PageClient.h:
        (WebKit::PageClient::didCreateContextForVisibilityPropagation):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::contextIDForVisibilityPropagation):
        * UIProcess/WebProcessProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didCreateContextForVisibilityPropagation):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
        (-[WKContentView _setupVisibilityPropagationView]):
        (-[WKContentView _processDidExit]):
        (-[WKContentView _didRelaunchProcess]):
        (-[WKContentView _processDidCreateContextForVisibilityPropagation]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didCreateContextForVisibilityPropagation):
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::didCreateContextForVisibilityPropagation):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2019-04-09  Sihui Liu  <sihui_liu@apple.com>

        Remove unnecessary network process assertion for IDB close
        https://bugs.webkit.org/show_bug.cgi?id=196693

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::notifyHoldingLockedFiles): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didClose):
        (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:

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

        Loads using loadHTMLString() cause flashing when process-swapping
        https://bugs.webkit.org/show_bug.cgi?id=196714
        <rdar://problem/49637354>

        Reviewed by Antti Koivisto.

        Our logic to decide if we should construct a SuspendedPageProxy on process-swap was assuming
        a SuspendedPageProxy is only useful for PageCache and would therefore not create one if PageCache
        is disabled or if there is no associated WebBackForwardListItem. However, constructing a
        SuspendedPageProxy is also useful to prevent flashing when process-swapping as we need to keep
        displaying the layer of the previous process until there is something meaningful to show in the
        new process.

        This patch makes it so that we now construct a SuspendedPageProxy on process-swap, even if
        PageCache is disabled or if there is no associated WebBackForwardListItem. The process in
        question will not be useful for PageCache but it will avoid flashing. The SuspendedPageProxy's
        process may also get used for future navigations to the same site (as demonstrated by the
        API test) which is beneficial for performance.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::findReusableSuspendedPageProcess):

2019-04-08  Don Olmstead  <don.olmstead@sony.com>

        [CMake][WinCairo] Separate copied headers into different directories
        https://bugs.webkit.org/show_bug.cgi?id=196655

        Reviewed by Michael Catanzaro.

        * CMakeLists.txt:
        * PlatformWin.cmake:

2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Do not allow starting selection drags when selection views are not visible
        https://bugs.webkit.org/show_bug.cgi?id=196686
        <rdar://problem/49399192>

        Reviewed by Tim Horton.

        Currently, on iOS, it's possible to start dragging selected text in a web view even if the selection itself is
        not visible. This can happen if the user selects some text, focuses a native text field, and then long presses
        the previously selected text. This is because the text is still selected in the document since we don't clear
        the selection when resigning first responder on iOS, despite the fact that the native selection view is no
        longer present.

        To fix this, we add plumbing to specify the set of allowed drag source actions when requesting drag start; this
        set of allowed drag source actions only includes DragSourceActionSelection if the selection view can be visible
        (i.e. the content view is first responder, and isn't suppressing text interactions). We then update WebPage's
        allowed drag source actions with this given set of actions, while sending "dragstart" to the page.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView hasSelectablePositionAtPoint:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

        Only bail out of text selection in text that is already selected if the web view allows dragging text selections
        (i.e. the web view is first responder, and is not suppressing text interactions).

        (-[WKContentView _allowedDragSourceActions]):
        (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
        (-[WKContentView _dragInteraction:prepareForSession:completion:]):

        Pass the set of allowed drag source actions when requesting a drag start or adding items to an existing session.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::requestDragStart):
        (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):

        Plumb the allowed drag source actions from the UI process (WKContentView) over to the web process (WebPage).

        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        (WebKit::WebDragClient::dragSourceActionMaskForPoint):

        Instead of always returning Any, consult WebPage's allowed drag source actions.

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::allowedDragSourceActions const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDragStart):
        (WebKit::WebPage::requestAdditionalItemsForDragSession):

        Set WebPage's allowed drag source actions to the given set of actions when sending a drag start to the page.

2019-04-08  Justin Fan  <justin_fan@apple.com>

        [Web GPU] Fix Web GPU experimental feature on iOS
        https://bugs.webkit.org/show_bug.cgi?id=196632

        Reviewed by Myles C. Maxfield.

        Add feature conditionals for iOS 11.
        Properly make Web GPU available on iOS 11+.

        * Configurations/FeatureDefines.xcconfig:
        * Configurations/WebKitTargetConditionals.xcconfig:

2019-04-08  Alex Christensen  <achristensen@webkit.org>

        Fix selector name after r243834
        https://bugs.webkit.org/show_bug.cgi?id=196549

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        I forgot the colon in the setter's name.

2019-04-08  Antti Koivisto  <antti@apple.com>

        Compute touch actions for touch point from remote layer tree regions
        https://bugs.webkit.org/show_bug.cgi?id=196701

        Reviewed by Simon Fraser.

        Add a function for finding the right layer and getting the touch actions in UI process side.

        The code is not used yet.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::touchActionsForPoint):

        Use the same code as overlap hit testing for collecting the candidate layers for the touch point,
        taking event regions into account.
        Return the touch actions from the deepest event sensitive layer hit.

        (-[UIView _web_findDescendantViewAtPoint:withEvent:]):

        Modernize.

2019-04-08  Brent Fulgham  <bfulgham@apple.com>

        Make HSTS list handling more robust against unexpected content 
        https://bugs.webkit.org/show_bug.cgi?id=196552
        <rdar://problem/43403817>

        Reviewed by Chris Dumez.

        Crash logs indicate we sometimes encounter null key values during processing.
        This patch adds some debug assertions to catch this in test environments, and
        allows the code to skip the bad entries if encountered.

        It also avoids calling CFDictionaryApplyFunction when the HSTS policies returned
        by _CFNetworkCopyHSTSPolicies is nullptr, which is a possible return value.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::filterPreloadHSTSEntry):
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache):

2019-04-05  Brian Burg  <bburg@apple.com>

        Web Automation: clean up some WebAutomationSession methods to use modern async IPC
        https://bugs.webkit.org/show_bug.cgi?id=196168

        Reviewed by Devin Rousso.

        Modern WebKit IPC is capable of providing completion handlers and can track callback IDs.
        So, most messages between WebAutomationSession and its proxy can use this facility and stop
        keeping track of callback IDs manually. This makes most code easier to read on both the
        sender and receiver side.

        There are two cases that could not be converted:
        - For evaluateJavaScript, we cannot use async IPC because WebAutomationSession expects to
        be able to cancel all pending replies when a page navigates away, the web process crashes,
        or when handling an alert.
        - For takeScreenshot, there is not currently support in the modern async IPC code paths for
        sending the result back. ShareableBitmap and friends lack a modern decoder implementation.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::resolveChildFrameHandle):
        (WebKit::WebAutomationSession::resolveParentFrameHandle):
        (WebKit::WebAutomationSession::computeElementLayout):
        (WebKit::WebAutomationSession::selectOptionElement):
        (WebKit::WebAutomationSession::getAllCookies):
        (WebKit::WebAutomationSession::deleteSingleCookie):
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
        (WebKit::WebAutomationSession::didResolveChildFrame): Deleted.
        (WebKit::WebAutomationSession::didResolveParentFrame): Deleted.
        (WebKit::WebAutomationSession::didComputeElementLayout): Deleted.
        (WebKit::WebAutomationSession::didSelectOptionElement): Deleted.
        (WebKit::WebAutomationSession::didGetCookiesForFrame): Deleted.
        (WebKit::WebAutomationSession::didDeleteCookie): Deleted.
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.messages.in:
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
        (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
        (WebKit::WebAutomationSessionProxy::resolveParentFrame):
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        (WebKit::WebAutomationSessionProxy::selectOptionElement):
        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
        (WebKit::WebAutomationSessionProxy::deleteCookie):
        * WebProcess/Automation/WebAutomationSessionProxy.h:
        * WebProcess/Automation/WebAutomationSessionProxy.messages.in:

2019-04-08  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(236463) DownloadManager can call a null CompletionHandler
        https://bugs.webkit.org/show_bug.cgi?id=196414
        <rdar://problem/48389434>

        Reviewed by Geoff Garen.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::convertToDownload):
        DownloadManager::continueDecidePendingDownloadDestination is being called when there is no completion handler.
        r236463 introduced an unchecked code path that can allow this to happen.

2019-04-07  Commit Queue  <commit-queue@webkit.org>

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

        Broke API Test SafeBrowsing.WKWebViewGoBackIFrame (Requested
        by aakashjain on #webkit).

        Reverted changeset:

        "Clicking "Go Back" from a safe browsing warning from an
        iframe should navigate the WKWebView back to the previous
        page"
        https://bugs.webkit.org/show_bug.cgi?id=196665
        https://trac.webkit.org/changeset/243956

2019-04-07  Geoffrey Garen  <ggaren@apple.com>

        Remove stray byte added by r241131
        https://bugs.webkit.org/show_bug.cgi?id=196682

        Reviewed by Alexey Proskuryakov.

        Sublime Text thinks WKWebView.mm is binary instead of text.

        According to online documentation and bisecting, this is because r241131
        introduced a stray byte (probably a null byte?) into the file.

        I fixed this with Cmd-C Cmd-V.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):

2019-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Hide next and previous form control buttons when WKWebView is editable
        https://bugs.webkit.org/show_bug.cgi?id=196672
        <rdar://problem/35625321>

        Reviewed by Tim Horton.

        Adopt new UIKit SPI to hide or show next and previous controls in the form accessory view when changing
        editability.

        Test: KeyboardInputTests.FormNavigationAssistantBarButtonItems

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setEditable:]):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _updateAccessory]):
        (-[WKContentView _didChangeWebViewEditability]):

2019-04-06  Antti Koivisto  <antti@apple.com>

        Combine event and touch action regions into a single class
        https://bugs.webkit.org/show_bug.cgi?id=196644
        <rdar://problem/49643614>

        Reviewed by Darin Adler.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        (WebKit::RemoteLayerTreeNode::eventRegion const):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
        (WebKit::RemoteLayerTreeNode::setEventRegion):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::setEventRegion):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>

        We should pass minimumEffectiveDeviceWidth to web process on new page creation.
        https://bugs.webkit.org/show_bug.cgi?id=196077
        <rdar://problem/49108202>

        Reviewed by Chris Dumez.

        When a new web view is created, it is possible we don't have the web content process till a load
        is requested. This patch stashes minimumEffectiveDeviceWidth in WebPageProxy.cpp and passes that
        value down to web process via WebPageCreationParameters when a new process is created, just like
        we did for other values like viewportConfigurationLayoutSizeScaleFactor or viewportConfigurationViewLayoutSize.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const): Encode viewportConfigurationMinimumEffectiveDeviceWidth value.
        (WebKit::WebPageCreationParameters::decode): Decode viewportConfigurationMinimumEffectiveDeviceWidth value.
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm: Now that we stash the minimumEffectiveDeviceWidth value in WebPageProxy, we
            don't need the iVar in WKWebView any more.
        (-[WKWebView _dispatchSetViewLayoutSize:]): Use _page->minimumEffectiveDeviceWidth().
        (-[WKWebView _setViewScale:]): Ditto.
        (-[WKWebView _setMinimumEffectiveDeviceWidth:]): Ditto.
        (-[WKWebView _minimumEffectiveDeviceWidth]): Ditto.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters): Also add viewportConfigurationMinimumEffectiveDeviceWidth to
            web process creation parameter.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::minimumEffectiveDeviceWidth const): Returns m_viewportConfigurationMinimumEffectiveDeviceWidth.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Pass parameters.viewportConfigurationMinimumEffectiveDeviceWidth
            to web process.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage): Take viewportConfigurationMinimumEffectiveDeviceWidth value from the parameter and
            set that to viewport configuration.

2019-04-05  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Deactivate the audio session before the WebProcess suspends.
        https://bugs.webkit.org/show_bug.cgi?id=196658

        Reviewed by Eric Carlson.

        Notify the PlatformMediaSessionManager when the process suspends or resumes.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::cancelPrepareToSuspend):
        (WebKit::WebProcess::processDidResume):

2019-04-05  Sihui Liu  <sihui_liu@apple.com>

        [iOS] Web process gets suspended while holding locked database files
        https://bugs.webkit.org/show_bug.cgi?id=196519
        <rdar://problem/49531797>

        Reviewed by Chris Dumez.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):

2019-04-05  Alex Christensen  <achristensen@webkit.org>

        Clicking "Go Back" from a safe browsing warning from an iframe should navigate the WKWebView back to the previous page
        https://bugs.webkit.org/show_bug.cgi?id=196665
        <rdar://45115669>

        Reviewed by Geoff Garen.

        It is insufficient to just not navigate the subframe.  We must leave the page that contained it.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::showSafeBrowsingWarning):

2019-04-05  Alex Christensen  <achristensen@webkit.org>

        Undeprecate WKNavigationData
        https://bugs.webkit.org/show_bug.cgi?id=196559
        <rdar://44927425>

        Reviewed by Geoff Garen.

        * UIProcess/API/Cocoa/WKNavigationData.h:
        It is used to communicate information from FrameLoaderClient::updateGlobalHistory() to the application.
        This use in WKBrowsingContextHistoryDelegate is definitely still deprecated, but its use in
        WKHistoryDelegatePrivate does not have an adequate replacement yet, so it must remain undeprecated SPI.

2019-04-05  Sihui Liu  <sihui_liu@apple.com>

        [iOS] Web process gets suspended while holding locked database files
        https://bugs.webkit.org/show_bug.cgi?id=196519
        <rdar://problem/49531797>

        Reviewed by Chris Dumez.

        * Shared/WebSQLiteDatabaseTracker.cpp:
        (WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
        * Shared/WebSQLiteDatabaseTracker.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::m_webSQLiteDatabaseTracker):
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::processWillSuspendImminently):
        (WebKit::WebProcess::cancelPrepareToSuspend):
        (WebKit::WebProcess::processDidResume):
        * WebProcess/WebProcess.h:

2019-04-05  Commit Queue  <commit-queue@webkit.org>

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

        This change breaks build of WPE and GTK ports (Requested by
        annulen on #webkit).

        Reverted changeset:

        "[CMake][WTF] Mirror XCode header directories"
        https://bugs.webkit.org/show_bug.cgi?id=191662
        https://trac.webkit.org/changeset/243833

2019-04-05  David Kilzer  <ddkilzer@apple.com>

        REGRESSION(r240685): Remove duplicate Headers entry for _WKInspectorWindow.h in Xcode project
        <https://bugs.webkit.org/show_bug.cgi?id=193951>
        <rdar://problem/47621366>

        Fixes the following build warnings:
            Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installhdrs/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
            Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_installapi/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h
            Warning: Multiple build commands for output file WebKit2_WebKit.roots/BuildRecords/WebKit2_install/Root/System/Library/Frameworks/WebKit.framework/PrivateHeaders/_WKInspectorWindow.h

        * WebKit.xcodeproj/project.pbxproj: Remove duplicate entry for
        _WKInspectorWindow.h.  In r240685, a second Headers entry was
        added, but the first one was never removed.

2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
        https://bugs.webkit.org/show_bug.cgi?id=196593
        <rdar://problem/49599153>

        Reviewed by Michael Catanzaro.

        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
        (accessibilityRootObjectWrapper): Cast wrapper() as AtkObject.

2019-04-04  Simon Fraser  <simon.fraser@apple.com>

        Simple iframe scrolling test fails to get a composited scrolling frame in WebKitTestRunnerApp
        https://bugs.webkit.org/show_bug.cgi?id=196635

        Reviewed by Antti Koivisto.

        Remove WKBundleSetAsyncFrameScrollingEnabled().

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetAsyncFrameScrollingEnabled): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

2019-04-04  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
        https://bugs.webkit.org/show_bug.cgi?id=195584

        Reviewed by Zalan Bujtas.

        Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
        RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
        just as we do for frames.

        AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.

        Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
        ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
        callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
        ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.

        Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
        the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
        already been put in the right locations, but the UI process needs to know that a scroll happened).
        However, we need to prevent notifications from programmatic scrolls getting back to the
        web process, because this causes jumpiness. This is done via an early return in
        RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): Subframe nodes have
        a delegate, and that will take care of the requestedScrollPosition update.
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
        (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

2019-04-04  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r243888.

        Introduced layout test crashes.

        Reverted changeset:

        "[macOS][iOS] Add filter to syscall sandbox rule"
        https://bugs.webkit.org/show_bug.cgi?id=196613
        https://trac.webkit.org/changeset/243888

2019-04-04  Youenn Fablet  <youenn@apple.com>

        Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
        https://bugs.webkit.org/show_bug.cgi?id=196543

        Reviewed by Alex Christensen.

        Renamed methods used to set cache storage quota to be storage generic
        since they will apply to all storage.

        Pass quota parameters as part of WebsiteDataStoreParameters from UIProcess
        to NetworkProcess (start-up time and new WebsiteDataStore time).

        Compute on UIProcess the quota for third party origins using the default rule of dividing by 10.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::addWebsiteDataStore):
        (WebKit::NetworkProcess::initializeStorageQuota):
        (WebKit::NetworkProcess::setCacheStorageParameters):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        * Shared/WebsiteDataStoreParameters.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetPerOriginStorageQuota):
        (WKWebsiteDataStoreSetCacheStoragePerOriginQuota): Deleted.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _perOriginStorageQuota]):
        (-[WKWebsiteDataStore _setPerOriginStorageQuota:]):
        (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]): Deleted.
        (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::perOriginStorageQuota const):
        (WebKit::WebsiteDataStore::setPerOriginStorageQuota):
        (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): Deleted.
        (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::perOriginStorageQuota):
        (WebKit::WebsiteDataStoreConfiguration::setPerOriginStorageQuota):
        (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): Deleted.
        (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): Deleted.

2019-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        Changing default website policies shouldn't change default website policies in subsequent navigations
        https://bugs.webkit.org/show_bug.cgi?id=196562
        <rdar://problem/49573377>

        Reviewed by Tim Horton.

        Currently, changing the default WKWebpagePreferences object when deciding navigation policy causes the set of
        default policies to change in subsequent navigations. Among other things, this prevents clients from passing
        a modified version of the default website policies into the decision handler without impacting future
        navigations. To fix this, teach API::WebsitePolicies to make a copy of itself, and then use this to pass a copy
        of the default website policies to the navigation delegate when deciding navigation policies.

        Test: DoNotAllowChangingDefaultWebpagePreferencesInDelegateMethod

        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::copy const):

        Add a helper method to copy a set of website policies.

        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

2019-04-04  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix -Wreturn-type warning

        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::ownerProcess):

2019-04-04  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix sandbox violations
        https://bugs.webkit.org/show_bug.cgi?id=196616
        <rdar://problem/49498040>

        Reviewed by Brent Fulgham.

        Fix some observed sandbox violations in the WebContent process on macOS.

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

2019-04-04  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Host should be able to mute screen capture and camera/microphone independently
        https://bugs.webkit.org/show_bug.cgi?id=196555
        <rdar://problem/47303865>

        Reviewed by Youenn Fablet.

        * UIProcess/API/C/WKPagePrivate.h: Add kWKMediaScreenCaptureMuted.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setPageMuted:]):
        (-[WKWebView _setMediaCaptureMuted:]): Deleted, it was unused.
        (-[WKWebView _muteMediaCapture]): Deleted, it was unused.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): Fix
        a log comment typo.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setMediaStreamCaptureMuted): Use the new flag.
        (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Ditto.
        (WebKit::WebPageProxy::setMuted): Ditto.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isMediaStreamCaptureMuted const): Ditto.

2019-04-04  Per Arne Vollan  <pvollan@apple.com>

        [macOS][iOS] Add filter to syscall sandbox rule
        https://bugs.webkit.org/show_bug.cgi?id=196613
        <rdar://problem/49531420>

        Reviewed by Brent Fulgham.

        This will restrict the existing sandbox rule for the syscall.

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

2019-04-04  Youenn Fablet  <youenn@apple.com>

        Service Worker Process does not have the right domain name
        https://bugs.webkit.org/show_bug.cgi?id=196585

        Reviewed by Chris Dumez.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
        (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
        Updated extraInitializationData to go from "security-origin" to "registrable-domain".

2019-04-04  Chris Dumez  <cdumez@apple.com>

        Temporarily disable delayed WebProcess launch on iOS to address PLT regression
        https://bugs.webkit.org/show_bug.cgi?id=196604
        <rdar://problem/49074131>

        Reviewed by Geoffrey Garen.

        Temporarily disable delayed WebProcess launch on iOS to address PLT regression. This
        is while I figure out how to enable this on iOS without regressed PLT.

        * UIProcess/WebProcessPool.h:

2019-04-04  Miguel Gomez  <magomez@igalia.com>

        [CoordGraphics] Revalidate need for 'coordinated update completion' in ThreadedCompositor
        https://bugs.webkit.org/show_bug.cgi?id=188839

        Reviewed by Žan Doberšek.

        Even if a platform layer has changed, don't wait for a main thread callback to finish the
        CompositingRunLoop update. It can be finished as soon as we receive the frameComplete signal.

        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
        (WebKit::CompositingRunLoop::scheduleUpdate):
        (WebKit::CompositingRunLoop::stopUpdates):
        (WebKit::CompositingRunLoop::updateCompleted):
        (WebKit::CompositingRunLoop::updateTimerFired):
        (WebKit::CompositingRunLoop::compositionCompleted): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::renderLayerTree):
        (WebKit::ThreadedCompositor::sceneUpdateFinished):
        (WebKit::ThreadedCompositor::displayRefreshMonitor):
        (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):

2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [ATK] Cleanup WebPageAccessibilityObjectAtk
        https://bugs.webkit.org/show_bug.cgi?id=196537

        Reviewed by Michael Catanzaro.

        Several changes and cleanups:

         - Add WebKit prefix so that style checker doesn't complain about GObject conventions.
         - Rename the header to remove the Atk prefix to match the cpp file and class name.
         - Use pragma once.
         - Use nullptr instead of 0.
         - Use WEBKIT_DEFINE_TYPE instead of G_DEFINE_TYPE.
         - Return generic AtkObject* from constructor.

        * SourcesGTK.txt:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: Renamed from Source/WebKit/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp.
        (accessibilityRootObjectWrapper):
        (webkitWebPageAccessibilityObjectInitialize):
        (webkitWebPageAccessibilityObjectGetIndexInParent):
        (webkitWebPageAccessibilityObjectGetNChildren):
        (webkitWebPageAccessibilityObjectRefChild):
        (webkit_web_page_accessibility_object_class_init):
        (webkitWebPageAccessibilityObjectNew):
        (webkitWebPageAccessibilityObjectRefresh):
        * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Added.
        * WebProcess/WebPage/atk/WebPageAccessibilityObject.h: Removed.
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::platformInitialize):
        (WebKit::WebPage::updateAccessibilityTree):

2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [ATK] Set ATK_STATE_TRANSIENT on the atk socket until it's embedded
        https://bugs.webkit.org/show_bug.cgi?id=196535

        Reviewed by Michael Catanzaro.

        This way the properties are not cached. Right now, if number of children is queried before the socket is
        embedded, 0 is returned and cached, so ATs don't see the child even after the socket has been embedded.

        * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
        (webkitWebViewBaseAccessibleRefStateSet): Set ATK_STATE_TRANSIENT is the socket is not occupied.
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::bindAccessibilityTree): Unset ATK_STATE_TRANSIENT.

2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [ATK] Embed the AtkSocket as soon as we receive the plug ID
        https://bugs.webkit.org/show_bug.cgi?id=196534

        Reviewed by Michael Catanzaro.

        We are currently storing the ID and waiting for the next time get_accessible is called to embed the socket. We
        can simply embed the socket when the plug ID is received.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseGetAccessible):
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::bindAccessibilityTree):

2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [ATK] Don't touch accessibility tree in WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld
        https://bugs.webkit.org/show_bug.cgi?id=193914

        Reviewed by Michael Catanzaro.

        Move it to dispatchDidFinishDocumentLoad, since we know we have the document at that point and we can create the
        root accessibility object wrapper.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):

2019-04-03  Simon Fraser  <simon.fraser@apple.com>

        Simplify some "programmaticScroll" code paths
        https://bugs.webkit.org/show_bug.cgi?id=196589

        Reviewed by Zalan Bujtas.

        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Remove the parameter.
        (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): Use the enum type.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::updateVisibleContentRects):

2019-04-03  Chris Dumez  <cdumez@apple.com>

        The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash
        https://bugs.webkit.org/show_bug.cgi?id=196588
        <rdar://problem/49365787>

        Reviewed by Ryosuke Niwa.

        The page's focusedFrame / frameSetLargestFrame do not get cleared on process swap or crash.
        This can lead to returning stale frames to the client if it asks for those.

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

2019-04-03  Simon Fraser  <simon.fraser@apple.com>

        Remove the isProgrammaticScroll argument to requestScroll() because no-one uses it
        https://bugs.webkit.org/show_bug.cgi?id=196587

        Reviewed by Zalan Bujtas.

        This argument was unused.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::requestScroll):
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::requestScroll):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/PageClient.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestScroll):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::requestScroll):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::requestScroll):
        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::requestScroll):
        * UIProcess/win/PageClientImpl.h:

2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>

        -apple-trailing-word is needed for browser detection
        https://bugs.webkit.org/show_bug.cgi?id=196575

        Unreviewed.

        * Configurations/FeatureDefines.xcconfig:

2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add a WebKit internal feature flag to always enable modern compatibility mode by default
        https://bugs.webkit.org/show_bug.cgi?id=196526
        <rdar://problem/49532923>

        Reviewed by Tim Horton.

        Change UseModernCompatibilityModeByDefault from an internal preference to a debug preference, so that it may be
        enabled for all apps on the system.

        * Shared/WebPreferences.yaml:

2019-04-03  Alex Christensen  <achristensen@webkit.org>

        Fix internal build after r243829
        https://bugs.webkit.org/show_bug.cgi?id=196549

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        Some SDK's don't include this selector in the header.
        Use NSSelectorFromString.

2019-04-03  Don Olmstead  <don.olmstead@sony.com>

        [CMake][WTF] Mirror XCode header directories
        https://bugs.webkit.org/show_bug.cgi?id=191662

        Reviewed by Konstantin Tokarev.

        Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
        builds.

        * CMakeLists.txt:

2019-04-03  Alex Christensen  <achristensen@webkit.org>

        Add SPI to disable legacy TLS fallback
        https://bugs.webkit.org/show_bug.cgi?id=196549
        <rdar://44979744>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setAllowsTLSFallback:]):
        (-[WKWebsiteDataStore _allowsTLSFallback]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
        (WebKit::WebsiteDataStore::setAllowsTLSFallback):
        (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::allowsTLSFallback const):
        (WebKit::WebsiteDataStore::networkingHasBegun):
        (WebKit::WebsiteDataStore::finalizeApplicationIdentifiers): Deleted.

2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>

        Remove support for -apple-trailing-word
        https://bugs.webkit.org/show_bug.cgi?id=196525

        Reviewed by Zalan Bujtas.

        This CSS property is nonstandard and not used.

        * Configurations/FeatureDefines.xcconfig:

2019-04-03  Alex Christensen  <achristensen@webkit.org>

        Resurrect and fix layout test http/tests/adClickAttribution/store-ad-click-attribution.html
        https://bugs.webkit.org/show_bug.cgi?id=196476

        Reviewed by Chris Dumez.

        Re-apply a change I reverted in r241754 now that it's safe to do so.

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

2019-04-03  Daniel Bates  <dabates@apple.com>

        [iOS] Should be able to dismiss picker or popover using the keyboard
        https://bugs.webkit.org/show_bug.cgi?id=196272
        <rdar://problem/48943170>

        Reviewed by Wenson Hsieh.

        Intercept key events and route them to the current input peripheral (if we have one). Add a base key event handler
        for all form peripherals that dismisses the accessory when either the Escape key is pressed or Command + . is pressed.
        I will fix this issue for the file upload picker/popover in <https://bugs.webkit.org/show_bug.cgi?id=196287>.

        * SourcesCocoa.txt: Add file WKFormPeripheralBase.mm.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason]): Added.
        (-[WKContentView resignFirstResponderForWebView]): Write in terms of -endEditingAndUpdateFocusAppearance.
        (-[WKContentView inputView]): Code style nit while I am here; add an empty line to demarcate the "crazy"
        code that the FIXME is referring to and should ideally be removed from the code that is sane to always do.
        (-[WKContentView accessoryDone]): When the accessory is dismissed via the Done button (iPhone) or by pressing
        Escape or Command + . using a hardware keyboard (iPhone or iPad) then end the current editing session, but
        do not resign first responder status as the page activation state should not be changed.
        (-[WKContentView _handleKeyUIEvent:]): Bring back this code when building with USE(UIKIT_KEYBOARD_ADDITIONS)
        as we need to route key events to the input peripheral (if we have one). If the input peripheral handles it
        then we're done: no need to let UIKit or WebKit handle it when building with USE(UIKIT_KEYBOARD_ADDITIONS),
        respectively. If the input peripheral does not handle it then do what we do now.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        If the element is re-focused and we have an input peripheral then we want to ensure we are first responder,
        reveal the focused element, update the accessory and tell the peripheral that editing has begun (again).
        For all other element re-focusing where we don't have a peripheral do what we do now. Also, update _isEditable
        to reflect whether the focused element contains selectable text. This is what UIKit wants to know when it queries
        -isEditable. Now that we no longer blur the focused element on iPad when the popover is dismissed and keep the
        peripheral until there is a focus change we need to ensure that we give the correct answer to UIKit on view
        editability. Otherwise, UIKit thinks it needs to update the text selection state when a popup button is tapped
        again (as part of its gesture recognizer logic) and this causes an assertion failure in UIKit after it calls back
        into us to ask for selection details, which we correctly respond with the equivalent of "we have none" and is
        not the answer UIKit expects since we told it we are editable. (Currently we manage to get away with telling UIKit
        we are always editable because it is not possible to perform a selection operation when we have a popover open.
        Closing the popover blurs the element, setting -isEditable to NO and deallocates the peripheral avoiding this issue).
        * UIProcess/ios/forms/WKFormColorControl.h:
        * UIProcess/ios/forms/WKFormColorControl.mm:
        (-[WKColorPopover controlEndEditing]): Dismiss the popover.
        (-[WKFormColorControl initWithView:]): Modified to call base class initializer.
        (-[WKFormColorControl assistantView]): Deleted.
        (-[WKFormColorControl beginEditing]): Deleted.
        (-[WKFormColorControl endEditing]): Deleted.
        * UIProcess/ios/forms/WKFormInputControl.h:
        * UIProcess/ios/forms/WKFormInputControl.mm:
        (-[WKFormInputControl initWithView:]): Modified to call base class initializer.
        (-[WKFormInputControl dateTimePickerCalendarType]): Write in terms of self.control.
        (-[WKDateTimePopover controlEndEditing]): Dismiss the popover and tell the controller that editing ended.
        (-[WKFormInputControl beginEditing]): Deleted.
        (-[WKFormInputControl endEditing]): Deleted.
        (-[WKFormInputControl assistantView]): Deleted.
        * UIProcess/ios/forms/WKFormPeripheral.h:
        * UIProcess/ios/forms/WKFormPeripheralBase.h: Added.
        * UIProcess/ios/forms/WKFormPeripheralBase.mm: Added.
        (-[WKFormPeripheralBase initWithView:control:]): Take ownership of the passed WKFormControl.
        (-[WKFormPeripheralBase beginEditing]): Turn around and tell the control.
        (-[WKFormPeripheralBase endEditing]): Ditto.
        (-[WKFormPeripheralBase assistantView]): Ditto.
        (-[WKFormPeripheralBase control]): Return the control.
        (-[WKFormPeripheralBase handleKeyEvent:]): Dismiss the accessory (in the same way we dismiss when the Done
        button is pressed on iPhone) on keydown of the Escape key or when we receive a UIKeyInputEscape event (for
        Command + .).
        * UIProcess/ios/forms/WKFormSelectControl.h:
        * UIProcess/ios/forms/WKFormSelectControl.mm:
        (-[WKFormSelectControl initWithView:]): Modified to call base class initializer.
        (-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): Write in terms of self.control.
        (-[WKFormSelectControl selectFormPopoverTitle]): Ditto.
        (-[WKFormSelectControl assistantView]): Deleted.
        (-[WKFormSelectControl beginEditing]): Deleted.
        (-[WKFormSelectControl endEditing]): Deleted.
        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        (-[WKSelectPopover controlEndEditing]): Dismiss the popover.
        * WebKit.xcodeproj/project.pbxproj: Add files WKFormPeripheralBase.{h, mm}.

2019-04-03  Youenn Fablet  <youenn@apple.com>

        Resetting quota should take into account third party origins
        https://bugs.webkit.org/show_bug.cgi?id=196462

        Reviewed by Geoffrey Garen.

        When clearing the storage quota, we were resetting it to the default value
        without taking care of whether third party or not.
        Updated the code to ensure that the default quota is computed based on the origin.

        Updated existing test to cover this case.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::clearStorageQuota):
        (WebKit::NetworkProcess::setCacheStorageParameters):
        (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
        (WebKit::NetworkProcess::storageQuotaManager):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const):
        (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas):
        (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin):

2019-04-03  Michael Catanzaro  <mcatanzaro@igalia.com>

        Get rid of HTMLInputElement::setEditingValue
        https://bugs.webkit.org/show_bug.cgi?id=196402

        Reviewed by Darin Adler.

        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp:
        (webkit_dom_element_html_input_element_set_editing_value):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
        (webkit_dom_html_input_element_set_editing_value):

2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add a WebKit internal feature flag to always enable modern compatibility mode by default
        https://bugs.webkit.org/show_bug.cgi?id=196526
        <rdar://problem/49532923>

        Reviewed by Antoine Quint.

        * Shared/WebPreferences.yaml:

2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Introduce and add plumbing for a website policy for meta viewport tag handling
        https://bugs.webkit.org/show_bug.cgi?id=196285

        Reviewed by Tim Horton.

        Add WebsiteMetaViewportPolicy, a bit that can be used to determine whether to respect or ignore the meta
        viewport tag and use native web page parameters instead of the default parameters.

        * Shared/WebsiteMetaViewportPolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):

        Convert WebKit::WebsiteMetaViewportPolicy into WebCore::MetaViewportPolicy.

        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:

        Add additional plumbing for the policy flag.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::resetViewportDefaultConfiguration):

        Use native web page parameters if either "shouldIgnoreMetaViewport" is enabled, or the new policy is set.
        Eventually, the policy should completely replace the former preference once no internal clients depend on it.

2019-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add plumbing for a compatibility mode preference in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=196005

        Reviewed by Tim Horton.

        Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
        (API::WebsitePolicies) for compatibility mode.

        * Shared/WebCompatibilityMode.h: Added.
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        * WebKit.xcodeproj/project.pbxproj:

2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [CoordinatedGraphics] Hidden pages are not suspended after a web view resize
        https://bugs.webkit.org/show_bug.cgi?id=196487

        Reviewed by Žan Doberšek.

        When resizing the window, the hidden tabs are updated too, to avoid flickering or getting the old size when
        switching tabs. For that we need to resume painting but we are not suspending it again after the update.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState): Suspend the painting again after a
        synchronous update if needed.

2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        Web Inspector: [GTK] Copy copies to nowhere
        https://bugs.webkit.org/show_bug.cgi?id=181228

        Reviewed by Michael Catanzaro.

        The thing is that those items are actually submenu items, with options, for example in the case of Copy to copy
        HTML, Text, XPath, etc. We are not correctly handling submenus when populating the context menu received from
        the web process.

        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::populateSubMenu): Helper to populate submenu items recursively.
        (WebKit::WebContextMenuProxyGtk::populate): Handle submenu items.
        * UIProcess/gtk/WebContextMenuProxyGtk.h:

2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Cocoa] Add new API around WKWebpagePreferences in WKNavigationDelegate and WKWebViewConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=196284
        <rdar://problem/47228232>

        Reviewed by Tim Horton.

        Tests for both of these APIs will be added in a subsequent patch.

        * Shared/API/Cocoa/WebKit.h:
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::defaultWebsitePolicies const):
        (API::PageConfiguration::setDefaultWebsitePolicies):
        * UIProcess/API/APIPageConfiguration.h:
        * UIProcess/API/Cocoa/WKNavigationDelegate.h:

        Add a new navigation delegate hook to allow clients to return a WKWebpagePreference targeting the given
        navigation action.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

        Add new API on WKWebViewConfiguration to specify a default WKWebpagePreference to use when navigating.

        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration defaultWebpagePreferences]):
        (-[WKWebViewConfiguration setDefaultWebpagePreferences:]):
        * UIProcess/API/Cocoa/WKWebpagePreferences.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

        Invoke the new WKWebpagePreferences-based navigation delegate method.

        * WebKit.xcodeproj/project.pbxproj:
        * mac/postprocess-framework-headers.sh:
        * mac/replace-webkit-additions-in-framework-headers.sh: Added.

        Move logic in the "Postprocess Framework Headers" step responsible for stripping away included files from
        WebKitAdditions out into a separate build phase, called "Replace WebKitAdditions in Framework Headers". This
        ensures headers attempting to include from WebKitAdditions have these additional statements removed.

2019-04-02  Geoffrey Garen  <ggaren@apple.com>

        Eliminate plugin sandbox exceptions
        https://bugs.webkit.org/show_bug.cgi?id=196510

        Reviewed by Chris Dumez.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::initializeSandbox):
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.
        * UIProcess/Plugins/PluginInfoStore.h:
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::shouldUsePlugin):
        (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed): Deleted.

2019-04-02  Alex Christensen  <achristensen@webkit.org>

        Fix assertion in http/tests/adClickAttribution/store-ad-click-attribution.html
        https://bugs.webkit.org/show_bug.cgi?id=196503

        Reviewed by Chris Dumez.

        In WebPageProxy::didDestroyNavigation we try to ignore a request to destroy a navigation from a page being navigated from
        during a cross-site navigation, but if the old web process sends the message after WebPageProxy::commitProvisionalPage
        has been called, we can still destroy a navigation when we are continuing a navigation in another process.  To prevent this,
        have the process not send the message when it knows the navigation is continuing in another process.
        Also make the use of unchecked navigation pointers more robust by checking it for nullity.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::didReceivePolicyDecision):
        (WebKit::WebFrame::documentLoaderDetached):
        * WebProcess/WebPage/WebFrame.h:

2019-04-02  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix iokit-get-properties sandbox violation in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=196500
        <rdar://problem/49497788>

        Reviewed by Brent Fulgham.

        Attempting to get the iokit properties 'product-description', 'artwork-display-gamut' and
        'artwork-scale-factor' is causing sandbox violations.

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

2019-04-02  Chris Dumez  <cdumez@apple.com>

        [WK2] Add support for Window's beforeprint / afterprint events
        https://bugs.webkit.org/show_bug.cgi?id=196478

        Reviewed by Alex Christensen.

        Add support for Window's beforeprint / afterprint events as per:
        - https://html.spec.whatwg.org/#dom-print

        Blink and Gecko already support this.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::beginPrinting):
        (WebKit::WebPage::endPrinting):

2019-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r243726): Crash at unrecognized selector: -[WKWebpagePreferences webpagePreferences]
        https://bugs.webkit.org/show_bug.cgi?id=196496
        <rdar://problem/49521634>

        Reviewed by Chris Dumez.

        r243726 made an incorrect assumption that all callers of -decidePolicyForNavigationAction:decisionHandler: and
        -decidePolicyForNavigationAction:userInfo:decisionHandler: must be instances of _WKWebsitePolicies, as opposed
        to the new WKWebpagePreferences. However, it's possible for clients (in this case, Safari) to already generate
        and pass in an instance of WKWebpagePreferences by bridging the C API opaque ref (WKWebsitePoliciesRef) into the
        Objective-C object (which is now WKWebpagePreferences, after my change).

        To maintain binary compatibility of trunk WebKit against prior versions of Safari, we need to handle both
        WKWebpagePreferences and the soon-to-be-deprecated _WKWebsitePolicies in the navigation action policy decision
        handler.

        Tests:  WebKit.WebsitePoliciesWithBridgingCast
                WebKit.WebsitePoliciesWithUnexpectedType

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

2019-04-01  Chris Dumez  <cdumez@apple.com>

        Unreviewed, drop debug logging landed as part of r242903 by mistake.

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

2019-04-01  Remy Demarest  <rdemarest@apple.com>

        Add SPI to give injected bundles access to displayed PDFDocuments
        https://bugs.webkit.org/show_bug.cgi?id=196471
        <rdar://problem/48080768>

        Reviewed by Tim Horton.

        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.h: Added.
        * WebProcess/InjectedBundle/API/c/mac/WKBundlePageMac.mm: Added.
        (WKBundlePageGetPDFDocumentInFrame):

2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit2] Introduce a public version of WKWebsitePolicies
        https://bugs.webkit.org/show_bug.cgi?id=195989
        <rdar://problem/47228232>

        Reviewed by Tim Horton.

        Expose the existing _WKWebsitePolicies object as WKWebpagePreferences, in what will eventually become a public
        header in the WebKit SDK (WKWebpagePreferences.h). Following a similar transitioning strategy as
        _WKWebsiteDataStore and WKWebsiteDataStore, we move existing logic from _WKWebsitePolicies to WKWebpagePreferences
        and make _WKWebsitePolicies a wrapper around WKWebpagePreferences.

        No change in behavior.

        * Shared/Cocoa/APIObject.mm:
        (API::Object::newObject):

        Wrap API::WebsitePolicies with WKWebpagePreferences.

        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _updateWebsitePolicies:]):
        * UIProcess/API/Cocoa/WKWebpagePreferences.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
        * UIProcess/API/Cocoa/WKWebpagePreferences.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm.

        Introduce WKWebpagePreferences.

        (+[WKWebpagePreferences defaultPreferences]):
        (-[WKWebpagePreferences dealloc]):
        (-[WKWebpagePreferences init]):
        (-[WKWebpagePreferences _setContentBlockersEnabled:]):
        (-[WKWebpagePreferences _contentBlockersEnabled]):
        (-[WKWebpagePreferences _setAllowedAutoplayQuirks:]):
        (-[WKWebpagePreferences _allowedAutoplayQuirks]):
        (-[WKWebpagePreferences _setAutoplayPolicy:]):
        (-[WKWebpagePreferences _autoplayPolicy]):
        (-[WKWebpagePreferences _setDeviceOrientationAndMotionAccessPolicy:]):
        (-[WKWebpagePreferences _deviceOrientationAndMotionAccessPolicy]):
        (-[WKWebpagePreferences _setPopUpPolicy:]):
        (-[WKWebpagePreferences _popUpPolicy]):
        (-[WKWebpagePreferences _customHeaderFields]):
        (-[WKWebpagePreferences _setCustomHeaderFields:]):
        (-[WKWebpagePreferences _websiteDataStore]):
        (-[WKWebpagePreferences _setWebsiteDataStore:]):
        (-[WKWebpagePreferences _setCustomUserAgent:]):
        (-[WKWebpagePreferences _customUserAgent]):
        (-[WKWebpagePreferences _setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
        (-[WKWebpagePreferences _customJavaScriptUserAgentAsSiteSpecificQuirks]):
        (-[WKWebpagePreferences _setCustomNavigatorPlatform:]):
        (-[WKWebpagePreferences _customNavigatorPlatform]):
        (-[WKWebpagePreferences _apiObject]):
        * UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h.
        * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h.

        Reintroduce all the interfaces currently available on _WKWebsitePolicies as underscore-prefixed SPI on
        WKWebpagePreferences.

        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:

        Make _WKWebsitePolicies wrap WKWebpagePreferences, and plumb all existing SPI on WKWebsitePolicies through to
        WKWebpagePreferences.

        (-[_WKWebsitePolicies init]):
        (-[_WKWebsitePolicies webpagePreferences]):
        (-[_WKWebsitePolicies setContentBlockersEnabled:]):
        (-[_WKWebsitePolicies contentBlockersEnabled]):
        (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
        (-[_WKWebsitePolicies allowedAutoplayQuirks]):
        (-[_WKWebsitePolicies setAutoplayPolicy:]):
        (-[_WKWebsitePolicies autoplayPolicy]):
        (-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
        (-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):
        (-[_WKWebsitePolicies setPopUpPolicy:]):
        (-[_WKWebsitePolicies popUpPolicy]):
        (-[_WKWebsitePolicies customHeaderFields]):
        (-[_WKWebsitePolicies setCustomHeaderFields:]):
        (-[_WKWebsitePolicies websiteDataStore]):
        (-[_WKWebsitePolicies setWebsiteDataStore:]):
        (-[_WKWebsitePolicies setCustomUserAgent:]):
        (-[_WKWebsitePolicies customUserAgent]):
        (-[_WKWebsitePolicies setCustomJavaScriptUserAgentAsSiteSpecificQuirks:]):
        (-[_WKWebsitePolicies customJavaScriptUserAgentAsSiteSpecificQuirks]):
        (-[_WKWebsitePolicies setCustomNavigatorPlatform:]):
        (-[_WKWebsitePolicies customNavigatorPlatform]):
        (-[_WKWebsitePolicies description]):
        (-[_WKWebsitePolicies _apiObject]):
        (-[_WKWebsitePolicies dealloc]): Deleted.
        * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * WebKit.xcodeproj/project.pbxproj:

2019-04-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unable to copy and paste a PDF from Notes into Mail compose body
        https://bugs.webkit.org/show_bug.cgi?id=196442
        <rdar://problem/48573098>

        Reviewed by Tim Horton.

        Relax the -canPerformAction: logic in the case of pasting an attachment. Consider an NSItemProvider to possibly
        paste as an attachment if either it has a preferred presentation style of UIPreferredPresentationStyleAttachment
        or has a style of UIPreferredPresentationStyleUnspecified, but has a suggested file name.

        This allows for the "Paste" action to be shown in the callout menu when copying and pasting a non-text file.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):

2019-04-01  Tim Horton  <timothy_horton@apple.com>

        Make UIWKDocumentContext rects per-character instead of per-word
        https://bugs.webkit.org/show_bug.cgi?id=196459

        Reviewed by Wenson Hsieh.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):
        Switch to CharacterIterator instead of TextIterator directly, to get
        per-character rects as the API requests.

2019-04-01  Chris Dumez  <cdumez@apple.com>

        UIProcess crash when a prewarmed process is terminated
        https://bugs.webkit.org/show_bug.cgi?id=196451
        <rdar://problem/49245471>

        Reviewed by Geoffrey Garen.

        Stop assuming that WebProcessProxy::m_websiteDataStore is non-null as this is no longer
        true after r243384. For example, prewarmed WebContent processe do not get a data store
        until they actually get used.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _prewarmedProcessIdentifier]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessIdentifier):
        (WebKit::WebProcessPool::prewarmedProcessIdentifier):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didClose):
        (WebKit::WebProcessProxy::didFinishLaunching):
        (WebKit::WebProcessProxy::requestTermination):
        (WebKit::WebProcessProxy::isReleaseLoggingAllowed const):
        * UIProcess/WebProcessProxy.h:

2019-04-01  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Add more websitedatastore directories to web process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=196447

        Reviewed by Michael Catanzaro.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bubblewrapSpawn):
        * UIProcess/glib/WebProcessProxyGLib.cpp:
        (WebKit::WebProcessProxy::platformGetLaunchOptions):

2019-04-01  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Crash when loading Twitter with autoplay video enabled.
        https://bugs.webkit.org/show_bug.cgi?id=196446
        <rdar://problem/49060359>

        Reviewed by Brent Fulgham.

        This is caused by a syscall violation.

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

2019-04-01  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Fix seccomp rule for blacklisting TIOCSTI
        https://bugs.webkit.org/show_bug.cgi?id=196297

        Reviewed by Michael Catanzaro.

        More information can be found here: https://www.exploit-db.com/exploits/46594

        Note that this sandbox never made it into production so does not
        warrant any CVE specific to WebKit.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::setupSeccomp):

2019-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Crash when changing inputmode for certain types of focusable elements
        https://bugs.webkit.org/show_bug.cgi?id=196431
        <rdar://problem/49454962>

        Reviewed by Tim Horton.

        The crash is happening because WebPage::focusedElementDidChangeInputMode assumes that the document's focused
        element must be the same as m_focusedElement in WebPage. However, this is not the case, since m_focusedElement
        is only set for certain types of elements that require user input (e.g. text fields, editable content, select
        menus, etc.). The function then attempts to dereference m_focusedElement, which may be null if the document's
        focused element doesn't fall into one of the aforementioned categories.

        To fix this, bail if the element that is changing inputmode is not equal to the WebPage's current focused
        element. See below for more details.

        Test: fast/forms/change-inputmode-crash.html

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

        Clean up some existing logic by introducing a helper method for determining whether an element should
        propagate inputmode attribute changes to the UI process. Also, check the element type using type traits instead
        of checking against the tag name.

        (WebKit::WebPage::elementDidFocus):
        (WebKit::WebPage::focusedElementDidChangeInputMode):

2019-03-31  Sam Weinig  <weinig@apple.com>

        Remove more i386 specific configurations
        https://bugs.webkit.org/show_bug.cgi?id=196430

        Reviewed by Alexey Proskuryakov.

        * Configurations/BaseTarget.xcconfig:
        WK_HAVE_CORE_PREDICTION can now be enabled unconditionally.
 
        * Configurations/FeatureDefines.xcconfig:
        ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.

2019-03-31  Andy Estes  <aestes@apple.com>

        [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
        https://bugs.webkit.org/show_bug.cgi?id=196433
        <rdar://problem/49293305>

        Reviewed by Tim Horton.

        Added WKWebViewConfiguration SPI for setting the QuickLook navigation response policy
        decision behavior. The configuration setting defaults to YES for clients linked on or after
        this WebKit change and NO otherwise.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
        * Shared/WebPreferences.yaml:
        * Shared/ios/QuickLookDocumentData.cpp:
        (WebKit::QuickLookDocumentData::isEmpty const):
        * Shared/ios/QuickLookDocumentData.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (defaultShouldDecidePolicyBeforeLoadingQuickLookPreview):
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration encodeWithCoder:]):
        (-[WKWebViewConfiguration initWithCoder:]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _shouldDecidePolicyBeforeLoadingQuickLookPreview]):
        (-[WKWebViewConfiguration _setShouldDecidePolicyBeforeLoadingQuickLookPreview:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/Cocoa/VersionChecks.h:
        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
        (WebKit::WebPreviewLoaderClient::didReceiveDataArray):

2019-03-30  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Subframe load should not reset content observation on the mainframe
        https://bugs.webkit.org/show_bug.cgi?id=196408
        <rdar://problem/49436797>

        Reviewed by Simon Fraser.

        Hover intent fails when an unrelated frame commits a load the same time.
        cancelPotentialTapInFrame is called from didCommitLoad, but what we are looking for here is the user initiated cancel of a tap (cancelPotentialTap).
        (If the current frame navigates away, willDetachPage takes care of canceling the observation.)

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

2019-03-29  John Wilander  <wilander@apple.com>

        Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
        https://bugs.webkit.org/show_bug.cgi?id=196407
        <rdar://problem/47859936>

        Reviewed by Brent Fulgham.

        The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
        moved Resource Load Statistics from the UI process to the network process. One
        of the endpoints is the message RequestStorageAccessUnderOpener which underpins
        our compatibility fix for federated logins using popups. This patch redirects
        these IPC calls to the network process and cleans up some assumptions around
        them.

        * CMakeLists.txt:
            Removed the old IPC receiver.
        * DerivedSources.make:
            Removed the old IPC receiver.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
            This is no longer needed since there is a dedicated update mechanism
            that actually sends the update.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
            Two new IPC receivers to pipe the calls to the network process.
        (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
            NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
            this purpose.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
            Removed the old IPC receiver.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleResourceLoadStatisticsNotifyObserver):
            Function name update.
        * WebProcess/WebProcess.cpp:
            Now calls IPC to the network process instead of the UI process.

2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>

        Delete WebMetal implementation in favor of WebGPU
        https://bugs.webkit.org/show_bug.cgi?id=195418

        Reviewed by Dean Jackson.

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

2019-03-29  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] Add Server Trust Evaluation Support.
        https://bugs.webkit.org/show_bug.cgi?id=191646

        Reviewed by Fujii Hironori.

        Tests: http/tests/ssl/iframe-upgrade.https.html
               http/tests/ssl/mixedContent/insecure-websocket.html
               http/tests/ssl/upgrade-origin-usage.html

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
        (WebKit::NetworkDataTaskCurl::tryServerTrustEvaluation):
        (WebKit::NetworkDataTaskCurl::restartWithCredential):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:

2019-03-29  Cathie Chen  <cathiechen@igalia.com>

        Implement ResizeObserver.
        https://bugs.webkit.org/show_bug.cgi?id=157743

        Reviewed by Simon Fraser.

        Add WebPreferences and FeatureDefines for ResizeObserver.

        * Configurations/FeatureDefines.xcconfig:
        * Shared/WebPreferences.yaml:

2019-03-28  Timothy Hatcher  <timothy@apple.com>

        CFDictionary encoder crashes on non-string keys.
        https://bugs.webkit.org/show_bug.cgi?id=196388
        rdar://problem/49339242

        Reviewed by Ryosuke Niwa.

        Allow non-string keys in CFDictionary encoding/decoding. Encode the correct
        size for dictionaries and arrays when unknown keys or values are skipped.
        Allow null array encoding and decoding like dictionary already allowed.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode):
        (IPC::decode):

2019-03-28  John Wilander  <wilander@apple.com>

        Resource Load Statistics: IPC to the WebsiteDataStore in the UI process from NetworkProcess::deleteWebsiteDataForRegistrableDomains()
        https://bugs.webkit.org/show_bug.cgi?id=196281
        <rdar://problem/48938748>

        Reviewed by Alex Christensen.

        The move of Resource Load Statistics to the network process requires that it
        calls the UI process when clearing website data (previously the other way
        around). This patch achieves that.

        Specifically, NetworkProcess::deleteWebsiteDataForRegistrableDomains() now
        filters its WebsiteDataTypes down to just the ones applicable for the UI
        process and then calls DeleteWebsiteDataInUIProcessForRegistrableDomains over
        IPC.

        NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains() on
        the UI process side makes use of the re-introduced
        WebsiteDataStore::fetchDataForRegistrableDomains() function to get the relevant
        data records and call WebsiteDataStore::removeData(). The re-introduced
        WebsiteDataStore::fetchDataForRegistrableDomains() was removed as dead code in
        https://trac.webkit.org/changeset/242056/webkit, then under the name
        WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(). The reason it
        was dead code was the lack of IPC call that this patch adds.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
           Now calls DeleteWebsiteDataInUIProcessForRegistrableDomains over IPC if there
           are WebsiteDataTypes applicable to the UI process.
        * NetworkProcess/NetworkProcess.h:
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::ownerProcess):
        (WebKit::WebsiteData::filter):
            Convenience functions to manage process ownership of website data types.
        * Shared/WebsiteData/WebsiteData.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsHasLocalStorage):
            Test infrastructure, called by the TestRunner.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::deleteWebsiteDataInUIProcessForRegistrableDomains):
            New function to be called from the network process.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::matches const):
            Now matches with WebCore::RegistrableDomain instead of a string.
        (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain const): Deleted.
            Replaced by WebsiteDataRecord::matches().
        * UIProcess/WebsiteData/WebsiteDataRecord.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataForRegistrableDomains):
            Re-introduced. It was removed as dead code in r242056.
        (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
        (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
            Test infrastructure, called by the TestRunner.
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-03-28  Jiewen Tan  <jiewen_tan@apple.com>

        API::Data::createWithoutCopying should do a null check before calling CFRelease
        https://bugs.webkit.org/show_bug.cgi?id=196276
        <rdar://problem/48059859>

        Reviewed by Alex Christensen.

        * Shared/Cocoa/APIDataCocoa.mm:
        (API::Data::createWithoutCopying):

2019-03-28  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Automatic focus of input field is flaky
        https://bugs.webkit.org/show_bug.cgi?id=196302

        Reviewed by Brent Fulgham.

        Sometimes the status of whether a keyboard is connected can be incorrect, both in the UI process, and in
        the WebContent process. Fix this by sending the keyboard status to the WebContent process as part of the
        Web page creation parameters. Stop caching the keyboard status in the Web process proxy, and call
        [UIKeyboard isInHardwareKeyboardMode] instead, since this method is swizzled in the test harness.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (hardwareKeyboardAvailabilityChangedCallback):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::setKeyboardIsAttached): Deleted.
        (WebKit::WebProcessProxy::keyboardIsAttached const): Deleted.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::isInHardwareKeyboardMode):
        (WebKit::WebPageProxy::applicationWillEnterForeground):
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:

2019-03-28  Tim Horton  <timothy_horton@apple.com>

        Fix the build.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant showImageSheet]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):

2019-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] webkit_web_resource_get_data_finish can return NULL without setting error
        https://bugs.webkit.org/show_bug.cgi?id=186276

        Reviewed by Carlos Garcia Campos.

        Currently it's possible for webkit_web_resource_get_data_finish() to return NULL without
        setting the error parameter. This is illegal because it is an API guarantee (and a GObject
        convention) that if an error parameter exists, it should be set whenever a function call
        returns NULL. Epiphany correctly dereferences the error in this case without checking if it
        is NULL, because it knows it does not have to, and crashes. Fix this. We'll return a byte
        array of length 1 containing a NUL character. This isn't great, but there's not really any
        better solution without deprecating the API or returning an error code to indicate an empty
        resource, and it at least fixes the Epiphany crash.

        This does not fix bug #186276, in which this function incorrectly returns no data when it
        ought to. But that is a different bug. Now, at least we won't crash when no data is
        available.

        * UIProcess/API/glib/WebKitWebResource.cpp:
        (resourceDataCallback):

2019-03-28  Daniel Bates  <dabates@apple.com>

        [iPad] Tapping on a popup form control may not show a popover
        https://bugs.webkit.org/show_bug.cgi?id=196322
        <rdar://problem/49229632>

        Reviewed by Wenson Hsieh.

        Stop taking advantage of -[WKContentView inputView] being called when we invoke -reloadInputViews
        to "lazily" allocate the input peripheral for the currently focused element. In theory, UIKit only
        needs to call -inputView when it actually needs to display the input view (the keyboard). For
        popup menu buttons, like <select>, no keyboard is needed. Instead we should create the peripheral
        as part of the logic in the UI process to focus a new element before we call -reloadInputViews.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView inputView]): Extract logic to allocate the peripheral from here and moved it to createInputPeripheralWithView().
        (-[WKContentView accessoryTab:]): While I am here, add a FIXME comment to explain why we need to
        end the input sessions and nullify the input peripheral before we tell the web process to switch
        focus as opposed to letting this happen after the web process tells us it focused a new element.
        (createInputPeripheralWithView): Added.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        Write in terms of createInputPeripheralWithView(). Create the input peripheral after becoming
        first responder because creating the peripheral has known side-effects: for popup buttons it
        tells the popup controller to present the popover. For key input to popovers to work from the get-go,
        the content view must be the first responder. See <https://bugs.webkit.org/show_bug.cgi?id=196272>
        for more details.

2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>

        Silence lot of warnings when compiling with clang
        https://bugs.webkit.org/show_bug.cgi?id=196310

        Reviewed by Michael Catanzaro.

        * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: add missing
        override clause.
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: add
        missing override clause.

2019-03-27  Ryosuke Niwa  <rniwa@webkit.org>

        [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
        https://bugs.webkit.org/show_bug.cgi?id=196336

        Reviewed by Tim Horton.

        The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
        This resulted in RenderMenuList::m_popupIsVisible to be never reset.

        Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
        the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
        Send cancelTracking to NSMenu instead, which DOES dismiss the popup.

        Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
               fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html

        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::hide):

2019-03-27  Dean Jackson  <dino@apple.com>

        [ARKit] Black view when opening a 3D model usdz file in new tab
        https://bugs.webkit.org/show_bug.cgi?id=196333
        <rdar://problem/47693367>

        Reviewed by Tim Horton.

        When opening a new WKSystemPreviewView, we were exiting if there was no
        presentingViewController. This code was unnecessary, and causing blank
        content when opening a new tab.

        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
        Remove the code looking for a presentingViewController.

2019-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Need a way to include WebKitAdditions code in WebKit API headers
        https://bugs.webkit.org/show_bug.cgi?id=196173

        Reviewed by Tim Horton.

        Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
        using `#import`s of the form:

        ```
        #if USE(APPLE_INTERNAL_SDK)
        #import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
        #endif
        ```

        The resulting header in the built products directory will contain the contents of the imported file inserted in
        place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
        the additions header content will be imported by the usual means.

        * mac/postprocess-framework-headers.sh:
        * mac/replace-webkit-additions-includes.py: Added.

        Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
        with the text content of the additions files. The replacement script first searches in the built products
        directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
        are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.

        (read_content_from_webkit_additions):
        (main):

2019-03-27  Andy Estes  <aestes@apple.com>

        REGRESSION (r242686): package-root creates roots with broken symlinks in WebKit.framework/XPCServices/
        https://bugs.webkit.org/show_bug.cgi?id=196317

        Reviewed by Dan Bernstein.

        Removed some remnants of the Storage Process.

        * Configurations/BaseTarget.xcconfig:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Removed.
        * WebKit.xcodeproj/project.pbxproj:

2019-03-27  Keith Rollin  <krollin@apple.com>

        Include the CFNetworking task UUID to the NSError when a resource-load fails
        https://bugs.webkit.org/show_bug.cgi?id=196156

        Reviewed by Alex Christensen.

        In order to help track the connection between a failed resource-load
        and a user-visible error message, include the CFNetworking task UUID
        in the associated error as an element of the userInfo property. This
        can then be pulled out and reported in the logging at the point the
        error is reported to the user.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):

2019-03-27  Chris Dumez  <cdumez@apple.com>

        [ iOS Sim ] REGRESSION (r242277) Layout Test http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=195425
        <rdar://problem/48682403>

        Reviewed by Alex Christensen.

        When process-swapping on history navigation, we lookup the WebProcessProxy we'd like to use from the
        process identifier that is saved on the WebBackForwardListItem, to try and load the item in the process
        in which it was previously loaded. However, we were failing to check if the WebProcess in question was
        still running so we could potentially try to use a process that's already exited.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):

2019-03-27  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Always dispatch the synthetic click asynchronously
        https://bugs.webkit.org/show_bug.cgi?id=196278
        <rdar://problem/49299968>

        Reviewed by Simon Fraser.

        This patch ensures that all completeSyntheticClick() calls happen in an asynchronous manner (unless the feature is turned off).

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

2019-03-27  Tim Horton  <timothy_horton@apple.com>

        Fix some more deprecation warnings in WKDrawingView
        https://bugs.webkit.org/show_bug.cgi?id=196282
        <rdar://problem/47637608>

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/PencilKitSPI.h:
        * SourcesCocoa.txt:
        * UIProcess/ios/PencilKitSoftLink.h:
        * UIProcess/ios/PencilKitSoftLink.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKDrawingCoordinator.h:
        * UIProcess/ios/WKDrawingCoordinator.mm:
        (-[WKDrawingCoordinator initWithContentView:]):
        (-[WKDrawingCoordinator currentInk]):
        (-[WKDrawingCoordinator undoManagerForInkPicker:]):
        (-[WKDrawingCoordinator containingViewForInkPicker:]):
        (-[WKDrawingCoordinator inkPickerDidToggleRuler:]):
        (-[WKDrawingCoordinator inkPickerDidChangeInk:]):
        (-[WKDrawingCoordinator installInkPickerForDrawing:]):
        (-[WKDrawingCoordinator uninstallInkPicker]):
        (-[WKDrawingCoordinator inkPicker]): Deleted.
        (-[WKDrawingCoordinator didChangeRulerState:]): Deleted.
        (-[WKDrawingCoordinator didChangeInk:]): Deleted.
        * UIProcess/ios/WKDrawingView.mm:
        (-[WKDrawingView _canvasViewWillBeginDrawing:]):
        * UIProcess/ios/WKInkPickerView.h: Removed.
        * UIProcess/ios/WKInkPickerView.mm: Removed.
        * WebKit.xcodeproj/project.pbxproj:
        Adopt the new names.

2019-03-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        Geolocation request not complete when watch request was started in a different web process
        https://bugs.webkit.org/show_bug.cgi?id=195996

        Reviewed by Alex Christensen.

        In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
        reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
        don't have a known position, the request will be completed when
        WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
        processes.

        * UIProcess/WebGeolocationManagerProxy.cpp:
        (WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
        (WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
        * UIProcess/WebGeolocationManagerProxy.h:
        (WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
        * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
        (WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.

2019-03-26  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Correct kerberos-related sandbox violations
        https://bugs.webkit.org/show_bug.cgi?id=196279
        <rdar://problem/48622502>

        Reviewed by Per Arne Vollan.

        We need to allow communications with a Kerberos-related service on macOS
        until <rdar://problem/35542803> is fixed.

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

2019-03-26  Chris Dumez  <cdumez@apple.com>

        [macOS] The network process is not exiting reliably when the WebProcessPool is destroyed
        https://bugs.webkit.org/show_bug.cgi?id=196277
        <rdar://problem/49127581>

        Reviewed by Alex Christensen.

        When, an AuxiliaryProcess receives the AuxiliaryProcess::Terminate IPC, it calls stopRunLoop()
        to exit. WebProcess overrides AuxiliaryProcess::stopRunLoop() to call exit(0) on the main
        thread. Other auxiliary processes such as the NetworkProcess would end up calling
        platformStopRunLoop(). On iOS and iOSMac, platformStopRunLoop() calls XPCServiceExit(), which
        makes sense since auxiliary processes run their run loop by calling xpc_main(). However, on
        macOS, platformStopRunLoop() was calling RunLoop::main().stop() to exit instead, which was
        unreliable as demonstrated by the test app attached to the radar.

        Updating platformStopRunLoop() to call XPCServiceExit() on macOS fixes the problem and I now
        see the NetworkProcess exiting reliably there. This is the approach I have chosen in this
        patch since it appears to be reliable and it makes the code consistent on all Cocoa platforms.

        * Shared/AuxiliaryProcess.cpp:
        * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
        (WebKit::AuxiliaryProcess::platformStopRunLoop):
        * Shared/ios/AuxiliaryProcessIOS.mm:
        (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.
        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::platformStopRunLoop): Deleted.

2019-03-26  Keith Rollin  <krollin@apple.com>

        Inhibit CFNetwork logging in private sessions
        https://bugs.webkit.org/show_bug.cgi?id=196268
        <rdar://problem/48210793>

        Reviewed by Alex Christensen.

        Before performing any logging, the NetworkProcess checks to see if
        it's performing an operation associated with a private (ephemeral)
        browsing session. If so, it skips the logging. However, networking
        layers below the NetworkProcess don't know about private browsing, so
        they would still perform their own logging. CFNetwork now has a flag
        that lets us control that, so set it to False if private browsing.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::configurationForSessionID):

2019-03-26  Chris Dumez  <cdumez@apple.com>

        Add basic layout test coverage for File Picker on iOS
        https://bugs.webkit.org/show_bug.cgi?id=196265

        Reviewed by Wenson Hsieh.

        Add layout test infrastructure to test the file picker on iOS.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _dismissFilePicker]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dismissFilePicker]):
        (-[WKContentView _contentsOfUserInterfaceItem:]):
        * UIProcess/ios/forms/WKFileUploadPanel.h:
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel currentAvailableActionTitles]):

2019-03-26  Daniel Bates  <dabates@apple.com>

        [iOS][WK2] Use a better concept to describe the reason we defer zooming a focused element: selectabiltiy
        https://bugs.webkit.org/show_bug.cgi?id=196264

        Reviewed by Wenson Hsieh.

        Rename shouldDeferZoomingToSelectionWhenRevealingFocusedElement() to mayContainSelectableText() to describe
        the criterion that we will use to decide whether to defer zooming or not. We defer zooming only for elements
        that may support text selection on initial focus because we do not have an up-to-date selection rect at that
        time. For element, like <select>, that do not support text selection, we can zoom them immediately when focused.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (mayContainSelectableText): Renamed from shouldDeferZoomingToSelectionWhenRevealingFocusedElement.
        List all the input types in the switch block and remove the default case to force the compiler to check that we
        covered all cases. This will prevent unforseen keyboard issues (why isn't the keyboard shown? or why is the keyboard shown?)
        for future input types that we may add.
        (rectToRevealWhenZoomingToFocusedElement): Update for renaming.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Add a
        comment to explain why we may need to defer the zoom: the focused element supports text selection and we need
        to wait for the web process to call back to provide an up-to-date selection rect for us to zoom and reveal.
        (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Update for renaming.
        (shouldDeferZoomingToSelectionWhenRevealingFocusedElement): Deleted.

2019-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        Implement async paste method on UIWKInteractionViewProtocol
        https://bugs.webkit.org/show_bug.cgi?id=196267
        <rdar://problem/49236346>

        Reviewed by Tim Horton.

        Implement a new UIWKInteractionViewProtocol hook to perform a paste command, and invoke the given completion
        handler when pasting is finished.

        Test: UIPasteboardTests.PasteWithCompletionHandler

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

2019-03-26  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix sandbox violations
        https://bugs.webkit.org/show_bug.cgi?id=196262
        <rdar://problem/47738015>

        Reviewed by Brent Fulgham.

        Fix various observed sandbox violations.

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

2019-03-26  Tomoki Imai  <Tomoki.Imai@sony.com>

        Assertion failure !isInAcceleratedCompositingMode() in DrawingAreaProxyCoordinatedGraphics::incorporateUpdate when forceCompositingMode is turned on
        https://bugs.webkit.org/show_bug.cgi?id=195879

        Reviewed by Carlos Garcia Campos.

        The root cause is that DrawingAreaProxyCoordinatedGraphics::isInAcceleratedCompositingMode checks both of alwaysUseCompositing() and !m_layerTreeContext.isEmpty().
        alwaysUseCompositing() refers preferences, which is written by the application (UIProcess).
        On the other hand, m_layerTreeContext is changed when it receives enterAcceleratedCompositingMode/exitAcceleratedCompositingMode from WebProcess.

        It results when we set forceCompositingMode and acceleratedCompositingEnabled to true, WebProcess and UIProcess is out of sync until WebProcess sends enterAcceleratedCompositingMode message.
        In such situation, WebProcess sends incorporateUpdate to UIProcess because WebProcess is in non-AC mode, but isInAcceleratedCompositingMode becomes true in UIProcess side.

        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics): Should call exitAcceleratedCompositingMode even when alwaysUseCompositing is true.
        (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode): enterAcceleratedCompositingMode should check enterAcceleratedCompositingMode is not called twice.
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Remove alwaysUseCompositing from isInAcceleratedCompositingMode

2019-03-26  Antoine Quint  <graouts@apple.com>

        Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
        https://bugs.webkit.org/show_bug.cgi?id=196254
        <rdar://problem/49124334>

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2019-03-26  Philippe Normand  <pnormand@igalia.com>

        [WPE][Qt] Uninitialized racy ViewBackend
        https://bugs.webkit.org/show_bug.cgi?id=196247

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/wpe/qt/WPEQtView.h: Initialize the backend pointer to nullptr.

2019-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix typo in GLib geolocation API after r243285.

        gelocation -> geolocation.

        * UIProcess/API/glib/WebKitGeolocationManager.cpp:
        (webkit_geolocation_manager_class_init):
        (webkit_geolocation_manager_update_position):
        (webkit_geolocation_manager_failed):
        (webkit_gelocation_manager_update_position): Deleted.
        (webkit_gelocation_manager_failed): Deleted.
        * UIProcess/API/gtk/WebKitGeolocationManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitGeolocationManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2019-03-26  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Disable process warming
        https://bugs.webkit.org/show_bug.cgi?id=196208

        Reviewed by Chris Dumez.

        Fixes crash caused by r243384.

        Process warming is incompatible with our launcher as it expects a valid
        WebsiteDataStore at initialization time for sandbox permissions.

        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitialize):

2019-03-25  Alex Christensen  <achristensen@webkit.org>

        Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
        https://bugs.webkit.org/show_bug.cgi?id=196213

        Reviewed by Geoff Garen.

        A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
        with a SecIdentityRef wrapped in an NSCredential.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode):

2019-03-25  Chris Dumez  <cdumez@apple.com>

        Regression(r242369) Trying to change profile picture on linked in shows file picker, not the image picker
        https://bugs.webkit.org/show_bug.cgi?id=196205
        <rdar://problem/49083324>

        Reviewed by Geoffrey Garen.

        Update our FileUploadPanel code on iOS to properly deal with the MIME types containing
        wild cards (e.g. "image/*") that are defined in the HTML specification:
        - https://html.spec.whatwg.org/multipage/input.html#attr-input-accept

        Previously, we would fail to convert those to UTIs.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:

2019-03-25  Tim Horton  <timothy_horton@apple.com>

        Remove some now-unnecessary dynamic class lookup
        https://bugs.webkit.org/show_bug.cgi?id=196237

        Reviewed by Simon Fraser.

        * Shared/DocumentEditingContext.mm:
        (WebKit::DocumentEditingContext::toPlatformContext):

2019-03-25  Tim Horton  <timothy_horton@apple.com>

        Get rid of ENABLE(ANIMATED_KEYBOARD_SCROLLING)
        https://bugs.webkit.org/show_bug.cgi?id=196224

        Reviewed by Simon Fraser.

        * Platform/spi/ios/AccessibilitySupportSPI.h:
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator invalidate]):
        (perpendicularAbsoluteUnitVector):
        (-[WKKeyboardScrollingAnimator beginWithEvent:]):
        (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
        (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
        (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
        (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
        (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): Deleted.
        (-[WKKeyboardScrollingAnimator stopRepeatTimer]): Deleted.
        (-[WKKeyboardScrollingAnimator performDiscreteScroll]): Deleted.

2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>

        Enable IPC sending and receiving non-default-constructible types
        https://bugs.webkit.org/show_bug.cgi?id=196132
        <rdar://problem/49229221>

        Unreviewed build fix for WinCairo port.

        error C2440: '=': cannot convert from 'int' to 'HANDLE'

        * Platform/win/SharedMemoryWin.cpp:
        (WebKit::SharedMemory::Handle::Handle): std::exchange HANDLE with nullptr, not 0.
        (WebKit::SharedMemory::Handle::operator=): Ditto.

2019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Coordinated Graphics][WinCairo] ASSERTION FAILED: state.id == m_nicosia.state.id
        https://bugs.webkit.org/show_bug.cgi?id=196190

        Reviewed by Žan Doberšek.

        This assertion assumes the pre-committed and the committed scenes
        are identical. But, the pre-committed scene is updated in the main
        thread. Removed the false assertion.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::purgeGLResources): Remove the
        assertion. Removed layers of committed scene, not pre-committed
        scene.

2019-03-25  Brady Eidson  <beidson@apple.com>

        Add socket-delegate to another entitlements config
        rdar://problem/48090350 and https://bugs.webkit.org/show_bug.cgi?id=196227

        Reviewed by Geoffrey Garen.

        * Configurations/Network-iOSMac.entitlements:

2019-03-25  Commit Queue  <commit-queue@webkit.org>

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

        the test doesn't build (Requested by thorton on #webkit).

        Reverted changeset:

        "Do not terminate the NetworkProcess if a third party
        application sends a NSCredential with a SecIdentityRef"
        https://bugs.webkit.org/show_bug.cgi?id=196213
        https://trac.webkit.org/changeset/243465

2019-03-25  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
        https://bugs.webkit.org/show_bug.cgi?id=196126
        rdar://problem/49095791

        Reviewed by Tim Horton.
        
        I fumbled the commit after the enum rename. Make this actually work.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):

2019-03-25  Simon Fraser  <simon.fraser@apple.com>

        Zoom on macOS is centered around a point lower than the cursor
        https://bugs.webkit.org/show_bug.cgi?id=196225
        rdar://problem/49213574

        Reviewed by Tim Horton.
        
        The origin handed to ViewGestureController::handleMagnificationGestureEvent is in WKWebView
        coordinates, but we end up setting the transform on the RenderView's layer, so we need
        to subtract the topContentInset.

        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::handleMagnificationGestureEvent):

2019-03-25  Alex Christensen  <achristensen@webkit.org>

        Do not terminate the NetworkProcess if a third party application sends a NSCredential with a SecIdentityRef
        https://bugs.webkit.org/show_bug.cgi?id=196213

        Reviewed by Geoff Garen.

        A release assertion added in r230225 was reachable.  I reached it in a unit test that responds to a challenge
        with a SecIdentityRef wrapped in an NSCredential.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode):

2019-03-25  Chris Dumez  <cdumez@apple.com>

        Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag
        https://bugs.webkit.org/show_bug.cgi?id=196210
        <rdar://problem/48681326>

        Reviewed by Geoffrey Garen.

        Get rid of WebPage::m_shouldResetDrawingAreaAfterSuspend flag and use the drawing area identifier
        instead to reset the DrawingArea in the WebProcess whenever the UIProcess did.

        This is less error-prone and guarantees that the WebProcess and the UIProcess can reliably
        communicate via DrawingArea IPC.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reinitializeWebPage):
        (WebKit::WebPage::setIsSuspended):
        * WebProcess/WebPage/WebPage.h:

2019-03-25  Alex Christensen  <achristensen@webkit.org>

        Enable IPC sending and receiving non-default-constructible types
        https://bugs.webkit.org/show_bug.cgi?id=196132

        Reviewed by Geoff Garen.

        * Platform/IPC/ArgumentCoder.h:
        * Platform/IPC/ArgumentCoders.h:
        (IPC::TupleEncoder::encode):
        (IPC::tupleFromTupleAndObject):
        (IPC::TupleDecoderImpl::decode):
        (IPC::TupleDecoderImpl<Type>::decode):
        (IPC::TupleDecoder::decode):
        (IPC::TupleDecoder<0>::decode):
        (IPC::TupleCoder::encode): Deleted.
        (IPC::TupleCoder::decode): Deleted.
        * Platform/IPC/Connection.h:
        (IPC::Connection::sendWithReply):
        (IPC::TupleMover::move):
        (IPC::moveTuple):
        (IPC::Connection::sendSync):
        * Platform/IPC/Decoder.h:
        (IPC::Decoder::decode):
        (IPC::Decoder::operator>>):
        * Platform/IPC/HandleMessage.h:
        (IPC::handleMessage):
        (IPC::handleMessageSynchronous):
        (IPC::handleMessageSynchronousWantsConnection):
        (IPC::handleMessageAsync):
        * Platform/SharedMemory.h:
        * Scripts/webkit/LegacyMessages-expected.h:
        * Scripts/webkit/Messages-expected.h:
        * Scripts/webkit/MessagesSuperclass-expected.h:
        * Scripts/webkit/messages.py:
        * Shared/Databases/IndexedDB/WebIDBResult.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        * Shared/ShareableBitmap.h:
        * Shared/ShareableResource.h:
        * Shared/UpdateInfo.h:
        * Shared/WebEvent.h:
        * Shared/WebProcessCreationParameters.cpp:
        * Shared/WebProcessCreationParameters.h:
        * Shared/mac/SecItemResponseData.cpp:
        (WebKit::SecItemResponseData::SecItemResponseData):
        (WebKit::SecItemResponseData::decode):
        * Shared/mac/SecItemResponseData.h:
        * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h:

2019-03-25  Tim Horton  <timothy_horton@apple.com>

        Animated keyboard scrolling is extremely chaotic
        https://bugs.webkit.org/show_bug.cgi?id=196164
        <rdar://problem/48702444>

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
        Consume keyboard events instead of interpreting them traditionally
        if WKKeyboardScrollingAnimator is animating.

        * UIProcess/ios/WKKeyboardScrollingAnimator.h:
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator beginWithEvent:]):
        (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
        (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
        (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
        (-[WKKeyboardScrollingAnimator displayLinkFired:]):
        (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
        Expose the current state of interactive scrolling, and rename the related member.

2019-03-25  Keith Rollin  <krollin@apple.com>

        Add WebKit logging for first paint and other interesting layout milestones
        https://bugs.webkit.org/show_bug.cgi?id=196159
        <rdar://problem/49128952>

        Reviewed by Simon Fraser.

        Add some logging to indicate what layout milestones have been reached.
        This should help us determine if there's a client, rendering, layout,
        or some other issue when page content does not appear in the client
        window.

        The logging is being added to
        WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
        a nice central place to capture layout milestones. However, it will
        only log notifications that are being sent to clients. It does not
        indicate all milestones that have occurred. That is, it does not
        report milestones that are filtered out due to client disinterest.
        There doesn't seem to be a good central place to capture all
        milestones, regardless of client interest.

        * Platform/Logging.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):

2019-03-25  Patrick Griffis  <pgriffis@igalia.com>

        [GTK][WPE] Remove network access from web process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=189967

        Reviewed by Michael Catanzaro.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::createFlatpakInfo):
        (WebKit::bubblewrapSpawn):
        * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
        (WebKit::flatpakSpawn):

2019-03-25  Andy Estes  <aestes@apple.com>

        [Apple Pay] Call +canMakePayments on a work queue
        https://bugs.webkit.org/show_bug.cgi?id=196179
        <rdar://problem/45388749>

        Reviewed by Brady Eidson.

        Calling +canMakePayments on either PKPaymentAuthorizationController or
        PKPaymentAuthorizationViewController results in synchronous IPC and is therefore very
        expensive to call on the main thread. On iOS, these calls are made in the network process,
        and on Mac in the UI process.

        Call these methods on a work queue to avoid main thread spins.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::canMakePayments):
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):

2019-03-25  Andy Estes  <aestes@apple.com>

        [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
        https://bugs.webkit.org/show_bug.cgi?id=196180

        Reviewed by Youenn Fablet.

        Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
        without an entitlement. Therefore, we can call it from the web process directly rather than
        synchronously messaging the entitled UI or networking process.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
        * WebProcess/ApplePay/WebPaymentCoordinator.h:
        * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
        (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
        (-[WKAccessibilityWebPageObjectBase setWebPage:]):

2019-03-25  Chris Dumez  <cdumez@apple.com>

        Unreviewed, tiny fix after r243388 to address API test failures on iOS

        m_processType was properly initialized on macOS but not iOS.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2019-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Do not allow changes in active URI before provisional load starts for non-API requests
        https://bugs.webkit.org/show_bug.cgi?id=194208

        Reviewed by Michael Catanzaro.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewWillStartLoad): Block updates of active URL.
        (webkitWebViewLoadChanged): Unblock updates of active URL on WEBKIT_LOAD_STARTED.

2019-03-25  Gyuyoung Kim  <gyuyoung.kim@webkit.org>

        Remove NavigatorContentUtils in WebCore/Modules
        https://bugs.webkit.org/show_bug.cgi?id=196070

        Reviewed by Alex Christensen.

        NavigatorContentUtils was to support the custom scheme spec [1].
        However, in WebKit side, no port has supported the feature in
        WebKit layer after EFL port was removed. So there has been the
        only IDL implementation of the NavigatorContentUtils in WebCore.
        So we don't need to keep the implementation in WebCore anymore.

        [1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h: Removed.

2019-03-24  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed WPE build fix.

        * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
        Add an explicit CompletionHandler.h include to avoid a trip-up in
        unified builds.

2019-03-24  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] WebProcessDataStoreParameters.h(32): error C2653: 'SandboxExtension': is not a class or namespace name
        https://bugs.webkit.org/show_bug.cgi?id=196192

        Unreviewed for WinCairo port.

        * Shared/WebProcessDataStoreParameters.h: Added #include "SandboxExtension.h".

2019-03-24  Andy Estes  <aestes@apple.com>

        [watchOS] Remove unused Proximity Networking code
        https://bugs.webkit.org/show_bug.cgi?id=196188

        Reviewed by Tim Horton.

        * Configurations/WebKit.xcconfig:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidResume):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        * NetworkProcess/watchos/NetworkProximityAssertion.h: Removed.
        * NetworkProcess/watchos/NetworkProximityAssertion.mm: Removed.
        * NetworkProcess/watchos/NetworkProximityManager.h: Removed.
        * NetworkProcess/watchos/NetworkProximityManager.mm: Removed.
        * SourcesCocoa.txt:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
        (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * WebKit.xcodeproj/project.pbxproj:

2019-03-23  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix typo in comment added in r243379.

        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (-[WKProcessGroup setDelegate:]):

2019-03-23  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
        https://bugs.webkit.org/show_bug.cgi?id=137043
        rdar://problem/16595330

        Reviewed by Zalan Bujtas.

        Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
        to the UI process, and use it to set UIScrollView indicators visible or not.
        
        The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
        where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
        tests, so would never get called.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
        (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

2019-03-23  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Taping on a form control should always result in click.
        https://bugs.webkit.org/show_bug.cgi?id=196177

        Reviewed by Simon Fraser.

        This patch enures that we send a synthetic click when the traget node is a form control (button, edit field etc) even if
        the mousemove brings up some hover content.

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

2019-03-23  Andy Estes  <aestes@apple.com>

        [Apple Pay] Stop calling PKPaymentAuthorizationViewController class methods on iOS
        https://bugs.webkit.org/show_bug.cgi?id=196163
        <rdar://problem/48787564>

        Reviewed by Anders Carlsson.

        Now that we've transitioned to PKPaymentAuthorizationController on iOS, we should stop
        calling PKPaymentAuthorizationViewController class methods on iOS in favor of their
        PKPaymentAuthorizationController alternatives.

        While we're here, we should also transition to calling
        +paymentServicesMerchantURLForAPIType:completion: on both
        PKPaymentAuthorizationViewController and PKPaymentAuthorizationController.

        * Platform/cocoa/PaymentAuthorizationViewController.mm:
        (-[WKPaymentAuthorizationViewControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
        * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
        (-[WKPaymentAuthorizationDelegate _initWithRequest:presenter:]):
        (-[WKPaymentAuthorizationDelegate _paymentServicesMerchantURLForAPIType:completion:]):
        * Platform/ios/PaymentAuthorizationController.mm:
        (-[WKPaymentAuthorizationControllerDelegate _paymentServicesMerchantURLForAPIType:completion:]):
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments): Deleted.
        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):

2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK build after r243409.

        Build failure is actually unrelated to r243409, it's yet another unified build failure that happens when source
        file list changes.

        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformShowCertificate): Use WebCore namespace for CertificateInfo parameter.

2019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Remove build time dependency on Geoclue2
        https://bugs.webkit.org/show_bug.cgi?id=195994

        Reviewed by Michael Catanzaro.

        Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitGeolocationManager.cpp:
        (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
        (webkitGeolocationManagerStop):
        (webkitGeolocationManagerSetEnableHighAccuracy):
        (webkitGeolocationManagerDispose):
        (webkit_geolocation_manager_class_init):
        * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
        (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
        (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
        (WebKit::GeoclueGeolocationProvider::start):
        (WebKit::GeoclueGeolocationProvider::stop):
        (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
        (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
        (WebKit::GeoclueGeolocationProvider::destroyManager):
        (WebKit::GeoclueGeolocationProvider::setupManager):
        (WebKit::GeoclueGeolocationProvider::createClient):
        (WebKit::GeoclueGeolocationProvider::setupClient):
        (WebKit::GeoclueGeolocationProvider::startClient):
        (WebKit::GeoclueGeolocationProvider::stopClient):
        (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
        (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
        (WebKit::GeoclueGeolocationProvider::createLocation):
        (WebKit::GeoclueGeolocationProvider::locationUpdated):
        (WebKit::GeoclueGeolocationProvider::didFail):
        * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.

2019-03-22  Simon Fraser  <simon.fraser@apple.com>

        Undo collision with r243390.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (stringForSSLProtocol):

2019-03-22  Simon Fraser  <simon.fraser@apple.com>

        Fix internal builds.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (stringForSSLProtocol):

2019-03-22  Keith Rollin  <krollin@apple.com>

        Enable ThinLTO support in Production builds
        https://bugs.webkit.org/show_bug.cgi?id=190758
        <rdar://problem/45413233>

        Reviewed by Daniel Bates.

        Enable building with Thin LTO in Production when using Xcode 10.2 or
        later. This change results in a 1.45% progression in PLT5. Full
        Production build times increase about 2-3%. Incremental build times
        are more severely affected, and so LTO is not enabled for local
        engineering builds.

        LTO is enabled only on macOS for now, until rdar://problem/49013399,
        which affects ARM builds, is fixed.

        To change the LTO setting when building locally:

        - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
          command line.
        - If building with `build-webkit`, specify --lto-mode={none,thin,full}
          on the command line.
        - If building with `build-root`, specify --lto={none,thin,full} on the
          command line.
        - If building with Xcode, create a LocalOverrides.xcconfig file at the
          top level of your repository directory (if needed) and define
          WK_LTO_MODE to full, thin, or none.

        * Configurations/Base.xcconfig:

2019-03-22  Chris Dumez  <cdumez@apple.com>

        Unreviewed build fix after r243388.

        * WebProcess/WebProcess.h:

2019-03-22  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=196153
        <rdar://problem/49123855>

        Reviewed by Brent Fulgham.

        The sandbox on macOS is blocking the mach lookup.

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

2019-03-21  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, fix the build with recent SDKs.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (stringForSSLProtocol):

2019-03-22  Chris Dumez  <cdumez@apple.com>

        Implement WebProcess freezer opt-in completely on WebContent process side
        https://bugs.webkit.org/show_bug.cgi?id=196149

        Reviewed by Brady Eidson.

        Implement WebProcess freezer opt-in completely on WebContent process side, we do not need
        to involve the UIProcess with this and rely on IPC which may be fragile.

        In the future, we may want to set freezable state from the UIProcess when the API supports
        it. We can move the logic to be fully on the UIProcess side then. In the mean time, it is
        likely best not to rely on IPC and process coordination for this.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::globalPageMap):
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::WebProcessProxy::setIsInProcessCache):
        (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
        (WebKit::WebProcessProxy::didFinishLaunching):
        (WebKit::WebProcessProxy::validateFreezerStatus): Deleted.
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::removeProvisionalPageProxy):
        (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::size const): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::values): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::values const): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::begin): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::end): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::get): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::contains const): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::set): Deleted.
        (WebKit::WebProcessProxy::WebPageProxyMap::take): Deleted.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setIsInProcessCache):
        (WebKit::WebProcess::markIsNoLongerPrewarmed):
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::setFreezable): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updateProcessName):
        (WebKit::WebProcess::shouldFreezeOnSuspension const):
        (WebKit::WebProcess::updateFreezerStatus):

2019-03-22  Chris Dumez  <cdumez@apple.com>

        Prewarmed processes should be usable with any website data store
        https://bugs.webkit.org/show_bug.cgi?id=196104

        Reviewed by Alex Christensen.

        Split WebsiteDataStore-specific data out of WebProcessCreationParameters and into a new
        WebProcessDataStoreParameters struct so that we do not need a WebsiteDataStore in order
        to lauch and initialize a WebProcess. When the process finally gets used and we thus
        know which WebsiteDataStore they will be used for, we send the WebProcessDataStoreParameters
        to the process to that it can do its data store-specific initialization.

        This allows prewarmed processes not not have a WebsiteDataStore assocated with them. They
        can then be used for any WebsiteDataStore when we need them.

        This is also used by our dummy WebProcessProxy since it does not have a backing process and
        thus has no associated WebsiteDataStore.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * Shared/WebProcessDataStoreParameters.h: Added.
        (WebKit::WebProcessDataStoreParameters::encode const):
        (WebKit::WebProcessDataStoreParameters::decode):
        * UIProcess/API/C/WKContext.cpp:
        (WKContextWarmInitialProcess):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _warmInitialProcess]):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::createNewWebProcess):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::sendWebProcessDataStoreParameters):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::prewarmProcess):
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        * UIProcess/WebProcessPool.h:
        (WebKit::WebProcessPool::sendToOneProcess):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::create):
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::WebProcessProxy::setWebsiteDataStore):
        (WebKit::WebProcessProxy::addExistingWebPage):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::websiteDataStore const):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
        (WebKit::WebMediaKeyStorageManager::setWebsiteDataStore):
        * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/WebProcessSupplement.h:
        (WebKit::WebProcessSupplement::initialize):
        (WebKit::WebProcessSupplement::setWebsiteDataStore):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
        * WebProcess/win/WebProcessWin.cpp:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):

2019-03-22  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
        https://bugs.webkit.org/show_bug.cgi?id=196126
        rdar://problem/49095791

        Reviewed by Antti Koivisto.

        The scrolling tree doesn't have an accurate picture of the main view's scroll position
        during pinch-zooming, so don't have it apply layer positions if a transient zoom is
        in progress.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
        (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):

2019-03-22  Antti Koivisto  <antti@apple.com>

        Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
        https://bugs.webkit.org/show_bug.cgi?id=196100
        <rdar://problem/49117933>

        Reviewed by Simon Fraser.

        Test: fast/scrolling/ios/overflow-scroll-overlap-6.html

        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        (WebKit::RemoteLayerTreeNode::relatedScrollContainerIDs const):
        (WebKit::RemoteLayerTreeNode::relatedScrollContainerPositioningBehavior const):

        Make more generic and save the associated positioning behavior.

        (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const): Deleted.
        (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID): Deleted.
        (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs): Deleted.
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
        (WebKit::RemoteLayerTreeNode::setRelatedScrollContainerBehaviorAndIDs):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::isScrolledBy):

        Stationary relationship means the layer won't scroll the scroller.

        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

2019-03-22  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r243094): ePub files do not render or open in Books
        https://bugs.webkit.org/show_bug.cgi?id=196119
        <rdar://problem/49121686>

        Reviewed by Brady Eidson.

        Do not delay the WebProcess launch until a load when contructing a web view and the client
        may observe when its injected bundle is loaded via WKProcessGroupDelegate's
        didCreateConnectionToWebProcessPlugIn.

        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (-[WKProcessGroup setDelegate:]):
        * UIProcess/WebInspectorUtilities.cpp:
        (WebKit::inspectorProcessPool):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):
        * UIProcess/WebProcessPool.h:

2019-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r243094): Automation: browser crash in WebAutomationSession::exitFullscreenWindowForPage()
        https://bugs.webkit.org/show_bug.cgi?id=196140

        Reviewed by Chris Dumez.

        Since r243094, the WebPageProxy fullscreen manager is not created in the constructor, but once the page has a
        process launched.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::exitFullscreenWindowForPage): Null check WebPageProxy::fullScreenManager() before
        using it.

2019-03-22  Timothy Hatcher  <timothy@apple.com>

        Change macosx() to macos() in WK_API... and JSC_API... macros.
        https://bugs.webkit.org/show_bug.cgi?id=196106

        Reviewed by Brian Burg.

        * Shared/API/Cocoa/WKBrowsingContextHandle.h:
        * Shared/API/Cocoa/WKDragDestinationAction.h:
        * Shared/API/Cocoa/WKMain.h:
        * Shared/API/Cocoa/_WKFrameHandle.h:
        * Shared/API/Cocoa/_WKHitTestResult.h:
        * Shared/API/Cocoa/_WKNSWindowExtras.h:
        * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
        * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
        * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
        * UIProcess/API/C/WKPage.h:
        * UIProcess/API/Cocoa/NSAttributedString.h:
        * UIProcess/API/Cocoa/WKBackForwardList.h:
        * UIProcess/API/Cocoa/WKBackForwardListItem.h:
        * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
        * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
        * UIProcess/API/Cocoa/WKContentRuleList.h:
        * UIProcess/API/Cocoa/WKContentRuleListStore.h:
        * UIProcess/API/Cocoa/WKError.h:
        * UIProcess/API/Cocoa/WKErrorPrivate.h:
        * UIProcess/API/Cocoa/WKFrameInfo.h:
        * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
        * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
        * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
        * UIProcess/API/Cocoa/WKNavigation.h:
        * UIProcess/API/Cocoa/WKNavigationAction.h:
        * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
        * UIProcess/API/Cocoa/WKNavigationDelegate.h:
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKNavigationResponse.h:
        * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
        * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKScriptMessage.h:
        * UIProcess/API/Cocoa/WKSecurityOrigin.h:
        * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
        * UIProcess/API/Cocoa/WKURLSchemeTask.h:
        * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
        * UIProcess/API/Cocoa/WKUserContentController.h:
        * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
        * UIProcess/API/Cocoa/WKUserScript.h:
        * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
        * UIProcess/API/Cocoa/WKViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/WKWindowFeatures.h:
        * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
        * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
        * UIProcess/API/Cocoa/_WKApplicationManifest.h:
        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
        * UIProcess/API/Cocoa/_WKAutomationSession.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
        * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
        * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
        * UIProcess/API/Cocoa/_WKDownload.h:
        * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
        * UIProcess/API/Cocoa/_WKElementAction.h:
        * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
        * UIProcess/API/Cocoa/_WKFindOptions.h:
        * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
        * UIProcess/API/Cocoa/_WKFormInputSession.h:
        * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
        * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
        * UIProcess/API/Cocoa/_WKInspector.h:
        * UIProcess/API/Cocoa/_WKInspectorWindow.h:
        * UIProcess/API/Cocoa/_WKInternalDebugFeature.h:
        * UIProcess/API/Cocoa/_WKLayoutMode.h:
        * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
        * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
        * UIProcess/API/Cocoa/_WKSessionState.h:
        * UIProcess/API/Cocoa/_WKTextInputContext.h:
        * UIProcess/API/Cocoa/_WKThumbnailView.h:
        * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
        * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
        * UIProcess/API/Cocoa/_WKUserContentFilter.h:
        * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
        * UIProcess/API/Cocoa/_WKUserContentWorld.h:
        * UIProcess/API/Cocoa/_WKUserInitiatedAction.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
        * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * WebProcess/API/Cocoa/WKWebProcess.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:

2019-03-22  Yousuke Kimoto  <Yousuke.Kimoto@sony.com>

        Unreviewed build fix.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:

2019-03-22  Tim Horton  <timothy_horton@apple.com>

        Fix the build after r243354
        https://bugs.webkit.org/show_bug.cgi?id=196138
        <rdar://problem/49145951>

        * Platform/spi/ios/UIKitSPI.h:
        * Shared/DocumentEditingContext.mm:
        (WebKit::DocumentEditingContext::toPlatformContext):
        * UIProcess/ios/WKContentViewInteraction.mm:

2019-03-21  Simon Fraser  <simon.fraser@apple.com>

        Clean up some TiledCoreAnimationDrawingArea members
        https://bugs.webkit.org/show_bug.cgi?id=196124

        Reviewed by Tim Horton.

        The giant m_transform was unused.
        
        Group the bools etc.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):

2019-03-21  Brady Eidson  <beidson@apple.com>

        Certain WebProcesses should opt-out of the freezer.
        <rdar://problem/42846139> and https://bugs.webkit.org/show_bug.cgi?id=196062

        Reviewed by Andy Estes.

        WebProcesses should opt-in and opt-out of the freezer as is appropriate.
        By default a WebProcess is freezer eligible.
        If any of the following become true then it should become ineligible:
        - The WebProcess is a pre-warmed process.
        - The WebProcess is in the process cache.
        - The WebProcess is not actively hosting any web pages (e.g. it only has suspending web pages)

        The most complicated part of the above is guaranteeing that any operation that changes
        the active pages hosted by the process causes a recalculation of the freezer opt-in state.

        To do that this replaces the basic WebPageProxyMap with a custom class.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::globalPageMap):
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::WebProcessProxy::validateFreezerStatus):
        (WebKit::WebProcessProxy::setIsInProcessCache):
        (WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::WebPageProxyMap::WebPageProxyMap):
        (WebKit::WebProcessProxy::WebPageProxyMap::size const):
        (WebKit::WebProcessProxy::WebPageProxyMap::values):
        (WebKit::WebProcessProxy::WebPageProxyMap::values const):
        (WebKit::WebProcessProxy::WebPageProxyMap::begin):
        (WebKit::WebProcessProxy::WebPageProxyMap::end):
        (WebKit::WebProcessProxy::WebPageProxyMap::get):
        (WebKit::WebProcessProxy::WebPageProxyMap::contains const):
        (WebKit::WebProcessProxy::WebPageProxyMap::isEmpty const):
        (WebKit::WebProcessProxy::WebPageProxyMap::set):
        (WebKit::WebProcessProxy::WebPageProxyMap::take):

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

2019-03-21  Tim Horton  <timothy_horton@apple.com>

        Adopt UIWKDocumentContext
        https://bugs.webkit.org/show_bug.cgi?id=196040
        <rdar://problem/48642440>

        Reviewed by Ryosuke Niwa.

        * Platform/spi/ios/UIKitSPI.h:
        * Scripts/webkit/messages.py:
        * Shared/DocumentEditingContext.h: Added.
        * Shared/DocumentEditingContext.mm: Added.
        (WebKit::toNSRange):
        (WebKit::DocumentEditingContext::toPlatformContext):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::encode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContext::Range>::decode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::encode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContext::TextRect>::decode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::encode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContext>::decode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::encode):
        (IPC::ArgumentCoder<WebKit::DocumentEditingContextRequest>::decode):
        Add DocumentEditingContext(Request), and coders.
        Also expose DocumentEditingContext::toPlatformContext, which populates
        a UIWKDocumentContext with the relevant values.

        * SourcesCocoa.txt:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toWebDocumentRequestOptions):
        (toWebRequest):
        (-[WKContentView adjustSelectionWithDelta:completionHandler:]):
        (-[WKContentView requestDocumentContext:completionHandler:]):
        (-[WKContentView selectPositionAtPoint:withContextRequest:completionHandler:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::adjustSelectionWithDelta):
        (WebKit::WebPageProxy::requestDocumentEditingContext):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        Plumb DocumentEditingContext(Request) around.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::adjustSelectionWithDelta):
        Adjust the current selection given deltas to apply to the location and length.

        (WebKit::visiblePositionAdjacentToVisiblePosition):
        (WebKit::visiblePositionForPointInRootViewCoordinates):
        (WebKit::WebPage::requestDocumentEditingContext):
        Retrieve the relevant part of the selection, as well as the context,
        given either the selection, or a rect.
        If we're collecting context for a rect, we split the context between
        before and after (except for the part that intersects the selection).
        The three strings will always be directly adjacent, and any of the three
        can sometimes be null.

2019-03-21  James Magahern  <jmagahern@apple.com>

        Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
        https://bugs.webkit.org/show_bug.cgi?id=195726
        rdar://problem/48582449

        Reviewed by Megan Gardner.

        We just need to add another clause to WKContentViewInteraction's
        canPreventGestureRecognizer whitelist. 

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):

2019-03-21  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Turn on async overflow scrolling by default
        https://bugs.webkit.org/show_bug.cgi?id=196011
        rdar://problem/48453859

        Reviewed by Antti Koivisto.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-03-21  Alex Christensen  <achristensen@webkit.org>

        Remove last use of LegacySync IPC messages
        https://bugs.webkit.org/show_bug.cgi?id=196113

        Reviewed by Chris Dumez.

        Also rename "Delayed" to "Synchronous" now that there's only one type of synchronous message.

        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient):
        * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * Platform/IPC/Connection.cpp:
        (IPC::Connection::dispatchMessage):
        * Platform/IPC/HandleMessage.h:
        (IPC::handleMessageSynchronous):
        (IPC::handleMessageSynchronousWantsConnection):
        (IPC::handleMessageLegacySync): Deleted.
        (IPC::handleMessageDelayed): Deleted.
        (IPC::handleMessageDelayedWantsConnection): Deleted.
        * PluginProcess/PluginControllerProxy.messages.in:
        * PluginProcess/WebProcessConnection.messages.in:
        * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
        (WebKit::WebPage::didReceiveSyncWebPageMessage):
        * Scripts/webkit/MessageReceiver-expected.cpp:
        (WebKit::WebPage::didReceiveSyncMessage):
        * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
        (Messages::WebPage::TestSyncMessage::send):
        (Messages::WebPage::TestSynchronousMessage::send):
        (WebKit::WebPage::didReceiveSyncMessage):
        (Messages::WebPage::TestDelayedMessage::send): Deleted.
        * Scripts/webkit/MessagesSuperclass-expected.h:
        (Messages::WebPage::TestSynchronousMessage::name):
        (Messages::WebPage::TestSynchronousMessage::TestSynchronousMessage):
        (Messages::WebPage::TestDelayedMessage::receiverName): Deleted.
        (Messages::WebPage::TestDelayedMessage::name): Deleted.
        (Messages::WebPage::TestDelayedMessage::TestDelayedMessage): Deleted.
        (Messages::WebPage::TestDelayedMessage::arguments const): Deleted.
        * Scripts/webkit/messages.py:
        * Scripts/webkit/messages_unittest.py:
        * Scripts/webkit/test-legacy-messages.in:
        * Scripts/webkit/test-messages.in:
        * Scripts/webkit/test-superclass-messages.in:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
        * Shared/Plugins/NPObjectMessageReceiver.messages.in:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * UIProcess/Plugins/PluginProcessProxy.messages.in:
        * UIProcess/WebFullScreenManagerProxy.messages.in:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/WebProcessPool.messages.in:
        * UIProcess/WebProcessProxy.messages.in:
        * UIProcess/WebStorage/StorageManager.messages.in:
        * UIProcess/mac/SecItemShimProxy.messages.in:
        * WebProcess/Plugins/PluginProcessConnection.messages.in:
        * WebProcess/Plugins/PluginProxy.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::syncTerminateWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebProcess.messages.in:

2019-03-21  Brian Burg  <bburg@apple.com>

        Web Automation: support uploading non-local file paths
        https://bugs.webkit.org/show_bug.cgi?id=196081
        <rdar://problem/45819897>

        Reviewed by Devin Rousso and Joseph Pecoraro.

        To support cases where supplied file paths do not exist on the session host, add support for
        receiving file contents via Automation.setFilesToSelectForFileUpload.

        * UIProcess/Automation/Automation.json: Add new parameter.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
        Add support for receiving and saving file contents to a temporary directory. Rewrite the used paths so
        that WebCore knows to look at the revised paths where the file contents have been saved.

        (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
        Since WebKit does not have usable FileSystem implementations for all ports, shell out the actual
        saving of base64-encoded file data. Provide a Cocoa implementation, since that's what I can test.

        * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
        (WebKit::WebAutomationSession::platformGenerateLocalFilePathForRemoteFile):
        Use WTF::FileSystem to create a temporary directory, and use Cocoa methods to actually write the file.

2019-03-21  Youenn Fablet  <youenn@apple.com>

        Cache API and IDB space usages should be initialized on first quota check
        https://bugs.webkit.org/show_bug.cgi?id=195707

        Reviewed by Chris Dumez.

        When the quota manager is created, make sure it delays quota check decisions until IDB and Cache API quota users are initialized.
        For IDB, the creation is synchronous but it may not be synchronous for Cache API.
        For that purpose, add a temporary quota user that will stay uninitialized until these two quota users are added.
        Once added, the temporary quota user is removed.
        The addition of the real users is made asynchronously as this is triggered by the creation of one of the two quota users.

        In the case of a Cache API caches being cleared, make sure to reset the size to zero and to redo the quota user initialization dance.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::QuotaUserInitializer::initialize):
        (WebKit::QuotaUserInitializer::~QuotaUserInitializer):
        (WebKit::QuotaUserInitializer::QuotaUserInitializer):
        (WebKit::NetworkProcess::storageQuotaManager):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::initializeQuotaUser):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clear):

2019-03-21  Per Arne Vollan  <pvollan@apple.com>

        [iOS][macOS] Fix sandbox call violations
        https://bugs.webkit.org/show_bug.cgi?id=195809
        <rdar://problem/48829655>

        Reviewed by Brent Fulgham.

        An additional syscall needs to be added to the sandbox allow list.

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

2019-03-21  Eric Carlson  <eric.carlson@apple.com>

        Add UI process WebRTC runtime logging.
        https://bugs.webkit.org/show_bug.cgi?id=196020
        <rdar://problem/49071443>

        Reviewed by Youenn Fablet.

        * Platform/Logging.cpp:
        (WebKit::getLogChannel): New.
        * Platform/Logging.h:
        * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.

        Add runtime logging.
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
        (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
        (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
        (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
        (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
        (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
        (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
        (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
        (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
        (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
        (WebKit::convertEnumerationToString):

        * UIProcess/UserMediaPermissionRequestManagerProxy.h:
        (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
        * UIProcess/UserMediaPermissionRequestProxy.cpp:
        (WebKit::convertEnumerationToString): Add an enum specialization for logging.

        * UIProcess/UserMediaPermissionRequestProxy.h:
        (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::logger):
        (WebKit::WebPageProxy::configureLoggingChannel):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::configureLoggingChannel):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::configureLoggingChannel):
        * WebProcess/WebPage/WebPage.h:

2019-03-21  Alex Christensen  <achristensen@webkit.org>

        Stop using LegacySync messages in WebPageProxy
        https://bugs.webkit.org/show_bug.cgi?id=196056

        Reviewed by Chris Dumez.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::loadRecentSearches):
        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::backForwardGoToItem):
        (WebKit::ProvisionalPageProxy::didReceiveSyncMessage):
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleSynchronousMessage):
        (WebKit::WebPageProxy::hasInsecureContent):
        (WebKit::WebPageProxy::accessibilityScreenToRootView):
        (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
        (WebKit::WebPageProxy::printFrame):
        (WebKit::WebPageProxy::backForwardGoToItem):
        (WebKit::WebPageProxy::backForwardGoToItemShared):
        (WebKit::WebPageProxy::backForwardItemAtIndex):
        (WebKit::WebPageProxy::backForwardBackListCount):
        (WebKit::WebPageProxy::backForwardForwardListCount):
        (WebKit::WebPageProxy::canUndoRedo):
        (WebKit::WebPageProxy::executeUndoRedo):
        (WebKit::WebPageProxy::checkTextOfParagraph):
        (WebKit::WebPageProxy::checkSpellingOfString):
        (WebKit::WebPageProxy::checkGrammarOfString):
        (WebKit::WebPageProxy::spellingUIIsShowing):
        (WebKit::WebPageProxy::getGuessesForWord):
        (WebKit::WebPageProxy::substitutionsPanelIsShowing):
        (WebKit::WebPageProxy::showCorrectionPanel):
        (WebKit::WebPageProxy::dismissCorrectionPanel):
        (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
        (WebKit::WebPageProxy::recordAutocorrectionResponse):
        (WebKit::WebPageProxy::dictationAlternatives):
        (WebKit::WebPageProxy::wrapCryptoKey):
        (WebKit::WebPageProxy::unwrapCryptoKey):
        (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
        (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers):
        (WebKit::WebPageProxy::speechSynthesisVoiceList):
        (WebKit::WebPageProxy::printMainFrame): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebPageProxy::createPluginContainer):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::interpretKeyEvent):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::getIsSpeaking):
        (WebKit::WebPageProxy::executeSavedCommandBySelector):
        (WebKit::WebPageProxy::showPDFContextMenu):

2019-03-21  Alex Christensen  <achristensen@webkit.org>

        Stop using LegacySync messages in WebPage
        https://bugs.webkit.org/show_bug.cgi?id=196057

        Reviewed by Chris Dumez.

        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::markLayersVolatile):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::getCenterForZoomGesture):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::readSelectionFromPasteboard):
        (WebKit::WebPage::getStringSelectionForPasteboard):
        (WebKit::WebPage::getDataSelectionForPasteboard):
        (WebKit::WebPage::shouldDelayWindowOrderingEvent):
        (WebKit::WebPage::acceptsFirstMouse):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::replaceSelectionWithPasteboardData):
        (WebKit::WebPage::readSelectionFromPasteboard):
        (WebKit::WebPage::getStringSelectionForPasteboard):
        (WebKit::WebPage::getDataSelectionForPasteboard):
        (WebKit::WebPage::shouldDelayWindowOrderingEvent):
        (WebKit::WebPage::acceptsFirstMouse):

2019-03-21  Alex Christensen  <achristensen@webkit.org>

        Stop using LegacySync messages in WebPasteboardProxy
        https://bugs.webkit.org/show_bug.cgi?id=196060

        Reviewed by Chris Dumez.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::getPasteboardTypes):
        (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringForType):
        (WebKit::WebPasteboardProxy::getPasteboardStringsForType):
        (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::pasteboardCopy):
        (WebKit::WebPasteboardProxy::getPasteboardChangeCount):
        (WebKit::WebPasteboardProxy::getPasteboardUniqueName):
        (WebKit::WebPasteboardProxy::getPasteboardColor):
        (WebKit::WebPasteboardProxy::getPasteboardURL):
        (WebKit::WebPasteboardProxy::addPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardTypes):
        (WebKit::WebPasteboardProxy::setPasteboardURL):
        (WebKit::WebPasteboardProxy::setPasteboardColor):
        (WebKit::WebPasteboardProxy::setPasteboardStringForType):
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::getNumberOfFiles):
        (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
        (WebKit::WebPasteboardProxy::writeCustomData):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::readURLFromPasteboard):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
        (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
        (WebKit::WebPasteboardProxy::informationForItemAtIndex):
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
        (WebKit::WebPasteboardProxy::writeCustomData):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
        (WebKit::WebPasteboardProxy::writeToClipboard):
        (WebKit::WebPasteboardProxy::readFromClipboard):
        * UIProcess/wpe/WebPasteboardProxyWPE.cpp:
        (WebKit::WebPasteboardProxy::getPasteboardTypes):
        (WebKit::WebPasteboardProxy::readStringFromPasteboard):
        (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
        (WebKit::WebPasteboardProxy::writeStringToPasteboard):

2019-03-21  Andy Estes  <aestes@apple.com>

        [iOS] Apple Pay should be available in documents with no user agent scripts
        https://bugs.webkit.org/show_bug.cgi?id=196061
        <rdar://problem/48649391>

        Reviewed by Brady Eidson.

        * Shared/AuxiliaryProcess.h:
        * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
        (WebKit::AuxiliaryProcess::parentProcessHasEntitlement):

        Added a convenience function for checking parent process entitlements.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):

        Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.

        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::supportsUnrestrictedApplePay const):
        * WebProcess/ApplePay/WebPaymentCoordinator.h:

        Implemented supportsUnrestrictedApplePay by checking for the
        com.apple.private.WebKit.UnrestrictedApplePay entitlement on platforms that enable
        APPLE_PAY_REMOTE_UI.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (didClearWindowObjectForFrame):
        (setUpPageLoaderClient):

        Added injected bundle SPI that TestWebKitAPI uses to inject the WebCore Internals interface.

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

        Changed to call ScriptController::executeUserAgentScriptInWorld.

2019-03-21  Chris Dumez  <cdumez@apple.com>

        WebKit should throw when trying to create a WKWebView with a related view that is using a different data store
        https://bugs.webkit.org/show_bug.cgi?id=196041
        <rdar://problem/49083230>

        Reviewed by Alex Christensen.

        WebKit should throw when trying to create a WKWebView with a related view that is using a different data store.
        We do not support having several WebsiteDataStores sharing the same WebProcess.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage):

2019-03-21  Alex Christensen  <achristensen@webkit.org>

        Add SPI to inform applications of WKContentRuleList actions
        https://bugs.webkit.org/show_bug.cgi?id=195965
        <rdar://problem/42664365>

        Reviewed by Geoff Garen.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::processContentRuleListsForLoad):
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): Deleted.
        * NetworkProcess/NetworkLoadChecker.h:
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::contentRuleListNotification):
        * 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::contentRuleListNotification):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::contentRuleListNotification):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::contentRuleListNotification):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2019-03-21  Simon Fraser  <simon.fraser@apple.com>

        Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
        https://bugs.webkit.org/show_bug.cgi?id=196058
        rdar://problem/49078202

        Reviewed by Antti Koivisto.

        Add an internal feature flag called "LegacyOverflowScrollingTouchEnabled", initially
        on by default.

        * Shared/WebPreferences.yaml:

2019-03-21  Antti Koivisto  <antti@apple.com>

        UI-process hit-testing needs to know about containing block relationships
        https://bugs.webkit.org/show_bug.cgi?id=195845
        <rdar://problem/48949633>

        Reviewed by Simon Fraser.

        Test: fast/scrolling/ios/overflow-scroll-overlap-5.html

        When an overflow scroller contains a positioned element the element may not be on a descendant layer of the scroller,
        yet should move along with it. This needs to be taken into account in UI-side hit testing.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        (WebKit::RemoteLayerTreeNode::nonAncestorScrollContainerIDs const):
        (WebKit::RemoteLayerTreeNode::addNonAncestorScrollContainerID):
        (WebKit::RemoteLayerTreeNode::clearNonAncestorScrollContainerIDs):

        Maintain non-ancestor scrolling relationships for layers.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::isScrolledBy):

        Helper to figure out who scrolls who.

        (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

        After commit, pull the non-ancestor scrolling relationships from the scrolling tree and update the layer tree.

2019-03-21  Daniel Bates  <dabates@apple.com>

        [iOS] Inline -_ensureFormAccessoryView into -formAccessoryView and have -_updateAccessory ensure we have a form accessory
        https://bugs.webkit.org/show_bug.cgi?id=196021

        Reviewed by Wenson Hsieh.

        Every caller of -_ensureFormAccessoryView, except -formAccessoryView, immediately follows the call
        with a call to -_updateAccessory. Let's just have -_updateAccessory ensure we have a form accessory
        view and inline the implementation of -_ensureFormAccessoryView into -formAccessoryView so we can
        remove one method.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView inputView]): Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
        the equivalent work for us.
        (-[WKContentView formAccessoryView]): Moved implementation of -_ensureFormAccessoryView into here.
        (-[WKContentView _updateAccessory]): Call self.formAccessoryView to ensure we have a form accessory view.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        Remove call to -_ensureFormAccessoryView, -_updateAccessory will do
        the equivalent work for us.
        (-[WKContentView _ensureFormAccessoryView]): Deleted.

2019-03-21  Shawn Roberts  <sroberts@apple.com>

        Unreviewed, rolling out r243250.

        Causing 109 Failures and 2 crashes on iOS Sim Debug
        OpenSource/Internal queues

        Reverted changeset:

        "[iOS WK2] Turn on async overflow scrolling by default"
        https://bugs.webkit.org/show_bug.cgi?id=196011
        https://trac.webkit.org/changeset/243250

2019-03-21  Brent Fulgham  <bfulgham@apple.com>

        Fix possible memory leak when dismissing a color picker
        https://bugs.webkit.org/show_bug.cgi?id=196026
        <rdar://problem/48778568>

        Reviewed by Wenson Hsieh.

        Fix a problem with WebPageProxy::endColorPicker where an early return could leave a color picker
        with a +1 reference count after dismissing it.

        * UIProcess/WebColorPicker.cpp:
        (WebKit::WebColorPicker::endPicker):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::endColorPicker):
        (WebKit::WebPageProxy::didEndColorPicker):

2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to provide geolocation information
        https://bugs.webkit.org/show_bug.cgi?id=195940

        Reviewed by Michael Catanzaro.

        Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
        been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
        (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
        (webkit_geolocation_position_new):
        (webkit_geolocation_position_copy):
        (webkit_geolocation_position_free):
        (webkit_geolocation_position_set_timestamp):
        (webkit_geolocation_position_set_altitude):
        (webkit_geolocation_position_set_altitude_accuracy):
        (webkit_geolocation_position_set_heading):
        (webkit_geolocation_position_set_speed):
        (webkitGeolocationManagerStop):
        (webkitGeolocationManagerSetEnableHighAccuracy):
        (webkitGeolocationManagerCreate):
        (webkitGeolocationManagerGetProperty):
        (webkit_geolocation_manager_class_init):
        (webkit_gelocation_manager_update_position):
        (webkit_gelocation_manager_failed):
        (webkit_geolocation_manager_get_enable_high_accuracy):
        * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
        * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
        * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
        (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
        * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
        * UIProcess/API/gtk/WebKitWebContext.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/gtk/webkit2.h:
        * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
        * UIProcess/API/wpe/WebKitWebContext.h:
        * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
        * UIProcess/API/wpe/docs/wpe-docs.sgml:
        * UIProcess/API/wpe/webkit.h:

2019-03-20  Youenn Fablet  <youenn@apple.com>

        Compute quota after network process restart based on default quota and space used
        https://bugs.webkit.org/show_bug.cgi?id=195804

        Reviewed by Chris Dumez.

        Make sure that Cache Storage quota user waits to declare as initialized to its manager
        until all data is loaded so that it can report a valid space used from the start.

        Add test API to reset the quota to its default value and compute it according current space use.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::create):
        (WebKit::CacheStorage::Caches::Caches):
        (WebKit::CacheStorage::Caches::whenInitialized):
        * NetworkProcess/cache/CacheStorageEngineCaches.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::dereference):
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::setQuotaBasedOnSpaceUsage):
        * WebProcess/Cache/WebCacheStorageConnection.h:

2019-03-20  Simon Fraser  <simon.fraser@apple.com>

        Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
        https://bugs.webkit.org/show_bug.cgi?id=196049

        Reviewed by Tim Horton.

        This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
        overflow scrolling in general, so rename it.

        * Configurations/FeatureDefines.xcconfig:

2019-03-20  Jiewen Tan  <jiewen_tan@apple.com>

        Extend Networking Process sandbox for some system frameworks
        https://bugs.webkit.org/show_bug.cgi?id=196036
        <rdar://problem/47594150>

        Reviewed by Brent Fulgham.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2019-03-20  Alex Christensen  <achristensen@webkit.org>

        Reduce use of LegacySync IPC message type
        https://bugs.webkit.org/show_bug.cgi?id=194835

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        (WebKit::NetworkConnectionToWebProcess::blobSize):
        (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
        (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest):
        (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse):
        (WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation):
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
        (WebKit::UserMediaCaptureManagerProxy::capabilities):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Plugins/PluginProcessProxy.messages.in:
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::launchProcess):
        (WebKit::PluginProcessProxy::launchApplicationAtURL):
        (WebKit::PluginProcessProxy::openURL):
        (WebKit::PluginProcessProxy::openFile):
        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
        * UIProcess/WebFullScreenManagerProxy.h:
        * UIProcess/WebFullScreenManagerProxy.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::fetchWebsiteData):
        (WebKit::WebProcess::deleteWebsiteData):
        (WebKit::WebProcess::deleteWebsiteDataForOrigins):
        (WebKit::WebProcess::processWillSuspendImminently):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-03-20  Keith Rollin  <krollin@apple.com>

        Update checks that determine if WebKit is system WebKit
        https://bugs.webkit.org/show_bug.cgi?id=195756

        Unreviewed tweak of r243251 after unreviewed build fix after r243230.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::isSystemWebKit):

2019-03-20  Keith Rollin  <krollin@apple.com>

        Update checks that determine if WebKit is system WebKit
        https://bugs.webkit.org/show_bug.cgi?id=195756

        Unreviewed build fix after r243230.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::isSystemWebKit):

2019-03-20  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Turn on async overflow scrolling by default
        https://bugs.webkit.org/show_bug.cgi?id=196011
        rdar://problem/48453859

        Reviewed by Antti Koivisto.

        Turn async overflow scroll on by default for iOS WK2.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-03-20  Youenn Fablet  <youenn@apple.com>

        Have smaller default quotas for third party frames
        https://bugs.webkit.org/show_bug.cgi?id=195841

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::storageQuotaManager):
        For third party iframes, use the default quota divided by 10.

2019-03-20  Dean Jackson  <dino@apple.com>

        [iOS] Enable fast clicking everywhere
        https://bugs.webkit.org/show_bug.cgi?id=196023
        <rdar://problem/49073589>

        Reviewed by Wenson Hsieh.

        Set FastClicksEverywhere to on by default for iPhone & iPad.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-03-20  Chris Dumez  <cdumez@apple.com>

        Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
        https://bugs.webkit.org/show_bug.cgi?id=196029
        <rdar://problem/48954651>

        Reviewed by Tim Horton.

        If there is a ViewGestureController when process swapping, make sure we disconnect it
        from the old process and reconnect it to the new one. This matches what is done in
        WebViewImpl for macOS (see r238356).

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processWillSwap]):
        (-[WKWebView _processDidExit]):
        (-[WKWebView _didRelaunchProcess]):

2019-03-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] REGRESSION(r243094): crash when launching minibrowser
        https://bugs.webkit.org/show_bug.cgi?id=195951

        Reviewed by Joseph Pecoraro.

        Always return the inspector from WebPageProxy::inspector() when the page hasn't been closed. The inspector is
        created in WebPageProxy constructor and it's safe to use even before a process has been launched, because
        m_inspectedPage is null-checked everywhere.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::inspector const):

2019-03-20  Keith Rollin  <krollin@apple.com>

        Update checks that determine if WebKit is system WebKit
        https://bugs.webkit.org/show_bug.cgi?id=195756

        Reviewed by Alexey Proskuryakov.

        The system WebKit can be installed in additional locations, so check
        for and allow those, too.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::isSystemWebKit):

2019-03-20  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Unable to PiP web videos in Safari due to sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=196015
        <rdar://problem/48867037>

        Reviewed by Brent Fulgham.

        The sandbox should allow getting the iokit property 'ui-pip'.

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

2019-03-20  John Wilander  <wilander@apple.com>

        (Test fix) Override minimumTimeBetweenDataRecordsRemoval in ResourceLoadStatisticsStore::shouldRemoveDataRecord() during layout tests
        https://bugs.webkit.org/show_bug.cgi?id=196017

        Unreviewed test fix.

        This patch adds a check of parameters().isRunningTest to the return of
        ResourceLoadStatisticsStore::shouldRemoveDataRecord() to allow successive
        layout tests to remove website data, effectively overriding the
        minimumTimeBetweenDataRecordsRemoval setting.

        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):

2019-03-20  Daniel Bates  <dabates@apple.com>

        [iOS] Group UIWebFormAccessoryDelegate-related code and tighten it up a bit
        https://bugs.webkit.org/show_bug.cgi?id=196018

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView accessoryClear]): Use uniform initializer syntax. Code could send the empty
        string, but I resisted since null string, as we do now, likely encodes more compactly and we
        avoid a per-process alloc.
        (-[WKContentView accessoryTab:]): Fix style nit; missing space between capture list and arguments
        in lambda. Also use lamdba capture initializer syntax and remove a local.
        (-[WKContentView _updateAccessory]): Remove a FIXME as it can't be satified with the current
        design without more bookkeeping. The design for showing and hiding an AutoFill button added in
        r166933 requires knowing the title for the button when showing it via -setAccessoryViewCustomButtonTitle.
        We could re-implement such that -setAccessoryViewCustomButtonTitle: stores the title and calls
        -_updateAccessory, but that has the disadvantage of increasing the memory footprint of WKContentView
        for the stored title and that seems worse than centralizing the logic in _updateAccessory. So,
        let's not fix this FIXME. Now that we are removing the FIXME, change to use an early return style.
        (-[WKContentView _hideKeyboard]): Micro optimization; only call _updateAccessory if we have
        a form accessory view. This method is called everytime we load a page (more precisely when we
        commit the load for a page) in addition to everytime we blur (defocus) an element. No need to
        update an accessory if we don't have one.
 
2019-03-20  Olivier Robin  <olivierrobin@chromium.org>

        Fix _getContentsAsAttributedStringWithCompletionHandler availability for iOS.
        https://bugs.webkit.org/show_bug.cgi?id=195999

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2019-03-20  Brent Fulgham  <bfulgham@apple.com>

        Adopt RegistrableDomain in the Storage Access API prompt code paths
        https://bugs.webkit.org/show_bug.cgi?id=195957
        <rdar://problem/49048028>

        Reviewed by Chris Dumez.

        While making the code changes in Bug 195866 we noticed that strings were being
        used to pass the origins for the API calls. We should adopt the RegistrableDomain
        class to improve type safety and avoid introducing bugs in the future.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::requestStorageAccessConfirm):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
        * UIProcess/Cocoa/WKStorageAccessAlert.h:
        * UIProcess/Cocoa/WKStorageAccessAlert.mm:
        (WebKit::presentStorageAccessAlert):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestStorageAccessConfirm):

2019-03-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix typo in comment added in r243156.

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

2019-03-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, drop invalid assertions landed in r243163.

        Those assertions were causing some API tests to crash.
        Also include some post-review suggestions from Darin.

        * Shared/CallbackID.h:
        (WebKit::CallbackID::operator=):
        * Shared/OptionalCallbackID.h:
        (WebKit::OptionalCallbackID::operator=):

2019-03-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix assertion failures in API tests after r243159.

        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::removeProcess):

2019-03-20  Tim Horton  <timothy_horton@apple.com>

        Add an platform-driven spell-checking mechanism
        https://bugs.webkit.org/show_bug.cgi?id=195795

        Reviewed by Ryosuke Niwa.

        * DerivedSources-input.xcfilelist:
        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/TextCheckingController.h: Added.
        * UIProcess/Cocoa/TextCheckingController.mm: Added.
        (WebKit::TextCheckingController::TextCheckingController):
        (WebKit::TextCheckingController::replaceRelativeToSelection):
        (WebKit::TextCheckingController::removeAnnotationRelativeToSelection):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView replaceSelectionOffset:length:withAnnotatedString:relativeReplacementRange:]):
        (-[WKContentView removeAnnotation:forSelectionOffset:length:]):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::textCheckingController):
        Plumb two UITextInput methods through to the Web Content process.
        I added a new object instead of just sticking things on WebPage
        because there are quite a few more related ones coming down the pipeline,
        and will also end up being messages going in the opposite direction.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Added.
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: Added.
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm: Added.
        (WebKit::TextCheckingControllerProxy::TextCheckingControllerProxy):
        (WebKit::TextCheckingControllerProxy::~TextCheckingControllerProxy):
        (WebKit::relevantMarkerTypes):
        (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection):
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection):
        (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection):
        Make it possible for the platform to maintain arbitrary key-value pairs
        attached to document ranges, as a way for it to keep track of various
        text checking context (e.g. if something has been checked, replaced,
        what language it might be, ...).

        Allow it to replace the text of a range and the annotations in that range,
        or remove annotations in a range. Ranges are specified relative to
        the selection.

        One large missing piece is giving the platform the ability to retrieve
        annotations in a range; that is coming in a future patch.

        We translate certain annotations into traditional WebCore spelling
        and grammar document markers, for normal display-time treatment.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
        Unified sources fixes.

2019-03-19  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Implement FIDO AppID extension
        https://bugs.webkit.org/show_bug.cgi?id=143491
        <rdar://problem/48298273>

        Reviewed by Brent Fulgham.

        In U2fHidAuthenticator::continueSignCommandAfterResponseReceived, it will retry the current command
        with the AppID if it exists when SW_WRONG_DATA is received from devices. Noted, it will not set
        the AuthenticationExtensionsClientOutputs::appid to false in any circumstances. In other words, the
        field will be empty if AppID is supplied in AuthenticationExtensionsClientInputs and not used.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
        (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
        * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp:
        (WebKit::U2fHidAuthenticator::issueSignCommand):
        (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived):
        * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h:

2019-03-19  Ross Kirsling  <ross.kirsling@sony.com>

        Unreviewed adjustment to r242842 per Darin's request.

        * Platform/win/LoggingWin.cpp:
        (WebKit::logLevelString):

2019-03-19  Gyuyoung Kim  <gyuyoung.kim@lge.com>

        [WPE] Fix build warnings because of missing an argument when initializing wpe_input_axis_event
        https://bugs.webkit.org/show_bug.cgi?id=195931

        Reviewed by Michael Catanzaro.

        There are still build warnings when building wpe port. It looks like
        these build warnings have been caused by missing to set an argument
        for the modifier parameter of wpe_input_axis_event. This patch sets 0
        for the modifier argument to avoid the build warnings.

        * UIProcess/API/wpe/ScrollGestureController.cpp:
        (WebKit::ScrollGestureController::handleEvent):

2019-03-19  John Wilander  <wilander@apple.com>

        Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
        https://bugs.webkit.org/show_bug.cgi?id=195923
        <rdar://problem/49001272>

        Reviewed by Alex Christensen.

        Cross-site trackers abuse link query parameters to transport user identifiers and then store
        them in first-party storage space. To address this, we've done three things:
        - r236448 capped all persistent client-side cookies to seven days of storage.
        - r242288 further capped persistent client-side cookies for navigations with link decoration from prevalent resources.
        - r242603 added logging of navigations with link decoration from prevalent resources.

        This patch introduces an experimental feature that removes non-cookie website data for sites
        that have been navigated to, with link decoration, by a prevalent resource.

        To achieve this, resource domains to remove website data for are now marked with an enum called
        WebsiteDataToRemove with values All, AllButHttpOnlyCookies, AllButCookies. As resources are
        iterated, they are marked for either of these values and the new function
        ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor() leads to the marking with
        WebsiteDataToRemove::AllButCookies.

        Then NetworkProcess::deleteWebsiteDataForRegistrableDomains() looks at this setting and removes
        website data accordingly.

        The thinking behind this is that the lifetime cap applied in r236448 and r242288 take care of
        script writable cookies, and this patch takes care of all other script writable storage.

        The infrastructure to handle user interaction expiration is now parameterized so that multiple
        expiries can be applied. In this particular case, seven days of browser use.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const):
        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllWebsiteDataFor const):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::domainsToString):
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
        (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
        (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
        (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
        (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
           Renamed to reflect that it actually takes a parameter for which types of data to remove.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::setCrossSiteLoadWithLinkDecorationForTesting):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::deleteCookiesForTesting):
        (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
           Renamed to reflect that it actually takes a parameter for which types of data to remove.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
        (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores): Deleted.
           Renamed to reflect that it actually takes a parameter for which types of data to remove.
        * NetworkProcess/NetworkSession.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsCrossSiteLoadWithLinkDecoration):
        (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
        (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setCrossSiteLoadWithLinkDecorationForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-03-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed build fix after r243173.

        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):

2019-03-19  Brent Fulgham  <bfulgham@apple.com>

        Add default prompt implementation for the Storage Access API
        https://bugs.webkit.org/show_bug.cgi?id=195866
        <rdar://problem/45150009>

        Reviewed by Chris Dumez.

        This patch revises the UIDelegate implementation with a default permission dialog
        for the Storage Access API. This allows us to use and test the API in MiniBrowser,
        rather than requiring a full-fledged web browser to drive testing.
 
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::presentStorageAccessConfirmDialog): Added.
        (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): Modify to call new default
        implementation if the WKWebVIew client doesn't implement the necessary SPI.
        * UIProcess/Cocoa/WKStorageAccessAlert.h: Added.
        * UIProcess/Cocoa/WKStorageAccessAlert.mm: Added.
        (WebKit::presentStorageAccessAlert):
        * WebKit.xcodeproj/project.pbxproj:

2019-03-19  Conrad Shultz  <conrad_shultz@apple.com>

        REGRESSION (r242369): Only use picker-supported UTIs when creating image picker
        https://bugs.webkit.org/show_bug.cgi?id=195955

        Reviewed by Chris Dumez and Wenson Hsieh.

        r242369 started passing UTIs to -[UIImagePickerController setMediaTypes:] that correspond to types accepted by the
        file input element. However, UIImagePickerController expects a specific subset of UTIs. In the worst case, if no
        expected types are passed, this can cause a crash.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (UTIsForMIMETypes):
        Return a set rather than an array.
        (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
        Rather than hardcode specific UTIs, ask UIImagePickerController for its available types. If an accepted type
        is in the list of available types, use it. Otherwise, if an accepted type conforms to an available type,
        use the available type. This is an O(n^2) process, but there typically are only a handful of types, so
        this seems acceptable.
        (-[WKFileUploadPanel _showDocumentPickerMenu]):
        Convert the set from UTIsForMIMETypes() to an array.

2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>

        Build cleanly with GCC 9
        https://bugs.webkit.org/show_bug.cgi?id=195920

        Reviewed by Chris Dumez.

        WebKit triggers three new GCC 9 warnings:

        """
        -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
        declared copy constructor and assignment operator if one of them is user-provided.
        """

        Solution is to either add a copy constructor or copy assignment operator, if required, or
        else remove one if it is redundant.

        """
        -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
        -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
        """

        These account for most of this patch. Solution is to just remove the bad WTFMove().

        Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
        These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
        would be safer to not use memcpy on nontrivial types, but that's too complex for this
        patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)

        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::decode):
        * Platform/IPC/ArgumentCoders.h:
        * Shared/CallbackID.h:
        (WebKit::CallbackID::operator=):
        * Shared/OptionalCallbackID.h:
        (WebKit::OptionalCallbackID::operator=):
        * Shared/Plugins/NPIdentifierData.cpp:
        (WebKit::NPIdentifierData::decode):
        * Shared/Plugins/NPVariantData.cpp:
        (WebKit::NPVariantData::decode):
        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
        (WebKit::NetscapePluginModule::getOrCreate):
        * Shared/RTCNetwork.cpp:
        (WebKit::RTCNetwork::IPAddress::decode):
        * Shared/SessionState.cpp:
        (WebKit::HTTPBody::Element::decode):
        (WebKit::FrameState::decode):
        (WebKit::BackForwardListItemState::decode):
        * Shared/WebCompiledContentRuleListData.cpp:
        (WebKit::WebCompiledContentRuleListData::decode):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<FloatPoint>::decode):
        (IPC::ArgumentCoder<FloatRect>::decode):
        (IPC::ArgumentCoder<FloatQuad>::decode):
        (IPC::ArgumentCoder<ViewportArguments>::decode):
        (IPC::ArgumentCoder<IntPoint>::decode):
        (IPC::ArgumentCoder<IntRect>::decode):
        (IPC::ArgumentCoder<IntSize>::decode):
        (IPC::ArgumentCoder<MimeClassInfo>::decode):
        (IPC::ArgumentCoder<PluginInfo>::decode):
        (IPC::ArgumentCoder<SelectionRect>::decode):
        (IPC::ArgumentCoder<CompositionUnderline>::decode):
        (IPC::ArgumentCoder<BlobPart>::decode):
        (IPC::ArgumentCoder<TextIndicatorData>::decode):
        (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
        (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPlatformTouchPoint.cpp:
        (WebKit::WebPlatformTouchPoint::decode):
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::Entry::decode):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::decode):
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::decodeContentRuleListMetaData):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::launchProcessForReload):
        (WebKit::WebPageProxy::launchProcessWithItem):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::reload):
        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::takeProcess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
        * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
        (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::getOrCreate):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::create):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::createGraphicsLayer):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::pdfSnapshotAtSize):
        (WebKit::WebPage::createDocumentLoader):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::copy):

2019-03-19  Chris Dumez  <cdumez@apple.com>

        Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
        https://bugs.webkit.org/show_bug.cgi?id=194787
        <rdar://problem/48175520>

        Reviewed by Geoff Garen.

        The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
        when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
        given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
        side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.

        In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
        WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
        as soon as the WebPage object has been created on the WebProcess side. This part was fine.
        However, unregistration from the visitedLinkStores would only happen when either the
        visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
        WebProcess could stay registered with a visitedLinkStore even after the page that was using it
        has been closed, which would lead to such logging.

        To address the issue, the WebProcessProxy now keeps track for which pages are using which
        visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
        WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
        using a given visitedLinkStore is closed, the process unregisters itself from the
        visitedLinkStore, thus avoiding the bug.

        I also simplified a lot the logic for having a page telling the WebProcessProxy it started
        using a visitedLinkStore. Previously, it would have to wait until the process is done launching
        before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
        that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
        WebProcess (no matter if the process is still launching or not). At this point, the
        WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
        until it is done launching before registering itself with the visitedLinkStore.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::initializeWebPage):
        (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
        (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::~VisitedLinkStore):
        (WebKit::VisitedLinkStore::addProcess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::finishAttachingToWebProcess):
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
        (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::removeWebPage):
        (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
        (WebKit::WebProcessProxy::didFinishLaunching):
        (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
        (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
        * UIProcess/WebProcessProxy.h:

2019-03-19  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r243094): internal media test fairplay-hls-error.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=195954
        <rdar://problem/49005981>

        Reviewed by Geoffrey Garen.

        TestController::resetStateToConsistentValues() tries to send a "reset" message to its
        injected bundle. Part of the "reset" message sets the external hosts that we're allowed
        to load. If there is no WebProcess yet when WKPagePostMessageToInjectedBundle() is called,
        then this message does not get sent and the allowed hosts do not get set, causing this
        test failure.

        To address the issue, make sure we launch the initial process if necessary when
        WebPageProxy::postMessageToInjectedBundle() is called, in order to maintain backward
        compatibility.

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

2019-03-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r243142.

        Caused assertion hits in WK2 Debug

        Reverted changeset:

        "Spew: Unhandled web process message
        'VisitedLinkTableController:VisitedLinkStateChanged'"
        https://bugs.webkit.org/show_bug.cgi?id=194787
        https://trac.webkit.org/changeset/243142

2019-03-19  Daniel Bates  <dabates@apple.com>

        [iOS] Focus not preserved when switching between tabs
        https://bugs.webkit.org/show_bug.cgi?id=195820
        <rdar://problem/43614450>

        Reviewed by Brent Fulgham.

        Fixes a usability annoyance when using a hardware keyboard; focus is not preserved when switching between tabs.
        Do not unconditionally tell the WebProcess to blur the currently focused element when the content view (WKContentView)
        resigns first responder. Instead only tell it to blur when the content view is resigning because either the
        accessory view was dismissed (Done button was pressed) or the keyboard was dismissed (the hide keyboard button
        was pressed).

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm: Add new ivar to track whether the content view is resigning
        first responder status because the accessory view is being dismissed.
        (-[WKContentView resignFirstResponderForWebView]): Only tell WebKit to blur the focused element if we are
        resigning because the accessory view is being dismissed or the keyboard was hidden. We continue to do all
        other steps when resigning, including hiding the keyboard. Note that by not telling WebKit to blur the
        focused element we let it's focus controller manage the focused element with respect to the current
        page activation state (i.e. whether the content view is first responder or not). When the content view
        becomes the first responder then WebKit's focus controller will be told that the page has become activated
        and will tell the UIProcess to focus the currently focused element, which will bring up the keyboard.
        (-[WKContentView accessoryDone]): Update state so we know that a subsequent call to resign first responder
        was due to the accessory view being dismissed.

2019-03-19  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Remove overridden rules in sandbox
        https://bugs.webkit.org/show_bug.cgi?id=193840
        <rdar://problem/47558526>

        Reviewed by Brent Fulgham.

        On iOS, there are some rules overridden in the same sandbox file. The overridden rules
        should be removed.

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

2019-03-19  Timothy Hatcher  <timothy@apple.com>

        Make WebKit/NSAttributedString.h a public header.
        https://bugs.webkit.org/show_bug.cgi?id=195944

        Reviewed by Dean Jackson.

        * WebKit.xcodeproj/project.pbxproj:

2019-03-19  Chris Dumez  <cdumez@apple.com>

        Drop NetworkCacheStatistics code
        https://bugs.webkit.org/show_bug.cgi?id=195910

        Reviewed by Antti Koivisto.

        Drop NetworkCacheStatistics code. It was a temporary experiment and has not been used in a long time.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::Cache):
        (WebKit::NetworkCache::Cache::retrieve):
        (WebKit::NetworkCache::Cache::store):
        (WebKit::NetworkCache::Cache::storeRedirect):
        (WebKit::NetworkCache::Cache::update):
        (WebKit::NetworkCache::Cache::clear):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheStatistics.cpp: Removed.
        * NetworkProcess/cache/NetworkCacheStatistics.h: Removed.
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::traverseRecordsFiles):
        * NetworkProcess/cache/NetworkCacheStorage.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
        * Sources.txt:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::registerUserDefaultsIfNeeded):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/soup/WebProcessPoolSoup.cpp:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * WebKit.xcodeproj/project.pbxproj:

2019-03-19  Chris Dumez  <cdumez@apple.com>

        Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
        https://bugs.webkit.org/show_bug.cgi?id=194787
        <rdar://problem/48175520>

        Reviewed by Geoffrey Garen.

        The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
        when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
        given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
        side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.

        In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
        WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
        as soon as the WebPage object has been created on the WebProcess side. This part was fine.
        However, unregistration from the visitedLinkStores would only happen when either the
        visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
        WebProcess could stay registered with a visitedLinkStore even after the page that was using it
        has been closed, which would lead to such logging.

        To address the issue, the WebProcessProxy now keeps track for which pages are using which
        visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
        WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
        using a given visitedLinkStore is closed, the process unregisters itself from the
        visitedLinkStore, thus avoiding the bug.

        I also simplified a lot the logic for having a page telling the WebProcessProxy it started
        using a visitedLinkStore. Previously, it would have to wait until the process is done launching
        before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
        that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
        WebProcess (no matter if the process is still launching or not). At this point, the
        WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
        until it is done launching before registering itself with the visitedLinkStore.

        * UIProcess/ProvisionalPageProxy.cpp:
        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
        (WebKit::ProvisionalPageProxy::initializeWebPage):
        (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
        (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
        * UIProcess/ProvisionalPageProxy.h:
        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::~VisitedLinkStore):
        (WebKit::VisitedLinkStore::addProcess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::finishAttachingToWebProcess):
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
        (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::removeWebPage):
        (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
        (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
        (WebKit::WebProcessProxy::didFinishLaunching):
        (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
        (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
        * UIProcess/WebProcessProxy.h:

2019-03-19  Alex Christensen  <achristensen@webkit.org>

        Make WTFLogChannelState and WTFLogLevel enum classes
        https://bugs.webkit.org/show_bug.cgi?id=195904

        Reviewed by Eric Carlson.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):

2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r243132.

        Broke GTK build

        Reverted changeset:

        "Make WTFLogChannelState and WTFLogLevel enum classes"
        https://bugs.webkit.org/show_bug.cgi?id=195904
        https://trac.webkit.org/changeset/243132

2019-03-19  Antti Koivisto  <antti@apple.com>

        Layer with no backing store should still hit-test over a scroller
        https://bugs.webkit.org/show_bug.cgi?id=195378
        <rdar://problem/48652078>

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (WebKit::RemoteLayerTreeHost::makeNode):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):

        No need for special WKTiledBackingView, tiled views now have correct event regions.

2019-03-18  Alex Christensen  <achristensen@webkit.org>

        Make WTFLogChannelState and WTFLogLevel enum classes
        https://bugs.webkit.org/show_bug.cgi?id=195904

        Reviewed by Eric Carlson.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):

2019-03-18  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r243092 and r243096.
        https://bugs.webkit.org/show_bug.cgi?id=195926

        Caused assertions in tests (Requested by smfr on #webkit).

        Reverted changesets:

        "Layer with no backing store should still hit-test over a
        scroller"
        https://bugs.webkit.org/show_bug.cgi?id=195378
        https://trac.webkit.org/changeset/243092

        "Try to fix Windows build."
        https://trac.webkit.org/changeset/243096

2019-03-18  Timothy Hatcher  <timothy@apple.com>

        WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
        https://bugs.webkit.org/show_bug.cgi?id=195916

        Reviewed by Tim Horton.

        Add direct support for UIColor so it does not try to use the NSSecureCoding path.
        This avoids needs to list the classes when decoding the attributes NSDictionary
        and matches the macOS NSColor encoder/decoder.

        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::typeFromObject):
        (IPC::encodeColorInternal):
        (IPC::decodeColorInternal):
        (IPC::encodeObject):
        (IPC::decodeObject):

2019-03-18  Timothy Hatcher  <timothy@apple.com>

        Add new NSAttributedString API for converting HTML.
        https://bugs.webkit.org/show_bug.cgi?id=195636
        rdar://problem/45055697

        Reviewed by Tim Horton.

        * Platform/spi/ios/UIKitSPI.h:
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/NSAttributedString.h: Added.
        * UIProcess/API/Cocoa/NSAttributedString.mm: Added.
        (-[_WKAttributedStringNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
        (-[_WKAttributedStringNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
        (-[_WKAttributedStringNavigationDelegate webView:didFailNavigation:withError:]):
        (-[_WKAttributedStringNavigationDelegate webView:didFinishNavigation:]):
        (+[_WKAttributedStringWebViewCache cache]):
        (+[_WKAttributedStringWebViewCache configuration]):
        (+[_WKAttributedStringWebViewCache clearConfiguration]):
        (+[_WKAttributedStringWebViewCache retrieveOrCreateWebView]):
        (+[_WKAttributedStringWebViewCache cacheWebView:]):
        (+[_WKAttributedStringWebViewCache resetPurgeDelay]):
        (+[_WKAttributedStringWebViewCache purgeSingleWebView]):
        (+[_WKAttributedStringWebViewCache purgeAllWebViews]):
        (+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]):
        (+[NSAttributedString loadFromHTMLWithRequest:options:completionHandler:]):
        (+[NSAttributedString loadFromHTMLWithFileURL:options:completionHandler:]):
        (+[NSAttributedString loadFromHTMLWithString:options:completionHandler:]):
        (+[NSAttributedString loadFromHTMLWithData:options:completionHandler:]):
        * UIProcess/API/Cocoa/NSAttributedStringPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKErrorInternal.h.
        * UIProcess/API/Cocoa/WKError.h:
        * UIProcess/API/Cocoa/WKError.mm:
        (localizedDescriptionForErrorCode):
        (createNSError):
        * UIProcess/API/Cocoa/WKErrorInternal.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::getContentsAsAttributedString):

2019-03-18  Alex Christensen  <achristensen@webkit.org>

        Implement DownloadMonitor to prevent long-running slow downloads from background apps
        https://bugs.webkit.org/show_bug.cgi?id=195785

        Reviewed by Geoffrey Garen.

        This is similar to what was updated in <rdar://problem/42677685> but for WebKit Downloads.
        To test it I implemented a throttled TCP server, SPI to speed up DownloadMonitor's timer,
        and SPI to synthesize the application going into the background and foreground, which
        NSNotificationCenter does on iOS.

        * NetworkProcess/Downloads/Download.cpp:
        (WebKit::Download::didReceiveData):
        (WebKit::Download::didFinish):
        (WebKit::Download::didFail):
        (WebKit::Download::didCancel):
        * NetworkProcess/Downloads/Download.h:
        (WebKit::Download::applicationEnteredBackground):
        (WebKit::Download::applicationEnteredForeground):
        (WebKit::Download::manager const):
        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::downloadFinished):
        (WebKit::DownloadManager::applicationDidEnterBackground):
        (WebKit::DownloadManager::applicationWillEnterForeground):
        * NetworkProcess/Downloads/DownloadManager.h:
        * NetworkProcess/Downloads/DownloadMap.cpp:
        (WebKit::DownloadMap::values):
        * NetworkProcess/Downloads/DownloadMap.h:
        * NetworkProcess/Downloads/DownloadMonitor.cpp: Added.
        (WebKit::operator _kbps):
        (WebKit::timeUntilNextInterval):
        (WebKit::DownloadMonitor::DownloadMonitor):
        (WebKit::DownloadMonitor::measuredThroughputRate const):
        (WebKit::DownloadMonitor::downloadReceivedBytes):
        (WebKit::DownloadMonitor::applicationEnteredForeground):
        (WebKit::DownloadMonitor::applicationEnteredBackground):
        (WebKit::DownloadMonitor::speedMultiplier const):
        (WebKit::DownloadMonitor::timerFired):
        * NetworkProcess/Downloads/DownloadMonitor.h: Added.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::applicationDidEnterBackground):
        (WebKit::NetworkProcess::applicationWillEnterForeground):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextDownloadURLRequest):
        (WKContextResumeDownload):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _synthesizeAppIsBackground:]):
        (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplier]):
        (-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplier:]):
        * UIProcess/Cocoa/DownloadProxyMapCocoa.mm: Added.
        (WebKit::DownloadProxyMap::platformCreate):
        (WebKit::DownloadProxyMap::platformDestroy):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::didFinish):
        (WebKit::DownloadProxy::didFail):
        (WebKit::DownloadProxy::didCancel):
        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::DownloadProxyMap):
        (WebKit::DownloadProxyMap::~DownloadProxyMap):
        (WebKit::DownloadProxyMap::platformCreate):
        (WebKit::DownloadProxyMap::platformDestroy):
        (WebKit::DownloadProxyMap::applicationDidEnterBackground):
        (WebKit::DownloadProxyMap::applicationWillEnterForeground):
        (WebKit::DownloadProxyMap::createDownloadProxy):
        (WebKit::DownloadProxyMap::downloadFinished):
        * UIProcess/Downloads/DownloadProxyMap.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::synthesizeAppIsBackground):
        (WebKit::NetworkProcessProxy::createDownloadProxy):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::handleDownloadRequest):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download):
        (WebKit::WebProcessPool::resumeDownload):
        (WebKit::WebProcessPool::createDownloadProxy):
        (WebKit::WebProcessPool::synthesizeAppIsBackground):
        * UIProcess/WebProcessPool.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::handleDownloadRequest):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::handleDownloadRequest):
        * WebKit.xcodeproj/project.pbxproj:

2019-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Native selection views sometimes appear in hidden editable areas after losing focus
        https://bugs.webkit.org/show_bug.cgi?id=195894
        <rdar://problem/48849989>

        Reviewed by Tim Horton.

        On certain websites, focus is moved away from an editable element while maintaining a selection inside the
        editable element. In the case where the editable element is hidden, this currently breaks our text interaction
        suppression heuristics, which suppress text selection gestures and overlays inside focused hidden editable
        elements. To fix this, we refactor our text interaction suppression heuristics, such that they are not dependent
        on an editable element being focused. See changes below for more details.

        Test: editing/selection/ios/hide-selection-in-non-focused-element.html

        * Shared/EditorState.cpp:
        (WebKit::EditorState::PostLayoutData::encode const):
        (WebKit::EditorState::PostLayoutData::decode):
        * Shared/EditorState.h:

        Rename elementIsTransparentOrFullyClipped to editableRootIsTransparentOrFullyClipped, and additionally compute
        this flag by checking whether the root editable element containing the selection is transparent or clipped,
        instead of using the currently focused element.

        * Shared/FocusedElementInformation.cpp:
        (WebKit::FocusedElementInformation::encode const):
        (WebKit::FocusedElementInformation::decode):
        * Shared/FocusedElementInformation.h:

        Remove the elementIsTransparentOrFullyClipped flag from FocusedElementInformation (see below for more detail).

        * UIProcess/ios/WKContentViewInteraction.h:

        Rename FocusedElementIsTransparentOrFullyClipped to EditableRootIsTransparentOrFullyClipped.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _zoomToRevealFocusedElement]):
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

        Remove logic that currently uses state on FocusedElementInformation to determine whether to suppress platform
        text interactions; instead, only use EditorState to make this determination. This logic was originally added in
        the initial implementation of the text interaction suppression heuristic as a way to begin suppressing text
        selection state before zooming to reveal the focused element; however, since we now zoom to reveal the text
        selection when focusing editable elements, zooming is deferred until the next complete EditorState update
        arrives in the UI process so we don't need to worry about beginning to suppress text interactions prior to this
        initial editor state update.

        (-[WKContentView _elementDidBlur]):
        (-[WKContentView _updateSelectionAssistantSuppressionState]):

        Add a helper method that updates text selection suppression state using the current EditorState.

        (-[WKContentView _selectionChanged]):
        (-[WKContentView _updateChangedSelection:]):

        Always update text suppression state when receiving an EditorState, instead of only doing so when processing a
        text selection gesture.

        (-[WKContentView _startSuppressingSelectionAssistantForReason:]):

        Renamed from _beginSuppressingSelectionAssistantForReason:, to better match "start/end" terminology of
        _endSuppressingSelectionAssistantForReason:.

        (-[WKContentView dropInteraction:performDrop:]):
        (-[WKContentView _beginSuppressingSelectionAssistantForReason:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::editorStateChanged):

        Ensure that we run logic to zoom to the focused element *after* updating text selection suppression state, so we
        don't erroneously zoom to reveal hidden editable elements.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformEditorState const):
        (WebKit::WebPage::getFocusedElementInformation):

2019-03-18  Chris Dumez  <cdumez@apple.com>

        Delay WebProcess launch until a load is triggered in a Web view
        https://bugs.webkit.org/show_bug.cgi?id=195758
        <rdar://problem/48126013>

        Reviewed by Geoff Garen.

        This is achieved by constructing WebPageProxy objects with a WebProcessProxy that is in
        terminated state (because it never launched its process). This is convenient because
        it is a state that the WebPageProxy supports, which normally happened by the WebProcess
        crashes. When trying to do a load, we were already checking if the WebPageProxy's process
        was running (via an isValid() check) and we would re-launch the WebProcess if necessary
        by calling reattachToWebProcess(). For clarity, given that this state is no longer
        indicating that the WebProcess crashed, I renamed isValid() to hasRunningProcess() and
        reattachToWebProcess() to launchProcess().

        The reason delaying the WebProcess launch until the first load is useful is because it
        allows us to leverage the WebProcessCache given that we now know which registrable
        domain is going to be loaded in the process.

        This is a progression from a power usage standpoint. When it comes to page load time,
        it would be a progression if we found a suitable process in the cache. I do not expect
        a performance hit when no process is found in the cache because of process prewarming.

        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        * Shared/API/Cocoa/RemoteObjectRegistry.mm:
        (WebKit::m_launchInitialProcessIfNecessary):
        (WebKit::RemoteObjectRegistry::sendInvocation):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _processCacheSize]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _isValid]):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::willShowJavaScriptDialog):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
        (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
        (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
        (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
        * UIProcess/DrawingAreaProxy.cpp:
        (WebKit::DrawingAreaProxy::setViewExposedRect):
        (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
        * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
        (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
        * UIProcess/InspectorTargetProxy.cpp:
        (WebKit::InspectorTargetProxy::connect):
        (WebKit::InspectorTargetProxy::disconnect):
        (WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::sizeDidChange):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
        (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
        (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
        (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::ViewGestureController):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::~WebBackForwardList):
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
        * UIProcess/WebEditCommandProxy.cpp:
        (WebKit::WebEditCommandProxy::unapply):
        (WebKit::WebEditCommandProxy::reapply):
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::stopLoading const):
        * UIProcess/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::WebInspectorProxy):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::hasRunningProcess const):
        (WebKit::WebPageProxy::setUIClient):
        (WebKit::WebPageProxy::setIconLoadingClient):
        (WebKit::WebPageProxy::launchProcess):
        (WebKit::WebPageProxy::swapToWebProcess):
        (WebKit::WebPageProxy::finishAttachingToWebProcess):
        (WebKit::WebPageProxy::didAttachToRunningProcess):
        (WebKit::WebPageProxy::launchProcessForReload):
        (WebKit::WebPageProxy::launchProcessWithItem):
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::tryClose):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
        (WebKit::WebPageProxy::stopLoading):
        (WebKit::WebPageProxy::reload):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::tryRestoreScrollPosition):
        (WebKit::WebPageProxy::setControlledByAutomation):
        (WebKit::WebPageProxy::setIndicating):
        (WebKit::WebPageProxy::setBackgroundColor):
        (WebKit::WebPageProxy::setTopContentInset):
        (WebKit::WebPageProxy::setUnderlayColor):
        (WebKit::WebPageProxy::viewWillStartLiveResize):
        (WebKit::WebPageProxy::viewWillEndLiveResize):
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::layerHostingModeDidChange):
        (WebKit::WebPageProxy::waitForDidUpdateActivityState):
        (WebKit::WebPageProxy::setInitialFocus):
        (WebKit::WebPageProxy::clearSelection):
        (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
        (WebKit::WebPageProxy::validateCommand):
        (WebKit::WebPageProxy::increaseListLevel):
        (WebKit::WebPageProxy::decreaseListLevel):
        (WebKit::WebPageProxy::changeListType):
        (WebKit::WebPageProxy::setBaseWritingDirection):
        (WebKit::WebPageProxy::setNeedsFontAttributes):
        (WebKit::WebPageProxy::executeEditCommand):
        (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
        (WebKit::WebPageProxy::setEditable):
        (WebKit::WebPageProxy::performDragControllerAction):
        (WebKit::WebPageProxy::dragEnded):
        (WebKit::WebPageProxy::didStartDrag):
        (WebKit::WebPageProxy::dragCancelled):
        (WebKit::WebPageProxy::handleMouseEvent):
        (WebKit::WebPageProxy::processNextQueuedMouseEvent):
        (WebKit::WebPageProxy::handleWheelEvent):
        (WebKit::WebPageProxy::handleKeyboardEvent):
        (WebKit::WebPageProxy::handleGestureEvent):
        (WebKit::WebPageProxy::handleTouchEventSynchronously):
        (WebKit::WebPageProxy::handleTouchEventAsynchronously):
        (WebKit::WebPageProxy::handleTouchEvent):
        (WebKit::WebPageProxy::scrollBy):
        (WebKit::WebPageProxy::centerSelectionInVisibleArea):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::setUserAgent):
        (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations):
        (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations):
        (WebKit::WebPageProxy::setCustomTextEncodingName):
        (WebKit::WebPageProxy::setTextZoomFactor):
        (WebKit::WebPageProxy::setPageZoomFactor):
        (WebKit::WebPageProxy::setPageAndTextZoomFactors):
        (WebKit::WebPageProxy::scalePage):
        (WebKit::WebPageProxy::scalePageInViewCoordinates):
        (WebKit::WebPageProxy::scaleView):
        (WebKit::WebPageProxy::windowScreenDidChange):
        (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
        (WebKit::WebPageProxy::accessibilitySettingsDidChange):
        (WebKit::WebPageProxy::updateAccessibilityEventsEnabled):
        (WebKit::WebPageProxy::setUseFixedLayout):
        (WebKit::WebPageProxy::setFixedLayoutSize):
        (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller):
        (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller):
        (WebKit::WebPageProxy::listenForLayoutMilestones):
        (WebKit::WebPageProxy::setSuppressScrollbarAnimations):
        (WebKit::WebPageProxy::setEnableVerticalRubberBanding):
        (WebKit::WebPageProxy::setEnableHorizontalRubberBanding):
        (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage):
        (WebKit::WebPageProxy::setPaginationMode):
        (WebKit::WebPageProxy::setPaginationBehavesLikeColumns):
        (WebKit::WebPageProxy::setPageLength):
        (WebKit::WebPageProxy::setGapBetweenPages):
        (WebKit::WebPageProxy::setPaginationLineGridEnabled):
        (WebKit::WebPageProxy::countStringMatches):
        (WebKit::WebPageProxy::replaceMatches):
        (WebKit::WebPageProxy::launchInitialProcessIfNecessary):
        (WebKit::WebPageProxy::runJavaScriptInMainFrame):
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
        (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
        (WebKit::WebPageProxy::getSourceForFrame):
        (WebKit::WebPageProxy::getContentsAsString):
        (WebKit::WebPageProxy::getContentsAsAttributedString):
        (WebKit::WebPageProxy::getBytecodeProfile):
        (WebKit::WebPageProxy::getSamplingProfilerOutput):
        (WebKit::WebPageProxy::getContentsAsMHTMLData):
        (WebKit::WebPageProxy::getSelectionOrContentsAsString):
        (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
        (WebKit::WebPageProxy::getMainResourceDataOfFrame):
        (WebKit::WebPageProxy::getResourceDataFromFrame):
        (WebKit::WebPageProxy::getWebArchiveOfFrame):
        (WebKit::WebPageProxy::forceRepaint):
        (WebKit::WebPageProxy::preferencesDidChange):
        (WebKit::WebPageProxy::setMediaVolume):
        (WebKit::WebPageProxy::setMuted):
        (WebKit::WebPageProxy::setMediaCaptureEnabled):
        (WebKit::WebPageProxy::stopMediaCapture):
        (WebKit::WebPageProxy::stopAllMediaPlayback):
        (WebKit::WebPageProxy::suspendAllMediaPlayback):
        (WebKit::WebPageProxy::resumeAllMediaPlayback):
        (WebKit::WebPageProxy::handleMediaEvent):
        (WebKit::WebPageProxy::setVolumeOfMediaElement):
        (WebKit::WebPageProxy::setMayStartMediaWhenInWindow):
        (WebKit::WebPageProxy::didChooseColor):
        (WebKit::WebPageProxy::didEndColorPicker):
        (WebKit::WebPageProxy::didSelectOption):
        (WebKit::WebPageProxy::inspector const):
        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
        (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
        (WebKit::WebPageProxy::didCancelForOpenPanel):
        (WebKit::WebPageProxy::removeEditCommand):
        (WebKit::WebPageProxy::processDidBecomeUnresponsive):
        (WebKit::WebPageProxy::processDidBecomeResponsive):
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::processWillBecomeSuspended):
        (WebKit::WebPageProxy::processWillBecomeForeground):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        (WebKit::WebPageProxy::setCanRunModal):
        (WebKit::WebPageProxy::canRunModal):
        (WebKit::WebPageProxy::computePagesForPrinting):
        (WebKit::WebPageProxy::drawRectToImage):
        (WebKit::WebPageProxy::drawPagesToPDF):
        (WebKit::WebPageProxy::drawPagesForPrinting):
        (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
        (WebKit::WebPageProxy::setViewLayoutSize):
        (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight):
        (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
        (WebKit::WebPageProxy::setComposition):
        (WebKit::WebPageProxy::confirmComposition):
        (WebKit::WebPageProxy::cancelComposition):
        (WebKit::WebPageProxy::setScrollPinningBehavior):
        (WebKit::WebPageProxy::setOverlayScrollbarStyle):
        (WebKit::WebPageProxy::changeFontAttributes):
        (WebKit::WebPageProxy::changeFont):
        (WebKit::WebPageProxy::setTextAsync):
        (WebKit::WebPageProxy::insertTextAsync):
        (WebKit::WebPageProxy::getMarkedRangeAsync):
        (WebKit::WebPageProxy::getSelectedRangeAsync):
        (WebKit::WebPageProxy::characterIndexForPointAsync):
        (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
        (WebKit::WebPageProxy::setCompositionAsync):
        (WebKit::WebPageProxy::confirmCompositionAsync):
        (WebKit::WebPageProxy::takeSnapshot):
        (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
        (WebKit::WebPageProxy::setUseSystemAppearance):
        (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
        (WebKit::WebPageProxy::setPlaybackTarget):
        (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
        (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
        (WebKit::WebPageProxy::clearWheelEventTestTrigger):
        (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
        (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
        (WebKit::WebPageProxy::getLoadDecisionForIcon):
        (WebKit::WebPageProxy::setResourceCachingDisabled):
        (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
        (WebKit::WebPageProxy::effectiveAppearanceDidChange):
        (WebKit::WebPageProxy::insertAttachment):
        (WebKit::WebPageProxy::updateAttachmentAttributes):
        (WebKit::WebPageProxy::getApplicationManifest):
        (WebKit::WebPageProxy::textInputContextsInRect):
        (WebKit::WebPageProxy::focusTextInputContext):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::create):
        (WebKit::WebProcessProxy::addExistingWebPage):
        (WebKit::WebProcessProxy::maybeShutDown):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp:
        (WebKit::InstallMissingMediaPluginsPermissionRequest::allow):
        (WebKit::InstallMissingMediaPluginsPermissionRequest::didEndRequestInstallMissingMediaPlugins):
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformDetach):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _webTouchEventsRecognized:]):
        (-[WKContentView _hoverGestureRecognizerChanged:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::requestFocusedElementInformation):
        (WebKit::WebPageProxy::updateVisibleContentRects):
        (WebKit::WebPageProxy::updateStringForFind):
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
        (WebKit::WebPageProxy::setForceAlwaysUserScalable):
        (WebKit::WebPageProxy::setMaximumUnobscuredSize):
        (WebKit::WebPageProxy::setDeviceOrientation):
        (WebKit::WebPageProxy::setOverrideViewportArguments):
        (WebKit::WebPageProxy::selectWithGesture):
        (WebKit::WebPageProxy::updateSelectionWithTouches):
        (WebKit::WebPageProxy::requestAutocorrectionData):
        (WebKit::WebPageProxy::applyAutocorrection):
        (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
        (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
        (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
        (WebKit::WebPageProxy::selectPositionAtPoint):
        (WebKit::WebPageProxy::beginSelectionInDirection):
        (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
        (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
        (WebKit::WebPageProxy::requestDictationContext):
        (WebKit::WebPageProxy::getSelectionContext):
        (WebKit::WebPageProxy::selectWithTwoTouches):
        (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
        (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
        (WebKit::WebPageProxy::moveSelectionByOffset):
        (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
        (WebKit::WebPageProxy::focusNextFocusedElement):
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
        (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
        (WebKit::WebPageProxy::requestDragStart):
        (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::sizeDidChange):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::windowAndViewFramesChanged):
        (WebKit::WebPageProxy::setMainFrameIsScrollable):
        (WebKit::WebPageProxy::insertDictatedTextAsync):
        (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
        (WebKit::WebPageProxy::fontAtSelection):
        (WebKit::WebPageProxy::stringSelectionForPasteboard):
        (WebKit::WebPageProxy::dataSelectionForPasteboard):
        (WebKit::WebPageProxy::readSelectionFromPasteboard):
        (WebKit::WebPageProxy::sendComplexTextInputToPlugin):
        (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
        (WebKit::WebPageProxy::registerUIProcessAccessibilityTokens):
        (WebKit::WebPageProxy::acceptsFirstMouse):
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::WebInspectorProxy::platformDetach):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::cursorToShow const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_hostFileDescriptor):

2019-03-18  Antti Koivisto  <antti@apple.com>

        Layer with no backing store should still hit-test over a scroller
        https://bugs.webkit.org/show_bug.cgi?id=195378
        <rdar://problem/48652078>

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (WebKit::RemoteLayerTreeHost::makeNode):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):

        No need for special WKTiledBackingView, tiled views now have correct event regions.

2019-03-18  Daniel Bates  <dabates@apple.com>

        [iOS] No DOM keypress event emitted for cursor key commands when non-editable element is focused
        https://bugs.webkit.org/show_bug.cgi?id=195626
        <rdar://problem/48810626>

        Reviewed by Wenson Hsieh.

        Following the UIKit fix <rdar://problem/47333786> WebKit will be asked whether it can perform some
        more actions, including cursor movements and more editing actions. All such actions are only applicable
        to editable elements. By responding NO to UIKit for such actions when we are not in an editable element
        we avoid the need to do such bookkeeping ourselves as UIKit will forward our response back to us
        on return from -handleKeyTextCommandForCurrentEvent, called from -[WKContentView _interpretKeyEvent].
        WebKit is then in a position to try to handle the event or in the case of all standard text editing
        key commands at the time of writing (e.g. Control + a) tell WebCore that it did not handle the event
        so that WebCore can continue the DOM key event dispatch algorithm. For standard text editing key
        commands, such as Control + a, we will emit a DOM keypress event for the 'a'.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformAction:withSender:]):

2019-03-18  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Bump public API to wpe-1.0
        https://bugs.webkit.org/show_bug.cgi?id=195887

        Reviewed by Philippe Normand.

        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: Renamed from Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt.
        * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt.

2019-03-18  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Bump dependencies to wpe-1.0 and wpebackend-fdo-1.0
        https://bugs.webkit.org/show_bug.cgi?id=195786

        Reviewed by Philippe Normand.

        * wpe/wpe-web-extension.pc.in: Change dependency to wpe-1.0
        * wpe/wpe-webkit.pc.in: Ditto.

2019-03-17  Fujii Hironori  <Hironori.Fujii@sony.com>

        [iOS] Block the accessibility server when accessibility is not enabled.
        https://bugs.webkit.org/show_bug.cgi?id=195342
        <rdar://problem/48615720>

        Unreviewed build fix for WinCairo.

        * Shared/SandboxExtension.h: Use ProcessID instead of pid_t.

2019-03-16  Dean Jackson  <dino@apple.com>

        ASSERT(gestureRecognizer == _doubleTapGestureRecognizer) in _doubleTapDidFail:
        https://bugs.webkit.org/show_bug.cgi?id=195857
        <rdar://problem/48954679>

        Reviewed by Wenson Hsieh.

        Reset an existing gesture recognizer before creating a new one.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
        (-[WKContentView _setDoubleTapGesturesEnabled:]):

2019-03-16  Jer Noble  <jer.noble@apple.com>

        Add a new MediaCapabilitiesExtensionsEnabled setting
        https://bugs.webkit.org/show_bug.cgi?id=195843

        Reviewed by Geoffrey Garen.

        * Shared/WebPreferences.yaml:

2019-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Software keyboard never appears when editing on some websites
        https://bugs.webkit.org/show_bug.cgi?id=195824
        <rdar://problem/48020610>

        Reviewed by Ryosuke Niwa.

        In the scenario where an element has already been programmatically focused but the UI process isn't showing an
        input view for it, there are a couple of different ways in which an input view may still be shown for that
        element:

        1. If the page attempts to programmatically focus the element, we'll invoke elementDidRefocus to recompute
        information about the focused element and propagate it to the UI process. By default, if programmatic focus was
        triggered under the scope of user interaction, we'll allow the input view to appear.

        2. In the case where page does not attempt to programmatically focus the element but a click is dispatched,
        there is logic in WebPage::completeSyntheticClick to send information about the already-focused element.

        On the web page relevant to this bug, focus is programmatically moved to hidden contenteditable areas upon page
        load, and touchstart is also prevented; furthermore, the page does not attempt to programmatically refocus the
        hidden editable area upon receiving touchstart. This means that the user will never be able to bring up the
        keyboard, since the editable area is already programmatically focused and subsequent attempts to tap in the
        page do nothing, because the page has already focused the hidden editable area (with the expectation that the
        software keyboard should already be present).

        To fix this, we bring some of the same logic in completeSyntheticClick over to dispatchTouchEvent, by sending
        focused element information to the UI process if the focused element did not change over the course of
        dispatching the touch event. Similar code was introduced in r167774 to fix the same type of issue (i.e.
        inability to bring up the software keyboard), but this was later reverted in r188405 due to causing bugs such as
        <rdar://problem/22204108>, wherein this logic to bring up the keyboard in dispatchTouchEvent would scroll and
        zoom the page, such that the click event fired after touchend would be dispatched in the wrong location and (in
        the case of <rdar://problem/22204108>) caused the focused element to immediately blur again.

        To mitigate this issue, we add the additional constraint that we only send focused element info in the case
        where the touch won't also generate a click later down the road, by requiring that the dispatched event was
        handled by the page (i.e. prevented).

        Test: fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html

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

2019-03-16  Zalan Bujtas  <zalan@apple.com>

        Unable to close trending window on naver.com.
        https://bugs.webkit.org/show_bug.cgi?id=195842
        <rdar://problem/48067338>

        Reviewed by Simon Fraser.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::dispatchSyntheticMouseMove):
        (WebKit::WebPage::handleSyntheticClick):
        (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):

2019-03-16  Timothy Hatcher  <timothy@apple.com>

        REGRESSION (r242807): Unified sources build failure from missing imports.
        https://bugs.webkit.org/show_bug.cgi?id=195852

        Unreviewed speculative build fix.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        Include <wtf/SoftLinking.h> and "UIKitSPI.h" on iOS.

2019-03-15  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Block the accessibility server when accessibility is not enabled.
        https://bugs.webkit.org/show_bug.cgi?id=195342

        Reviewed by Brent Fulgham.

        By default, block the iOS accessibility server in the sandbox. If accessibility is enabled,
        let the UI process issue a mach extension to the WebContent process. The UI process will
        issue the mach extension the the WebContent process by its process identifier. The sandbox
        extension handle is sent to the WebContent process to be consumed. The message will be sent
        when the WebProcess has finished launching, and also when accessibility is turned on.

        * Platform/spi/ios/AccessibilitySupportSPI.h:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/SandboxExtension.h:
        * Shared/mac/SandboxExtensionMac.mm:
        (WebKit::SandboxExtensionImpl::create):
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
        (WebKit::SandboxExtension::createHandleForMachLookupByPid):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::unblockAccessibilityServer):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-03-15  Timothy Hatcher  <timothy@apple.com>

        Unreviewed speculative build fix for non-Cocoa ports after r243012.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getContentsAsAttributedString):
        * UIProcess/WebPageProxy.h:

2019-03-15  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r243008.

        This revision broke High Sierra builders

        Reverted changeset:

        "[iOS] Block the accessibility server when accessibility is
        not enabled."
        https://bugs.webkit.org/show_bug.cgi?id=195342
        https://trac.webkit.org/changeset/243008

2019-03-15  Per Arne Vollan  <pvollan@apple.com>

        All networking from WebKit.Networking fails when Network Extension content filter is enabled
        https://bugs.webkit.org/show_bug.cgi?id=195815
        <rdar://problem/47598758>

        Reviewed by Brent Fulgham.

        The sandbox needs to allow an associated mach lookup.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2019-03-15  Sihui Liu  <sihui_liu@apple.com>

        [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=190350
        <rdar://problem/45089503>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::collectIndexedDatabaseOriginsForVersion):
        (WebKit::NetworkProcess::indexedDatabaseOrigins):
        * NetworkProcess/NetworkProcess.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::addSession):
        (WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade): For efficientcy and atomicity, we choose to use
        symlink to create v0 folder. Because network process does not have the permission to create a symlink, we need 
        to do this in UI process. UI process would create v0 folder inside the IndexedDB directory if there isn't one.
        Also if there is a v0 directory but it doesn't have content, it means it's not a correct symlink and we need to 
        delete it and create again.

        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-03-15  Sihui Liu  <sihui_liu@apple.com>

        [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=190350
        <rdar://problem/45089503>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::collectIndexedDatabaseOriginsForVersion):
        (WebKit::NetworkProcess::indexedDatabaseOrigins):
        * NetworkProcess/NetworkProcess.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::addSession):
        (WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2019-03-15  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Restrict iokit-user-client-class "IOHIDLibUserClient" from WebKit
        https://bugs.webkit.org/show_bug.cgi?id=195821
        <rdar://problem/47606250>

        Reviewed by Brent Fulgham.

        This should be removed from the WebContent sandbox on iOS.

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

2019-03-15  Alex Christensen  <achristensen@webkit.org>

        _WKDownload should conform to NSCopying protocol
        https://bugs.webkit.org/show_bug.cgi?id=195718

        Reviewed by Tim Horton.

        This will allow us to use it as keys in NSMutableDictionaries, which Safari already kind of does.

        * UIProcess/API/Cocoa/_WKDownload.h:
        * UIProcess/API/Cocoa/_WKDownload.mm:
        (-[_WKDownload copyWithZone:]):

2019-03-15  Dean Jackson  <dino@apple.com>

        Provide an option for an always-on fast click mode in iOS
        https://bugs.webkit.org/show_bug.cgi?id=195822
        <rdar://problem/48939357>

        Reviewed by Sam Weinig.

        Add an option that will always trigger a click and never
        wait for a double tap to zoom. It is disabled by default.

        * Shared/WebPreferences.yaml:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):

2019-03-15  Timothy Hatcher  <timothy@apple.com>

        Add support to WebPage for getting the contents as an attributed string.
        https://bugs.webkit.org/show_bug.cgi?id=195636
        rdar://problem/45055697

        Reviewed by Tim Horton.

        * Shared/mac/AttributedString.h:
        (WebKit::AttributedString::AttributedString):
        * Shared/mac/AttributedString.mm:
        (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
        (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getContentsAsAttributedString):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::getContentsAsAttributedString):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-03-15  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=195387
        <rdar://problem/48442387>

        Reviewed by Brent Fulgham.

        The sandbox on iOS and macOS needs to allow mach lookup to the "com.apple.nesessionmanager.content-filter"
        mach service. Also, mach lookups to "com.apple.nehelper" should be allowed.

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

2019-03-15  Chris Dumez  <cdumez@apple.com>

        [PSON] Make sure the WebProcessCache is leverage when relaunching a process after termination
        https://bugs.webkit.org/show_bug.cgi?id=195747

        Reviewed by Geoff Garen.

        Make sure the WebProcessCache and the prewarmed process are used when relaunching a process
        after termination (e.g. crash).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::reattachToWebProcessForReload):
        (WebKit::WebPageProxy::reattachToWebProcessWithItem):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::processForNavigationInternal):
        (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
        * UIProcess/WebProcessPool.h:

2019-03-15  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Block the accessibility server when accessibility is not enabled.
        https://bugs.webkit.org/show_bug.cgi?id=195342

        Reviewed by Brent Fulgham.

        By default, block the iOS accessibility server in the sandbox. If accessibility is enabled,
        let the UI process issue a mach extension to the WebContent process. The UI process will
        issue the mach extension the the WebContent process by its process identifier. The sandbox
        extension handle is sent to the WebContent process to be consumed. The message will be sent
        when the WebProcess has finished launching, and also when accessibility is turned on.

        * Platform/spi/ios/AccessibilitySupportSPI.h:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/SandboxExtension.h:
        * Shared/mac/SandboxExtensionMac.mm:
        (WebKit::SandboxExtensionImpl::create):
        (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
        (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
        (WebKit::SandboxExtension::createHandleForMachLookupByPid):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WebProcessProxyIOS.mm:
        (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::unblockAccessibilityServer):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2019-03-15  Antti Koivisto  <antti@apple.com>

        Use Region for event region even when it is a rectangle
        https://bugs.webkit.org/show_bug.cgi?id=195803

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        (WebKit::RemoteLayerTreeNode::eventRegion const):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
        (WebKit::RemoteLayerTreeNode::setEventRegion):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::setEventRegion):
        (WebKit::PlatformCALayerRemote::eventRegion const): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

2019-03-15  Shawn Roberts  <sroberts@apple.com>

        Unreviewed, rolling out r242952.

        Causing API failures on iOS Simulator

        Reverted changeset:

        "[PSON] Make sure the WebProcessCache is leverage when
        relaunching a process after termination"
        https://bugs.webkit.org/show_bug.cgi?id=195747
        https://trac.webkit.org/changeset/242952

2019-03-15  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Broker access to Speech Synthesis
        https://bugs.webkit.org/show_bug.cgi?id=195645
        <rdar://problem/35369026>

        Reviewed by Brent Fulgham.

        To be able to close the connection to the speech synthesis daemon in the WebContent process,
        speech synthesis should be performed in the UI process. This patch forwards speech synthesis
        requests to the UI process by sending messages. On the UI process side, the speech synthesis
        is performed by simply using the existing platform speech synthesizer. Speech synthesis
        events are sent back to the WebContent process. All messages are async, except for the
        message to get the list of available voices.

        * Sources.txt:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::didStartSpeaking):
        (WebKit::WebPageProxy::didFinishSpeaking):
        (WebKit::WebPageProxy::didPauseSpeaking):
        (WebKit::WebPageProxy::didResumeSpeaking):
        (WebKit::WebPageProxy::speakingErrorOccurred):
        (WebKit::WebPageProxy::boundaryEventOccurred):
        (WebKit::WebPageProxy::voicesDidChange):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::ensureSpeechSynthesisData):
        (WebKit::WebPageProxy::speechSynthesisVoiceList):
        (WebKit::WebPageProxy::speechSynthesisSpeak):
        (WebKit::WebPageProxy::speechSynthesisCancel):
        (WebKit::WebPageProxy::speechSynthesisPause):
        (WebKit::WebPageProxy::speechSynthesisResume):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.cpp: Added.
        (WebKit::WebSpeechSynthesisClient::voiceList):
        (WebKit::WebSpeechSynthesisClient::speak):
        (WebKit::WebSpeechSynthesisClient::cancel):
        (WebKit::WebSpeechSynthesisClient::pause):
        (WebKit::WebSpeechSynthesisClient::resume):
        * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h: Added.
        (WebKit::WebSpeechSynthesisClient::WebSpeechSynthesisClient):
        (WebKit::WebSpeechSynthesisClient::~WebSpeechSynthesisClient):
        * WebProcess/WebCoreSupport/WebSpeechSynthesisVoice.h: Added.
        (WebKit::WebSpeechSynthesisVoice::encode const):
        (WebKit::WebSpeechSynthesisVoice::decode):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_hostFileDescriptor):
        (WebKit::WebPage::speakingErrorOccurred):
        (WebKit::WebPage::boundaryEventOccurred):
        (WebKit::WebPage::voicesDidChange):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/com.apple.WebProcess.sb.in:
        * WebProcess/glib/WebProcessGLib.cpp:

2019-03-15  Antti Koivisto  <antti@apple.com>

        Optimize Region for single rectangle case
        https://bugs.webkit.org/show_bug.cgi?id=195743

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<EventTrackingRegions>::decode):
        (IPC::ArgumentCoder<Region::Span>::encode): Deleted.
        (IPC::ArgumentCoder<Region::Span>::decode): Deleted.
        (IPC::ArgumentCoder<Region>::encode): Deleted.
        (IPC::ArgumentCoder<Region>::decode): Deleted.
        * Shared/WebCoreArgumentCoders.h:

2019-03-14  Per Arne Vollan  <pvollan@apple.com>

        [iOS] WebKit crashes when opening pages documents
        https://bugs.webkit.org/show_bug.cgi?id=195784
        <rdar://problem/48904334>

        Reviewed by Brent Fulgham.

        The sandbox needs to allow additional syscalls.

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

2019-03-14  Simon Fraser  <simon.fraser@apple.com>

        Make it possible to test scrolling tree layer manipulation more easily
        https://bugs.webkit.org/show_bug.cgi?id=195780

        Reviewed by Tim Horton.

        Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
        cuts off communication of scrolling tree scrolls back to the web process
        (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
        allows tests to trigger scrolls which run the scrolling tree layer positioning
        logic, but never get another commit from the web process that might mask
        scrolling tree bugs.
        
        WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
        whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
        via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _scrollingUpdatesDisabledForTesting]):
        (-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/PageClientImplCocoa.h:
        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        (WebKit::PageClientImplCocoa::scrollingUpdatesDisabledForTesting):
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::scrollingUpdatesDisabledForTesting):
        * UIProcess/PageClient.h:
        (WebKit::PageClient::scrollingUpdatesDisabledForTesting):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
        * UIProcess/WebPageProxy.h:

2019-03-14  Youenn Fablet  <youenn@apple.com>

        Move IDB storage in private browsing mode to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=195602

        Reviewed by Brady Eidson.

        Covered by existing IDB tests and added API test.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createIDBServer):
        Make sure that path is empty for private sessions.
        This will make IDB use a memory backing store.
        * WebProcess/Databases/WebDatabaseProvider.cpp:
        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
        Use NetworkProcess IDB server instead of InProcessIDBServer.

2019-03-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r242801): [iOS] preventDefault() on touchstart in a subframe does not prevent focusing the subframe
        https://bugs.webkit.org/show_bug.cgi?id=195749
        <rdar://problem/48892367>

        Reviewed by Tim Horton.

        r242801 added logic to fetch interaction information at the touch location upon touch start. However this,
        combined with an existing behavior where the process of computing InteractionInformationAtPosition in WebPage
        moves focus into the frame of the hit-tested node below the touch location, means that we'll always trigger a
        blur event on the window and move focus into the subframe when performing a touch inside a subframe, even if the
        page prevents default on touchstart.

        To fix this, add a "readonly" flag to InteractionInformationRequest, and only change focus when requesting
        position information in the case where the request is not readonly. For now, this readonly flag is false by
        default; in a future patch, we should identify the (hopefully few) places that rely on position information
        requests to move focus, explicitly turn this bit off in those places, and otherwise send readonly position
        information requests by default.

        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::encode const):
        (WebKit::InteractionInformationRequest::decode):
        (WebKit::InteractionInformationRequest::isValidForRequest):
        (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):

        Ensure that a readonly request is not valid for a non-readonly request.

        * Shared/ios/InteractionInformationRequest.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):

        Send a readonly position information request in the case where a WebKit SPI client is querying for element
        information at the given location.

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

        Send a readonly position information request on touchstart.

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

2019-03-14  Chris Dumez  <cdumez@apple.com>

        Add WebsitePolicy for the client to specify the device orientation & motion access policy
        https://bugs.webkit.org/show_bug.cgi?id=195750

        Reviewed by Geoffrey Garen.

        Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
        the client already knows access to the device motion & orientation API will be granted / denied,
        it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
        permission is requested by JS.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * Shared/WebsitePoliciesData.h:
        * UIProcess/API/APIWebsitePolicies.cpp:
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies setDeviceOrientationAndMotionAccessPolicy:]):
        (-[_WKWebsitePolicies deviceOrientationAndMotionAccessPolicy]):

2019-03-14  Timothy Hatcher  <timothy@apple.com>

        REGRESSION (r242908): TestWebKitAPI.WebKit.AddAndRemoveDataDetectors Crashed
        https://bugs.webkit.org/show_bug.cgi?id=195751

        Reviewed by Wenson Hsieh.

        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::decodeArrayInternal): Added allowedClasses, pass to internal decodeObject for values.
        (IPC::decodeDictionaryInternal): Ditto for keys and values.
        (IPC::decodeObject): Pass allowedClasses to array and dictionary decoders.

2019-03-14  Chris Dumez  <cdumez@apple.com>

        [PSON] Make sure the WebProcessCache is leverage when relaunching a process after termination
        https://bugs.webkit.org/show_bug.cgi?id=195747

        Reviewed by Geoff Garen.

        Make sure the WebProcessCache and the prewarmed process are used when relaunching a process
        after termination (e.g. crash).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::reattachToWebProcessForReload):
        (WebKit::WebPageProxy::reattachToWebProcessWithItem):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForRegistrableDomain):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::processForNavigationInternal):
        (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
        * UIProcess/WebProcessPool.h:

2019-03-14  Timothy Hatcher  <timothy@apple.com>

        Unreviewed speculative build fix for watchOS after r242908.

        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

2019-03-14  Youenn Fablet  <youenn@apple.com>

        Reset storage quota when clearing IDB/Cache API entries
        https://bugs.webkit.org/show_bug.cgi?id=195716

        Reviewed by Chris Dumez.

        On clearing DOMCache or IDB data, reset quota value to the default value.
        This ensures consistent layout test runs.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::clearStorageQuota):
        * NetworkProcess/NetworkProcess.h:

2019-03-13  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
        https://bugs.webkit.org/show_bug.cgi?id=195724
        <rdar://problem/48873456>

        Reviewed by Simon Fraser.

        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::didPreventDefaultForEvent):

2019-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Make -[_WKAttachment setFileWrapper:contentType:completion:] robust when given a nil completion handler
        https://bugs.webkit.org/show_bug.cgi?id=195725
        <rdar://problem/48545062>

        Reviewed by Tim Horton.

        Add a missing nil check before invoking the given completionHandler in the case where the attachment is invalid.
        Tested by augmenting WKAttachmentTests.SetFileWrapperForPDFImageAttachment to exercise this scenario.

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

        Additionally make sure that an invalidated _WKAttachment is also considered to be disconnected.

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

2019-03-13  Timothy Hatcher  <timothy@apple.com>

        REGRESSION (r242908):  'NSInvalidArgumentException', reason: '+[PKPaymentMerchantSession count]: unrecognized selector sent to class 0x1c0fae060'
        https://bugs.webkit.org/show_bug.cgi?id=195720

        Reviewed by Andy Estes.

        Add back decode(Decoder& decoder, Class allowedClass) for Apple Pay code.

        * Shared/Cocoa/ArgumentCodersCocoa.h:
        (IPC::decode): Added.

2019-03-13  Tim Horton  <timothy_horton@apple.com>

        Stop using some deprecated SPI in WKDrawingView
        https://bugs.webkit.org/show_bug.cgi?id=195706
        <rdar://problem/48062599>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKDrawingView.mm:
        (-[WKDrawingView renderedDrawing]):
        (-[WKDrawingView PNGRepresentation]):
        (-[WKDrawingView loadDrawingFromPNGRepresentation:]):

2019-03-13  Timothy Hatcher  <timothy@apple.com>

        Unreviewed speculative build fix for watchOS after r242908.

        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::decodeObject):

2019-03-13  Dean Jackson  <dino@apple.com>

        Block all plugins smaller than 5x5px
        https://bugs.webkit.org/show_bug.cgi?id=195702
        <rdar://problem/28435204>

        Reviewed by Sam Weinig.

        Block all plugins that are smaller than a threshold, in this case
        5x5px. Other browsers have implemented this for a while, and now
        that we have Intersection Observers, small plugins are no longer
        necessary.

        * Shared/WebPreferences.yaml: New setting for this feature.

        * UIProcess/WebPageProxy.cpp: Handle new unavailability type.
        (WebKit::WebPageProxy::unavailablePluginButtonClicked):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Removed this function
        as it was never being called.
        (WebKit::WebFrameLoaderClient::recreatePlugin): Deleted.
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::pluginIsSmall): Checks the size of the plugin.
        (WebKit::WebPage::createPlugin): If the plugin is too small, stop it from
        launching.

2019-03-13  Keith Rollin  <krollin@apple.com>

        Add support for new StagedFrameworks layout
        https://bugs.webkit.org/show_bug.cgi?id=195543

        Reviewed by Alexey Proskuryakov.

        When creating the WebKit layout for out-of-band Safari/WebKit updates,
        use an optional path prefix when called for.

        Update the dyld_env path in OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH to
        also understand about this layout.

        * Configurations/BaseTarget.xcconfig:

2019-03-13  Simon Fraser  <simon.fraser@apple.com>

        Scrolling tree should reposition non-stacking order descendents of overflow:scroll.
        https://bugs.webkit.org/show_bug.cgi?id=195608

        Reviewed by Zalan Bujtas.

        Step 1: add scrolling tree positioning nodes classes (but don't create them yet).

        Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
        an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
        the values of ScrollPositioningBehavior:

        ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
            async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
            When the overflow scrolls, this layer has to move along with the overflow.

        ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
            overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
            This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.

        PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
        
        This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
        is just a stub so the new node types aren't created yet.
        
        RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
        role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
        the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
        (ArgumentCoder<ScrollingStatePositionedNode>::encode):
        (ArgumentCoder<ScrollingStatePositionedNode>::decode):
        (WebKit::encodeNodeAndDescendants):
        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
        (WebKit::dump):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<LayoutConstraints>::encode):
        (IPC::ArgumentCoder<LayoutConstraints>::decode):
        (IPC::ArgumentCoder<StickyPositionViewportConstraints>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::createScrollingTreeNode):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):

2019-03-13  Youenn Fablet  <youenn@apple.com>

        Check IDB quota usage through QuotaManager
        https://bugs.webkit.org/show_bug.cgi?id=195302

        Reviewed by Chris Dumez.

        Set the quota manager getter for IDBServer at creation time.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createIDBServer):
        (WebKit::NetworkProcess::idbServer):
        * NetworkProcess/NetworkProcess.h:
        * WebProcess/Databases/WebDatabaseProvider.cpp:
        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):

2019-03-13  Timothy Hatcher  <timothy@apple.com>

        Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
        https://bugs.webkit.org/show_bug.cgi?id=195636
        rdar://problem/45055697

        Reviewed by Ryosuke Niwa.

        Merge the two similar encoders and decoders. This avoids issues where
        one encoder could be used and the other decoder, which caused a crash.
        It also stops handling NSAttributedString specifically and just uses
        the NSSecureCoding path to handle more complex attributes.

        Some WebCore encoders code needed to move to platform files, since
        ArgumentCodersCocoa.h requires an ObjectiveC++ implementation to work.

        * Shared/Cocoa/ArgumentCodersCocoa.h:
        (IPC::encode):
        (IPC::decode):
        (IPC::ArgumentCoder<RetainPtr<T>>::encode):
        (IPC::ArgumentCoder<RetainPtr<T>>::decode):
        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::typeFromObject):
        (IPC::isSerializableFont):
        (IPC::isSerializableValue):
        (IPC::encodeObject):
        (IPC::decodeObject):
        * Shared/Cocoa/LoadParametersCocoa.mm:
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<WebCore::DictionaryPopupInfo>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::DictionaryPopupInfo>::decodePlatformData):
        (IPC::ArgumentCoder<WebCore::FontAttributes>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::FontAttributes>::decodePlatformData):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<DictionaryPopupInfo>::encode):
        (IPC::ArgumentCoder<DictionaryPopupInfo>::decode):
        (IPC::ArgumentCoder<FontAttributes>::encode):
        (IPC::ArgumentCoder<FontAttributes>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * Shared/mac/ArgumentCodersMac.h: Removed.
        * Shared/mac/ArgumentCodersMac.mm: Removed.
        * Shared/mac/AttributedString.mm:
        (WebKit::AttributedString::encode const):
        * Shared/mac/ObjCObjectGraph.mm:
        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:

2019-03-13  Chris Dumez  <cdumez@apple.com>

        Use a ServiceWorker process per registrable domain
        https://bugs.webkit.org/show_bug.cgi?id=195649

        Reviewed by Youenn Fablet.

        Use a ServiceWorker process per registrable domain instead of one per security origin. This is
        more in line with PSON and avoids launching too many processes.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::connectionToContextProcessWasClosed):
        (WebKit::NetworkProcess::needsServerToContextConnectionForRegistrableDomain const):
        (WebKit::NetworkProcess::serverToContextConnectionForRegistrableDomain):
        (WebKit::NetworkProcess::createServerToContextConnection):
        (WebKit::NetworkProcess::swContextConnectionMayNoLongerBeNeeded):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcessForExplicitSession):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::create):
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::updateProcessAssertions):
        * UIProcess/WebProcessPool.h:

2019-03-13  Chris Dumez  <cdumez@apple.com>

        REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
        https://bugs.webkit.org/show_bug.cgi?id=195684
        <rdar://problem/48294714>

        Reviewed by Antti Koivisto.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const):
        (WebKit::NavigationActionData::decode):
        * Shared/NavigationActionData.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::backForwardAddItem):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2019-03-13  Chris Dumez  <cdumez@apple.com>

        Drop legacy WebCore::toRegistrableDomain() utility function
        https://bugs.webkit.org/show_bug.cgi?id=195637

        Reviewed by Geoffrey Garen.

        Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
        Update call sites to use modern RegistrableDomain type instead.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):

2019-03-12  Brady Eidson  <beidson@apple.com>

        Take UnboundedNetworking assertion when a file upload is in progress.
        https://bugs.webkit.org/show_bug.cgi?id=195497

        Reviewed by Geoff Garen.

        This patch implements whole bunch of bookkeeping in both the Networking and UI processes.

        The TLDR of that bookkeeping is:
        - Whenever any uploads are in progress, take an assertion for both Networking and UI processes.
        - Whenever a particular WebProcess has an upload in progress, take an assertion for it.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::setProcessIdentifier):
        (WebKit::NetworkConnectionToWebProcess::setConnectionHasUploads):
        (WebKit::NetworkConnectionToWebProcess::clearConnectionHasUploads):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:

        * NetworkProcess/NetworkResourceLoadMap.cpp: Added.
        (WebKit::NetworkResourceLoadMap::add):
        (WebKit::NetworkResourceLoadMap::remove):
        (WebKit::NetworkResourceLoadMap::get const):
        * NetworkProcess/NetworkResourceLoadMap.h: Added.
        (WebKit::NetworkResourceLoadMap::NetworkResourceLoadMap):
        (WebKit::NetworkResourceLoadMap::isEmpty const):
        (WebKit::NetworkResourceLoadMap::contains const):
        (WebKit::NetworkResourceLoadMap::begin):
        (WebKit::NetworkResourceLoadMap::values):

        * NetworkProcess/NetworkSession.cpp:
 
       * Scripts/webkit/messages.py:

        * Sources.txt:

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::takeUploadAssertion):
        (WebKit::NetworkProcessProxy::clearUploadAssertion):
        * UIProcess/Network/NetworkProcessProxy.h:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setWebProcessHasUploads):
        (WebKit::WebProcessPool::clearWebProcessHasUploads):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessPool.messages.in:
 
       * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2019-03-13  Chris Dumez  <cdumez@apple.com>

        Use new RegistrableDomain type in PSON code
        https://bugs.webkit.org/show_bug.cgi?id=195634

        Reviewed by Youenn Fablet.

        Use new RegistrableDomain type in PSON code instead of more error-prone String type.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        * UIProcess/SuspendedPageProxy.h:
        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::canCacheProcess const):
        (WebKit::WebProcessCache::addProcessIfPossible):
        (WebKit::WebProcessCache::takeProcess):
        (WebKit::WebProcessCache::clearAllProcessesForSession):
        * UIProcess/WebProcessCache.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addProcessToOriginCacheSet):
        (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
        (WebKit::WebProcessPool::processForNavigationInternal):
        (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
        (WebKit::WebProcessPool::didCollectPrewarmInformation):
        (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
        (WebKit::WebProcessProxy::maybeShutDown):
        (WebKit::WebProcessProxy::didCollectPrewarmInformation):
        (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::registrableDomain const):
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::sendPrewarmInformation):

2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][PlayStation] Remove WebCore::standardUserAgentForURL
        https://bugs.webkit.org/show_bug.cgi?id=195662

        Reviewed by Ryosuke Niwa.

        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::platformUserAgent const): Return an empty string as well as mac/ios ports.

2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>

        [Win] Fix a slew of simple clang-cl warnings.
        https://bugs.webkit.org/show_bug.cgi?id=195652

        Reviewed by Don Olmstead.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): -Wswitch
        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::readEventHandler): -Wunused-variable
        * Platform/win/LoggingWin.cpp:
        (WebKit::logLevelString): -Wwritable-strings
        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
        (WebKit::ProcessLauncher::launchProcess): -Wunused-variable

2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>

        Move the code for determining the need for touch bar quirks to Quirks class
        https://bugs.webkit.org/show_bug.cgi?id=195654

        Reviewed by Brent Fulgham.

        Moved the code to determine whether touch bar quirks are needed or not to WebCore.

        Also renamed HiddenContentEditableQuirk to IsTouchBarUpdateSupressedForHiddenContentEditable
        and PlainTextQuirk to NeverRichlyEditableForTouchBar.

        * UIProcess/Cocoa/WebViewImpl.h:
        (WebKit::WebViewImpl::isRichlyEditableForTouchBar): Renamed.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateTouchBar):
        (WebKit::WebViewImpl::candidateListTouchBarItem const):
        (WebKit::WebViewImpl::isRichlyEditableForTouchBar const): Renamed from isRichlyEditable.
        (WebKit::WebViewImpl::textTouchBar const):
        (WebKit::WebViewImpl::updateTextTouchBar):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsTouchBarUpdateSupressedForHiddenContentEditable): Renamed from
        setNeedsHiddenContentEditableQuirk.
        (WebKit::WebPageProxy::setIsNeverRichlyEditableForTouchBar): Renamed from setNeedsPlainTextQuirk.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isTouchBarUpdateSupressedForHiddenContentEditable const): Renamed from
        needsHiddenContentEditableQuirk.
        (WebKit::WebPageProxy::isNeverRichlyEditableForTouchBar const): Renamed from needsPlainTextQuirk.
        * UIProcess/WebPageProxy.messages.in: Renamed the IPC messages.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::needsHiddenContentEditableQuirk): Deleted. Moved to WebCore.
        (WebKit::needsPlainTextQuirk): Deleted. Moved to WebCore.
        (WebKit::WebPage::didStartPageTransition):
        (WebKit::WebPage::didChangeSelection):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage):

2019-03-12  Jiewen Tan  <jiewen_tan@apple.com>

        Add WebFrameProxy::loadData
        https://bugs.webkit.org/show_bug.cgi?id=195647
        <rdar://problem/48826856>

        Reviewed by Youenn Fablet.

        This patch adds WebFrameProxy::loadData which is a simplified version of WebPageProxy::loadData that
        loads substitute data to an iframe. This is needed by the Load Optimizer.

        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::loadData):
        * UIProcess/WebFrameProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadDataInFrame):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Input view sometimes flickers when blurring and refocusing an element
        https://bugs.webkit.org/show_bug.cgi?id=195639
        <rdar://problem/48735337>

        Reviewed by Tim Horton.

        On iOS, if a focused element is blurred and immediately refocused in the scope of user interaction, we will end
        up reloading interaction state (input views, autocorrection contexts, etc.) in the UI process. On certain well-
        trafficked websites, this results in the input view and input accessory view flickering (or more egregiously,
        scrolling to re-reveal the focused element) when changing selection.

        To fix the issue, this patch refactors some focus management logic to suppress sending focused element updates
        to the UI process in the case where the same element is being blurred and immediately refocused. To do this, we
        track the most recently blurred element and bail when the recently blurred element is identical to the newly
        focused element. See below for more detail.

        Test: fast/forms/ios/keyboard-stability-when-refocusing-element.html

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _elementDidBlur]):

        Update the web process' notion of whether an input view is showing. Importantly, this accounts for decisions
        made by _WKUIDelegate. See below for more details.

        (isAssistableInputType): Deleted.

        Removed this helper function; this was only used in one place as a sanity check that the focused element's type
        is not none, right before attempting to show an input view. Instead, we can just check the focused element's
        type directly against InputType::None in the if statement of the early return.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setIsShowingInputViewForFocusedElement):

        Add a hook to notify the web process when an input view is showing or not (see below for more detail).

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didStartPageTransition):
        (WebKit::WebPage::elementDidRefocus):
        (WebKit::WebPage::shouldDispatchUpdateAfterFocusingElement const):

        Add a helper to determine whether we notify the UI process about a newly focused element. On macOS, this is true
        only when the new focused element is neither the currently focused element, nor the focused element that was
        just blurred. On iOS, we have an additional constraint that when the input view is not showing, we still need to
        notify the UI process, since the UI process might want to begin showing the keyboard for an element that has
        only been programmatically focused, for which we aren't currently showing the input view.

        (WebKit::WebPage::elementDidFocus):
        (WebKit::WebPage::elementDidBlur):

        Replace a couple of existing member variables in WebPage used for focus management:
        -   Replace m_hasPendingBlurNotification with m_recentlyBlurredElement, a RefPtr to the Element that is being
            blurred. Behavior here is the same as before (i.e. having a pending blur notification is equivalent to
            having recently blurred a focused element). However, this allows us to check newly focused elements against
            the recently blurred element in WebPage::elementDidFocus().
        -   Replace m_isFocusingElementDueToUserInteraction with m_isShowingInputViewForFocusedElement. The flag
            m_isFocusingElementDueToUserInteraction was originally added to fix <webkit.org/b/146735>, by ensuring that
            we don't send redundant ElementDidFocus (formerly, StartAssistingNode) messages to the UI process even when
            the keyboard is already up. In these simpler times, user interaction when focusing an element was equivalent
            to showing an input view for the focused element. However, in today's world, there are a variety of reasons
            why we might or might not show an input view for a given element (including, but not limited to activity
            state changes and decisions made by _WKInputDelegate). As such, it doesn't make sense to continue relying on
            m_isFocusingElementDueToUserInteraction in this early return. Instead, have the UI process propagate a
            message back to the web process, to let it know whether there is a keyboard showing, and use this flag
            instead.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setIsShowingInputViewForFocusedElement):

2019-03-12  Tim Horton  <timothy_horton@apple.com>

        More attempts at build fixing.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        Yet more.

2019-03-12  Chris Dumez  <cdumez@apple.com>

        Device Orientation access permission should be denied unless explicitly granted by the client
        https://bugs.webkit.org/show_bug.cgi?id=195625

        Reviewed by Youenn Fablet.

        Device Orientation access permission should be denied unless explicitly granted by the client.
        Previously, it was granted by default.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):

2019-03-12  Antti Koivisto  <antti@apple.com>

        [iOS] Enable asynchronous frame scrolling by default
        https://bugs.webkit.org/show_bug.cgi?id=195622
        <rdar://problem/48658028>

        Reviewed by Simon Fraser

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:

2019-03-12  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Block access to backboardd service
        https://bugs.webkit.org/show_bug.cgi?id=195484

        Reviewed by Brent Fulgham.

        This patch is addressing blocking the backboardd service "com.apple.backboard.hid.services". Getting the
        backlight level in the WebContent process will initiate a connection with this service. To be able to
        block the service, the backlight level is queried in the UI process and sent to the WebContent process
        when the WebContent process is started, and when the backlight level is changed. On the WebContent side,
        the method getting the backlight level is swizzled to return the value sent from the UI process.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::displayBrightness):
        (WebKit::WebProcessPool::backlightLevelDidChangeCallback):
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::currentBacklightLevel):
        (WebKit::WebProcess::backlightLevelDidChange):

2019-03-12  Tim Horton  <timothy_horton@apple.com>

        Fix the build after 242801

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant _elementActionForDDAction:]):
        More.

2019-03-12  Tim Horton  <timothy_horton@apple.com>

        Fix the build after 242801

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant _elementActionForDDAction:]):

2019-03-12  Eric Carlson  <eric.carlson@apple.com>

        [iOS] Sandbox must allow mach lookup required to compress video
        https://bugs.webkit.org/show_bug.cgi?id=195627
        <rdar://problem/48811072>

        Reviewed by Youenn Fablet.

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

2019-03-12  Jennifer Moore  <jennifer.moore@apple.com>

        Check whether to launch a default action instead of action sheet
        https://bugs.webkit.org/show_bug.cgi?id=195225
        <rdar://problem/47715544>

        Reviewed by Daniel Bates and Tim Horton.

        Notify DataDetectors at the start of a touch on a link, and check whether to immediately
        launch the default action instead of an action sheet.

        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant interactionDidStart]):
        (-[WKActionSheetAssistant _createSheetWithElementActions:defaultTitle:showLinkTitle:]):
        (-[WKActionSheetAssistant showImageSheet]):
        (-[WKActionSheetAssistant showLinkSheet]):
        (-[WKActionSheetAssistant showDataDetectorsSheet]):
        (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Deleted.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _webTouchEventsRecognized:]):
:
2019-03-12  Zalan Bujtas  <zalan@apple.com>

        [Synthetic Click] Dispatch mouseout soon after mouseup
        https://bugs.webkit.org/show_bug.cgi?id=195575
        <rdar://problem/47093049>

        Reviewed by Simon Fraser.

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

2019-03-12  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Stop content change observation when the touch event turns into long press
        https://bugs.webkit.org/show_bug.cgi?id=195601
        <rdar://problem/48796324>

        Reviewed by Wenson Hsieh.

        Add didRecognizeLongPress() message to be able to cancel content observation (started at touchStart).

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _longPressRecognized:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::didRecognizeLongPress):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::didRecognizeLongPress):

2019-03-11  Andy Estes  <aestes@apple.com>

        [Mac] Ensure Apple Pay is unavailable when PassKit.framework is missing
        https://bugs.webkit.org/show_bug.cgi?id=195583
        <rdar://problem/48420224>

        Reviewed by Daniel Bates.

        PassKit.framework is optionally soft-linked on Mac because it is missing from the Recovery
        Partition. We need to check if the framework is available before calling into it.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
        (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):

2019-03-12  Antti Koivisto  <antti@apple.com>

        Compositing layer that renders two positioned elements should not hit test
        https://bugs.webkit.org/show_bug.cgi?id=195371
        <rdar://problem/48649586>

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):

        Pass event region to UI process.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
        (WebKit::RemoteLayerTreeNode::layerID const):
        (WebKit::RemoteLayerTreeNode::eventRegion const):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
        (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
        (WebKit::RemoteLayerTreeNode::~RemoteLayerTreeNode):
        (WebKit::RemoteLayerTreeNode::setEventRegion):

        Maintain event region in RemoteLayerTreeNodes.

        (WebKit::RemoteLayerTreeNode::initializeLayer):
        (WebKit::RemoteLayerTreeNode::layerID):
        (WebKit::RemoteLayerTreeNode::forCALayer):

        Move layerID to RemoteLayerTreeNode and store RemoteLayerTreeNode pointer to CALayers instead.
        This makes it easy to find the matching RemoteLayerTreeNode from a layer, globally.

        (WebKit::RemoteLayerTreeNode::setLayerID): Deleted.
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):

        If we have event region, use it for hit testing.

        (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
        (collectDescendantViewsAtPoint): Deleted.
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::eventRegion const):
        (WebKit::PlatformCALayerRemote::setEventRegion):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

2019-03-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE][GTK] Load events may occur in unexpected order when JS redirects page before subresource load finishes
        https://bugs.webkit.org/show_bug.cgi?id=194131

        Reviewed by Michael Catanzaro.

        Ensure we emit the load-failed and load-changed with finished event when there's still an ongoing load when a
        new provisional load strarts. Previous load fails with cancelled error.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewWillStartLoad): Call webkitWebViewLoadFailed() if current page load state is not finished.
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Call webkitWebViewWillStartLoad().
        * UIProcess/API/wpe/APIViewClient.h:
        (API::ViewClient::willStartLoad): Add willStartLoad() to API::ViewClient
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Call WPEView::willStartLoad().
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::View::willStartLoad): Call API::ViewClient::willStartLoad().
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/PageLoadState.h:
        (WebKit::PageLoadState::isProvisional const):
        (WebKit::PageLoadState::isCommitted const):
        (WebKit::PageLoadState::isFinished const):

2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r242763.

        Causes layout test crashes on iOS simulator

        Reverted changeset:

        "[Synthetic Click] Dispatch mouseout soon after mouseup"
        https://bugs.webkit.org/show_bug.cgi?id=195575
        https://trac.webkit.org/changeset/242763

2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>

        Add Optional to Forward.h.
        https://bugs.webkit.org/show_bug.cgi?id=195586

        Reviewed by Darin Adler.

        * Shared/RTCNetwork.cpp:
        * Shared/RTCNetwork.h:
        * Shared/RTCPacketOptions.cpp:
        * Shared/RTCPacketOptions.h:
        * UIProcess/API/APIWebsitePolicies.h:
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
        Remove unnecessary includes from headers.

2019-03-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r242745 and r242756.
        https://bugs.webkit.org/show_bug.cgi?id=195606

        Breaks internal builds (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "[iOS] Block access to backboardd service"
        https://bugs.webkit.org/show_bug.cgi?id=195484
        https://trac.webkit.org/changeset/242745

        "Unreviewed build fix after r242745."
        https://trac.webkit.org/changeset/242756

2019-03-11  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CoordinatedGraphics] ASSERTION FAILED: !m_state.isSuspended
        https://bugs.webkit.org/show_bug.cgi?id=195550

        Reviewed by Carlos Garcia Campos.

        CompositingRunLoop::suspend() locks a mutex and stops the update
        timer. But, the timer can be fired after the lock was acquired and
        before the timer is stopped.

        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
        (WebKit::CompositingRunLoop::updateTimerFired): Removed the
        assertion. Return early if m_state.isSuspended.

2019-03-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Remove the Kerberos rules from the WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=195464
        <rdar://problem/35369230>

        Reviewed by Brent Fulgham.

        Kerberos auth is done in the UIProcess or NetworkProcess now.

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

2019-03-11  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add entitlement to enable use of graphics endpoint with limited capabilities
        https://bugs.webkit.org/show_bug.cgi?id=195582
        <rdar://problem/36082379>

        Reviewed by Brent Fulgham.

        This is a QuartzCore endpoint with a minimal set of capabilities.

        * Configurations/WebContent-iOS.entitlements:

2019-03-11  John Wilander  <wilander@apple.com>

        Move NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm functionality into UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
        https://bugs.webkit.org/show_bug.cgi?id=195117
        <rdar://problem/48448715>

        Reviewed by Brent Fulgham.

        Reading of user defaults on Cocoa platforms should be done in the UI process and
        forwarded to Resource Load Statistics in the network process through the
        WebKit::NetworkSessionCreationParameters struct.

        This patch does away with some old user defaults we don't use anymore. It also
        changes the developer-facing default name to ITPManualPrevalentResource.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
            Removed the call to the old registerUserDefaultsIfNeeded().
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
            Removed the call to the old registerUserDefaultsIfNeeded().
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
            Removed the declaration of the old registerUserDefaultsIfNeeded().
        * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Removed.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
            Added an enum class EnableResourceLoadStatisticsDebugMode.
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
           The struct now has two new fields:
           - enableResourceLoadStatisticsDebugMode
           - resourceLoadStatisticsManualPrevalentResource
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
            Forwarding of the parameters.
        * SourcesCocoa.txt:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
            Forwarding of the parameters.
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
            This is where user defaults for Resource Load Statistics are now read.
        * WebKit.xcodeproj/project.pbxproj:

2019-03-11  Zalan Bujtas  <zalan@apple.com>

        [Synthetic Click] Dispatch mouseout soon after mouseup
        https://bugs.webkit.org/show_bug.cgi?id=195575
        <rdar://problem/47093049>

        Reviewed by Simon Fraser.

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

2019-03-11  Tim Horton  <timothy_horton@apple.com>

        API test WebKit.RequestTextInputContext fails on iOS
        https://bugs.webkit.org/show_bug.cgi?id=195585

        Reviewed by Wenson Hsieh and Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _convertRectFromRootViewCoordinates:]):
        (-[WKWebView _convertRectToRootViewCoordinates:]):
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        (-[WKWebView _focusTextInputContext:completionHandler:]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::elementRectInRootViewCoordinates):
        (WebKit::WebPage::textInputContextsInRect):
        (WebKit::elementRectInWindowCoordinates): Deleted.
        Text input context SPI should be in terms of WKWebView coordinates,
        for consistency's sake. This is a bit irritating; WebPage(Proxy) continue
        to operate in "root view" coordinates, which means different things
        depending on if delegatesScrolling is true or not. So, WKWebView does
        the conversion, re-creating objects as needed.

2019-03-09  Jiewen Tan  <jiewen_tan@apple.com>

        Optimizing loads when creating new pages
        https://bugs.webkit.org/show_bug.cgi?id=195516
        <rdar://problem/48738086>

        Reviewed by Darin Adler.

        This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
        of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
        API::NavigationAction to the load optimizer instead of the request within.

        * UIProcess/API/APINavigationAction.h:
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::createNewPage):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/glib/WebKitUIClient.cpp:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::tryOptimizingLoad):
        (WebKit::tryInterceptNavigation):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::createNewPage):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::tryOptimizingLoad):
        (WebKit::WebPageProxy::createNewPage):
        * UIProcess/WebPageProxy.h:

2019-03-11  Dean Jackson  <dino@apple.com>

        [iOS] Implement a faster click detection that intercepts double-tap-to-zoom if possible
        https://bugs.webkit.org/show_bug.cgi?id=195473
        <rdar://problem/48718396>

        Reviewed by Wenson Hsieh (with some help from Dan Bates).

        Adds a new algorithm, behind a flag FasterClicksEnabled, that can trigger a click
        event without waiting to see if a double tap will occur. It does this by examining
        the amount of zoom that would be triggered if it was a double tap, and if that value
        doesn't exceed a set threshold, commits to the click event instead.

        This is implemented by having the Web Process respond to the potential click with
        some geometry information. If the UI Process receives the information before the
        second tap in a double tap, it can decide to trigger a click.

        * Shared/WebPreferences.yaml: New internal feature so this can be toggled in
            a UI for testing.

        * SourcesCocoa.txt: Renamed WKSyntheticTapGestureRecognizer.
        * WebKit.xcodeproj/project.pbxproj: Ditto.

        * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
        * UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
        (-[WKSyntheticTapGestureRecognizer setGestureIdentifiedTarget:action:]):
        (-[WKSyntheticTapGestureRecognizer setGestureFailedTarget:action:]):
        (-[WKSyntheticTapGestureRecognizer setResetTarget:action:]):
        (-[WKSyntheticTapGestureRecognizer setState:]):
        (-[WKSyntheticTapGestureRecognizer reset]):  Renamed WKSyntheticClickTapGestureRecognizer to
            WKSyntheticTapGestureRecognizer, changed the signature of the main function to be a bit
            more clear about what it does, and added a gesture failed target.

        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initialScaleFactor]):
        (-[WKWebView _contentZoomScale]):
        (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
            Exposed the initial content scale, the current scale and added a declaration that
            was missing from the .h.

        * UIProcess/WebPageProxy.messages.in: Add a new message,
            HandleSmartMagnificationInformationForPotentialTap, to
            communicate the geometry of the clicked node to the UI Process.

        * UIProcess/PageClient.h: Pure virtual function for the geometry message response.
        * UIProcess/WebPageProxy.h: Ditto.

        * UIProcess/ios/PageClientImplIOS.h: Calls into the WKContentView.
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap):

        * UIProcess/ios/SmartMagnificationController.h:
        * UIProcess/ios/SmartMagnificationController.mm:
        (WebKit::SmartMagnificationController::calculatePotentialZoomParameters): A new method that
            asks the WKContentView to work out what the zoom factor will be for a potential double
            tap at a location.
        (WebKit::SmartMagnificationController::smartMagnificationTargetRectAndZoomScales): New implementation
            of this function to avoid multiple out-arguments.

        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _initialScaleFactor]):
        (-[WKContentView _contentZoomScale]):
        (-[WKContentView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]):
            Exposed the initial content scale, the current scale and the target zoom scale. These
            all just call into the WKWebView implementation.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]): Use a WKSyntheticTapGestureRecognizer instead
            of a generic one, so we can capture the failure.
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:origin:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
            New method that responds to the incoming Web Process message, and decides if any
            potential zoom would be "significant".
        (-[WKContentView _singleTapIdentified:]):
        (-[WKContentView _doubleTapDidFail:]):
        (-[WKContentView _didCompleteSyntheticClick]):
        (-[WKContentView _singleTapRecognized:]):
        (-[WKContentView _doubleTapRecognized:]):
            Add some release logging.
        (-[WKContentView _singleTapCommited:]): Deleted.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::potentialTapAtPosition):
        (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap):
        * WebProcess/WebPage/ViewGestureGeometryCollector.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
            Removed an unused parameter from the existing message.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::potentialTapAtPosition): Calculates the geometry of the element
        if requested, and sends it to the UIProcess.

2019-03-11  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r242745.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):

2019-03-11  Chris Dumez  <cdumez@apple.com>

        Assert in WebPageProxy::suspendCurrentPageIfPossible()
        https://bugs.webkit.org/show_bug.cgi?id=195506
        <rdar://problem/48733477>

        Reviewed by Alex Christensen.

        The crash was caused by the top-hit preloading logic in MobileSafari which creates a new Web view that is *related*
        to the previous one, restores the session state onto it and then triggers a load in this new Web view.

        Initially, the 2 Web views use the same process as they are related. However, if the new load's URL is cross-site
        with regards to the first view's URL, then we decide to process swap in the new view. This process swap makes
        sense from a security standpoint. However, when we commit the load in the new process and call
        suspendCurrentPageIfPossible() we end up in an unexpected state because we have a fromItem (due to the session
        state having been restored on the new view) but we haven't committed any load yet in this new view.

        To address the issue, suspendCurrentPageIfPossible() now returns early and does not attempt to suspend anything
        if we have not committed any load yet.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
        Do not attempt to suspend to current page if we have not committed any provisional load yet.

2019-03-11  Chris Dumez  <cdumez@apple.com>

        Update device orientation & motion permission native SPI as per latest proposal
        https://bugs.webkit.org/show_bug.cgi?id=195567

        Reviewed by Youenn Fablet.

        The native SPI is now:
        +- (void)_webView:(WKWebView *)webView shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:(WKFrameInfo *)frameInfo decisionHandler:(void (^)(BOOL))decisionHandler;

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
        * WebProcess/WebPage/WebPage.h:

2019-03-11  Andy Estes  <aestes@apple.com>

        [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
        https://bugs.webkit.org/show_bug.cgi?id=195530
        <rdar://problem/48747164>

        Reviewed by Alex Christensen.

        * Configurations/Network-iOS.entitlements: Added the 'com.apple.payment.all-access'
        entitlement and reordered the others.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): Forwarded
        WebPaymentCoordinatorProxy messages to the payment coordinator.
        (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): Ditto.
        (WebKit::NetworkConnectionToWebProcess::didClose): Set m_paymentCoordinator to nullptr.
        * NetworkProcess/NetworkConnectionToWebProcess.h: Inherited from
        WebPaymentCoordinatorProxy::Client and added a unique_ptr<WebPaymentCoordinatorProxy> member.

        * NetworkProcess/cocoa/NetworkSessionCocoa.h: Declared getters for source application bundle
        and secondary identifiers, and CTDataConnectionServiceType on iOS.
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::sourceApplicationBundleIdentifier const): Defined getter.
        (WebKit::NetworkSessionCocoa::sourceApplicationSecondaryIdentifier const): Ditto.
        (WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Ditto.
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Initialized
        m_sourceApplicationBundleIdentifier and m_sourceApplicationSecondaryIdentifier with
        corresponding NetworkSessionCreationParameters.

        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: Added.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinator): Added. Returns
        m_paymentCoordinator after lazily initializing it.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorConnection): Added. Returns the
        connection to the web process.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorPresentingViewController): Added.
        Returns nil.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType):
        Added. Returns the value from the network session identified by sessionID.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationBundleIdentifier):
        Ditto.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationSecondaryIdentifier):
        Ditto.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter): Added.
        Returns a new PaymentAuthorizationController.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver): Added empty
        definition. NetworkConnectionToWebProcess explicitly forwards WebPaymentCoordinatorProxy
        messages to its payment coordinator, so there's no need to register with a MessageReceiverMap.
        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver): Ditto.

        * Platform/ios/PaymentAuthorizationController.h: Added. Declares a
        PaymentAuthorizationPresenter subclass based on PKPaymentAuthorizationController.
        * Platform/ios/PaymentAuthorizationController.mm: Added.
        (-[WKPaymentAuthorizationControllerDelegate initWithRequest:presenter:]):
        Initialized WKPaymentAuthorizationDelegate with request and presenter.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationControllerDidFinish:]):
        Forwarded call to WKPaymentAuthorizationDelegate.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didAuthorizePayment:handler:]):
        Ditto.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingMethod:handler:]):
        Ditto.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingContact:handler:]):
        Ditto.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectPaymentMethod:handler:]):
        Ditto.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:willFinishWithError:]):
        Ditto.
        (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didRequestMerchantSession:]):
        Ditto.
        (WebKit::PaymentAuthorizationController::PaymentAuthorizationController):
        Initialized m_controller with a new PKPaymentAuthorizationController and m_delegate with a
        new WKPaymentAuthorizationControllerDelegate.
        (WebKit::PaymentAuthorizationController::platformDelegate): Returned m_delegate.
        (WebKit::PaymentAuthorizationController::dismiss): Dismissed the controller, set its
        delegates to nil, set m_controller to nil, invalidated the delegate, and set m_delegate to
        nil.
        (WebKit::PaymentAuthorizationController::present): Called -presentWithCompletion: on the
        controller, forwarding the passed-in completion handler.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Allowed PassKit to look up
        the "com.apple.passd.in-app-payment" and "com.apple.passd.library" service endpoints.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Changed to call
        paymentCoordinatorAddMessageReceiver.
        (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Changed to call
        paymentCoordinatorRemoveMessageReceiver.
        (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Deleted.
        (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Passed sessionID to
        platformCanMakePaymentsWithActiveCard.
        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Stored destinationID and passed
        sessionID to platformShowPaymentUI.
        (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Changed to account for new
        behavior of didCancelPaymentSession.
        (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Changed to call hidePaymentUI.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Changed to only call hidePaymentUI
        when didReachFinalState is true, since didCancelPaymentSession is called otherwise.
        (WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Cleared m_destinationID.
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Added m_destionationID member.
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Changed
        CanMakePaymentsWithActiveCard and ShowPaymentUI messages to take destinationID and sessionID
        arguments.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Passed
        sessionID to paymentCoordinatorSourceApplicationSecondaryIdentifier.
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Passed sessionID to various
        m_client call sites.

        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to
        platformPaymentRequest.
        (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter
        before calling dismiss.

        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to
        platformPaymentRequest.
        (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter
        before calling dismiss.

        * Shared/WebPreferences.yaml: Added ApplePayRemoteUIEnabled as an internal preference.

        * SourcesCocoa.txt: Added NetworkConnectionToWebProcessIOS.mm and
        PaymentAuthorizationController.mm.

        * UIProcess/AuxiliaryProcessProxy.h:
        (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Deleted.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::paymentCoordinatorConnection): Moved from WebPageProxy.cpp.
        (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
        (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
        (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver): Ditto.
        (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver): Ditto.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::paymentCoordinatorConnection): Moved to WebPageProxyCocoa.mm.
        (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
        (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
        (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
        (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
        * UIProcess/WebPageProxy.h:

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Asserted that
        sessionID equals the website data store's sessionID.

        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::networkProcessConnectionClosed): Added. Cancels the current
        session if Apple Pay Remote UI is enabled and the network process connection closes.
        (WebKit::WebPaymentCoordinator::availablePaymentNetworks): Changed to account for
        WebPaymentCoordinator being an IPC::MessageSender.
        (WebKit::WebPaymentCoordinator::canMakePayments): Ditto.
        (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard): Ditto.
        (WebKit::WebPaymentCoordinator::openPaymentSetup): Ditto.
        (WebKit::WebPaymentCoordinator::showPaymentUI): Ditto.
        (WebKit::WebPaymentCoordinator::completeMerchantValidation): Ditto.
        (WebKit::WebPaymentCoordinator::completeShippingMethodSelection): Ditto.
        (WebKit::WebPaymentCoordinator::completeShippingContactSelection): Ditto.
        (WebKit::WebPaymentCoordinator::completePaymentMethodSelection): Ditto.
        (WebKit::WebPaymentCoordinator::completePaymentSession): Ditto.
        (WebKit::WebPaymentCoordinator::abortPaymentSession): Ditto.
        (WebKit::WebPaymentCoordinator::cancelPaymentSession): Ditto.
        (WebKit::WebPaymentCoordinator::messageSenderConnection const): Added. Returns a connection
        to the network process if Apple Pay Remote UI is enabled. Otherwise, returned the web
        process's parent connection.
        (WebKit::WebPaymentCoordinator::messageSenderDestinationID const): Added. Returns the web
        page's ID.
        (WebKit::WebPaymentCoordinator::remoteUIEnabled const): Added. Calls Settings::applePayRemoteUIEnabled.
        * WebProcess/ApplePay/WebPaymentCoordinator.h: Inherited from IPC::MessageSender.

        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage): Forwarded WebPaymentCoordinator
        messages to the payment coordinator of the web page matching the decoder's destination ID.
        (WebKit::NetworkProcessConnection::didReceiveSyncMessage): Ditto for sync messages.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::paymentCoordinator): Added a payment coordinator getter.
        * WebProcess/WebPage/WebPage.h: Ditto.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::networkProcessConnectionClosed): Called
        WebPaymentCoordinator::networkProcessConnectionClosed when the network process connection
        closes.

2019-03-11  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Block access to backboardd service
        https://bugs.webkit.org/show_bug.cgi?id=195484

        Reviewed by Brent Fulgham.

        This patch is addressing blocking the backboardd service "com.apple.backboard.hid.services". Getting the
        backlight level in the WebContent process will initiate a connection with this service. To be able to
        block the service, the backlight level is queried in the UI process and sent to the WebContent process
        when the WebContent process is started, and when the backlight level is changed. On the WebContent side,
        the method getting the backlight level is swizzled to return the value sent from the UI process.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::displayBrightness):
        (WebKit::WebProcessPool::backlightLevelDidChangeCallback):
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::currentBacklightLevel):
        (WebKit::WebProcess::backlightLevelDidChange):

2019-03-11  Brent Fulgham  <bfulgham@apple.com>

        Remove obsolete runtime flag for StorageAccess API Prompt
        https://bugs.webkit.org/show_bug.cgi?id=195564
        <rdar://problem/37279014>

        Reviewed by Chris Dumez.

        This bug tracks the work of removing the obsolete flag that had been used to optionally
        prevent display of the StorageAccess API prompt. We have since shipped the final version
        of this feature with an always-on prompt, and should have removed this runtime flag.

        No test changes because this has no change in behavior. Tests already assume the prompt
        behavior, and did not test turning the flag off.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        (WebKit::ResourceLoadStatisticsStore::debugModeEnabled const):
        (WebKit::ResourceLoadStatisticsStore::storageAccessPromptsEnabled const): Deleted.
        (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::requestStorageAccess):
        (WebKit::NetworkProcess::requestStorageAccessGranted):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetStorageAccessPromptsEnabled): Deleted.
        (WKPreferencesGetStorageAccessPromptsEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRef.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _storageAccessPromptsEnabled]): Deleted.
        (-[WKPreferences _setStorageAccessPromptsEnabled:]): Deleted.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::requestStorageAccess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::requestStorageAccess):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::requestStorageAccess):

2019-03-11  Alex Christensen  <achristensen@webkit.org>

        Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
        https://bugs.webkit.org/show_bug.cgi?id=195511
        <rdar://problem/44873269>

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkContentRuleListManager.cpp:
        (WebKit::NetworkContentRuleListManager::addContentRuleLists):
        * NetworkProcess/NetworkContentRuleListManager.h:
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
        (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * Shared/WebCompiledContentRuleList.cpp:
        (WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
        (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
        (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
        (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
        (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
        (WebKit::WebCompiledContentRuleList::actions const):
        * Shared/WebCompiledContentRuleList.h:
        * Shared/WebCompiledContentRuleListData.cpp:
        (WebKit::WebCompiledContentRuleListData::size const):
        (WebKit::WebCompiledContentRuleListData::dataPointer const):
        (WebKit::WebCompiledContentRuleListData::encode const):
        (WebKit::WebCompiledContentRuleListData::decode):
        * Shared/WebCompiledContentRuleListData.h:
        (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
        * UIProcess/API/APIContentRuleList.cpp:
        (API::ContentRuleList::usesCopiedMemory const):
        * UIProcess/API/APIContentRuleList.h:
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::getData):
        (API::decodeContentRuleListMetaData):
        (API::ContentRuleListStore::readContentsOfFile):
        (API::MappedOrCopiedData::dataPointer const):
        (API::openAndMapOrCopyContentRuleList):
        (API::compiledToFile):
        (API::createExtension):
        (API::ContentRuleListStore::lookupContentRuleList):
        (API::ContentRuleListStore::compileContentRuleList):
        (API::ContentRuleListStore::getContentRuleListSource):
        (API::openAndMapContentRuleList): Deleted.
        * UIProcess/API/APIContentRuleListStore.h:
        * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
        (API::ContentRuleListStore::readContentsOfFile):
        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
        * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
        * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
        (-[_WKUserContentFilter usesCopiedMemory]):
        * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addContentRuleLists):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_hostFileDescriptor):

2019-03-11  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix assertions in layout tests on iOS Simulator after r242666.

        Log an error but do not crash if we fail to acquire a ProcessAssertion.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):

2019-03-11  Chris Dumez  <cdumez@apple.com>

        WebProcessCache should keep track of processes being added
        https://bugs.webkit.org/show_bug.cgi?id=195538

        Reviewed by Geoffrey Garen.

        WebProcessCache should keep track of processes being added, while they are being
        checked for responsiveness. This is useful so that:
        - Requests to clear the cache also clear processes being added
        - Requests to remove a given process from the cache (either because it crashed
          or because it is being used for a history navigation) actually remove the
          process if it is still being checked for responsiveness.
        - The cached process eviction timer applies to such processes in case something
          goes wrong with the code and the pending request does not get processed.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::generateAddRequestIdentifier):
        (WebKit::WebProcessCache::addProcessIfPossible):
        (WebKit::WebProcessCache::addProcess):
        (WebKit::WebProcessCache::clear):
        (WebKit::WebProcessCache::clearAllProcessesForSession):
        (WebKit::WebProcessCache::removeProcess):
        (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
        (WebKit::WebProcessCache::evictProcess): Deleted.
        * UIProcess/WebProcessCache.h:
        (WebKit::WebProcessCache::size const):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):

2019-03-11  Alex Christensen  <achristensen@webkit.org>

        REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
        https://bugs.webkit.org/show_bug.cgi?id=194523

        Reviewed by Alexey Proskuryakov.

        Attempt another workaround to prevent crashes.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):

2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r242688, r242643, r242624.

        Caused multiple layout test failures and crashes on iOS and macOS.

        Reverted changeset:

        "requestAnimationFrame should execute before the next frame"
        https://bugs.webkit.org/show_bug.cgi?id=177484
        https://trac.webkit.org/changeset/242624/webkit

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
        (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
        (WebKit::DrawingAreaCoordinatedGraphics::display):
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::layerFlushTimerFired):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::layoutIfNeeded):
        (WebKit::WebPage::willDisplayPage):
        (WebKit::WebPage::renderingUpdate): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):

2019-03-11  Darin Adler  <darin@apple.com>

        Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
        https://bugs.webkit.org/show_bug.cgi?id=195533

        Reviewed by Brent Fulgham.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::dumpContentsToFile): Use appendFixedPrecisionNumber.
        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::asJSON const): Ditto.
        * Shared/Gamepad/GamepadData.cpp:
        (WebKit::GamepadData::loggingString const): Ditto.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::logDiagnosticMessageWithValue): Use numberToStringFixedPrecision.

2019-03-11  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make it possible exclude localhost from classification
        https://bugs.webkit.org/show_bug.cgi?id=195474
        <rdar://problem/47520577>

        Reviewed by Brent Fulgham.

        This patch allows for localhost to be excluded from classification and
        treatment as a prevalent resource.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
        (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
            Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
            Now takes a ShouldIncludeLocalhost parameter.
        (WebKit::ResourceLoadStatisticsStore::shouldSkip const):
            Convenience function, currently supporting the localhost exclusion.
        (WebKit::ResourceLoadStatisticsStore::setIsRunningTest):
            Test infrastructure.
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setIsRunningTest):
            Test infrastructure.
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
            Now takes a ShouldIncludeLocalhost parameter.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
            Defines the new ShouldIncludeLocalhost boolean enum.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
            Test infrastructure.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
            Forwards the localhost setting to the create function.
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
            New parameter called shouldIncludeLocalhostInResourceLoadStatistics.
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
            Picks up the localhost setting from the parameters.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsIsRunningTest):
            Test infrastructure.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setIsRunningResourceLoadStatisticsTest):
            Test infrastructure.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
            Picks up the localhost setting from the WebsiteDataStore parameters.
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
            Makes sure Safari does not exclude localhost.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
            Test infrastructure.
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2019-03-11  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r242698.

        API test crashes on bots.

        Reverted changeset:

        "Add a WKContentRuleList variant that uses copied memory
        instead of mmap'd shared memory for class A containerized
        apps"
        https://bugs.webkit.org/show_bug.cgi?id=195511
        https://trac.webkit.org/changeset/242698

2019-03-11  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Enable web process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=195169

        Reviewed by Daniel Bates.

        * PlatformWPE.cmake:
        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bubblewrapSpawn):

2019-03-11  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r242697.

        Broke internal builders.

        Reverted changeset:

        "Optimizing loads when creating new pages"
        https://bugs.webkit.org/show_bug.cgi?id=195516
        https://trac.webkit.org/changeset/242697

2019-03-10  Alex Christensen  <achristensen@webkit.org>

        Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
        https://bugs.webkit.org/show_bug.cgi?id=195511
        <rdar://problem/44873269>

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkContentRuleListManager.cpp:
        (WebKit::NetworkContentRuleListManager::addContentRuleLists):
        * NetworkProcess/NetworkContentRuleListManager.h:
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
        (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * Shared/WebCompiledContentRuleList.cpp:
        (WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
        (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
        (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
        (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
        (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
        (WebKit::WebCompiledContentRuleList::actions const):
        * Shared/WebCompiledContentRuleList.h:
        * Shared/WebCompiledContentRuleListData.cpp:
        (WebKit::WebCompiledContentRuleListData::size const):
        (WebKit::WebCompiledContentRuleListData::dataPointer const):
        (WebKit::WebCompiledContentRuleListData::encode const):
        (WebKit::WebCompiledContentRuleListData::decode):
        * Shared/WebCompiledContentRuleListData.h:
        (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
        * UIProcess/API/APIContentRuleList.cpp:
        (API::ContentRuleList::usesCopiedMemory const):
        * UIProcess/API/APIContentRuleList.h:
        * UIProcess/API/APIContentRuleListStore.cpp:
        (API::getData):
        (API::decodeContentRuleListMetaData):
        (API::ContentRuleListStore::readContentsOfFile):
        (API::MappedOrCopiedData::dataPointer const):
        (API::openAndMapOrCopyContentRuleList):
        (API::compiledToFile):
        (API::createExtension):
        (API::ContentRuleListStore::lookupContentRuleList):
        (API::ContentRuleListStore::compileContentRuleList):
        (API::ContentRuleListStore::getContentRuleListSource):
        (API::openAndMapContentRuleList): Deleted.
        * UIProcess/API/APIContentRuleListStore.h:
        * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
        (API::ContentRuleListStore::readContentsOfFile):
        * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
        (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
        * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
        * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
        (-[_WKUserContentFilter usesCopiedMemory]):
        * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addContentRuleLists):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_hostFileDescriptor):

2019-03-10  Jiewen Tan  <jiewen_tan@apple.com>

        Optimizing loads when creating new pages
        https://bugs.webkit.org/show_bug.cgi?id=195516
        <rdar://problem/48738086>

        Reviewed by Darin Adler.

        This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
        of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
        API::NavigationAction to the load optimizer instead of the request within.

        * UIProcess/API/APINavigationAction.h:
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::createNewPage):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/glib/WebKitUIClient.cpp:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::tryOptimizingLoad):
        (WebKit::tryInterceptNavigation):
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::createNewPage):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::tryOptimizingLoad):
        (WebKit::WebPageProxy::createNewPage):
        * UIProcess/WebPageProxy.h:

2019-03-10  Tim Horton  <timothy_horton@apple.com>

        Add SPI to retrieve the set of text inputs in a given rect, and later focus one
        https://bugs.webkit.org/show_bug.cgi?id=195499

        Reviewed by Darin Adler.

        * Scripts/webkit/messages.py:
        * Shared/TextInputContext.cpp: Added.
        (IPC::ArgumentCoder<WebKit::TextInputContext>::encode):
        (IPC::ArgumentCoder<WebKit::TextInputContext>::decode):
        * Shared/TextInputContext.h: Added.
        (WebKit::TextInputContext::operator== const):
        Add TextInputContext, which represents a minimal set of information
        about a text field.

        * Sources.txt:
        * SourcesCocoa.txt:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
        (-[WKWebView _focusTextInputContext:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        Add SPI that allows clients to asynchronously request text input
        contexts for a given rect, and later focus a given context.

        * UIProcess/API/Cocoa/_WKTextInputContext.h: Added.
        * UIProcess/API/Cocoa/_WKTextInputContext.mm: Added.
        (-[_WKTextInputContext _initWithTextInputContext:]):
        (-[_WKTextInputContext boundingRect]):
        (-[_WKTextInputContext _textInputContext]):
        (-[_WKTextInputContext isEqual:]):
        (-[_WKTextInputContext hash]):
        (-[_WKTextInputContext copyWithZone:]):
        * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: Added.
        Add an SPI object that exposes a read-only window on a TextInputContext to clients.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::textInputContextsInRect):
        (WebKit::WebPageProxy::focusTextInputContext):
        * UIProcess/WebPageProxy.h:
        Plumbing from WKWebView<->WebPage.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::elementRectInWindowCoordinates):
        (WebKit::isEditableTextInputElement):
        (WebKit::WebPage::textInputContextsInRect):
        Search the DOM for text input contexts: <input type='text'> (or other
        form fields that fall back on text field behavior), <textarea>, and
        contenteditable roots. Store the WebPage, Document, and Element identifiers
        so that we can find the element again later.

        (WebKit::WebPage::focusTextInputContext):
        Find the element for a given (web page, document, element) triple and focus it,
        if it's still available.

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

2019-03-10  Tim Horton  <timothy_horton@apple.com>

        iOS: Using ⌥ to scroll horizontally is no different than arrow key
        https://bugs.webkit.org/show_bug.cgi?id=195268
        <rdar://problem/48326682>

        Reviewed by Brent Fulgham.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
        (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): Deleted.
        * UIProcess/ios/WKKeyboardScrollingAnimator.h:
        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
        (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
        (-[WKKeyboardScrollViewAnimator setDelegate:]):
        (-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
        (-[WKKeyboardScrollViewAnimator distanceForIncrement:]): Deleted.
        Add a direction parameter to -distanceForIncrement:, so the client
        can return a different page/document size based on the scrolling axis.
        Adopt it both in the default implementation and in WKContentViewInteraction.
        Make the option key scroll by page when scrolling horizontally, like it
        does when scrolling vertically.

2019-03-10  David Quesada  <david_quesada@apple.com>

        ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap()
        https://bugs.webkit.org/show_bug.cgi?id=152480

        Reviewed by Chris Dumez.

        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::downloadFinished):
            If the DownloadProxy is holding the last reference to the process pool, then
            invalidating the proxy will cause the process pool, the network process proxy,
            and this DownloadProxyMap to deallocate. Ensure that doesn't happen until this
            method has done everything it wants to do to clean up.

2019-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix some misleading function and variable names in WKContentViewInteraction.mm
        https://bugs.webkit.org/show_bug.cgi?id=195536

        Reviewed by Tim Horton.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (shouldDeferZoomingToSelectionWhenRevealingFocusedElement):

        Rename shouldZoomToRevealSelectionRect to shouldDeferZoomingToSelectionWhenRevealingFocusedElement; this
        function is used to determine whether we should zoom to the selection rect when revealing the focused element,
        and therefore affects whether we need to defer zooming until we get selection information.

        (rectToRevealWhenZoomingToFocusedElement):
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

        Rename shouldShowKeyboard to shouldShowInputView; this boolean indicates whether we should show not only the
        keyboard, but other UI for user input such as date and select pickers.

        (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
        (shouldZoomToRevealSelectionRect): Deleted.

2019-03-10  Simon Fraser  <simon.fraser@apple.com>

        ScrollingTree should have the final say on where layers go
        https://bugs.webkit.org/show_bug.cgi?id=195507

        Reviewed by Antti Koivisto.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):

2019-03-09  Darin Adler  <darin@apple.com>

        [Cocoa] Code signing fails because services are copied into XPCServices after the framework is signed
        https://bugs.webkit.org/show_bug.cgi?id=195523

        Reviewed by Dan Bernstein.

        * WebKit.xcodeproj/project.pbxproj: Make symbolic links while building the WebKit
        framework instead of copying in the services after the framework is built.

2019-03-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r242551): Sporadic hangs when tapping to change selection on iOS
        https://bugs.webkit.org/show_bug.cgi?id=195475
        <rdar://problem/48721153>

        Reviewed by Chris Dumez.

        r242551 refactored synchronous autocorrection context requests to send an async IPC message and then use
        waitForAndDispatchImmediately, instead of calling sendSync. However, this exposes a couple of existing issues in
        the implementation of waitForAndDispatchImmediately that causes sporadic IPC deadlocks when changing selection.

        First, passing in InterruptWaitingIfSyncMessageArrives when synchronously waiting for an IPC message currently
        does not fulfill its intended behavior of interrupting waiting when a sync message arrives. This is because sync
        IPC messages, by default, may be dispatched while the receiver is waiting for a sync reply. This means that the
        logic in Connection::SyncMessageState::processIncomingMessage to dispatch an incoming sync message on the main
        thread will attempt to handle the incoming message by enqueueing it on the main thread, and then waking up the
        client runloop (i.e. signaling m_waitForSyncReplySemaphore). This works in the case of sendSync since the sync
        reply semaphore is used to block the main thread, but in the case of waitForAndDispatchImmediately, a different
        m_waitForMessageCondition is used instead, so SyncMessageState::processIncomingMessage will only enqueue the
        incoming sync message on the main thread, and not actually invoke it.

        To fix this first issue, observe that there is pre-existing logic to enqueue the incoming message and signal
        m_waitForMessageCondition in Connection::processIncomingMessage. This codepath is currently not taken because we
        end up bailing early in the call to SyncMessageState::processIncomingMessage. Instead, we can move this early
        return further down in the function, such that if there is an incoming sync message and we're waiting with the
        InterruptWaitingIfSyncMessageArrives option, we will correctly enqueue the incoming message, wake the runloop,
        and proceed to handle the incoming message.

        The second issue is more subtle; consider the scenario in which we send a sync message A from the web process to
        the UI process, and simultaneously, in the UI process, we schedule some work to be done on the main thread.
        Let's additionally suppose that this scheduled work will send an IPC message B to the web process and
        synchronously wait for a reply (in the case of this particular bug, this is the sync autocorrection context
        request). What happens upon receiving sync message A is that the IPC thread in the UI process will schedule A on
        the main thread; however, before the scheduled response to A is invoked, we will first invoke previously
        scheduled work that attempts to block synchronously until a message B is received. In summary:

        1. (Web process)    sends sync IPC message A to UI process.
        2. (UI process)     schedules some main runloop task that will block synchronously on IPC message B.
        3. (UI process)     receives sync IPC message A and schedules A on the main runloop.
        4. (UI process)     carry out the task scheduled in (2) and block on B.

        ...and then, the UI process and web process are now deadlocked because the UI process is waiting for B to
        arrive, but the web process can't send B because it's waiting for a reply for IPC message A! To fix this second
        deadlock, we first make an important observation: when using sendSync, we don't run into this problem because
        immediately before sending sync IPC, we will attempt to handle any incoming sync IPC messages that have been
        queued up. However, when calling waitForAndDispatchImmediately, we don't have this extra step, so a deadlock may
        occur in the manner described above. To fix this, we make waitForAndDispatchImmediately behave more like
        sendSync, by handling all incoming sync messages prior to blocking on an IPC response.

        Test: editing/selection/ios/change-selection-by-tapping.html

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::waitForMessage):
        (IPC::Connection::processIncomingMessage):

2019-03-09  Andy Estes  <aestes@apple.com>

        [Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
        https://bugs.webkit.org/show_bug.cgi?id=195526
        <rdar://problem/48745636>

        Reviewed by Chris Dumez.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinator::openPaymentSetup):
        (WebKit::generateCanMakePaymentsWithActiveCardReplyID): Deleted.
        (WebKit::generateOpenPaymentSetupReplyID): Deleted.
        (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCardReply): Deleted.
        (WebKit::WebPaymentCoordinator::openPaymentSetupReply): Deleted.
        * WebProcess/ApplePay/WebPaymentCoordinator.h:
        * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:

2019-03-09  Andy Estes  <aestes@apple.com>

        [iOS] Remove unneeded entitlements and sandbox allowances from the Networking service
        https://bugs.webkit.org/show_bug.cgi?id=195527

        Reviewed by Eric Carlson.

        * Configurations/Network-iOS.entitlements:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2019-03-09  Chris Dumez  <cdumez@apple.com>

        Use modern async IPC with reply for device orientation permission
        https://bugs.webkit.org/show_bug.cgi?id=195529

        Reviewed by Ryosuke Niwa.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
        (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID): Deleted.
        (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-03-09  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
        https://bugs.webkit.org/show_bug.cgi?id=195510
        <rdar://problem/48735695>

        Reviewed by Simon Fraser.

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

2019-03-08  Chris Dumez  <cdumez@apple.com>

        Enable ProcessAssertions on iOS Simulator
        https://bugs.webkit.org/show_bug.cgi?id=195479

        Reviewed by Alexey Proskuryakov.

        Enable ProcessAssertions on iOS Simulator. We have some layout tests timing out in the
        iOS Simulator due to the WebContent process suspending. Turning on ProcessAssertions in
        the iOS Simulator seems to make those tests pass.

        * UIProcess/ProcessAssertion.cpp:
        * UIProcess/ProcessAssertion.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:

2019-03-08  Chris Dumez  <cdumez@apple.com>

        Add support for Device Orientation / Motion permission API
        https://bugs.webkit.org/show_bug.cgi?id=195329
        <rdar://problem/47645367>

        Reviewed by Geoffrey Garen.

        Add support for Device Orientation / Motion permission API:
        - https://github.com/w3c/deviceorientation/issues/57

        This adds new SPI to WKUIDelegatePrivate, until we can make this API.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/C/WKPageUIClient.h:
        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID):
        (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
        (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2019-03-08  Brady Eidson  <beidson@apple.com>

        Have the UIProcess take the UnboundedNetworking assertion when downloads are in progress.
        https://bugs.webkit.org/show_bug.cgi?id=195468

        Reviewed by Andy Estes.

        * UIProcess/Downloads/DownloadProxyMap.cpp:
        (WebKit::DownloadProxyMap::DownloadProxyMap):
        (WebKit::DownloadProxyMap::createDownloadProxy): If this is the first download, and the process has the entitlement,
          take the assertion.
        (WebKit::DownloadProxyMap::downloadFinished):
        (WebKit::DownloadProxyMap::processDidClose):
        * UIProcess/Downloads/DownloadProxyMap.h:

2019-03-08  Chris Dumez  <cdumez@apple.com>

        Add assertions to help debug a WebProcessCache crash
        https://bugs.webkit.org/show_bug.cgi?id=195469

        Reviewed by Brady Eidson.

        I suspect the process's registrableDomain in null when evictProcess() gets
        called, thus crashing when lookup it up in the HashMap. Confirm this and
        how this could happen via assertions.

        * UIProcess/WebProcessCache.cpp:
        (WebKit::WebProcessCache::evictProcess):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):

2019-03-08  Brady Eidson  <beidson@apple.com>

        Rename AssertionState::Download.
        https://bugs.webkit.org/show_bug.cgi?id=195465

        Reviewed by Andy Estes.

        It's (currently) about uploads and downloads.
        Let's call it "UnboundedNetworking"

        * NetworkProcess/Downloads/DownloadMap.cpp:
        (WebKit::DownloadMap::add):

        * UIProcess/ProcessAssertion.h:

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didSetAssertionState):

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::flagsForState):
        (WebKit::reasonForState):

2019-03-08  Simon Fraser  <simon.fraser@apple.com>

        [macOS UI-side compositing] Mouse handling can trigger a crash before we have a scrolling tree root
        https://bugs.webkit.org/show_bug.cgi?id=195467

        Reviewed by Antti Koivisto.
        
        When launching MiniBrowser with UI-side compositing enabled in a state where the window
        appears under the mouse, we can hit RemoteScrollingTree::handleMouseEvent() for a mouseEnter
        event before we have a scrolling tree root node, so add a null check.

        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::handleMouseEvent):

2019-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r242624): [GTK] New rAF code path assumes AC mode
        https://bugs.webkit.org/show_bug.cgi?id=195459

        Reviewed by Žan Doberšek.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
        The refresh monitor now calls scheduleLayerFlush() but when AC
        mode is disabled this method does nothing, so setNeedsDisplay()
        needs to be called instead.

2019-03-07  Tim Horton  <timothy_horton@apple.com>

        Crash under RemoteLayerTreePropertyApplier::applyProperties
        https://bugs.webkit.org/show_bug.cgi?id=195448
        <rdar://problem/48588226>

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::updateLayerTree):
        Under some currently-unknown circumstances, the UI process is receiving
        commits referring to layers that it does not know about.
        One understood case of this was fixed in r241899, but there seem to be
        cases remaining that are not understood.
        Also, add a release log so that we can identify any downstream effects.

2019-03-07  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Introduce fixed duration content observation
        https://bugs.webkit.org/show_bug.cgi?id=195295
        <rdar://problem/48579913>

        Reviewed by Simon Fraser.

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

2019-03-07  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo][WebKit] Nothing is drawn after Web process crashed
        https://bugs.webkit.org/show_bug.cgi?id=195399

        Reviewed by Alex Christensen.

        PageClientImpl::viewSize returned 0x0 size after Web process
        crashed. Restored the original implementation using GetClientRect
        (Bug 52175).

        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::viewSize):

2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>

        requestAnimationFrame should execute before the next frame
        https://bugs.webkit.org/show_bug.cgi?id=177484

        Reviewed by Simon Fraser.

        Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
        a single call to Page::renderingUpdate(). This new function implements 
        "Update the rendering" step of the HTML Event Loop specification
        <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.

        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
        (WebKit::LayerTreeHost::layerFlushTimerFired):
        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        (WebKit::DrawingAreaImpl::display):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::layoutIfNeeded):
        (WebKit::WebPage::renderingUpdate):
        (WebKit::WebPage::willDisplayPage): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):

2019-03-07  Zalan Bujtas  <zalan@apple.com>

        [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
        https://bugs.webkit.org/show_bug.cgi?id=195353
        <rdar://problem/48626394>

        Reviewed by Simon Fraser.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetContentChangeObserverEnabled):
        (WKPreferencesGetContentChangeObserverEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _contentChangeObserverEnabled]):
        (-[WKPreferences _setContentChangeObserverEnabled:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleSyntheticClick):

2019-03-07  Andy Estes  <aestes@apple.com>

        [Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
        https://bugs.webkit.org/show_bug.cgi?id=195349
        <rdar://problem/48625510>

        Reviewed by Alex Christensen.

        Introduced PaymentAuthorizationPresenter and WKPaymentAuthorizationDelegate to encapsulate
        PKPaymentAuthorizationViewController and its delegate. Taught WebPaymentCoordinatorProxy to
        interact with PaymentAuthorizationPresenter rather than PKPAVC directly.

        These changes will allow us to swap out PKPaymentAuthorizationViewController with PKPaymentAuthorizationController in a follow-on patch.

        * Platform/cocoa/PaymentAuthorizationPresenter.h: Added. Defined the abstract interface for
        payment authorization presenters that use PKPA(V)C.
        * Platform/cocoa/PaymentAuthorizationPresenter.mm: Added.
        (WebKit::toPKPaymentAuthorizationStatus): Moved from WebPaymentCoordinatorProxyCocoa.mm.
        (WebKit::toPKPaymentErrorCode): Ditto.
        (WebKit::toNSError): Ditto.
        (WebKit::toNSErrors): Ditto.
        (WebKit::toPKShippingMethods): Ditto.
        (WebKit::PaymentAuthorizationPresenter::completeMerchantValidation): Added. Implements the
        logic previously in WebPaymentCoordinatorProxy::platformCompleteMerchantValidation.
        (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): Ditto for
        WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection.
        (WebKit::PaymentAuthorizationPresenter::completePaymentSession): Ditto for 
        (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): Ditto for
        WebPaymentCoordinatorProxy::platformCompletePaymentSession.
        (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Ditto for
        WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection.
        * Platform/cocoa/PaymentAuthorizationViewController.h: Added. Defined a subclass of PaymentAuthorizationPresenter for PKPaymentAuthorizationViewController.
        * Platform/cocoa/PaymentAuthorizationViewController.mm: Added.
        (-[WKPaymentAuthorizationViewControllerDelegate initWithPresenter:]): Added a PKPAVC
        delegate that's a subclass of WKPaymentAuthorizationDelegate.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
        Called -[WKPaymentAuthorizationDelegate _didFinish].
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Called
        -[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:].
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Called
        -[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:].
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Called
        -[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:].
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Called
        -[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:].
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]):
        Called -[WKPaymentAuthorizationDelegate _willFinishWithError:].
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Called
        -[WKPaymentAuthorizationDelegate _didRequestMerchantSession:].
        * Platform/cocoa/WKPaymentAuthorizationDelegate.h: Added.
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Added.
        (-[WKPaymentAuthorizationDelegate summaryItems]): Added a summaryItems getter.
        (-[WKPaymentAuthorizationDelegate shippingMethods]): Ditto for shippingMethods.
        (-[WKPaymentAuthorizationDelegate completeMerchantValidation:error:]): Called
        _didRequestMerchantSessionCompletion then set it to nil.
        (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): Ditto for
        _didSelectPaymentMethodCompletion.
        (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]): Ditto
        for _didAuthorizePaymentCompletion.
        (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
        Ditto for _didSelectShippingContactCompletion.
        (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): Ditto for
        _didSelectShippingMethodCompletion.
        (-[WKPaymentAuthorizationDelegate invalidate]): If there's an outstanding authorization
        callback, called -completePaymentSession:errors:didReachFinalState: with a state of
        PKPaymentAuthorizationStatusFailure.
        (-[WKPaymentAuthorizationDelegate _initWithPresenter:]):
        (-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:]): Added. Implements the
        logic previously in WKPaymentAuthorizationViewControllerDelegate.
        (-[WKPaymentAuthorizationDelegate _didFinish]): Ditto.
        (-[WKPaymentAuthorizationDelegate _didRequestMerchantSession:]): Ditto.
        (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]): Ditto.
        (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]): Ditto.
        (toShippingMethod): Moved from WebPaymentCoordinatorProxyCocoa.mm.
        (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): Added. Implements
        the logic previously in WKPaymentAuthorizationViewControllerDelegate.
        (-[WKPaymentAuthorizationDelegate _willFinishWithError:]): Ditto.
        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::presenterWillValidateMerchant): To conform to
        PaymentAuthorizationPresenter::Client, renamed from validateMerchant.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidAuthorizePayment): Renamed from
        didAuthorizePayment.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Moved logic here that previously
        existed in WKPaymentAuthorizationViewControllerDelegate.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingMethod): Renamed from
        didSelectShippingMethod.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingContact): Renamed from
        didSelectShippingContact.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectPaymentMethod): Renamed from
        didSelectPaymentMethod.
        (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Renamed to
        presenterWillValidateMerchant.
        (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Renamed to
        presenterDidAuthorizePayment.
        (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Renamed to
        presenterDidSelectShippingMethod.
        (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Renamed to
        presenterDidSelectShippingContact.
        (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Renamed to
        didSelectPaymentMethod.
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Changed WebPaymentCoordinatorProxy to
        subclass PaymentAuthorizationPresenter::Client.
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Removed WKPaymentAuthorizationViewControllerDelegate interface and declared some helper functions
        needed by PaymentAuthorizationPresenter.
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::toPKPaymentSummaryItemType): Removed static keyword.
        (WebKit::toDecimalNumber): Ditto.
        (WebKit::toPKPaymentSummaryItem): Ditto.
        (WebKit::toPKPaymentSummaryItems): Ditto.
        (WebKit::toPKShippingMethod): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Changed to call
        m_authorizationPresenter.
        (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): Ditto.
        (-[WKPaymentAuthorizationViewControllerDelegate initWithPaymentCoordinatorProxy:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate invalidate]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Deleted.
        (toShippingMethod): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
        (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): Deleted.
        (WebKit::toPKPaymentAuthorizationStatus): Moved to PaymentAuthorizationPresenter.mm.
        (WebKit::toPKPaymentErrorCode): Ditto.
        (WebKit::toNSError): Ditto.
        (WebKit::toNSErrors): Ditto.
        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Changed to present a
        PaymentAuthorizationPresenter rather than a PKPAVC.
        (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Changed to dismiss a
        PaymentAuthorizationPresenter rather than a PKPAVC.
        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Ditto.
        * SourcesCocoa.txt:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter): Added. Returns a new
        PaymentAuthorizationViewController.
        * WebKit.xcodeproj/project.pbxproj:

2019-03-07  Chris Dumez  <cdumez@apple.com>

        Regression(r242580) WebKit.NetworkProcessCrashWithPendingConnection API is crashing on iOS debug
        https://bugs.webkit.org/show_bug.cgi?id=195416

        Reviewed by Antti Koivisto.

        Drop ASSERT_NOT_REACHED() in WebPage::didCompletePageTransition() when the tree is still frozen due to
        LayerTreeFreezeReason::ProcessSuspended. As demonstrated by this API test, nothing prevents a load from
        completing and WebPage::didCompletePageTransition() to get called *after* WebProcess::prepareToSuspend()
        has been called. From the logging during the test, I can tell that WebProcess::processDidResume() gets
        called later on and the LayerTreeFreezeReason::ProcessSuspended freezing reason gets dropped, as expected.

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

2019-03-07  Chris Dumez  <cdumez@apple.com>

        Clean up / simplify ProcessAssertion code
        https://bugs.webkit.org/show_bug.cgi?id=195394

        Reviewed by Geoffrey Garen.

        Clean up / simplify ProcessAssertion code to facilitate its maintenance and make it
        less error-prone.

        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
        * UIProcess/ProcessAssertion.cpp:
        (WebKit::ProcessAssertion::ProcessAssertion):
        (WebKit::ProcessAssertion::setState):
        * UIProcess/ProcessAssertion.h:
        (WebKit::ProcessAssertion::Client::~Client):
        (WebKit::ProcessAssertion::setClient):
        (WebKit::ProcessAssertion::client):
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::didConnectToProcess):
        * UIProcess/ProcessThrottler.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (-[WKProcessAssertionBackgroundTaskManager dealloc]):
        (-[WKProcessAssertionBackgroundTaskManager addAssertionNeedingBackgroundTask:]):
        (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
        (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        (WebKit::ProcessAssertion::ProcessAssertion):
        (WebKit::ProcessAssertion::processAssertionWasInvalidated):
        (WebKit::ProcessAssertion::setState):
        (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
        (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
        (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
        (WebKit::ProcessAndUIAssertion::processAssertionWasInvalidated):