ChangeLog   [plain text]


2018-09-28  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r236571. rdar://problem/44852809

    [iOS] Allow access to VoiceServices features needed for accessibility
    https://bugs.webkit.org/show_bug.cgi?id=190019
    <rdar://problem/43621111>
    
    Reviewed by Chris Fleizach.
    
    Revise the sandbox to allow access to relevant WebSpeech features.
    
    * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236571 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [iOS] Allow access to VoiceServices features needed for accessibility
            https://bugs.webkit.org/show_bug.cgi?id=190019
            <rdar://problem/43621111>

            Reviewed by Chris Fleizach.

            Revise the sandbox to allow access to relevant WebSpeech features.

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

2018-09-21  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r236322. rdar://problem/44660342

    Whitelist two additional plugins
    https://bugs.webkit.org/show_bug.cgi?id=189832
    <rdar://problem/44628127>
    
    Reviewed by Brent Fulgham.
    
    * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
    (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236322 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Whitelist two additional plugins
            https://bugs.webkit.org/show_bug.cgi?id=189832
            <rdar://problem/44628127>

            Reviewed by Brent Fulgham.

            * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
            (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):

2018-09-21  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r236291. rdar://problem/44660342

    Allow additional plug-ins to run unsandboxed
    https://bugs.webkit.org/show_bug.cgi?id=189791
    <rdar://problem/44628127>
    
    Reviewed by Brent Fulgham.
    
    * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
    (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Allow additional plug-ins to run unsandboxed
            https://bugs.webkit.org/show_bug.cgi?id=189791
            <rdar://problem/44628127>

            Reviewed by Brent Fulgham.

            * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
            (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):

2018-09-19  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r235752. rdar://problem/44576797

    Don't pause playback when locking screen if video is being displayed on second screen.
    https://bugs.webkit.org/show_bug.cgi?id=189321
    
    Reviewed by Eric Carlson.
    
    Source/WebCore:
    
    Expand the existing behavior when AirPlaying to an external device to playing to a local
    external screen. Don't pause when the screen locks, and don't stop buffering in that mode either.
    
    Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass
    that observed value on to the media element.
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
    (WebCore::HTMLMediaElement::setPlayingOnSecondScreen):
    (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
    (WebCore::HTMLMediaElement::processingUserGestureForMedia const):
    (WebCore::HTMLMediaElement::mediaState const):
    (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
    (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const):
    (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
    (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted.
    (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted.
    * html/HTMLMediaElement.h:
    (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
    (WebCore::HTMLMediaElement::isPlayingToExternalTarget const):
    * html/MediaElementSession.cpp:
    (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted.
    * html/MediaElementSession.h:
    * platform/audio/PlatformMediaSession.h:
    (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
    (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const):
    (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted.
    (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted.
    * platform/cocoa/PlaybackSessionModel.h:
    * platform/cocoa/PlaybackSessionModelMediaElement.h:
    * platform/cocoa/PlaybackSessionModelMediaElement.mm:
    (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen):
    * platform/ios/WebAVPlayerController.mm:
    (-[WebAVPlayerController init]):
    (-[WebAVPlayerController dealloc]):
    (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
    
    Source/WebKit:
    
    Pass the "isPlayingOnSecondScreen" value across the process boundary.
    
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
    (WebKit::PlaybackSessionModelContext::setPlayingOnSecondScreen):
    (WebKit::PlaybackSessionManagerProxy::setPlayingOnSecondScreen):
    * WebProcess/cocoa/PlaybackSessionManager.h:
    * WebProcess/cocoa/PlaybackSessionManager.messages.in:
    * WebProcess/cocoa/PlaybackSessionManager.mm:
    (WebKit::PlaybackSessionManager::setPlayingOnSecondScreen):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Eric Carlson.

            Pass the "isPlayingOnSecondScreen" value across the process boundary.

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

2018-09-19  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r236086. rdar://problem/44576830

    Swipe snapshot can get stuck if swiping is disabled while it is visible
    https://bugs.webkit.org/show_bug.cgi?id=189667
    <rdar://problem/40367780>
    
    Reviewed by Simon Fraser.
    
    If navigation gestures are disabled while a swipe snapshot is visible,
    WKWebView will tear down the ViewGestureController, which means that
    the SnapshotRemovalTracker will no longer be around to ever remove
    the snapshot.
    
    It's currently very hard to write a test for this because we have
    yet to come up with a good mechanism for testing swiping on iOS.
    
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView setAllowsBackForwardNavigationGestures:]):
    Instead of tearing down the ViewGestureController when navigation
    gestures are disabled, just set a bit on it that disables gestures.
    
    * UIProcess/Cocoa/ViewGestureController.cpp:
    (WebKit::ViewGestureController::canSwipeInDirection const):
    * UIProcess/Cocoa/ViewGestureController.h:
    (WebKit::ViewGestureController::setSwipeGestureEnabled):
    (WebKit::ViewGestureController::isSwipeGestureEnabled):
    Add a bit to ViewGestureController that makes starting new gestures
    always fail, but allows e.g. snapshots from existing swipes to continue
    their usual behavior.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236086 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Swipe snapshot can get stuck if swiping is disabled while it is visible
            https://bugs.webkit.org/show_bug.cgi?id=189667
            <rdar://problem/40367780>

            Reviewed by Simon Fraser.

            If navigation gestures are disabled while a swipe snapshot is visible,
            WKWebView will tear down the ViewGestureController, which means that
            the SnapshotRemovalTracker will no longer be around to ever remove
            the snapshot.

            It's currently very hard to write a test for this because we have
            yet to come up with a good mechanism for testing swiping on iOS.

            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView setAllowsBackForwardNavigationGestures:]):
            Instead of tearing down the ViewGestureController when navigation
            gestures are disabled, just set a bit on it that disables gestures.

            * UIProcess/Cocoa/ViewGestureController.cpp:
            (WebKit::ViewGestureController::canSwipeInDirection const):
            * UIProcess/Cocoa/ViewGestureController.h:
            (WebKit::ViewGestureController::setSwipeGestureEnabled):
            (WebKit::ViewGestureController::isSwipeGestureEnabled):
            Add a bit to ViewGestureController that makes starting new gestures
            always fail, but allows e.g. snapshots from existing swipes to continue
            their usual behavior.

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235506. rdar://problem/44169670

    [macOS] Whitelist Network process features for VPN
    https://bugs.webkit.org/show_bug.cgi?id=189023
    <rdar://problem/43310000>
    
    Reviewed by Eric Carlson.
    
    CFNetwork needs access to some VPN preference files to configure networking, and
    need to be allowed to communicate with the VPN process from the Network Process
    sandbox.
    
    * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Eric Carlson.

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

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

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235569. rdar://problem/44169479

    Storage Access API: Maintain access through same-site navigations
    https://bugs.webkit.org/show_bug.cgi?id=188564
    <rdar://problem/43445160>
    
    Reviewed by Alex Christensen.
    
    Source/WebCore:
    
    Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
           http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html
    
    * dom/Document.h:
        Removed unused member variable m_hasFrameSpecificStorageAccess.
    * loader/DocumentLoader.cpp:
    (WebCore::DocumentLoader::willSendRequest):
    * loader/FrameLoaderClient.h:
    
    Source/WebKit:
    
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
        Now takes the current URL and the new URL as parameters
        and only clears out storage access if the navigation is
        cross-site, i.e. with differing eTLD+1s.
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
    
    LayoutTests:
    
    * http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame-expected.txt:
    * http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html:
        Added both a same-site and a cross-site navigation to the sub frame to test maintained and cleared access.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access-expected.txt: Copied from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html: Copied from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access-expected.txt: Renamed from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html: Renamed from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html.
    * http/tests/storageAccess/resources/get-cookies.php:
        Support for the new test scenarios.
    * http/tests/storageAccess/resources/self-navigating-frame-after-granted-access.html:
        Support for the new test scenarios.
    * platform/mac-wk2/TestExpectations:
        Marked the new and the renamed tests as [ Pass ].
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Alex Christensen.

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

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235251. rdar://problem/44209840

    [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
    https://bugs.webkit.org/show_bug.cgi?id=188829
    
    Reviewed by Tim Horton.
    
    Source/JavaScriptCore:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore:
    
    Test: http/tests/ssl/applepay/ApplePaySessionV4.html
    
    * Configurations/FeatureDefines.xcconfig:
    * testing/MockPaymentCoordinator.cpp:
    (WebCore::MockPaymentCoordinator::supportsVersion):
    
    Source/WebCore/PAL:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKit:
    
    * Configurations/FeatureDefines.xcconfig:
    * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
    (WebKit::WebPaymentCoordinator::supportsVersion):
    
    Source/WebKitLegacy/mac:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Tools:
    
    * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
    
    LayoutTests:
    
    * http/tests/ssl/applepay/ApplePaySession-expected.txt:
    * http/tests/ssl/applepay/ApplePaySession.html:
    * http/tests/ssl/applepay/ApplePaySessionV3-expected.txt:
    * http/tests/ssl/applepay/ApplePaySessionV3.html:
    * http/tests/ssl/applepay/ApplePaySessionV4-expected.txt: Added.
    * http/tests/ssl/applepay/ApplePaySessionV4.html: Added.
    * platform/mac-wk2/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235251 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Tim Horton.

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

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235209. rdar://problem/44169451

    The Storage Access API prompt should show the eTLD+1s, not the full host names
    https://bugs.webkit.org/show_bug.cgi?id=188830
    <rdar://problem/43380645>
    
    Reviewed by Brent Fulgham.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::requestStorageAccess):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Brent Fulgham.

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

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235145. rdar://problem/44169453

    Storage Access API: The call to ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal() should send eTLD+1s, not full host names
    https://bugs.webkit.org/show_bug.cgi?id=188783
    <rdar://problem/43559215>
    
    Reviewed by Alex Christensen.
    
    * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
    (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
        Now sends the eTLD+1 for the top frame and sub frame.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235145 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Alex Christensen.

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

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234719. rdar://problem/44169456

    Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
    https://bugs.webkit.org/show_bug.cgi?id=188427
    <rdar://problem/43064672>
    
    Reviewed by Wenson Hsieh.
    
    Speculatively fix more crashes seen under setSuggestions.
    
    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKFormInputSession isValid]):
    (-[WKFormInputSession setSuggestions:]):
    (-[WKFormInputSession invalidate]):
    Belt-and-suspenders fix: use WeakObjCPtr for WKFormInputSession's WKContentView reference.
    
    (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
    Invalidate the WKFormInputSession before replacing it; we theorize that
    there is a path in which we get here without having previously called stopAssistingNode.
    Most of the code is OK with this, but this leaves WKFormInputSession
    with a raw reference to WKContentView which can later become stale.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234719 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
            https://bugs.webkit.org/show_bug.cgi?id=188427
            <rdar://problem/43064672>

            Reviewed by Wenson Hsieh.

            Speculatively fix more crashes seen under setSuggestions.

            * UIProcess/ios/WKContentViewInteraction.mm:
            (-[WKFormInputSession isValid]):
            (-[WKFormInputSession setSuggestions:]):
            (-[WKFormInputSession invalidate]):
            Belt-and-suspenders fix: use WeakObjCPtr for WKFormInputSession's WKContentView reference.

            (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
            Invalidate the WKFormInputSession before replacing it; we theorize that
            there is a path in which we get here without having previously called stopAssistingNode.
            Most of the code is OK with this, but this leaves WKFormInputSession
            with a raw reference to WKContentView which can later become stale.

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234504. rdar://problem/44209851

    [iOS] Keyboard becomes unresponsive after pressing delete while pressing down on a character key with accents
    https://bugs.webkit.org/show_bug.cgi?id=188251
    <rdar://problem/37842108>
    
    Reviewed by Tim Horton.
    
    Source/WebKit:
    
    Fixes a bug in key event handling where invoking -handleKeyWebEvent:withCompletionHandler: from within the
    completion callback of a previous call to -handleKeyWebEvent:withCompletionHandler: would cause the completion
    callback to be cleared out prematurely. In some cases (as described in the title of this bug), UIKit exercises
    this codepath and subsequently hangs due to their completion block never getting invoked by WebKit.
    
    Test: KeyboardInputTests.CanHandleKeyEventInCompletionHandler
    
    * UIProcess/ios/WKContentViewInteraction.h:
    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
    (-[WKContentView _didHandleKeyEvent:eventWasHandled:]):
    
    Tools:
    
    Adds a new API test to verify that clients (in this case, UIKit) is allowed to invoke
    -handleKeyWebEvent:withCompletionHandler: within the completion block of a prior invocation.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm: Added.
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/ios/TestInputDelegate.h: Added.
    
    Pull some logic used to force an input session to start out from an existing API test file
    (WKWebViewAutofillTests) and into a separate helper class that is used by both the existing API tests and the
    new keyboard input test.
    
    * TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm:
    (-[AutofillTestView initWithFrame:]):
    (TestWebKitAPI::TEST):
    (-[TestInputDelegate init]): Deleted.
    (-[TestInputDelegate _webView:focusShouldStartInputSession:]): Deleted.
    * TestWebKitAPI/ios/UIKitSPI.h:
    
    Add some UIKit SPI utilized by the new API test.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234504 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [iOS] Keyboard becomes unresponsive after pressing delete while pressing down on a character key with accents
            https://bugs.webkit.org/show_bug.cgi?id=188251
            <rdar://problem/37842108>

            Reviewed by Tim Horton.

            Fixes a bug in key event handling where invoking -handleKeyWebEvent:withCompletionHandler: from within the
            completion callback of a previous call to -handleKeyWebEvent:withCompletionHandler: would cause the completion
            callback to be cleared out prematurely. In some cases (as described in the title of this bug), UIKit exercises
            this codepath and subsequently hangs due to their completion block never getting invoked by WebKit.

            Test: KeyboardInputTests.CanHandleKeyEventInCompletionHandler

            * UIProcess/ios/WKContentViewInteraction.h:
            * UIProcess/ios/WKContentViewInteraction.mm:
            (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
            (-[WKContentView _didHandleKeyEvent:eventWasHandled:]):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235133. rdar://problem/44144065

    Increment NetworkCache::Storage::lastStableVersion after r233742
    https://bugs.webkit.org/show_bug.cgi?id=188798
    <rdar://43561761>
    
    Reviewed by Geoffrey Garen.
    
    * NetworkProcess/cache/NetworkCacheStorage.h:
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

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

            Reviewed by Geoffrey Garen.

            * NetworkProcess/cache/NetworkCacheStorage.h:

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234908. rdar://problem/44144086

    [WinCairo] Unreviewed build fix after r234896.
    
    * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
    (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234908 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-15  Ross Kirsling  <ross.kirsling@sony.com>

            [WinCairo] Unreviewed build fix after r234896.

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

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234905. rdar://problem/44144059

    Can't share an app on AppStore to WeChat due to a release assert
    https://bugs.webkit.org/show_bug.cgi?id=188621
    <rdar://problem/43343976>
    
    Reviewed by Geoffrey Garen.
    
    Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
    is getting hit by third party applications on iOS in UI process.
    
    Source/WebCore:
    
    * platform/Timer.cpp:
    (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.
    
    Source/WebKit:
    
    * UIProcess/Cocoa/VersionChecks.h:
    (WebKit::SDKVersion::FirstWithMainThreadReleaseAssertionInWebPageProxy): Added. It's iOS 12 or macOS 10.14 Mojave.
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::isMainThreadOrCheckDisabled): Added. Returns true whether when we're in the main thread or if the app
    is not linked on or after iOS 12 or macOS 10.14 Mojave.
    (WebKit::globalPageMap):
    (WebKit::m_isInPrewarmedPool):
    (WebKit::WebProcessProxy::~WebProcessProxy):
    (WebKit::WebProcessProxy::shutDown):
    (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
    (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
    (WebKit::WebProcessProxy::didFinishLaunching):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Can't share an app on AppStore to WeChat due to a release assert
            https://bugs.webkit.org/show_bug.cgi?id=188621
            <rdar://problem/43343976>

            Reviewed by Geoffrey Garen.

            Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
            is getting hit by third party applications on iOS in UI process.

            * UIProcess/Cocoa/VersionChecks.h:
            (WebKit::SDKVersion::FirstWithMainThreadReleaseAssertionInWebPageProxy): Added. It's iOS 12 or macOS 10.14 Mojave.
            * UIProcess/WebProcessProxy.cpp:
            (WebKit::isMainThreadOrCheckDisabled): Added. Returns true whether when we're in the main thread or if the app
            is not linked on or after iOS 12 or macOS 10.14 Mojave.
            (WebKit::globalPageMap):
            (WebKit::m_isInPrewarmedPool):
            (WebKit::WebProcessProxy::~WebProcessProxy):
            (WebKit::WebProcessProxy::shutDown):
            (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
            (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
            (WebKit::WebProcessProxy::didFinishLaunching):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234896. rdar://problem/44144086

    NetworkCORSPreflightChecker should proceed in case of ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested even though the WebKit app is not implementing the didReceiveAuthenticationChallenge/didReceiveAuthenticationChallengeInFrame callback
    https://bugs.webkit.org/show_bug.cgi?id=188592
    <rdar://problem/43210331>
    
    Reviewed by Youenn Fablet.
    
    Do a canAuthenticateAgainstProtectionSpace check in NetworkCORSPreflightChecker like we do in NetworkLoad.
    Use CompletionHandlers to make the now 3 different canAuthenticateAgainstProtectionSpace checks look the same from the NetworkProcess.
    
    * NetworkProcess/NetworkCORSPreflightChecker.cpp:
    (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
    * NetworkProcess/NetworkCORSPreflightChecker.h:
    * NetworkProcess/NetworkDataTask.h:
    * NetworkProcess/NetworkLoad.cpp:
    (WebKit::NetworkLoad::didReceiveChallenge):
    * NetworkProcess/NetworkLoad.h:
    * NetworkProcess/NetworkProcess.cpp:
    (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
    (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
    * NetworkProcess/NetworkProcess.h:
    * NetworkProcess/NetworkResourceLoader.cpp:
    (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
    (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace): Deleted.
    * NetworkProcess/NetworkResourceLoader.h:
    * NetworkProcess/PingLoad.cpp:
    (WebKit::PingLoad::didReceiveChallenge):
    * NetworkProcess/PingLoad.h:
    * NetworkProcess/PreconnectTask.cpp:
    (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
    (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace): Deleted.
    * NetworkProcess/PreconnectTask.h:
    * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
    * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
    (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234896 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            NetworkCORSPreflightChecker should proceed in case of ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested even though the WebKit app is not implementing the didReceiveAuthenticationChallenge/didReceiveAuthenticationChallengeInFrame callback
            https://bugs.webkit.org/show_bug.cgi?id=188592
            <rdar://problem/43210331>

            Reviewed by Youenn Fablet.

            Do a canAuthenticateAgainstProtectionSpace check in NetworkCORSPreflightChecker like we do in NetworkLoad.
            Use CompletionHandlers to make the now 3 different canAuthenticateAgainstProtectionSpace checks look the same from the NetworkProcess.

            * NetworkProcess/NetworkCORSPreflightChecker.cpp:
            (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
            * NetworkProcess/NetworkCORSPreflightChecker.h:
            * NetworkProcess/NetworkDataTask.h:
            * NetworkProcess/NetworkLoad.cpp:
            (WebKit::NetworkLoad::didReceiveChallenge):
            * NetworkProcess/NetworkLoad.h:
            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
            (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
            * NetworkProcess/NetworkProcess.h:
            * NetworkProcess/NetworkResourceLoader.cpp:
            (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
            (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace): Deleted.
            * NetworkProcess/NetworkResourceLoader.h:
            * NetworkProcess/PingLoad.cpp:
            (WebKit::PingLoad::didReceiveChallenge):
            * NetworkProcess/PingLoad.h:
            * NetworkProcess/PreconnectTask.cpp:
            (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
            (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace): Deleted.
            * NetworkProcess/PreconnectTask.h:
            * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
            * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
            (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234873. rdar://problem/44144063

    isValidCSSSelector is unsafe to be called from a non-main thread
    https://bugs.webkit.org/show_bug.cgi?id=188581
    <rdar://problem/40517358>
    
    Reviewed by Sam Weinig.
    
    Source/WebCore:
    
    Parsing and determining whether the css selectors are valid is fast enough to do before
    hopping to the background thread for the slow NFA/DFA operations and writing to disk.
    Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings.
    
    * contentextensions/ContentExtensionCompiler.cpp:
    (WebCore::ContentExtensions::compileRuleList):
    * contentextensions/ContentExtensionCompiler.h:
    * contentextensions/ContentExtensionParser.cpp:
    (WebCore::ContentExtensions::isValidCSSSelector):
    (WebCore::ContentExtensions::loadEncodedRules):
    (WebCore::ContentExtensions::parseRuleList):
    * contentextensions/ContentExtensionParser.h:
    * contentextensions/ContentExtensionRule.cpp:
    (WebCore::ContentExtensions::Trigger::isolatedCopy const):
    (WebCore::ContentExtensions::Action::isolatedCopy const):
    * contentextensions/ContentExtensionRule.h:
    (WebCore::ContentExtensions::Trigger::isEmpty const):
    (WebCore::ContentExtensions::Trigger::operator== const):
    (WebCore::ContentExtensions::Action::Action):
    (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
    (WebCore::ContentExtensions::ContentExtensionRule::operator== const):
    (WebCore::ContentExtensions::vectorIsolatedCopy):
    
    Source/WebKit:
    
    * UIProcess/API/APIContentRuleListStore.cpp:
    (API::compiledToFile):
    (API::ContentRuleListStore::lookupContentRuleList):
    (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
    (API::ContentRuleListStore::compileContentRuleList):
    (API::ContentRuleListStore::removeContentRuleList):
    (API::ContentRuleListStore::getContentRuleListSource):
    * UIProcess/API/APIContentRuleListStore.h:
    * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
    
    Source/WTF:
    
    * wtf/Vector.h:
    (WTF::minCapacity>::isolatedCopy):
    
    Tools:
    
    * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
    (TestWebKitAPI::InMemoryCompiledContentExtension::create):
    (TestWebKitAPI::checkCompilerError):
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234873 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            isValidCSSSelector is unsafe to be called from a non-main thread
            https://bugs.webkit.org/show_bug.cgi?id=188581
            <rdar://problem/40517358>

            Reviewed by Sam Weinig.

            * UIProcess/API/APIContentRuleListStore.cpp:
            (API::compiledToFile):
            (API::ContentRuleListStore::lookupContentRuleList):
            (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
            (API::ContentRuleListStore::compileContentRuleList):
            (API::ContentRuleListStore::removeContentRuleList):
            (API::ContentRuleListStore::getContentRuleListSource):
            * UIProcess/API/APIContentRuleListStore.h:
            * UIProcess/API/Cocoa/WKContentRuleListStore.mm:

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234730. rdar://problem/44144081

    REGRESSION (r232083): WKWebView loses first-party cookies on iOS
    https://bugs.webkit.org/show_bug.cgi?id=188443
    <rdar://problem/42991584>
    
    Patch by Sihui Liu <sihui_liu@apple.com> on 2018-08-09
    Reviewed by Chris Dumez.
    
    Source/WebKit:
    
    Revert the change to set sharedCookieStorage for iOS as it is breaking Kayak.
    
    * NetworkProcess/NetworkProcess.h:
    * NetworkProcess/NetworkProcessCreationParameters.cpp:
    (WebKit::NetworkProcessCreationParameters::encode const):
    (WebKit::NetworkProcessCreationParameters::decode):
    * NetworkProcess/NetworkProcessCreationParameters.h:
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    (WebKit::WebProcessPool::platformInitializeNetworkProcess):
    
    Tools:
    
    Skip WebKit.WKHTTPCookieStoreWithoutProcessPool on iOS.
    
    * TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234730 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            REGRESSION (r232083): WKWebView loses first-party cookies on iOS
            https://bugs.webkit.org/show_bug.cgi?id=188443
            <rdar://problem/42991584>

            Reviewed by Chris Dumez.

            Revert the change to set sharedCookieStorage for iOS as it is breaking Kayak.

            * NetworkProcess/NetworkProcess.h:
            * NetworkProcess/NetworkProcessCreationParameters.cpp:
            (WebKit::NetworkProcessCreationParameters::encode const):
            (WebKit::NetworkProcessCreationParameters::decode):
            * NetworkProcess/NetworkProcessCreationParameters.h:
            * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
            (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
            * Shared/WebProcessCreationParameters.cpp:
            (WebKit::WebProcessCreationParameters::encode const):
            (WebKit::WebProcessCreationParameters::decode):
            * Shared/WebProcessCreationParameters.h:
            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
            (WebKit::WebProcessPool::platformInitializeWebProcess):
            (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234652. rdar://problem/43009928

    [macOS] Scrollbars are not visible when using 3rd party mouse
    https://bugs.webkit.org/show_bug.cgi?id=188372
    
    Reviewed by Simon Fraser.
    
    Source/WebCore/PAL:
    
    Added declaration of NSScrollerImpPair class method. This method updates all NSScrollerImpPairs
    with a new recommended scroller style.
    
    * pal/spi/mac/NSScrollerImpSPI.h:
    
    Source/WebKit:
    
    The scrollbars are not visible because they are not updated with the recommended scroller style
    when a 3rd party mouse is used. They still have the overlay style, but the system is
    recommending the legacy style in this case. The UI process is currently notifying the WebProcess
    about changes in the scroller style, but the current style is not set in the WebProcess on
    startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
    the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
    is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
    is called to update all NSScrollerImpPairs with the new recommended style. This method was
    previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
    this method. This has been manually tested by using a 3rd party mouse.
    
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    (WebKit::WebProcess::scrollerStylePreferenceChanged):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234652 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [macOS] Scrollbars are not visible when using 3rd party mouse
            https://bugs.webkit.org/show_bug.cgi?id=188372

            Reviewed by Simon Fraser.

            The scrollbars are not visible because they are not updated with the recommended scroller style
            when a 3rd party mouse is used. They still have the overlay style, but the system is
            recommending the legacy style in this case. The UI process is currently notifying the WebProcess
            about changes in the scroller style, but the current style is not set in the WebProcess on
            startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
            the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
            is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
            is called to update all NSScrollerImpPairs with the new recommended style. This method was
            previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
            this method. This has been manually tested by using a 3rd party mouse.

            * Shared/WebProcessCreationParameters.cpp:
            (WebKit::WebProcessCreationParameters::encode const):
            (WebKit::WebProcessCreationParameters::decode):
            * Shared/WebProcessCreationParameters.h:
            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
            (WebKit::WebProcessPool::platformInitializeWebProcess):
            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess):
            (WebKit::WebProcess::scrollerStylePreferenceChanged):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234626. rdar://problem/43009898

    Regression(NetworkLoadChecker): CORS preflights are no longer able to deal with client certificate authentication
    https://bugs.webkit.org/show_bug.cgi?id=188355
    <rdar://problem/42546319>
    
    Reviewed by Alex Christensen.
    
    Before we started using the NetworkLoadChecker to do CORS-preflighting in the Network process, challenges would
    use the NetworkLoad::completeAuthenticationChallenge() code path with isAllowedToAskUserForCredentials to set
    to false. This would call:
    1. completionHandler(AuthenticationChallengeDisposition::UseCredential, { }); for TLS handshakes (server trust
       evaluation & client certification authentication)
    2. NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge() otherwise
    
    However, NetworkCORSPreflightChecker::didReceiveChallenge() was behaving differently and calling:
    1. completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { }); for server trust evaluations
    2. completionHandler(AuthenticationChallengeDisposition::Cancel, { }); otherwise
    
    Restore previous behavior by aligning NetworkCORSPreflightChecker::didReceiveChallenge() with
    NetworkLoad::completeAuthenticationChallenge() when isAllowedToAskUserForCredentials is set to false. This means
    we end up asking the AuthenticationManager for client certificate authentication instead or cancelling the
    preflight.
    
    This fixes CORS-preflighting on some internal sites.
    
    * NetworkProcess/NetworkCORSPreflightChecker.cpp:
    (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
    * NetworkProcess/NetworkCORSPreflightChecker.h:
    * NetworkProcess/NetworkLoadChecker.cpp:
    (WebKit::NetworkLoadChecker::NetworkLoadChecker):
    (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
    * NetworkProcess/NetworkLoadChecker.h:
    * NetworkProcess/NetworkResourceLoader.cpp:
    * NetworkProcess/PingLoad.cpp:
    (WebKit::PingLoad::PingLoad):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234626 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Regression(NetworkLoadChecker): CORS preflights are no longer able to deal with client certificate authentication
            https://bugs.webkit.org/show_bug.cgi?id=188355
            <rdar://problem/42546319>

            Reviewed by Alex Christensen.

            Before we started using the NetworkLoadChecker to do CORS-preflighting in the Network process, challenges would
            use the NetworkLoad::completeAuthenticationChallenge() code path with isAllowedToAskUserForCredentials to set
            to false. This would call:
            1. completionHandler(AuthenticationChallengeDisposition::UseCredential, { }); for TLS handshakes (server trust
               evaluation & client certification authentication)
            2. NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge() otherwise

            However, NetworkCORSPreflightChecker::didReceiveChallenge() was behaving differently and calling:
            1. completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { }); for server trust evaluations
            2. completionHandler(AuthenticationChallengeDisposition::Cancel, { }); otherwise

            Restore previous behavior by aligning NetworkCORSPreflightChecker::didReceiveChallenge() with
            NetworkLoad::completeAuthenticationChallenge() when isAllowedToAskUserForCredentials is set to false. This means
            we end up asking the AuthenticationManager for client certificate authentication instead or cancelling the
            preflight.

            This fixes CORS-preflighting on some internal sites.

            * NetworkProcess/NetworkCORSPreflightChecker.cpp:
            (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
            * NetworkProcess/NetworkCORSPreflightChecker.h:
            * NetworkProcess/NetworkLoadChecker.cpp:
            (WebKit::NetworkLoadChecker::NetworkLoadChecker):
            (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
            * NetworkProcess/NetworkLoadChecker.h:
            * NetworkProcess/NetworkResourceLoader.cpp:
            * NetworkProcess/PingLoad.cpp:
            (WebKit::PingLoad::PingLoad):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234611. rdar://problem/43009906

    Fix IPC::Connection leak in StorageManager
    https://bugs.webkit.org/show_bug.cgi?id=188321
    <rdar://problem/42748485>
    
    Reviewed by Alex Christensen.
    
    When a StorageMap is destroyed on WebContent process side, StorageManager::destroyStorageMap()
    gets called via IPC with a (IPC::Connection, StorageMapID) pair. Normally, it removes this
    pair from m_storageAreasByConnection. However, if this is a *transient* StorageMap (sessionStorage),
    then we keep the pair in the map and we merely remove the StorageMapID as a listener from the
    StorageArea. We do this so that:
    1. The StorageArea stays alive so that it can be reused later on for the same security origin, on
       the same IPC::Connection (logic for this is in StorageManager::createTransientLocalStorageMap()
    2. Removing the StorageMapID as a listener from the StorageArea is important because
       StorageArea::m_eventListeners holds a strong reference to the IPC::Connection in a std::pair
       with the StorageMapID (HashSet<std::pair<RefPtr<IPC::Connection>, uint64_t>> m_eventListeners).
    
    As mentioned in 1 above, in StorageManager::createTransientLocalStorageMap(), there is logic to
    check if there is already an existing StorageArea for the given IPC::Connection that is transient
    and is for the same security origin. In this case, we could avoid constructing a new StorageArea
    and we would:
    1. Add a new entry to m_storageAreasByConnection with the key (connection, newStorageMapID), using
       same same StorageArea as value.
    2. Remove the previous (connection, oldStorageMapID) key from m_storageAreasByConnection.
    
    Step 2 here is wrong and is updated in this patch. It is only safe to remove the previous
    (connection, oldStorageMapID) if this oldStorageMapID no longer exists (i.e. destroyStorageMap()
    was already called for it). This patch thus adds a check before removing (connection, oldStorageMapID)
    from the HashMap to make sure that the oldStorageMapID is no longer a listener of the StorageArea).
    
    This would cause leaks in the following case:
    1. We construct a StorageArea for (connection1, storageMapId1)
    2. We ask for a StorageArea for (connection1, storageMapId2) and decide to reuse the existing StorageArea
       since it has the same SecurityOrigin.
    3. As a result of step2, we would remove (connection1, storageMapId1) from m_storageAreasByConnection
       and add (connection1, storageMapId2), even though there is still a StorageMap with storageMapId1
       on WebContent process side.
    4. Later on, we would try to call destroyStorageMap(connection1, storageMap1), it would fail to find
       it in m_storageAreasByConnection and return early. It would therefore fail to remove storageMapId1
       as a listener of the StorageArea which still exists.
    -> This would leak the IPC::Connection that there would be a std::pair<RefPtr<IPC::Connection>, StorageMapID>
       with value (connection1, storageMap1) which would get leaked and it would ref the IPC::Connection.
    
    This code should really be refactored to be less leak prone but I have kept the patch minimal for now
    to facilitate cherry-picking.
    
    Note that this would reproduce very easily on sina.com.cn, when clicking bold links at the top, which
    opens new tabs to different pages in the same WebContent process. When closing all Safari windows, the
    IPC::Connection for this WebContent process would stay alive.
    
    * UIProcess/WebStorage/StorageManager.cpp:
    (WebKit::StorageManager::StorageArea::hasListener const):
    (WebKit::StorageManager::createTransientLocalStorageMap):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234611 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Fix IPC::Connection leak in StorageManager
            https://bugs.webkit.org/show_bug.cgi?id=188321
            <rdar://problem/42748485>

            Reviewed by Alex Christensen.

            When a StorageMap is destroyed on WebContent process side, StorageManager::destroyStorageMap()
            gets called via IPC with a (IPC::Connection, StorageMapID) pair. Normally, it removes this
            pair from m_storageAreasByConnection. However, if this is a *transient* StorageMap (sessionStorage),
            then we keep the pair in the map and we merely remove the StorageMapID as a listener from the
            StorageArea. We do this so that:
            1. The StorageArea stays alive so that it can be reused later on for the same security origin, on
               the same IPC::Connection (logic for this is in StorageManager::createTransientLocalStorageMap()
            2. Removing the StorageMapID as a listener from the StorageArea is important because
               StorageArea::m_eventListeners holds a strong reference to the IPC::Connection in a std::pair
               with the StorageMapID (HashSet<std::pair<RefPtr<IPC::Connection>, uint64_t>> m_eventListeners).

            As mentioned in 1 above, in StorageManager::createTransientLocalStorageMap(), there is logic to
            check if there is already an existing StorageArea for the given IPC::Connection that is transient
            and is for the same security origin. In this case, we could avoid constructing a new StorageArea
            and we would:
            1. Add a new entry to m_storageAreasByConnection with the key (connection, newStorageMapID), using
               same same StorageArea as value.
            2. Remove the previous (connection, oldStorageMapID) key from m_storageAreasByConnection.

            Step 2 here is wrong and is updated in this patch. It is only safe to remove the previous
            (connection, oldStorageMapID) if this oldStorageMapID no longer exists (i.e. destroyStorageMap()
            was already called for it). This patch thus adds a check before removing (connection, oldStorageMapID)
            from the HashMap to make sure that the oldStorageMapID is no longer a listener of the StorageArea).

            This would cause leaks in the following case:
            1. We construct a StorageArea for (connection1, storageMapId1)
            2. We ask for a StorageArea for (connection1, storageMapId2) and decide to reuse the existing StorageArea
               since it has the same SecurityOrigin.
            3. As a result of step2, we would remove (connection1, storageMapId1) from m_storageAreasByConnection
               and add (connection1, storageMapId2), even though there is still a StorageMap with storageMapId1
               on WebContent process side.
            4. Later on, we would try to call destroyStorageMap(connection1, storageMap1), it would fail to find
               it in m_storageAreasByConnection and return early. It would therefore fail to remove storageMapId1
               as a listener of the StorageArea which still exists.
            -> This would leak the IPC::Connection that there would be a std::pair<RefPtr<IPC::Connection>, StorageMapID>
               with value (connection1, storageMap1) which would get leaked and it would ref the IPC::Connection.

            This code should really be refactored to be less leak prone but I have kept the patch minimal for now
            to facilitate cherry-picking.

            Note that this would reproduce very easily on sina.com.cn, when clicking bold links at the top, which
            opens new tabs to different pages in the same WebContent process. When closing all Safari windows, the
            IPC::Connection for this WebContent process would stay alive.

            * UIProcess/WebStorage/StorageManager.cpp:
            (WebKit::StorageManager::StorageArea::hasListener const):
            (WebKit::StorageManager::createTransientLocalStorageMap):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234651. rdar://problem/43009912

    [Wi-Fi Assertions] suspendWiFiAssertions() should be able to delay sending ProcessReadyToSuspend
    https://bugs.webkit.org/show_bug.cgi?id=188373
    <rdar://problem/42857398>
    
    Reviewed by Tim Horton.
    
    * NetworkProcess/NetworkProcess.cpp:
    (WebKit::NetworkProcess::actualPrepareToSuspend):
    * NetworkProcess/NetworkProcess.h:
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::platformPrepareToSuspend):
    (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
    * NetworkProcess/curl/NetworkProcessCurl.cpp:
    (WebKit::NetworkProcess::platformPrepareToSuspend):
    * NetworkProcess/soup/NetworkProcessSoup.cpp:
    (WebKit::NetworkProcess::platformPrepareToSuspend):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234651 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [Wi-Fi Assertions] suspendWiFiAssertions() should be able to delay sending ProcessReadyToSuspend
            https://bugs.webkit.org/show_bug.cgi?id=188373
            <rdar://problem/42857398>

            Reviewed by Tim Horton.

            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::actualPrepareToSuspend):
            * NetworkProcess/NetworkProcess.h:
            * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
            (WebKit::NetworkProcess::platformPrepareToSuspend):
            (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
            * NetworkProcess/curl/NetworkProcessCurl.cpp:
            (WebKit::NetworkProcess::platformPrepareToSuspend):
            * NetworkProcess/soup/NetworkProcessSoup.cpp:
            (WebKit::NetworkProcess::platformPrepareToSuspend):

2018-08-01  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234486. rdar://problem/42844004

    Make sure cookies get flushed to disk before exiting or suspending the network process
    https://bugs.webkit.org/show_bug.cgi?id=188241
    <rdar://problem/42831831>
    
    Reviewed by Alex Christensen and Geoffrey Garen.
    
    Make sure cookies get flushed to disk before exiting or suspending the network process,
    to make sure they do not get lost.
    
    * NetworkProcess/NetworkProcess.cpp:
    (WebKit::NetworkProcess::didClose):
    (WebKit::NetworkProcess::actualPrepareToSuspend):
    (WebKit::NetworkProcess::platformSyncAllCookies):
    * NetworkProcess/NetworkProcess.h:
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::syncAllCookies):
    (WebKit::NetworkProcess::platformSyncAllCookies):
    * Shared/ChildProcess.cpp:
    (WebKit::ChildProcess::didClose):
    (WebKit::callExitNow):
    (WebKit::callExitSoon):
    (WebKit::ChildProcess::initialize):
    (WebKit::didCloseOnConnectionWorkQueue): Deleted.
    * Shared/ChildProcess.h:
    (WebKit::ChildProcess::shouldCallExitWhenConnectionIsClosed const):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234486 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Make sure cookies get flushed to disk before exiting or suspending the network process
            https://bugs.webkit.org/show_bug.cgi?id=188241
            <rdar://problem/42831831>

            Reviewed by Alex Christensen and Geoffrey Garen.

            Make sure cookies get flushed to disk before exiting or suspending the network process,
            to make sure they do not get lost.

            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::didClose):
            (WebKit::NetworkProcess::actualPrepareToSuspend):
            (WebKit::NetworkProcess::platformSyncAllCookies):
            * NetworkProcess/NetworkProcess.h:
            * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
            (WebKit::NetworkProcess::syncAllCookies):
            (WebKit::NetworkProcess::platformSyncAllCookies):
            * Shared/ChildProcess.cpp:
            (WebKit::ChildProcess::didClose):
            (WebKit::callExitNow):
            (WebKit::callExitSoon):
            (WebKit::ChildProcess::initialize):
            (WebKit::didCloseOnConnectionWorkQueue): Deleted.
            * Shared/ChildProcess.h:
            (WebKit::ChildProcess::shouldCallExitWhenConnectionIsClosed const):

2018-08-01  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234384. rdar://problem/42843520

    REGRESSION (r230817): Terrible performance when selecting text on Stash code review
    https://bugs.webkit.org/show_bug.cgi?id=188144
    <rdar://problem/42642489>
    
    Reviewed by Darin Adler.
    
    After r230817, mouse events were serially dispatched to the web process and handled before the subsequent mouse
    event. However, this resulted in rapid-fire mouse move events filling up the mouse event queue in the case where
    mouse move events were being handled by the web process at a slower rate than the UI process was enqueueing
    them. To mitigate this, r231511 introduced a mechanism for replacing the most recently enqueued mouse move event
    with an incoming mouse move event.
    
    However, when a user with a force-click-enabled trackpad performs a mouse drag, a rapid stream of
    "mouseforcechanged" events is interleaved alongside the stream of "mousemove" events. This renders r231511
    ineffective, since the most recently queued event is often a "mouseforcechanged" event instead of a "mousemove".
    On the stash code review page, this can result in hundreds of mouse events being backed up in the mouse event
    queue, causing perceived slowness when selecting text.
    
    To fix this, we extend the mechanism introduced in r231511, such that it is capable of replacing both
    "mouseforcechanged" and "mousemove" events in the queue. Rather than consider only the most recently queued
    item, we instead find the most recently queued event that matches the type of the incoming event, remove it from
    the queue, and then append the incoming event to the end of the queue. To avoid the risk of removing the only
    "mousemove" or "mouseforcechanged" event in the middle of a mouse down and mouse up, we also bail when searching
    backwards for an event to replace if we come across any event that is neither of these types.
    
    This effectively throttles the rate at which mouseforcechanged or mousemove events are dispatched when a user
    with force-click-enabled hardware clicks and drags the mouse across the page.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::removeOldRedundantEvent):
    (WebKit::WebPageProxy::handleMouseEvent):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234384 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-30  Wenson Hsieh  <wenson_hsieh@apple.com>

            REGRESSION (r230817): Terrible performance when selecting text on Stash code review
            https://bugs.webkit.org/show_bug.cgi?id=188144
            <rdar://problem/42642489>

            Reviewed by Darin Adler.

            After r230817, mouse events were serially dispatched to the web process and handled before the subsequent mouse
            event. However, this resulted in rapid-fire mouse move events filling up the mouse event queue in the case where
            mouse move events were being handled by the web process at a slower rate than the UI process was enqueueing
            them. To mitigate this, r231511 introduced a mechanism for replacing the most recently enqueued mouse move event
            with an incoming mouse move event.

            However, when a user with a force-click-enabled trackpad performs a mouse drag, a rapid stream of
            "mouseforcechanged" events is interleaved alongside the stream of "mousemove" events. This renders r231511
            ineffective, since the most recently queued event is often a "mouseforcechanged" event instead of a "mousemove".
            On the stash code review page, this can result in hundreds of mouse events being backed up in the mouse event
            queue, causing perceived slowness when selecting text.

            To fix this, we extend the mechanism introduced in r231511, such that it is capable of replacing both
            "mouseforcechanged" and "mousemove" events in the queue. Rather than consider only the most recently queued
            item, we instead find the most recently queued event that matches the type of the incoming event, remove it from
            the queue, and then append the incoming event to the end of the queue. To avoid the risk of removing the only
            "mousemove" or "mouseforcechanged" event in the middle of a mouse down and mouse up, we also bail when searching
            backwards for an event to replace if we come across any event that is neither of these types.

            This effectively throttles the rate at which mouseforcechanged or mousemove events are dispatched when a user
            with force-click-enabled hardware clicks and drags the mouse across the page.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::removeOldRedundantEvent):
            (WebKit::WebPageProxy::handleMouseEvent):

2018-07-31  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234447. rdar://problem/42802126

    REGRESSION (r231107): MoviStar+ launches to a blank black screen
    https://bugs.webkit.org/show_bug.cgi?id=188139
    
    Reviewed by Brent Fulgham.
    
    Source/WebCore:
    
    For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
    r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
    targeted fix that will fix the affected app until they update.  
    
    I manually verified this fixes the app.
    
    * loader/DocumentThreadableLoader.cpp:
    (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::applicationSDKVersionOverride):
    (WebCore::setApplicationSDKVersion):
    (WebCore::applicationSDKVersion):
    (WebCore::IOSApplication::isMoviStarPlus):
    
    Source/WebKit:
    
    Add infrastructure to check UIProcess SDK from the WebProcess and NetworkProcess for linked-on-or-after checks.
    
    * NetworkProcess/NetworkProcessCreationParameters.cpp:
    (WebKit::NetworkProcessCreationParameters::encode const):
    (WebKit::NetworkProcessCreationParameters::decode):
    * NetworkProcess/NetworkProcessCreationParameters.h:
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    (WebKit::WebProcessPool::platformInitializeNetworkProcess):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234447 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-31  Alex Christensen  <achristensen@webkit.org>

            REGRESSION (r231107): MoviStar+ launches to a blank black screen
            https://bugs.webkit.org/show_bug.cgi?id=188139

            Reviewed by Brent Fulgham.

            Add infrastructure to check UIProcess SDK from the WebProcess and NetworkProcess for linked-on-or-after checks.

            * NetworkProcess/NetworkProcessCreationParameters.cpp:
            (WebKit::NetworkProcessCreationParameters::encode const):
            (WebKit::NetworkProcessCreationParameters::decode):
            * NetworkProcess/NetworkProcessCreationParameters.h:
            * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
            (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
            * Shared/WebProcessCreationParameters.cpp:
            (WebKit::WebProcessCreationParameters::encode const):
            (WebKit::WebProcessCreationParameters::decode):
            * Shared/WebProcessCreationParameters.h:
            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
            (WebKit::WebProcessPool::platformInitializeWebProcess):
            (WebKit::WebProcessPool::platformInitializeNetworkProcess):
            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess):

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Revert r233926. rdar://problem/42354941

2018-07-30  Kocsen Chung  <kocsen_chung@apple.com>

        Revert r233925. rdar://problem/42354959

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Revert r234081. rdar://problem/42490080

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234369. rdar://problem/42736179

    Potential null dereference under WebPage::applicationDidBecomeActive()
    https://bugs.webkit.org/show_bug.cgi?id=188170
    <rdar://problem/37493418>
    
    Reviewed by Wenson Hsieh.
    
    WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
    until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
    handlers.
    
    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::WebPage::applicationDidEnterBackground):
    (WebKit::WebPage::applicationWillEnterForeground):
    (WebKit::WebPage::applicationDidBecomeActive):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234369 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Potential null dereference under WebPage::applicationDidBecomeActive()
            https://bugs.webkit.org/show_bug.cgi?id=188170
            <rdar://problem/37493418>

            Reviewed by Wenson Hsieh.

            WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
            until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
            handlers.

            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::WebPage::applicationDidEnterBackground):
            (WebKit::WebPage::applicationWillEnterForeground):
            (WebKit::WebPage::applicationDidBecomeActive):

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234349. rdar://problem/42721129

    [Wi-Fi Assertions] Pass a ResumptionReason to resumeWiFiAssertions
    https://bugs.webkit.org/show_bug.cgi?id=188142
    <rdar://problem/42628842>
    
    Reviewed by Darin Adler.
    
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::platformProcessDidResume):
    (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234349 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-28  Andy Estes  <aestes@apple.com>

            [Wi-Fi Assertions] Pass a ResumptionReason to resumeWiFiAssertions
            https://bugs.webkit.org/show_bug.cgi?id=188142
            <rdar://problem/42628842>

            Reviewed by Darin Adler.

            * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
            (WebKit::NetworkProcess::platformProcessDidResume):
            (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234330. rdar://problem/42721217

    Be more conservative with compositing layer creation when memory is low
    https://bugs.webkit.org/show_bug.cgi?id=187866
    rdar://problem/42366345
    
    Reviewed by Zalan Bujtas.
    
    Source/WebCore:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    Test: compositing/layer-creation/compositing-policy.html
    
    * page/Page.h:
    (WebCore::Page::compositingPolicyOverride const):
    (WebCore::Page::setCompositingPolicyOverride):
    * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
    (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
    * platform/graphics/transforms/Matrix3DTransformOperation.h:
    * platform/graphics/transforms/PerspectiveTransformOperation.h:
    * platform/graphics/transforms/RotateTransformOperation.h:
    * platform/graphics/transforms/ScaleTransformOperation.h:
    * platform/graphics/transforms/TransformOperation.h:
    (WebCore::TransformOperation::isRepresentableIn2D const):
    * platform/graphics/transforms/TransformOperations.h:
    (WebCore::TransformOperations::has3DOperation const):
    (WebCore::TransformOperations::isRepresentableIn2D const):
    * platform/graphics/transforms/TranslateTransformOperation.h:
    * rendering/RenderLayerBacking.cpp:
    (WebCore::RenderLayerBacking::updateGeometry):
    * rendering/RenderLayerCompositor.cpp:
    (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
    (WebCore::RenderLayerCompositor::updateCompositingPolicy):
    (WebCore::RenderLayerCompositor::updateCompositingLayers):
    (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
    (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
    (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
    (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
    (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
    (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
    (WebCore::operator<<):
    * rendering/RenderLayerCompositor.h:
    * testing/Internals.cpp:
    (WebCore::Internals::setCompositingPolicyOverride):
    (WebCore::Internals::compositingPolicyOverride const):
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
    (WKBundlePageSetCompositingPolicyOverride):
    * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
    
    Source/WTF:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    * wtf/MemoryPressureHandler.cpp:
    (WTF::thresholdForPolicy):
    (WTF::MemoryPressureHandler::currentMemoryUsagePolicy):
    * wtf/MemoryPressureHandler.h:
    
    Tools:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::InjectedBundlePage::prepare):
    
    LayoutTests:
    
    * compositing/layer-creation/compositing-policy-expected.txt: Added.
    * compositing/layer-creation/compositing-policy.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Be more conservative with compositing layer creation when memory is low
            https://bugs.webkit.org/show_bug.cgi?id=187866
            rdar://problem/42366345

            Reviewed by Zalan Bujtas.

            When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
            compositing layers. We avoid compositing for these situations:
            1. Layers with 3D transforms which are affine (like translateZ(0)).
            2. Layers with will-change
            3. Layers for canvases (other than WebGL/WebGPU)

            We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
            falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
            Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.

            Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
            flakily falling into a different mode, and so that we can impose the conservative
            mode for testing.

            * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
            (WKBundlePageSetCompositingPolicyOverride):
            * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234326. rdar://problem/42721215

    Use SPI to compute the jetsam limit on iOS instead of hardcoding 840MB
    https://bugs.webkit.org/show_bug.cgi?id=188091
    <rdar://problem/42647697>
    
    Reviewed by Simon Fraser.
    
    Source/bmalloc:
    
    We want bmalloc to dynamically adapt to the jetsam limit of the process
    it's running in. WTF::ramSize() is based off bmalloc's availableMemory,
    so it will now reflect the result of the real jetsam limit when we can
    read it.
    
    Reading the jetsam limit requires an entitlement, so this patch opts in
    the WebContent/Storage/Network processes. We fall back to 840MB (the
    old hard coded value) when the SPI call fails (e.g, when we're in a
    process without the proper entitlement).
    
    * bmalloc.xcodeproj/project.pbxproj:
    * bmalloc/AvailableMemory.cpp:
    (bmalloc::jetsamLimit):
    (bmalloc::computeAvailableMemory):
    * bmalloc/darwin/MemoryStatusSPI.h: Added.
    
    Source/WebKit:
    
    Give the Network/Storage/WebContent process the com.apple.private.memorystatus
    entitlement. This allows them to read the process jetsam limit.
    
    * Configurations/Databases-iOS.entitlements:
    * Configurations/Network-iOS.entitlements:
    * Configurations/WebContent-iOS.entitlements:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234326 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-27  Saam Barati  <sbarati@apple.com>

            Use SPI to compute the jetsam limit on iOS instead of hardcoding 840MB
            https://bugs.webkit.org/show_bug.cgi?id=188091
            <rdar://problem/42647697>

            Reviewed by Simon Fraser.

            Give the Network/Storage/WebContent process the com.apple.private.memorystatus
            entitlement. This allows them to read the process jetsam limit.

            * Configurations/Databases-iOS.entitlements:
            * Configurations/Network-iOS.entitlements:
            * Configurations/WebContent-iOS.entitlements:

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234262. rdar://problem/42650389

    Disable Dark Mode in the Plugin process to avoid rendering issues
    https://bugs.webkit.org/show_bug.cgi?id=188059
    <rdar://problem/42369281>
    
    Reviewed by Tim Horton.
    
    Plugins generally do not support dark mode and this causes rendering issues so
    disable dark mode in the plugin process.
    
    * PluginProcess/mac/PluginProcessMac.mm:
    (WebKit::PluginProcess::platformInitializePluginProcess):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234262 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-26  Chris Dumez  <cdumez@apple.com>

            Disable Dark Mode in the Plugin process to avoid rendering issues
            https://bugs.webkit.org/show_bug.cgi?id=188059
            <rdar://problem/42369281>

            Reviewed by Tim Horton.

            Plugins generally do not support dark mode and this causes rendering issues so
            disable dark mode in the plugin process.

            * PluginProcess/mac/PluginProcessMac.mm:
            (WebKit::PluginProcess::platformInitializePluginProcess):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234223. rdar://problem/42650367

    [macOS] Update sandboxes for revised OpenCL calls and streaming media
    https://bugs.webkit.org/show_bug.cgi?id=188013
    <rdar://problem/42594262>
    
    Reviewed by Eric Carlson.
    
    Testing logs from recent Mojave builds shows that OpenCL is checking more CPU-specific values as part of WebKit
    painting operations. We need to allow these checks in the sandbox to support these more optimized drawing operations.
    
    I also corrected some sandbox violations I found while investigating streaming media issues.
    
    * WebProcess/com.apple.WebProcess.sb.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [macOS] Update sandboxes for revised OpenCL calls and streaming media
            https://bugs.webkit.org/show_bug.cgi?id=188013
            <rdar://problem/42594262>

            Reviewed by Eric Carlson.

            Testing logs from recent Mojave builds shows that OpenCL is checking more CPU-specific values as part of WebKit
            painting operations. We need to allow these checks in the sandbox to support these more optimized drawing operations.

            I also corrected some sandbox violations I found while investigating streaming media issues.

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

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234081. rdar://problem/42490080

    REGRESSION(r233925): Can't go into PiP twice
    https://bugs.webkit.org/show_bug.cgi?id=187876
    <rdar://problem/42444520>
    
    Reviewed by Jon Lee.
    
    We fail to enter PiP the second time because the video fullscreen interface no longer has a
    model, and so gives a contentSize of 0x0. This happens because we disassociate the
    interface from the model in didCleanupFullscreen. However, the interface and model can still
    be re-used if they're kept alive by another client. We should delay disassociating the model
    from the interface until just before the model is destroyed in removeClientForContext.
    
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenManagerProxy::removeClientForContext):
    (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Jer Noble  <jer.noble@apple.com>

            REGRESSION(r233925): Can't go into PiP twice
            https://bugs.webkit.org/show_bug.cgi?id=187876
            <rdar://problem/42444520>

            Reviewed by Jon Lee.

            We fail to enter PiP the second time because the video fullscreen interface no longer has a
            model, and so gives a contentSize of 0x0. This happens because we disassociate the
            interface from the model in didCleanupFullscreen. However, the interface and model can still
            be re-used if they're kept alive by another client. We should delay disassociating the model
            from the interface until just before the model is destroyed in removeClientForContext.

            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
            (WebKit::VideoFullscreenManagerProxy::removeClientForContext):
            (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233926. rdar://problem/42354941

    PiP from Element Fullscreen should match AVKit's behavior
    https://bugs.webkit.org/show_bug.cgi?id=187623
    Source/WebCore:
    
    Reviewed by Jon Lee.
    
    PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    
    Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
    
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
    
    Add VideoFullscreenModelClient virutal methods for PiP change notifications:
    
    * platform/cocoa/VideoFullscreenModel.h:
    (WebCore::VideoFullscreenModelClient::hasVideoChanged):
    (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
    (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
    * platform/cocoa/VideoFullscreenModelVideoElement.h:
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::willExitPictureInPicture):
    (VideoFullscreenModelVideoElement::didExitPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
    * platform/ios/VideoFullscreenInterfaceAVKit.h:
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (-[WebAVPlayerLayer layoutSublayers]):
    (-[WebAVPlayerLayer resolveBounds]):
    (-[WebAVPlayerLayer setVideoGravity:]):
    (VideoFullscreenInterfaceAVKit::setupFullscreen):
    (VideoFullscreenInterfaceAVKit::presentingViewController):
    (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
    (VideoFullscreenInterfaceAVKit::doSetup):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::willEnterPictureInPicture):
    (VideoFullscreenControllerContext::didEnterPictureInPicture):
    (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
    (VideoFullscreenControllerContext::willExitPictureInPicture):
    (VideoFullscreenControllerContext::didExitPictureInPicture):
    (VideoFullscreenControllerContext::failedToExitPictureInPicture):
    * platform/mac/VideoFullscreenInterfaceMac.h:
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
    (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
    
    Source/WebCore/PAL:
    
    Reviewed by Jon Lee.
    
    * pal/spi/mac/PIPSPI.h:
    
    Source/WebKit:
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
    (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
    (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
    (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
    (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenViewController initWithWebView:]):
    (-[WKFullScreenViewController dealloc]):
    (-[WKFullScreenViewController videoControlsManagerDidChange]):
    (-[WKFullScreenViewController ensurePiPAnimator]):
    (-[WKFullScreenViewController willEnterPictureInPicture]):
    (-[WKFullScreenViewController didEnterPictureInPicture]):
    (-[WKFullScreenViewController failedToEnterPictureInPicture]):
    (-[WKFullScreenViewController loadView]):
    (-[WKFullScreenViewController viewWillAppear:]):
    * UIProcess/Cocoa/WebViewImpl.mm:
    (WebKit::WebViewImpl::videoControlsManagerDidChange):
    * UIProcess/mac/WKFullScreenWindowController.h:
    * UIProcess/mac/WKFullScreenWindowController.mm:
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenWindowController initWithWindow:webView:page:]):
    (-[WKFullScreenWindowController dealloc]):
    (-[WKFullScreenWindowController videoControlsManagerDidChange]):
    (-[WKFullScreenWindowController willEnterPictureInPicture]):
    
    Tools:
    
    <rdar://problem/41212379>
    
    Reviewed by Jon Lee.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm: Added.
    (-[ExitFullscreenOnEnterPiPUIDelegate _webView:hasVideoInPictureInPictureDidChange:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidEnterFullscreen:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidExitFullscreen:]):
    (TestWebKitAPI::TEST):
    
    LayoutTests:
    
    Reviewed by Jon Lee.
    
    * TestExpectations:
    * media/fullscreen-video-going-into-pip-expected.txt: Removed.
    * media/fullscreen-video-going-into-pip.html: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip-expected.txt: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip.html: Removed.
    * platform/mac-wk2/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            PiP from Element Fullscreen should match AVKit's behavior
            https://bugs.webkit.org/show_bug.cgi?id=187623

            Reviewed by Jon Lee.

            * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
            (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
            * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
            (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
            (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
            (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
            (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
            (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
            (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
            (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
            * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
            (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
            (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
            (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
            (-[WKFullScreenViewController initWithWebView:]):
            (-[WKFullScreenViewController dealloc]):
            (-[WKFullScreenViewController videoControlsManagerDidChange]):
            (-[WKFullScreenViewController ensurePiPAnimator]):
            (-[WKFullScreenViewController willEnterPictureInPicture]):
            (-[WKFullScreenViewController didEnterPictureInPicture]):
            (-[WKFullScreenViewController failedToEnterPictureInPicture]):
            (-[WKFullScreenViewController loadView]):
            (-[WKFullScreenViewController viewWillAppear:]):
            * UIProcess/Cocoa/WebViewImpl.mm:
            (WebKit::WebViewImpl::videoControlsManagerDidChange):
            * UIProcess/mac/WKFullScreenWindowController.h:
            * UIProcess/mac/WKFullScreenWindowController.mm:
            (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
            (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
            (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
            (-[WKFullScreenWindowController initWithWindow:webView:page:]):
            (-[WKFullScreenWindowController dealloc]):
            (-[WKFullScreenWindowController videoControlsManagerDidChange]):
            (-[WKFullScreenWindowController willEnterPictureInPicture]):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233925. rdar://problem/42354959

    Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
    https://bugs.webkit.org/show_bug.cgi?id=187775
    <rdar://problem/42343229>
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
            https://bugs.webkit.org/show_bug.cgi?id=187775
            <rdar://problem/42343229>

            Reviewed by Jon Lee.

            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
            (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234272. rdar://problem/42645434

    Unreviewed, rolling out r234181 and r234189.
    https://bugs.webkit.org/show_bug.cgi?id=188075
    
    These are not needed right now (Requested by thorton on
    #webkit).
    
    Reverted changesets:
    
    "Enable Web Content Filtering on watchOS"
    https://bugs.webkit.org/show_bug.cgi?id=187979
    https://trac.webkit.org/changeset/234181
    
    "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
    https://bugs.webkit.org/show_bug.cgi?id=187985
    https://trac.webkit.org/changeset/234189
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234272 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-26  Commit Queue  <commit-queue@webkit.org>

            Unreviewed, rolling out r234181 and r234189.
            https://bugs.webkit.org/show_bug.cgi?id=188075

            These are not needed right now (Requested by thorton on
            #webkit).

            Reverted changesets:

            "Enable Web Content Filtering on watchOS"
            https://bugs.webkit.org/show_bug.cgi?id=187979
            https://trac.webkit.org/changeset/234181

            "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
            https://bugs.webkit.org/show_bug.cgi?id=187985
            https://trac.webkit.org/changeset/234189

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234216. rdar://problem/42604537

    Mask AVBackgroundView to the corner radius.
    https://bugs.webkit.org/show_bug.cgi?id=187976
    rdar://problem/41810866
    
    Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-25
    Reviewed by Jon Lee.
    
    This changes sets the appropriate mask to the layer so the corners look correct.
    
    * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
    (-[WKFullscreenStackView init]):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234216 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-25  Jeremy Jones  <jeremyj@apple.com>

            Mask AVBackgroundView to the corner radius.
            https://bugs.webkit.org/show_bug.cgi?id=187976
            rdar://problem/41810866

            Reviewed by Jon Lee.

            This changes sets the appropriate mask to the layer so the corners look correct.

            * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
            (-[WKFullscreenStackView init]):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234215. rdar://problem/42604541

    REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
    https://bugs.webkit.org/show_bug.cgi?id=188018
    <rdar://problem/42517520>
    
    Reviewed by Dean Jackson.
    
    Source/WebCore:
    
    Manual rollout of r227577.
    
    Test: fast/overflow/line-clamp-with-text-shadow.html
    
    * Sources.txt:
    * WebCore.xcodeproj/project.pbxproj:
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
    * css/CSSProperties.json:
    * css/StyleBuilderCustom.h:
    (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
    * css/parser/CSSParserContext.cpp:
    (WebCore::CSSParserContext::CSSParserContext):
    * css/parser/CSSParserContext.h:
    (WebCore::CSSParserContextHash::hash):
    * css/parser/CSSPropertyParser.cpp:
    (WebCore::CSSPropertyParser::parseSingleValue):
    (WebCore::consumeLinesClamp): Deleted.
    * page/Settings.yaml:
    * rendering/RenderBlockFlow.cpp:
    (WebCore::RenderBlockFlow::willCreateColumns const):
    (WebCore::getHeightForLineCount):
    (WebCore::RenderBlockFlow::heightForLineCount):
    (WebCore::RenderBlockFlow::layoutExcludedChildren):
    (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
    (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
    * rendering/RenderBlockFlow.h:
    * rendering/RenderDeprecatedFlexibleBox.cpp:
    (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
    * rendering/RenderFragmentContainer.cpp:
    (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
    * rendering/RenderFragmentContainer.h:
    * rendering/RenderFragmentedFlow.cpp:
    (WebCore::RenderFragmentedFlow::validateFragments):
    (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
    (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
    * rendering/RenderFragmentedFlow.h:
    * rendering/RenderLinesClampFlow.cpp: Removed.
    * rendering/RenderLinesClampFlow.h: Removed.
    * rendering/RenderLinesClampSet.cpp: Removed.
    * rendering/RenderLinesClampSet.h: Removed.
    * rendering/RenderMultiColumnFlow.cpp:
    (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
    (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
    * rendering/RenderMultiColumnFlow.h:
    (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
    (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
    (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
    (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
    (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
    (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
    (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
    (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
    (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
    (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
    (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
    (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
    (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
    (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
    (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
    (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
    (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
    (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
    * rendering/RenderMultiColumnSet.cpp:
    (WebCore::RenderMultiColumnSet::collectLayerFragments):
    (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
    * rendering/RenderMultiColumnSet.h:
    (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
    (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
    (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
    (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
    (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
    (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
    (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
    (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
    (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
    (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
    (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
    * rendering/RenderObject.h:
    (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
    (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
    * rendering/style/LineClampValue.h:
    (WebCore::LinesClampValue::LinesClampValue): Deleted.
    (WebCore::LinesClampValue::isNone const): Deleted.
    (WebCore::LinesClampValue::operator== const): Deleted.
    (WebCore::LinesClampValue::operator!= const): Deleted.
    (WebCore::LinesClampValue::start const): Deleted.
    (WebCore::LinesClampValue::end const): Deleted.
    (WebCore::LinesClampValue::center const): Deleted.
    * rendering/style/RenderStyle.h:
    (WebCore::RenderStyle::lineClamp const):
    (WebCore::RenderStyle::setLineClamp):
    (WebCore::RenderStyle::initialLineClamp):
    (WebCore::RenderStyle::hasInlineColumnAxis const):
    (WebCore::RenderStyle::linesClamp const): Deleted.
    (WebCore::RenderStyle::hasLinesClamp const): Deleted.
    (WebCore::RenderStyle::setLinesClamp): Deleted.
    (WebCore::RenderStyle::initialLinesClamp): Deleted.
    * rendering/style/StyleRareNonInheritedData.cpp:
    (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
    (WebCore::StyleRareNonInheritedData::operator== const):
    * rendering/style/StyleRareNonInheritedData.h:
    * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
    (WebCore::isValidColumnSpanner):
    (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
    (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
    
    Source/WebKit:
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::m_credentialsMessenger):
    
    LayoutTests:
    
    * fast/block/lines-clamp-advanced-expected.html: Removed.
    * fast/block/lines-clamp-advanced-rl-expected.html: Removed.
    * fast/block/lines-clamp-advanced-rl.html: Removed.
    * fast/block/lines-clamp-advanced.html: Removed.
    * fast/block/lines-clamp-basic-expected.html: Removed.
    * fast/block/lines-clamp-basic-rl-expected.html: Removed.
    * fast/block/lines-clamp-basic-rl.html: Removed.
    * fast/block/lines-clamp-basic.html: Removed.
    * fast/css/lines-clamp-parsing-expected.txt: Removed.
    * fast/css/lines-clamp-parsing.html: Removed.
    * fast/overflow/line-clamp-with-text-shadow-expected.html: Added.
    * fast/overflow/line-clamp-with-text-shadow.html: Added.
    * platform/ios-simulator-wk2/fast/overflow/line-clamp-expected.txt: Removed.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-25  Zalan Bujtas  <zalan@apple.com>

            REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
            https://bugs.webkit.org/show_bug.cgi?id=188018
            <rdar://problem/42517520>

            Reviewed by Dean Jackson.

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

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234195. rdar://problem/42604534

    [macOS] PluginProcess needs TCC entitlements for media capture
    https://bugs.webkit.org/show_bug.cgi?id=187981
    <rdar://problem/42433634>
    
    Reviewed by Chris Dumez.
    
    The changes needed in Bug 185526 are also needed for the plugin process, or else the UIProcess
    (e.g., Safari) is not able to pass the user's camera/microphone access permission to the plugin process.
    
    This patch has the following changes:
    
    1. Rename "WebContent-OSX-restricted.entitlements" to "WebContent-or-Plugin-OSX-restricted.entitlements"
    2. Rename "process-webcontent-entitlements.sh" to "process-webcontent-or-plugin-entitlements.sh"
    3. Add a run-script step to the Plugin.64 and Plugin.32 builds to add the relevant entitlements.
    4. Silence some Flash plugin sandbox exceptions triggered after activating the camera.
    
    * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX-restricted.entitlements.
    * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player ESR.plugin.sb: Address sandbox violations needed by camera use.
    * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb: Ditto.
    * Scripts/process-webcontent-or-plugin-entitlements.sh: Renamed from Source/WebKit/Scripts/process-webcontent-entitlements.sh.
    * WebKit.xcodeproj/project.pbxproj: Update for renaming, and perform entitlement steps on Plugin process.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [macOS] PluginProcess needs TCC entitlements for media capture
            https://bugs.webkit.org/show_bug.cgi?id=187981
            <rdar://problem/42433634>

            Reviewed by Chris Dumez.

            The changes needed in Bug 185526 are also needed for the plugin process, or else the UIProcess
            (e.g., Safari) is not able to pass the user's camera/microphone access permission to the plugin process.

            This patch has the following changes:

            1. Rename "WebContent-OSX-restricted.entitlements" to "WebContent-or-Plugin-OSX-restricted.entitlements"
            2. Rename "process-webcontent-entitlements.sh" to "process-webcontent-or-plugin-entitlements.sh"
            3. Add a run-script step to the Plugin.64 and Plugin.32 builds to add the relevant entitlements.
            4. Silence some Flash plugin sandbox exceptions triggered after activating the camera.

            * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX-restricted.entitlements.
            * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player ESR.plugin.sb: Address sandbox violations needed by camera use.
            * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb: Ditto.
            * Scripts/process-webcontent-or-plugin-entitlements.sh: Renamed from Source/WebKit/Scripts/process-webcontent-entitlements.sh.
            * WebKit.xcodeproj/project.pbxproj: Update for renaming, and perform entitlement steps on Plugin process.

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234181. rdar://problem/42604524

    Enable Web Content Filtering on watchOS
    https://bugs.webkit.org/show_bug.cgi?id=187979
    <rdar://problem/42559346>
    
    Reviewed by Wenson Hsieh.
    
    Source/JavaScriptCore:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore/PAL:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKit:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKitLegacy/mac:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Tools:
    
    * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Enable Web Content Filtering on watchOS
            https://bugs.webkit.org/show_bug.cgi?id=187979
            <rdar://problem/42559346>

            Reviewed by Wenson Hsieh.

            * Configurations/FeatureDefines.xcconfig:

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234124. rdar://problem/42604550

    Crash when loadViewIfRequired called while WKFullScreenViewController is being deallocated.
    https://bugs.webkit.org/show_bug.cgi?id=187920
    rdar://problem/41324023
    
    Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-23
    Reviewed by Eric Carlson.
    
    Clear dangling weak-ref.
    Prevent async playback state calls from instantiating the interface.
    Release WKFullScreenViewController when it is no longer needed.
    
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (-[WKFullScreenViewController dealloc]):
    (-[WKFullScreenViewController setPlaying:]):
    (-[WKFullScreenViewController setAnimating:]):
    * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
    (-[WKFullScreenWindowController _completedExitFullScreen]):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-23  Jeremy Jones  <jeremyj@apple.com>

            Crash when loadViewIfRequired called while WKFullScreenViewController is being deallocated.
            https://bugs.webkit.org/show_bug.cgi?id=187920
            rdar://problem/41324023

            Reviewed by Eric Carlson.

            Clear dangling weak-ref.
            Prevent async playback state calls from instantiating the interface.
            Release WKFullScreenViewController when it is no longer needed.

            * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
            (-[WKFullScreenViewController dealloc]):
            (-[WKFullScreenViewController setPlaying:]):
            (-[WKFullScreenViewController setAnimating:]):
            * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
            (-[WKFullScreenWindowController _completedExitFullScreen]):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234111. rdar://problem/42604691

    WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
    https://bugs.webkit.org/show_bug.cgi?id=187910
    <rdar://problem/42356526>
    
    Reviewed by Brent Fulgham.
    
    Source/WebCore:
    
    Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
    for the 5 second delay.
    
    * testing/Internals.cpp:
    (WebCore::Internals::notifyResourceLoadObserver):
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    
    The WebResourceLoadStatisticsStore was only removing itself as a MessageReceiver from the WebProcessProxy
    and that WebProcessProxy's connection was getting closed. However, it is possible for the
    WebResourceLoadStatisticsStore to get destroyed before this happens. This would lead to crashes such as
    the one in <rdar://problem/42356526>.
    
    To address the issue, we let the WebsiteDataStore take care of registering / unregistering the
    WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy. This is more reliable since
    the WebsiteDataStore is the one that subclasses WebProcessLifetimeObserver. Make sure the
    WebResourceLoadStatisticsStore is removed as a MessageReceiver whenever the WebsiteDataStore is destroyed
    or WebsiteDataStore::m_resourceLoadStatistics gets cleared.
    
    * UIProcess/WebResourceLoadStatisticsStore.cpp:
    * UIProcess/WebResourceLoadStatisticsStore.h:
    Drop logic to add / remove the WebResourceLoadStatisticsStore as a receiver now that the
    WebsiteDataStore takes care of it.
    
    * UIProcess/WebsiteData/WebsiteDataStore.cpp:
    (WebKit::WebsiteDataStore::~WebsiteDataStore):
    Make sure the WebResourceLoadStatisticsStore gets unregistered as a MessageReceiver from all associated
    WebProcessProxy objects when the WebsiteDataStore gets destroyed.
    
    (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
    (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
    Register / Unregister the WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy.
    
    (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
    Make sure we unregister the WebResourceLoadStatisticsStore as a MessageReceiver with all associated
    WebProcessProxy objects before we clear m_resourceLoadStatistics as this will causes the
    WebResourceLoadStatisticsStore to get destroyed.
    
    (WebKit::WebsiteDataStore::unregisterWebResourceLoadStatisticsStoreAsMessageReceiver):
    (WebKit::WebsiteDataStore::registerWebResourceLoadStatisticsStoreAsMessageReceiver):
    Add utility functions to register / unregister WebResourceLoadStatisticsStore as a MessageReceiver with
    all associated WebProcessProxy objects.
    
    (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
    Register the new WebResourceLoadStatisticsStore as a MessageReceiver with all associated WebProcessProxy
    objects in case setResourceLoadStatisticsEnabled(true) gets called *after* we've already started
    WebProcesses.
    
    * UIProcess/WebsiteData/WebsiteDataStore.h:
    
    Tools:
    
    Add API test coverage.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
    (-[DisableITPDuringNavigationDelegate webView:didCommitNavigation:]):
    (-[DisableITPDuringNavigationDelegate webView:didFinishNavigation:]):
    (TEST):
    * TestWebKitAPI/Tests/WebKitCocoa/notify-resourceLoadObserver.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-23  Chris Dumez  <cdumez@apple.com>

            WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
            https://bugs.webkit.org/show_bug.cgi?id=187910
            <rdar://problem/42356526>

            Reviewed by Brent Fulgham.

            The WebResourceLoadStatisticsStore was only removing itself as a MessageReceiver from the WebProcessProxy
            and that WebProcessProxy's connection was getting closed. However, it is possible for the
            WebResourceLoadStatisticsStore to get destroyed before this happens. This would lead to crashes such as
            the one in <rdar://problem/42356526>.

            To address the issue, we let the WebsiteDataStore take care of registering / unregistering the
            WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy. This is more reliable since
            the WebsiteDataStore is the one that subclasses WebProcessLifetimeObserver. Make sure the
            WebResourceLoadStatisticsStore is removed as a MessageReceiver whenever the WebsiteDataStore is destroyed
            or WebsiteDataStore::m_resourceLoadStatistics gets cleared.

            * UIProcess/WebResourceLoadStatisticsStore.cpp:
            * UIProcess/WebResourceLoadStatisticsStore.h:
            Drop logic to add / remove the WebResourceLoadStatisticsStore as a receiver now that the
            WebsiteDataStore takes care of it.

            * UIProcess/WebsiteData/WebsiteDataStore.cpp:
            (WebKit::WebsiteDataStore::~WebsiteDataStore):
            Make sure the WebResourceLoadStatisticsStore gets unregistered as a MessageReceiver from all associated
            WebProcessProxy objects when the WebsiteDataStore gets destroyed.

            (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
            (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
            Register / Unregister the WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy.

            (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
            Make sure we unregister the WebResourceLoadStatisticsStore as a MessageReceiver with all associated
            WebProcessProxy objects before we clear m_resourceLoadStatistics as this will causes the
            WebResourceLoadStatisticsStore to get destroyed.

            (WebKit::WebsiteDataStore::unregisterWebResourceLoadStatisticsStoreAsMessageReceiver):
            (WebKit::WebsiteDataStore::registerWebResourceLoadStatisticsStoreAsMessageReceiver):
            Add utility functions to register / unregister WebResourceLoadStatisticsStore as a MessageReceiver with
            all associated WebProcessProxy objects.

            (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
            Register the new WebResourceLoadStatisticsStore as a MessageReceiver with all associated WebProcessProxy
            objects in case setResourceLoadStatisticsEnabled(true) gets called *after* we've already started
            WebProcesses.

            * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234067. rdar://problem/42451597

    Occasional crash under -[WKFormInputSession setSuggestions:]
    https://bugs.webkit.org/show_bug.cgi?id=187869
    <rdar://problem/41357063>
    
    Reviewed by Dean Jackson.
    
    * UIProcess/ios/WKContentViewInteraction.h:
    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKContentView inputDelegate]):
    Make inputDelegate weak.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234067 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Occasional crash under -[WKFormInputSession setSuggestions:]
            https://bugs.webkit.org/show_bug.cgi?id=187869
            <rdar://problem/41357063>

            Reviewed by Dean Jackson.

            * UIProcess/ios/WKContentViewInteraction.h:
            * UIProcess/ios/WKContentViewInteraction.mm:
            (-[WKContentView inputDelegate]):
            Make inputDelegate weak.

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234054. rdar://problem/42451625

    [macOS] Relax WebKit sandbox to permit proper App Store behavior
    https://bugs.webkit.org/show_bug.cgi?id=187831
    <rdar://problem/42047455>
    
    Reviewed by Alexey Proskuryakov.
    
    The Mac App Store is unable to perform some gift card redemption tasks on macOS due to missing sandbox permissions.
    This patch adds those permissions.
    
    * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234054 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            [macOS] Relax WebKit sandbox to permit proper App Store behavior
            https://bugs.webkit.org/show_bug.cgi?id=187831
            <rdar://problem/42047455>

            Reviewed by Alexey Proskuryakov.

            The Mac App Store is unable to perform some gift card redemption tasks on macOS due to missing sandbox permissions.
            This patch adds those permissions.

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

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234023. rdar://problem/42451655

    Null pointer dereference under WebPage::autofillLoginCredentials()
    https://bugs.webkit.org/show_bug.cgi?id=187823
    <rdar://problem/37152195>
    
    Reviewed by David Kilzer.
    
    Deal with m_assistedNode being null under WebPage::autofillLoginCredentials().
    
    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::WebPage::autofillLoginCredentials):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234023 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Chris Dumez  <cdumez@apple.com>

            Null pointer dereference under WebPage::autofillLoginCredentials()
            https://bugs.webkit.org/show_bug.cgi?id=187823
            <rdar://problem/37152195>

            Reviewed by David Kilzer.

            Deal with m_assistedNode being null under WebPage::autofillLoginCredentials().

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

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Revert r233925. rdar://problem/42354959

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Revert r233926. rdar://problem/42446531

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233925. rdar://problem/42354959

    Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
    https://bugs.webkit.org/show_bug.cgi?id=187775
    <rdar://problem/42343229>
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
            https://bugs.webkit.org/show_bug.cgi?id=187775
            <rdar://problem/42343229>

            Reviewed by Jon Lee.

            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
            (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234020. rdar://problem/42417121

    [ITP] Crash under ResourceLoadStatisticsMemoryStore::removeDataRecords()
    https://bugs.webkit.org/show_bug.cgi?id=187821
    <rdar://problem/42112693>
    
    Reviewed by David Kilzer.
    
    In two cases, ResourceLoadStatisticsMemoryStore (which lives on a background queue) needs to call WebPageProxy
    operations on the main thread and then dispatch back on the background queue when the operation completes.
    However, it is possible for the ResourceLoadStatisticsMemoryStore to get destroyed on the background queue
    during this time and we would then crash when trying to use m_workQueue to re-dispatch. To address the issue,
    I now ref the work queue in the lambda so that we're guaranteed to be able to re-dispatch to the background
    queue. When we're back on the background queue, we'll realize that weakThis in gone and we'll call the callback
    and return early.
    
    Note that I am not checking weakThis on the main thread as this would not be safe. weakThis should only be
    used on the background queue.
    
    * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
    (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
    (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234020 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Chris Dumez  <cdumez@apple.com>

            [ITP] Crash under ResourceLoadStatisticsMemoryStore::removeDataRecords()
            https://bugs.webkit.org/show_bug.cgi?id=187821
            <rdar://problem/42112693>

            Reviewed by David Kilzer.

            In two cases, ResourceLoadStatisticsMemoryStore (which lives on a background queue) needs to call WebPageProxy
            operations on the main thread and then dispatch back on the background queue when the operation completes.
            However, it is possible for the ResourceLoadStatisticsMemoryStore to get destroyed on the background queue
            during this time and we would then crash when trying to use m_workQueue to re-dispatch. To address the issue,
            I now ref the work queue in the lambda so that we're guaranteed to be able to re-dispatch to the background
            queue. When we're back on the background queue, we'll realize that weakThis in gone and we'll call the callback
            and return early.

            Note that I am not checking weakThis on the main thread as this would not be safe. weakThis should only be
            used on the background queue.

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

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233992. rdar://problem/42417109

    Update iOS fullscreen alert text again
    https://bugs.webkit.org/show_bug.cgi?id=187797
    rdar://problem/42373783
    
    Reviewed by Jer Noble.
    
    Source/WebCore:
    
    * English.lproj/Localizable.strings:
    
    Source/WebKit:
    
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (-[WKFullScreenViewController _showPhishingAlert]):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233992 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Jon Lee  <jonlee@apple.com>

            Update iOS fullscreen alert text again
            https://bugs.webkit.org/show_bug.cgi?id=187797
            rdar://problem/42373783

            Reviewed by Jer Noble.

            * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
            (-[WKFullScreenViewController _showPhishingAlert]):

2018-07-19  Babak Shafiei  <bshafiei@apple.com>

        Revert r233925. rdar://problem/42354959

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233915. rdar://problem/42345407

    Add SPI to defer running async script until after document load
    https://bugs.webkit.org/show_bug.cgi?id=187748
    <rdar://problem/42317378>
    
    Reviewed by Ryosuke Niwa and Tim Horton.
    
    Source/WebCore:
    
    On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
    the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
    until after document load (i.e. the same timing as DOMContentLoaded).
    
    This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
    until after document load; this, in combination with the parser yielding token introduced in r233891, allows
    Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
    most article-like pages. See below for more details.
    
    Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument
    
    * dom/Document.cpp:
    (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
    (WebCore::Document::finishedParsing):
    
    Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.
    
    * dom/Document.h:
    * dom/ScriptRunner.cpp:
    (WebCore::ScriptRunner::documentFinishedParsing):
    
    When the document is finished parsing, kick off the script execution timer if needed to run any async script
    that has been deferred.
    
    (WebCore::ScriptRunner::notifyFinished):
    (WebCore::ScriptRunner::timerFired):
    
    Instead of always taking from the list of async scripts to execute, check our document to see whether we should
    defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.
    
    * dom/ScriptRunner.h:
    * page/Settings.yaml:
    
    Add a WebCore setting for this behavior.
    
    Source/WebKit:
    
    Add plumbing for a new ShouldDeferAsynchronousScriptsUntilAfterDocumentLoad configuration that determines
    whether async script execution should be deferred until document load (i.e. DOMContentLoaded). This
    configuration defaults to NO on all platforms. See WebCore ChangeLog for more detail.
    
    * Shared/WebPreferences.yaml:
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _initializeWithConfiguration:]):
    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
    (-[WKWebViewConfiguration init]):
    (-[WKWebViewConfiguration copyWithZone:]):
    (-[WKWebViewConfiguration _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad]):
    (-[WKWebViewConfiguration _setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:]):
    * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
    
    Tools:
    
    Add an API test to verify that when the deferred async script configuration is set, async scripts will be
    executed after the DOMContentLoaded event.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/RunScriptAfterDocumentLoad.mm: Added.
    (TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233915 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Wenson Hsieh  <wenson_hsieh@apple.com>

            Add SPI to defer running async script until after document load
            https://bugs.webkit.org/show_bug.cgi?id=187748
            <rdar://problem/42317378>

            Reviewed by Ryosuke Niwa and Tim Horton.

            Add plumbing for a new ShouldDeferAsynchronousScriptsUntilAfterDocumentLoad configuration that determines
            whether async script execution should be deferred until document load (i.e. DOMContentLoaded). This
            configuration defaults to NO on all platforms. See WebCore ChangeLog for more detail.

            * Shared/WebPreferences.yaml:
            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _initializeWithConfiguration:]):
            * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
            (-[WKWebViewConfiguration init]):
            (-[WKWebViewConfiguration copyWithZone:]):
            (-[WKWebViewConfiguration _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad]):
            (-[WKWebViewConfiguration _setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:]):
            * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233891. rdar://problem/42345327

    Add an SPI hook to allow clients to yield document parsing and script execution
    https://bugs.webkit.org/show_bug.cgi?id=187682
    <rdar://problem/42207453>
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
    including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
    again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
    and we don't eat the additional cost of a web process launch if prewarming fails.
    
    However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
    original page may contend with work being done to load and render the Reader page. This is especially bad when
    the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
    the page is available, but before it has finished loading the Reader page. The result is that script on the
    original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
    apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).
    
    To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
    a document. This capability is surfaced in the form of an opaque token which clients may request from a
    WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
    scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
    active tokens on the document causes it to stop yielding and resume execution of scripts if needed.
    
    Tests:  ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
            ParserYieldTokenTests.TakeMultipleParserYieldTokens
            ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
            ParserYieldTokenTests.AsyncScriptRunsWhenFetched
    
    * dom/Document.cpp:
    (WebCore::Document::implicitOpen):
    
    If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
    start yielding immediately after creation.
    
    (WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
    (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
    * dom/Document.h:
    
    Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
    have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
    parser yield count (respectively).
    
    (WebCore::Document::createParserYieldToken):
    (WebCore::Document::hasActiveParserYieldToken const):
    * dom/DocumentParser.h:
    (WebCore::DocumentParser::didBeginYieldingParser):
    (WebCore::DocumentParser::didEndYieldingParser):
    
    Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
    parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
    script.
    
    * dom/ScriptRunner.cpp:
    (WebCore::ScriptRunner::resume):
    (WebCore::ScriptRunner::notifyFinished):
    * dom/ScriptRunner.h:
    (WebCore::ScriptRunner::didBeginYieldingParser):
    (WebCore::ScriptRunner::didEndYieldingParser):
    
    Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
    and resume.
    
    * html/parser/HTMLDocumentParser.cpp:
    (WebCore::HTMLDocumentParser::didBeginYieldingParser):
    (WebCore::HTMLDocumentParser::didEndYieldingParser):
    
    Plumb to didBegin/didEnd calls to the HTMLParserScheduler.
    
    * html/parser/HTMLDocumentParser.h:
    * html/parser/HTMLParserScheduler.cpp:
    (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
    * html/parser/HTMLParserScheduler.h:
    (WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
    
    Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
    parser yield token.
    
    (WebCore::HTMLParserScheduler::isScheduledForResume const):
    
    Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
    incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
    parser is no longer scheduled to pump its tokenizer.
    
    (WebCore::HTMLParserScheduler::didBeginYieldingParser):
    (WebCore::HTMLParserScheduler::didEndYieldingParser):
    
    When the Document begins yielding due to the documet having active tokens or ends yielding after the document
    loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
    reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
    to resume, we'll never get the document load or load events after relinquishing the yield token.
    
    Source/WebKit:
    
    Add hooks to WKDOMDocument to create and return an internal WKDOMDocumentParserYieldToken object, whose lifetime
    is tied to a document parser yield token. See WebCore ChangeLog for more detail.
    
    * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
    * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
    (-[WKDOMDocumentParserYieldToken initWithDocument:]):
    (-[WKDOMDocument parserYieldToken]):
    
    Tools:
    
    Add a few tests to exercise the new document yield token SPI, verifying that clients can use the SPI to defer
    document load, and that doing so doesn't cause deferred `script` to execute in the wrong order (i.e. before
    synchronous script, or after "DOMContentLoaded").
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenPlugIn.mm: Added.
    (-[ParserYieldTokenPlugIn takeDocumentParserTokenAfterCommittingLoad]):
    (-[ParserYieldTokenPlugIn releaseDocumentParserToken]):
    (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didCommitLoadForFrame:]):
    (-[ParserYieldTokenPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
    (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didFinishDocumentLoadForFrame:]):
    (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didFinishLoadForFrame:]):
    
    Add an injected bundle object that knows how to take and release multiple document parser yield tokens.
    
    * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.h: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.mm: Added.
    (+[ParserYieldTokenTestWebView webView]):
    (-[ParserYieldTokenTestWebView bundle]):
    (-[ParserYieldTokenTestWebView schemeHandler]):
    (-[ParserYieldTokenTestWebView didFinishDocumentLoad]):
    (-[ParserYieldTokenTestWebView didFinishLoad]):
    (waitForDelay):
    (TEST):
    * TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.h: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.mm: Added.
    (-[TestURLSchemeHandler webView:startURLSchemeTask:]):
    (-[TestURLSchemeHandler webView:stopURLSchemeTask:]):
    (-[TestURLSchemeHandler setStartURLSchemeTaskHandler:]):
    (-[TestURLSchemeHandler startURLSchemeTaskHandler]):
    (-[TestURLSchemeHandler setStopURLSchemeTaskHandler:]):
    (-[TestURLSchemeHandler stopURLSchemeTaskHandler]):
    
    Add a new test helper class to handle custom schemes via a block-based API.
    
    * TestWebKitAPI/Tests/WebKitCocoa/text-with-async-script.html: Added.
    
    New test HTML page that contains a deferred script element, a synchronous script element, another deferred
    script element, and then some text, images, and links.
    
    * TestWebKitAPI/Tests/WebKitCocoa/text-with-deferred-script.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>

            Add an SPI hook to allow clients to yield document parsing and script execution
            https://bugs.webkit.org/show_bug.cgi?id=187682
            <rdar://problem/42207453>

            Reviewed by Ryosuke Niwa.

            Add hooks to WKDOMDocument to create and return an internal WKDOMDocumentParserYieldToken object, whose lifetime
            is tied to a document parser yield token. See WebCore ChangeLog for more detail.

            * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
            * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
            (-[WKDOMDocumentParserYieldToken initWithDocument:]):
            (-[WKDOMDocument parserYieldToken]):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233940. rdar://problem/42359640

    CRASH at WebKit: WebKit::WebFullScreenManagerProxy::saveScrollPosition
    https://bugs.webkit.org/show_bug.cgi?id=187769
    <rdar://problem/42160666>
    
    Reviewed by Tim Horton.
    
    Null-check all uses of _page and _manager in WKFullScreenWindowControllerIOS.
    
    * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
    (WebKit::WKWebViewState::applyTo):
    (WebKit::WKWebViewState::store):
    (-[WKFullScreenWindowController enterFullScreen]):
    (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
    (-[WKFullScreenWindowController _completedExitFullScreen]):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233940 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            CRASH at WebKit: WebKit::WebFullScreenManagerProxy::saveScrollPosition
            https://bugs.webkit.org/show_bug.cgi?id=187769
            <rdar://problem/42160666>

            Reviewed by Tim Horton.

            Null-check all uses of _page and _manager in WKFullScreenWindowControllerIOS.

            * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
            (WebKit::WKWebViewState::applyTo):
            (WebKit::WKWebViewState::store):
            (-[WKFullScreenWindowController enterFullScreen]):
            (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
            (-[WKFullScreenWindowController _completedExitFullScreen]):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233939. rdar://problem/42359636

    WebContent crash in WebProcess::ensureNetworkProcessConnection
    https://bugs.webkit.org/show_bug.cgi?id=187791
    <rdar://problem/41995022>
    
    Reviewed by Ryosuke Niwa.
    
    If the WebProcessProxy::GetNetworkProcessConnection synchronous IPC between the WebProcess
    and the UIProcess succeeded but we received an invalid connection identifier, then try
    once more. This may indicate the network process has crashed, in which case it will be
    relaunched.
    
    * WebProcess/WebProcess.cpp:
    (WebKit::getNetworkProcessConnection):
    (WebKit::WebProcess::ensureNetworkProcessConnection):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233939 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Chris Dumez  <cdumez@apple.com>

            WebContent crash in WebProcess::ensureNetworkProcessConnection
            https://bugs.webkit.org/show_bug.cgi?id=187791
            <rdar://problem/41995022>

            Reviewed by Ryosuke Niwa.

            If the WebProcessProxy::GetNetworkProcessConnection synchronous IPC between the WebProcess
            and the UIProcess succeeded but we received an invalid connection identifier, then try
            once more. This may indicate the network process has crashed, in which case it will be
            relaunched.

            * WebProcess/WebProcess.cpp:
            (WebKit::getNetworkProcessConnection):
            (WebKit::WebProcess::ensureNetworkProcessConnection):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233932. rdar://problem/42353789

    The WebContent process does not suspend when MiniBrowser is minimized.
    https://bugs.webkit.org/show_bug.cgi?id=187708
    
    Reviewed by Chris Dumez.
    
    Source/WebCore/PAL:
    
    Add function for enabling App nap.
    
    * pal/spi/cf/CFUtilitiesSPI.h:
    
    Source/WebKit:
    
    Using the NSRunLoop runloop type prevents the WebContent process from suspending. Instead, use the new
    _WebKit runloop type. Also do not leak a boost to the WebContent process, since this also prevents the
    WebContent process from going to sleep. Calling SetApplicationIsDaemon prevents the WebContent process
    from being assigned the application process priority level. To block WindowServer connections, call
    CGSSetDenyWindowServerConnections(true) instead. Finally, App nap must be manually enabled, since the
    WebContent process is no longer a NSApplication.
    
    * Configurations/WebContentService.xcconfig:
    * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
    (WebKit::shouldLeakBoost):
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::updateThrottleState):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeProcess):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Per Arne Vollan  <pvollan@apple.com>

            The WebContent process does not suspend when MiniBrowser is minimized.
            https://bugs.webkit.org/show_bug.cgi?id=187708

            Reviewed by Chris Dumez.

            Using the NSRunLoop runloop type prevents the WebContent process from suspending. Instead, use the new
            _WebKit runloop type. Also do not leak a boost to the WebContent process, since this also prevents the
            WebContent process from going to sleep. Calling SetApplicationIsDaemon prevents the WebContent process
            from being assigned the application process priority level. To block WindowServer connections, call
            CGSSetDenyWindowServerConnections(true) instead. Finally, App nap must be manually enabled, since the
            WebContent process is no longer a NSApplication.

            * Configurations/WebContentService.xcconfig:
            * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
            (WebKit::shouldLeakBoost):
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::updateThrottleState):
            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeProcess):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233927. rdar://problem/42354954

    -_beginAnimatedResizeWithUpdates: can leave view in bad state if called during an existing animation
    https://bugs.webkit.org/show_bug.cgi?id=187739
    Source/WebKit:
    
    Reviewed by Tim Horton.
    
    It's not enough to reset _dynamicViewportUpdateMode to NotResizing; other parts of the code
    check whether _resizeAnimationView is non-nil, the contentView may be hidden, etc. Add a new
    internal method _cancelAnimatedResize that cleans up state when a call to
    _beginAnimatedResizeWithUpdates: fails.
    
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _processDidExit]):
    (-[WKWebView _cancelAnimatedResize]):
    (-[WKWebView _didCompleteAnimatedResize]):
    (-[WKWebView _beginAnimatedResizeWithUpdates:]):
    
    Tools:
    
    <rdar://problem/42304518>
    
    Reviewed by Tim Horton.
    
    * TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
    (TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233927 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            -_beginAnimatedResizeWithUpdates: can leave view in bad state if called during an existing animation
            https://bugs.webkit.org/show_bug.cgi?id=187739

            Reviewed by Tim Horton.

            It's not enough to reset _dynamicViewportUpdateMode to NotResizing; other parts of the code
            check whether _resizeAnimationView is non-nil, the contentView may be hidden, etc. Add a new
            internal method _cancelAnimatedResize that cleans up state when a call to
            _beginAnimatedResizeWithUpdates: fails.

            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _processDidExit]):
            (-[WKWebView _cancelAnimatedResize]):
            (-[WKWebView _didCompleteAnimatedResize]):
            (-[WKWebView _beginAnimatedResizeWithUpdates:]):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233926. rdar://problem/42354941

    PiP from Element Fullscreen should match AVKit's behavior
    https://bugs.webkit.org/show_bug.cgi?id=187623
    Source/WebCore:
    
    Reviewed by Jon Lee.
    
    PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    
    Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
    
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
    
    Add VideoFullscreenModelClient virutal methods for PiP change notifications:
    
    * platform/cocoa/VideoFullscreenModel.h:
    (WebCore::VideoFullscreenModelClient::hasVideoChanged):
    (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
    (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
    * platform/cocoa/VideoFullscreenModelVideoElement.h:
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::willExitPictureInPicture):
    (VideoFullscreenModelVideoElement::didExitPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
    * platform/ios/VideoFullscreenInterfaceAVKit.h:
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (-[WebAVPlayerLayer layoutSublayers]):
    (-[WebAVPlayerLayer resolveBounds]):
    (-[WebAVPlayerLayer setVideoGravity:]):
    (VideoFullscreenInterfaceAVKit::setupFullscreen):
    (VideoFullscreenInterfaceAVKit::presentingViewController):
    (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
    (VideoFullscreenInterfaceAVKit::doSetup):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::willEnterPictureInPicture):
    (VideoFullscreenControllerContext::didEnterPictureInPicture):
    (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
    (VideoFullscreenControllerContext::willExitPictureInPicture):
    (VideoFullscreenControllerContext::didExitPictureInPicture):
    (VideoFullscreenControllerContext::failedToExitPictureInPicture):
    * platform/mac/VideoFullscreenInterfaceMac.h:
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
    (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
    
    Source/WebCore/PAL:
    
    Reviewed by Jon Lee.
    
    * pal/spi/mac/PIPSPI.h:
    
    Source/WebKit:
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
    (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
    (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
    (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
    (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenViewController initWithWebView:]):
    (-[WKFullScreenViewController dealloc]):
    (-[WKFullScreenViewController videoControlsManagerDidChange]):
    (-[WKFullScreenViewController ensurePiPAnimator]):
    (-[WKFullScreenViewController willEnterPictureInPicture]):
    (-[WKFullScreenViewController didEnterPictureInPicture]):
    (-[WKFullScreenViewController failedToEnterPictureInPicture]):
    (-[WKFullScreenViewController loadView]):
    (-[WKFullScreenViewController viewWillAppear:]):
    * UIProcess/Cocoa/WebViewImpl.mm:
    (WebKit::WebViewImpl::videoControlsManagerDidChange):
    * UIProcess/mac/WKFullScreenWindowController.h:
    * UIProcess/mac/WKFullScreenWindowController.mm:
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenWindowController initWithWindow:webView:page:]):
    (-[WKFullScreenWindowController dealloc]):
    (-[WKFullScreenWindowController videoControlsManagerDidChange]):
    (-[WKFullScreenWindowController willEnterPictureInPicture]):
    
    Tools:
    
    <rdar://problem/41212379>
    
    Reviewed by Jon Lee.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm: Added.
    (-[ExitFullscreenOnEnterPiPUIDelegate _webView:hasVideoInPictureInPictureDidChange:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidEnterFullscreen:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidExitFullscreen:]):
    (TestWebKitAPI::TEST):
    
    LayoutTests:
    
    Reviewed by Jon Lee.
    
    * TestExpectations:
    * media/fullscreen-video-going-into-pip-expected.txt: Removed.
    * media/fullscreen-video-going-into-pip.html: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip-expected.txt: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip.html: Removed.
    * platform/mac-wk2/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            PiP from Element Fullscreen should match AVKit's behavior
            https://bugs.webkit.org/show_bug.cgi?id=187623

            Reviewed by Jon Lee.

            * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
            (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
            * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
            (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
            (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
            (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
            (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
            (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
            (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
            (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
            * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
            (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
            (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
            (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
            (-[WKFullScreenViewController initWithWebView:]):
            (-[WKFullScreenViewController dealloc]):
            (-[WKFullScreenViewController videoControlsManagerDidChange]):
            (-[WKFullScreenViewController ensurePiPAnimator]):
            (-[WKFullScreenViewController willEnterPictureInPicture]):
            (-[WKFullScreenViewController didEnterPictureInPicture]):
            (-[WKFullScreenViewController failedToEnterPictureInPicture]):
            (-[WKFullScreenViewController loadView]):
            (-[WKFullScreenViewController viewWillAppear:]):
            * UIProcess/Cocoa/WebViewImpl.mm:
            (WebKit::WebViewImpl::videoControlsManagerDidChange):
            * UIProcess/mac/WKFullScreenWindowController.h:
            * UIProcess/mac/WKFullScreenWindowController.mm:
            (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
            (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
            (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
            (-[WKFullScreenWindowController initWithWindow:webView:page:]):
            (-[WKFullScreenWindowController dealloc]):
            (-[WKFullScreenWindowController videoControlsManagerDidChange]):
            (-[WKFullScreenWindowController willEnterPictureInPicture]):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233925. rdar://problem/42354959

    Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
    https://bugs.webkit.org/show_bug.cgi?id=187775
    <rdar://problem/42343229>
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Dissociate the VideoFullscreenInterface from its VideoFullscreenModel before removing it from the manager
            https://bugs.webkit.org/show_bug.cgi?id=187775
            <rdar://problem/42343229>

            Reviewed by Jon Lee.

            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
            (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233905. rdar://problem/42345236

    REGRESSION (iOS 12): Can't scroll to the bottom of the page in WKWebView while keyboard is up on pages with viewport-fit=cover
    https://bugs.webkit.org/show_bug.cgi?id=187743
    <rdar://problem/41651546>
    
    Reviewed by Simon Fraser.
    
    UIScrollView's _systemContentInset no longer includes keyboard insets
    in apps linked on iOS 12+ when contentInsetAdjustmentBehavior is None.
    
    We use contentInsetAdjustmentBehavior to control adjustment of other
    sources of insets, but expect the keyboard inset to always be applied.
    
    For now, barring a more comprehensive way to separate insets, re-add
    the keyboard inset in cases where UIKit does not.
    
    * Platform/spi/ios/UIKitSPI.h:
    Move some IPI to the SPI header.
    
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _haveSetObscuredInsets]):
    * UIProcess/API/Cocoa/WKWebViewInternal.h:
    Make it possible for WKScrollView to check whether the client is overriding insets.
    
    * UIProcess/Cocoa/VersionChecks.h:
    Add a linkedOnOrAfter() version for this new UIScrollView behavior.
    
    * UIProcess/ios/WKScrollView.mm:
    (-[WKScrollView initWithFrame:]):
    Force WKScrollView's scroll indicator to always respect insets. We always
    want the scroll bars in a sensible place, even if the page sets
    viewport-fit=cover.
    
    (-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):
    Store the bottom inset due to the keyboard.
    
    (-[WKScrollView _systemContentInset]):
    Add the bottom inset due to the keyboard to the systemContentInset
    in all cases where UIKit does not. Also avoid adding it if the client takes
    full control of the insets, because the only client that does (MobileSafari)
    includes insets-due-to-keyboard in their custom insets.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            REGRESSION (iOS 12): Can't scroll to the bottom of the page in WKWebView while keyboard is up on pages with viewport-fit=cover
            https://bugs.webkit.org/show_bug.cgi?id=187743
            <rdar://problem/41651546>

            Reviewed by Simon Fraser.

            UIScrollView's _systemContentInset no longer includes keyboard insets
            in apps linked on iOS 12+ when contentInsetAdjustmentBehavior is None.

            We use contentInsetAdjustmentBehavior to control adjustment of other
            sources of insets, but expect the keyboard inset to always be applied.

            For now, barring a more comprehensive way to separate insets, re-add
            the keyboard inset in cases where UIKit does not.

            * Platform/spi/ios/UIKitSPI.h:
            Move some IPI to the SPI header.

            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _haveSetObscuredInsets]):
            * UIProcess/API/Cocoa/WKWebViewInternal.h:
            Make it possible for WKScrollView to check whether the client is overriding insets.

            * UIProcess/Cocoa/VersionChecks.h:
            Add a linkedOnOrAfter() version for this new UIScrollView behavior.

            * UIProcess/ios/WKScrollView.mm:
            (-[WKScrollView initWithFrame:]):
            Force WKScrollView's scroll indicator to always respect insets. We always
            want the scroll bars in a sensible place, even if the page sets
            viewport-fit=cover.

            (-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):
            Store the bottom inset due to the keyboard.

            (-[WKScrollView _systemContentInset]):
            Add the bottom inset due to the keyboard to the systemContentInset
            in all cases where UIKit does not. Also avoid adding it if the client takes
            full control of the insets, because the only client that does (MobileSafari)
            includes insets-due-to-keyboard in their custom insets.

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233904. rdar://problem/42345140

    RELEASE_ASSERT() under IPC::Connection::sendSync() from PluginProxy::supportsSnapshotting()
    https://bugs.webkit.org/show_bug.cgi?id=187740
    <rdar://problem/41818955>
    
    Reviewed by Youenn Fablet.
    
    As per the crash trace, PluginProxy::supportsSnapshotting() can be called during layout but does synchronous
    IPC. As a result, we need to prevent WebCore re-entrancy by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply
    sendOption.
    
    * WebProcess/Plugins/PluginProxy.cpp:
    (WebKit::PluginProxy::supportsSnapshotting const):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233904 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-17  Chris Dumez  <cdumez@apple.com>

            RELEASE_ASSERT() under IPC::Connection::sendSync() from PluginProxy::supportsSnapshotting()
            https://bugs.webkit.org/show_bug.cgi?id=187740
            <rdar://problem/41818955>

            Reviewed by Youenn Fablet.

            As per the crash trace, PluginProxy::supportsSnapshotting() can be called during layout but does synchronous
            IPC. As a result, we need to prevent WebCore re-entrancy by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply
            sendOption.

            * WebProcess/Plugins/PluginProxy.cpp:
            (WebKit::PluginProxy::supportsSnapshotting const):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233888. rdar://problem/42345191

    Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatisticsPrevalentResource(), setStatisticsVeryPrevalentResource(), setStatisticsHasHadUserInteraction(), and setStatisticsHasHadNonRecentUserInteraction()
    https://bugs.webkit.org/show_bug.cgi?id=187710
    <rdar://problem/42252757>
    
    Reviewed by Chris Dumez.
    
    Source/WebKit:
    
    These changes are to back the completion handler functionality of
    TestRunner functions:
    - setStatisticsLastSeen(),
    - setStatisticsPrevalentResource(),
    - setStatisticsVeryPrevalentResource(),
    - setStatisticsHasHadUserInteraction(), and
    - setStatisticsHasHadNonRecentUserInteraction().
    
    * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
    (WKWebsiteDataStoreSetStatisticsLastSeen):
    (WKWebsiteDataStoreSetStatisticsPrevalentResource):
    (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
    (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
    (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
    * UIProcess/API/C/WKWebsiteDataStoreRef.h:
    * UIProcess/WebResourceLoadStatisticsStore.cpp:
    (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
    (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
    (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
    (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
    (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
    (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
    (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
    * UIProcess/WebResourceLoadStatisticsStore.h:
    
    Tools:
    
    * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
    * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
    (WTR::InjectedBundle::didReceiveMessageToPage):
    * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
    (WTR::TestRunner::setStatisticsLastSeen):
    (WTR::TestRunner::statisticsCallDidSetLastSeenCallback):
    (WTR::TestRunner::setStatisticsPrevalentResource):
    (WTR::TestRunner::statisticsCallDidSetPrevalentResourceCallback):
    (WTR::TestRunner::setStatisticsVeryPrevalentResource):
    (WTR::TestRunner::statisticsCallDidSetVeryPrevalentResourceCallback):
    (WTR::TestRunner::setStatisticsHasHadUserInteraction):
    (WTR::TestRunner::setStatisticsHasHadNonRecentUserInteraction):
    (WTR::TestRunner::statisticsCallDidSetHasHadUserInteractionCallback):
    * WebKitTestRunner/InjectedBundle/TestRunner.h:
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::setStatisticsLastSeen):
    (WTR::TestController::setStatisticsPrevalentResource):
    (WTR::TestController::setStatisticsVeryPrevalentResource):
    (WTR::TestController::setStatisticsHasHadUserInteraction):
    (WTR::TestController::setStatisticsHasHadNonRecentUserInteraction):
    * WebKitTestRunner/TestInvocation.cpp:
    (WTR::TestInvocation::didSetLastSeen):
    (WTR::TestInvocation::didSetPrevalentResource):
    (WTR::TestInvocation::didSetVeryPrevalentResource):
    (WTR::TestInvocation::didSetHasHadUserInteraction):
    (WTR::TestInvocation::didSetHasHadNonRecentUserInteraction):
    * WebKitTestRunner/TestInvocation.h:
    
    LayoutTests:
    
    These changes are to update all test cases that make use of
    TestRunner functions:
    - setStatisticsLastSeen(),
    - setStatisticsPrevalentResource(),
    - setStatisticsVeryPrevalentResource(),
    - setStatisticsHasHadUserInteraction(), and
    - setStatisticsHasHadNonRecentUserInteraction().
    
    * http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
    * http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
    * http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html:
    * http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html:
    * http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html:
    * http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent.html:
    * http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html:
    * http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html:
    * http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
    * http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:
    * http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html:
    * http/tests/resourceLoadStatistics/grandfathering.html:
    * http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
    * http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
    * http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
    * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
    * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
    * http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
    * http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
    * http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html:
    * http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html:
    * http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
    * http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
    * http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:
    * http/tests/resourceLoadStatistics/prune-statistics.html:
    * http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
    * http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
    * http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html:
    * http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html:
    * http/tests/resourceLoadStatistics/telemetry-generation.html:
    * http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
    * http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233888 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-17  John Wilander  <wilander@apple.com>

            Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatisticsPrevalentResource(), setStatisticsVeryPrevalentResource(), setStatisticsHasHadUserInteraction(), and setStatisticsHasHadNonRecentUserInteraction()
            https://bugs.webkit.org/show_bug.cgi?id=187710
            <rdar://problem/42252757>

            Reviewed by Chris Dumez.

            These changes are to back the completion handler functionality of
            TestRunner functions:
            - setStatisticsLastSeen(),
            - setStatisticsPrevalentResource(),
            - setStatisticsVeryPrevalentResource(),
            - setStatisticsHasHadUserInteraction(), and
            - setStatisticsHasHadNonRecentUserInteraction().

            * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
            (WKWebsiteDataStoreSetStatisticsLastSeen):
            (WKWebsiteDataStoreSetStatisticsPrevalentResource):
            (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
            (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
            (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
            * UIProcess/API/C/WKWebsiteDataStoreRef.h:
            * UIProcess/WebResourceLoadStatisticsStore.cpp:
            (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
            (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
            (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
            (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
            (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
            (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
            (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
            * UIProcess/WebResourceLoadStatisticsStore.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233877. rdar://problem/42344047

    Add color filter for transforming colors in Dark Mode
    https://bugs.webkit.org/show_bug.cgi?id=187717
    Source/WebCore:
    
    rdar://problem/41146650
    
    Reviewed by Dean Jackson.
    
    Add a new filter function for use in -apple-color-filter for transforming colors
    when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
    It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
    of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().
    
    Test: css3/color-filters/color-filter-apple-invert-lightness.html
    
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::ComputedStyleExtractor::valueForFilter):
    * css/CSSValueKeywords.in:
    * css/StyleResolver.cpp:
    (WebCore::filterOperationForType):
    (WebCore::StyleResolver::createFilterOperations):
    * css/parser/CSSPropertyParser.cpp:
    (WebCore::CSSPropertyParser::parseSingleValue):
    * css/parser/CSSPropertyParserHelpers.cpp:
    (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
    (WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
    (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
    (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
    (WebCore::CSSPropertyParserHelpers::consumeFilter):
    (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
    * css/parser/CSSPropertyParserHelpers.h:
    * page/FrameView.cpp:
    (WebCore::FrameView::paintContents):
    * platform/graphics/Color.cpp:
    * platform/graphics/ColorUtilities.cpp:
    (WebCore::sRGBToLinearComponents):
    (WebCore::linearToSRGBComponents):
    (WebCore::sRGBToLinearColorComponentForLuminance):
    (WebCore::luminance):
    (WebCore::sRGBToHSL):
    (WebCore::calcHue):
    (WebCore::HSLToSRGB):
    (WebCore::ColorMatrix::ColorMatrix):
    * platform/graphics/ColorUtilities.h:
    * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
    (PlatformCAFilters::filterValueForOperation):
    (PlatformCAFilters::colorMatrixValueForFilter):
    * platform/graphics/filters/FEColorMatrix.cpp:
    * platform/graphics/filters/FilterOperation.cpp:
    (WebCore::InvertLightnessFilterOperation::operator== const):
    (WebCore::InvertLightnessFilterOperation::blend):
    (WebCore::InvertLightnessFilterOperation::transformColor const):
    (WebCore::operator<<):
    * platform/graphics/filters/FilterOperation.h:
    * rendering/FilterEffectRenderer.cpp:
    (WebCore::FilterEffectRenderer::build):
    
    Source/WebKit:
    
    Reviewed by Dean Jackson.
    
    * Shared/WebCoreArgumentCoders.cpp:
    (IPC::ArgumentCoder<FilterOperation>::encode):
    (IPC::decodeFilterOperation):
    
    LayoutTests:
    
    rdar://problem/41146650
    
    Reviewed by Dean Jackson.
    
    * css3/color-filters/color-filter-apple-invert-lightness-expected.html: Added.
    * css3/color-filters/color-filter-apple-invert-lightness.html: Added.
    * css3/color-filters/color-filter-parsing-expected.txt:
    * css3/color-filters/color-filter-parsing.html:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233877 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Simon Fraser  <simon.fraser@apple.com>

            Add color filter for transforming colors in Dark Mode
            https://bugs.webkit.org/show_bug.cgi?id=187717

            Reviewed by Dean Jackson.

            * Shared/WebCoreArgumentCoders.cpp:
            (IPC::ArgumentCoder<FilterOperation>::encode):
            (IPC::decodeFilterOperation):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233876. rdar://problem/42345027

    Black flash in content area when returning to Mail
    https://bugs.webkit.org/show_bug.cgi?id=187719
    <rdar://problem/42165340>
    
    Reviewed by Wenson Hsieh.
    
    * UIProcess/ios/WebPageProxyIOS.mm:
    (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
    This still reproduces sometimes even after r233723, because:
    
    If a pending commit arrives after ApplicationDidEnterBackground (when we
    ask the web content process to freeze the layer tree), and after
    ApplicationDidFinishSnapshottingAfterEnteringBackground (when we hide
    WKContentView), but before the process sleeps, it will cause WKContentView
    to be unhidden (potentially including layers with empty surfaces as contents).
    Nothing will re-hide WKContentView. Instead, we should wait for the next
    *pending* commit, which will necessarily not come until after the application
    returns to the foreground because of the strict IPC ordering between
    the message that freezes the layer tree and the "next commit" mechanism.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233876 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Black flash in content area when returning to Mail
            https://bugs.webkit.org/show_bug.cgi?id=187719
            <rdar://problem/42165340>

            Reviewed by Wenson Hsieh.

            * UIProcess/ios/WebPageProxyIOS.mm:
            (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
            This still reproduces sometimes even after r233723, because:

            If a pending commit arrives after ApplicationDidEnterBackground (when we
            ask the web content process to freeze the layer tree), and after
            ApplicationDidFinishSnapshottingAfterEnteringBackground (when we hide
            WKContentView), but before the process sleeps, it will cause WKContentView
            to be unhidden (potentially including layers with empty surfaces as contents).
            Nothing will re-hide WKContentView. Instead, we should wait for the next
            *pending* commit, which will necessarily not come until after the application
            returns to the foreground because of the strict IPC ordering between
            the message that freezes the layer tree and the "next commit" mechanism.

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233872. rdar://problem/42345272

    Source/WebCore:
    [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
    https://bugs.webkit.org/show_bug.cgi?id=187375
    
    Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
    Reviewed by Simon Fraser.
    
    An immediate-paint transaction should force all the images which are pending
    decoding to be repainted.
    
    To do that, FrameView::paintControlTints() will be re-factored to a new
    generic function such that it takes PaintInvalidationReasons. The new function
    which is named 'traverseForPaintInvalidation' will traverse the render tree
    for a specific PaintInvalidationReasons.
    
    invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
    the underlying image and repaint all the clients which are waiting for the
    decoding to finish.
    
    * loader/cache/CachedImage.cpp:
    (WebCore::CachedImage::didRemoveClient):
    (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
    (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
    (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
    (WebCore::CachedImage::allClientsRemoved):
    (WebCore::CachedImage::clear):
    (WebCore::CachedImage::createImage):
    (WebCore::CachedImage::imageFrameAvailable):
    (WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
    * loader/cache/CachedImage.h:
    * page/FrameView.cpp:
    (WebCore::FrameView::paintScrollCorner):
    (WebCore::FrameView::updateControlTints):
    (WebCore::FrameView::traverseForPaintInvalidation):
    (WebCore::FrameView::adjustPageHeightDeprecated):
    (WebCore::FrameView::paintControlTints): Deleted.
    * page/FrameView.h:
    * platform/ScrollView.cpp:
    (WebCore::ScrollView::paint):
    * platform/Scrollbar.cpp:
    (WebCore::Scrollbar::paint):
    * platform/graphics/BitmapImage.h:
    * platform/graphics/GraphicsContext.cpp:
    (WebCore::GraphicsContext::GraphicsContext):
    * platform/graphics/GraphicsContext.h:
    (WebCore::GraphicsContext::performingPaintInvalidation const):
    (WebCore::GraphicsContext::invalidatingControlTints const):
    (WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
    (WebCore::GraphicsContext::updatingControlTints const): Deleted.
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintFillLayerExtended):
    * rendering/RenderImage.cpp:
    (WebCore::RenderImage::paintReplaced):
    (WebCore::RenderImage::paintAreaElementFocusRing):
    (WebCore::RenderImage::paintIntoRect):
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::paintScrollCorner):
    (WebCore::RenderLayer::paintResizer):
    (WebCore::RenderLayer::paintLayer):
    * rendering/RenderScrollbar.cpp:
    (WebCore::RenderScrollbar::paint):
    * rendering/RenderTheme.cpp:
    (WebCore::RenderTheme::paint):
    * testing/Internals.cpp:
    (WebCore::Internals::invalidateControlTints):
    (WebCore::Internals::paintControlTints): Deleted.
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
    https://bugs.webkit.org/show_bug.cgi?id=187375
    
    Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
    Reviewed by Simon Fraser.
    
    For immediate-paint transaction, we should force all the images which are
    pending decoding to be repainted before building this transaction.
    
    * WebProcess/Plugins/PDF/PDFPlugin.mm:
    (WebKit::PDFPlugin::updateControlTints):
    * WebProcess/Plugins/PluginView.cpp:
    (WebKit::PluginView::paint):
    * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
    (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
    
    LayoutTests:
    [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
    https://bugs.webkit.org/show_bug.cgi?id=187375
    
    Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
    Reviewed by Simon Fraser.
    
    The Internals API paintControlTints() is now renamed to invalidateControlTints()
    to be consistent with the new enum values and with the new name of the
    C++ function.
    
    * fast/css/webkit-mask-crash-fieldset-legend.html:
    * fast/css/webkit-mask-crash-figure.html:
    * fast/css/webkit-mask-crash-table.html:
    * fast/css/webkit-mask-crash-td-2.html:
    * fast/css/webkit-mask-crash-td.html:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233872 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>

            [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
            https://bugs.webkit.org/show_bug.cgi?id=187375

            Reviewed by Simon Fraser.

            For immediate-paint transaction, we should force all the images which are
            pending decoding to be repainted before building this transaction.

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::updateControlTints):
            * WebProcess/Plugins/PluginView.cpp:
            (WebKit::PluginView::paint):
            * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
            (WebKit::RemoteLayerTreeDrawingArea::flushLayers):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233869. rdar://problem/42344023

    Allow removal of white backgrounds
    https://bugs.webkit.org/show_bug.cgi?id=187574
    <rdar://problem/41146792>
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    Add a drawing mode that turns white backgrounds into transparent
    regions, such that a hosting app can see through to its window.
    
    Test: css3/color-filters/punch-out-white-backgrounds.html
    
    * page/Settings.yaml: New Setting.
    
    * rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
    if the background is white and we are punching out backgrounds, which means
    that it will erase the destination.
    (WebCore::InlineFlowBox::paintBoxDecorations):
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::paintBackground): Ditto.
    * rendering/RenderTableCell.cpp:
    (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.
    
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
    the composition mode if necessary.
    
    Source/WebKit:
    
    Add a new WebPreference for punching out white backgrounds.
    
    * Shared/WebPreferences.yaml:
    * UIProcess/API/C/WKPreferences.cpp:
    (WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode):
    (WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode):
    * UIProcess/API/C/WKPreferencesRefPrivate.h:
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _initializeWithConfiguration:]):
    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
    (-[WKWebViewConfiguration init]):
    (-[WKWebViewConfiguration copyWithZone:]):
    (-[WKWebViewConfiguration _punchOutWhiteBackgroundsInDarkMode]):
    (-[WKWebViewConfiguration _setPunchOutWhiteBackgroundsInDarkMode:]):
    * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
    
    Source/WebKitLegacy/mac:
    
    Add a new WebPreference for punching out white backgrounds.
    
    * WebView/WebPreferenceKeysPrivate.h:
    * WebView/WebPreferences.mm:
    (+[WebPreferences initialize]):
    (-[WebPreferences punchOutWhiteBackgroundsInDarkMode]):
    (-[WebPreferences setPunchOutWhiteBackgroundsInDarkMode:]):
    * WebView/WebPreferencesPrivate.h:
    * WebView/WebView.mm:
    (-[WebView _preferencesChanged:]):
    
    Tools:
    
    Add a new menu item for punching out white backgrounds in MiniBrowser.
    In WebKitTestRunner, expose the new setting and hook that up to
    drawing a background in the WebView.
    
    * MiniBrowser/mac/AppDelegate.m:
    (defaultConfiguration): Add _punchOutWhiteBackgroundsInDarkMode.
    
    * MiniBrowser/mac/SettingsController.h: Ditto.
    * MiniBrowser/mac/SettingsController.m:
    (-[SettingsController _populateMenu]):
    (-[SettingsController validateMenuItem:]):
    (-[SettingsController togglePunchOutWhiteBackgroundsInDarkMode:]):
    (-[SettingsController punchOutWhiteBackgroundsInDarkMode]):
    
    * MiniBrowser/mac/WK1BrowserWindowController.m:
    (-[WK1BrowserWindowController didChangeSettings]): Set the new preference.
    
    * WebKitTestRunner/PlatformWebView.h: Expose a drawsBackground property.
    * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: Null implementation.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    * WebKitTestRunner/wpe/PlatformWebViewWPE.cpp: Ditto.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    * WebKitTestRunner/ios/PlatformWebViewIOS.mm: Call into the WKWebView and
    set its SPI.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    * WebKitTestRunner/mac/PlatformWebViewMac.mm: Ditto.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    
    * WebKitTestRunner/TestController.cpp: Reset and copy the new preference.
    (WTR::TestController::resetPreferencesToConsistentValues):
    (WTR::updateTestOptionsFromTestHeader):
    * WebKitTestRunner/TestOptions.h:
    (WTR::TestOptions::hasSameInitializationOptions const):
    
    * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
    (WTR::TestController::platformCreateWebView): If the option for punching
    out the background was set, tell the WebView to not draw its background.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233869 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-11  Dean Jackson  <dino@apple.com>

            Allow removal of white backgrounds
            https://bugs.webkit.org/show_bug.cgi?id=187574
            <rdar://problem/41146792>

            Reviewed by Simon Fraser.

            Add a new WebPreference for punching out white backgrounds.

            * Shared/WebPreferences.yaml:
            * UIProcess/API/C/WKPreferences.cpp:
            (WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode):
            (WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode):
            * UIProcess/API/C/WKPreferencesRefPrivate.h:
            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _initializeWithConfiguration:]):
            * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
            (-[WKWebViewConfiguration init]):
            (-[WKWebViewConfiguration copyWithZone:]):
            (-[WKWebViewConfiguration _punchOutWhiteBackgroundsInDarkMode]):
            (-[WKWebViewConfiguration _setPunchOutWhiteBackgroundsInDarkMode:]):
            * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233865. rdar://problem/42343023

    Fullscreen requires active document.
    https://bugs.webkit.org/show_bug.cgi?id=186226
    rdar://problem/36187413
    
    Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-16
    Reviewed by Jer Noble.
    
    Source/WebCore:
    
    Test: media/no-fullscreen-when-hidden.html
    
    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
    
    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.
    
    Document::hidden() can't be relied upon because it won't update while JavaScript spins.
    
    This change adds a sync call to the UI process to get the current UI visibility state.
    
    * dom/Document.cpp:
    (WebCore::Document::requestFullScreenForElement):
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    * page/ChromeClient.h:
    
    Source/WebKit:
    
    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
    
    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.
    
    Document::hidden() can't be relied upon because it won't update while JavaScript spins.
    
    This change adds a sync call to the UI process to get the current UI visibility state.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::getIsViewVisible):
    * UIProcess/WebPageProxy.h:
    * UIProcess/WebPageProxy.messages.in:
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::isViewVisible):
    * WebProcess/WebCoreSupport/WebChromeClient.h:
    
    LayoutTests:
    
    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
    
    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.
    
    Document::hidden() can't be relied upon because it won't update while JavaScript spins.
    
    This change adds a sync call to the UI process to get the current UI visibility state.
    
    * media/no-fullscreen-when-hidden.html: Added.
    * media/video-test.js:
    (eventName.string_appeared_here.thunk):
    (runWithKeyDown):
    * platform/ios-wk1/TestExpectations:
    * platform/mac-wk1/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233865 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Jeremy Jones  <jeremyj@apple.com>

            Fullscreen requires active document.
            https://bugs.webkit.org/show_bug.cgi?id=186226
            rdar://problem/36187413

            Reviewed by Jer Noble.

            This change guarantees the document to be visible for both element fullscreen and video fullscreen.

            User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
            because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
            be hidden.

            Document::hidden() can't be relied upon because it won't update while JavaScript spins.

            This change adds a sync call to the UI process to get the current UI visibility state.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::getIsViewVisible):
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::isViewVisible):
            * WebProcess/WebCoreSupport/WebChromeClient.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233864. rdar://problem/42344962

    REGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempting to dismiss it
    https://bugs.webkit.org/show_bug.cgi?id=187706
    <rdar://problem/42137088>
    
    Reviewed by Wenson Hsieh.
    
    * UIProcess/ios/forms/WKFileUploadPanel.mm:
    Remove an unused member.
    
    (-[WKFileUploadPanel _dismissDisplayAnimated:]):
    Allow us to dismiss the camera view controller in addition to the menu.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233864 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            REGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempting to dismiss it
            https://bugs.webkit.org/show_bug.cgi?id=187706
            <rdar://problem/42137088>

            Reviewed by Wenson Hsieh.

            * UIProcess/ios/forms/WKFileUploadPanel.mm:
            Remove an unused member.

            (-[WKFileUploadPanel _dismissDisplayAnimated:]):
            Allow us to dismiss the camera view controller in addition to the menu.

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233853. rdar://problem/42344991

    IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
    https://bugs.webkit.org/show_bug.cgi?id=187631
    <rdar://problem/42164227>
    
    Reviewed by Brady Eidson.
    
    Source/WebCore:
    
    When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin
    is that origin. Given that the origin may create IndexedDB from subframes, we should delete
    databases whose openingOrigin is that origin too.
    
    Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths.
    
    * Modules/indexeddb/server/IDBServer.cpp:
    (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
    
    Source/WebKit:
    
    We need to return all origins, both openingOrigin and mainFrameOrigin, of IndexedDB so users
    could be better aware of which origins are using databases and decide what they want to
    remove.
    
    * StorageProcess/StorageProcess.cpp:
    (WebKit::StorageProcess::indexedDatabaseOrigins):
    * StorageProcess/StorageProcess.h:
    
    Tools:
    
    * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
    (TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233853 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Sihui Liu  <sihui_liu@apple.com>

            IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
            https://bugs.webkit.org/show_bug.cgi?id=187631
            <rdar://problem/42164227>

            Reviewed by Brady Eidson.

            We need to return all origins, both openingOrigin and mainFrameOrigin, of IndexedDB so users
            could be better aware of which origins are using databases and decide what they want to
            remove.

            * StorageProcess/StorageProcess.cpp:
            (WebKit::StorageProcess::indexedDatabaseOrigins):
            * StorageProcess/StorageProcess.h:

2018-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] http/tests/misc/bubble-drag-events.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=182352

        Reviewed by Youenn Fablet.

        PingLoad is not refcounted and deletes itself when the load finishes. The problem is that the network data
        task can also finish the load, causing the PingLoad to be deleted early. We tried to fix it in r233032 in the
        network data task soup implementation, but it caused regressions.

        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::didReceiveChallenge): Create a weak ref for the ping load before calling the operation completion
        handler and return early after the completion handler if it was deleted.
        (WebKit::PingLoad::didReceiveResponseNetworkSession): Ditto.
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::continueAuthenticate): Revert r233032.

2018-07-13  Timothy Hatcher  <timothy@apple.com>

        Add _drawsBackground to WKWebViewConfiguration.
        https://bugs.webkit.org/show_bug.cgi?id=187665
        rdar://problem/42182268

        Reviewed by Tim Horton.

        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::copy const): Copy m_drawsBackground, and some missing values.
        * UIProcess/API/APIPageConfiguration.h:
        (API::PageConfiguration::drawsBackground const): Added.
        (API::PageConfiguration::setDrawsBackground): Added.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Transfer _drawsBackground to page config.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]): Set _drawsBackground to YES.
        (-[WKWebViewConfiguration encodeWithCoder:]): Encode _drawsBackground.
        (-[WKWebViewConfiguration initWithCoder:]): Decode _drawsBackground.
        (-[WKWebViewConfiguration copyWithZone:]): Copy _drawsBackground.
        (-[WKWebViewConfiguration _drawsBackground]): Added.
        (-[WKWebViewConfiguration _setDrawsBackground:]): Added.
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp: Set m_drawsBackground based on configuration.

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

        WebKit sometimes holds WiFi/BT assertions while the Networking process is suspended
        https://bugs.webkit.org/show_bug.cgi?id=187662
        <rdar://problem/41999448>

        Reviewed by Chris Dumez.

        Inform WiFiAssertions when the Networking process is first going into the background,
        so it has a chance of dropping its assertions even in cases where the system
        suspends the process before we receive prepareToSuspend.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::processDidTransitionToForeground):
        (WebKit::NetworkProcess::processDidTransitionToBackground):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::sendProcessDidTransitionToForeground):
        (WebKit::NetworkProcessProxy::sendProcessDidTransitionToBackground):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::updateProcessAssertions):
        Plumb the foreground/background transition to NetworkProcess.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
        (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
        Make use of SuspensionReason to explain to WiFiAssertions the
        difference between prepareToSuspend and didTransitionToBackground,
        so that it can adjust the timing of dropping the assertion.

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

        REGRESSION (r231676): watchOS WebKit usually doesn't load in the background
        https://bugs.webkit.org/show_bug.cgi?id=187663
        <rdar://problem/42181185>

        Reviewed by Chris Dumez.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackground):
        "Screen lock" is very aggressive on watchOS; we want to do our usual
        30 seconds of loading in the background when you drop your wrist,
        so disable this power optimization on that platform.

2018-07-13  Chris Dumez  <cdumez@apple.com>

        WebResourceLoader may try to send a IPC with a destination ID that is 0
        https://bugs.webkit.org/show_bug.cgi?id=187654
        <rdar://problem/39265927>

        Reviewed by Brady Eidson.

        WebResourceLoader may try to send a IPC with a destination ID that is 0 according to release
        assertion hits we see in the wild. This can lead to HashMap corruption on recipient side when
        trying to lookup a key that is 0.

        As per the crash traces, we see it starts from WebLoaderStrategy::internallyFailedLoadTimerFired()
        which is likely due to the Network process crashing. WebLoaderStrategy::networkProcessCrashed()
        calls scheduleInternallyFailedLoad() on each ResourceLoader and clears the WebResourceLoaders in
        m_webResourceLoaders. When a ResourceLoader is cancelled (marked as failed), we clear its identifier
        and we normally null out the WebLoaderStrategy's coreLoader. However, if we cannot find the
        WebResourceLoader in m_webResourceLoaders (because that map was already cleared) then the
        WebResourceLoader's coreLoader may not get nulled out, even if the coreLoader's identifier has
        been reset. We have 2 lambdas in WebResourceLoader which keep the WebResourceLoader alive and
        try to send IPC and are merely doing a null check on the coreLoader before trying to send the
        IPC.

        To address the issue, we now clear the WebResourceLoader's coreLoader in
        WebLoaderStrategy::networkProcessCrashed(). For robustness, we also check that a coreLoader's
        identifier is not 0 before trying to send IPC.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::networkProcessCrashed):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::willSendRequest):
        (WebKit::WebResourceLoader::didReceiveResponse):

2018-07-13  Zach Li  <zachli@apple.com>

        Allow BOCOM and ABC plug-ins to run unsandboxed
        https://bugs.webkit.org/show_bug.cgi?id=187652
        rdar://problem/42149182

        Reviewed by Youenn Fablet.

        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):

2018-07-13  Chris Dumez  <cdumez@apple.com>

        Add more threading release assertions
        https://bugs.webkit.org/show_bug.cgi?id=187647

        Reviewed by Alex Christensen.

        Add more threading release assertions to help debug <rdar://problem/39265927>.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::m_isInPrewarmedPool):
        (WebKit::WebProcessProxy::~WebProcessProxy):
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::didFinishLaunching):

2018-07-13  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] Add windows storage process connection implementation
        https://bugs.webkit.org/show_bug.cgi?id=187531

        Reviewed by Fujii Hironori.

        * NetworkProcess/NetworkProcess.cpp:
        * Platform/IPC/Attachment.h:
        * StorageProcess/StorageProcess.cpp:
        * UIProcess/Storage/StorageProcessProxy.cpp:

2018-07-13  Dan Bernstein  <mitz@apple.com>

        [macOS] REGRESSION (r233536): Development WebContent service got opted back into Library Validation
        https://bugs.webkit.org/show_bug.cgi?id=187640

        Reviewed by Daniel Bates.

        * Scripts/process-webcontent-entitlements.sh: Add the
          com.apple.security.cs.disable-library-validation to the Development service regardless of
          whether restricted entitlements are to be used, because that entitlement is not restricted.

2018-07-13  Chris Dumez  <cdumez@apple.com>

        NetworkConnectionToWebProcess::m_networkResourceLoaders should use Ref<> for its values
        https://bugs.webkit.org/show_bug.cgi?id=187629

        Reviewed by Youenn Fablet.

        NetworkConnectionToWebProcess::m_networkResourceLoaders should use Ref<> for its values
        since they cannot be null.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:

2018-07-12  Alex Christensen  <achristensen@webkit.org>

        Reduce size of WebCore::URL
        https://bugs.webkit.org/show_bug.cgi?id=186820

        Reviewed by Yusuke Suzuki and Youenn Fablet.

        * NetworkProcess/cache/NetworkCacheStorage.h:
        Increment cache version because of URL encoding change.

2018-07-12  Chris Dumez  <cdumez@apple.com>

        [Cocoa] Make sure NetworkProcess::createNetworkConnectionToWebProcess() returns a valid mach port
        https://bugs.webkit.org/show_bug.cgi?id=187625

        Reviewed by Youenn Fablet.

        Make sure NetworkProcess::createNetworkConnectionToWebProcess() returns a valid mach port to help
        debug <rdar://problem/41995022>.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):

2018-07-12  Chris Dumez  <cdumez@apple.com>

        PingLoad does not need to ref the NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=187624

        Reviewed by Youenn Fablet.

        PingLoad does not need to ref the NetworkConnectionToWebProcess and keep it alive longer than it needs to be.
        Instead, ref the IPC::Connection which is lighter weight and gets invalidated when the NetworkConnectionToWebProcess
        is destroyed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:

2018-07-12  Brady Eidson  <beidson@apple.com>

        Make process-swap-on-navigation an experimental feature.
        <rdar://problem/41995053> and https://bugs.webkit.org/show_bug.cgi?id=187558

        Reviewed by Chris Dumez.

        * Shared/WebPreferences.yaml:
        
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetProcessSwapOnNavigationEnabled):
        (WKPreferencesGetProcessSwapOnNavigationEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
        
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage): If the new web page has PSON enabled via WebPreferences,
          absorb that setting into this process pool's configuration.

2018-07-12  Chris Dumez  <cdumez@apple.com>

        Simplify code in NetworkConnectionToWebProcess::didReceiveMessage()
        https://bugs.webkit.org/show_bug.cgi?id=187621

        Reviewed by Youenn Fablet.

        Simplify code in NetworkConnectionToWebProcess::didReceiveMessage() by not using HashMap iterators and
        calling get() directly.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):

2018-07-12  Chris Dumez  <cdumez@apple.com>

        Make sure WebProcess::ensureNetworkProcessConnection() is always called on the main thread
        https://bugs.webkit.org/show_bug.cgi?id=187607

        Reviewed by Alex Christensen.

        Add release assertion to make sure that ensureNetworkProcessConnection() is always called on the main
        thread. Calling it on a background thread would not be safe. It would not be safe because:
        1. We check if we have a network process connection and then create one if we don't without any locking.
        2. It is not safe to construct or use a NetworkProcessConnection object from a non-main thread

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2018-07-12  Chris Dumez  <cdumez@apple.com>

        Assert that the IPC::Connection is valid in Connection::dispatchMessage(Decoder&)
        https://bugs.webkit.org/show_bug.cgi?id=187617

        Reviewed by Youenn Fablet.

        Assert that the IPC::Connection is valid in Connection::dispatchMessage(Decoder&) as
        m_client would be stale otherwise.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::dispatchMessage):

2018-07-12  Youenn Fablet  <youenn@apple.com>

        Add a FrameLoaderClient willInjectUserScriptForFrame callback
        https://bugs.webkit.org/show_bug.cgi?id=187565

        Reviewed by Alex Christensen.

        Introduce a new WKBundlePageLoaderClient callback that is called everytime a user script is injected.
        Implement WebFrameLoaderClient::willInjectUserScript by calling this new callback.

        * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
        (API::InjectedBundle::PageLoaderClient::willInjectUserScriptForFrame):
        * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (setUpPageLoaderClient):
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
        (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame):
        (WebKit::InjectedBundlePageLoaderClient::willInjectUserScriptForFrame):
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::willInjectUserScript):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2018-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] When bringing MobileSafari to the foreground, images are drawn asynchronously after removing a snapshot that included them
        https://bugs.webkit.org/show_bug.cgi?id=187374
        <rdar://problem/41249545>

        Reviewed by Tim Horton.

        UIProcess should block committing all the layer tree transactions for 
        immediate update until it receives a one whose activityStateChangeID is
        greater than or equal to the one it sends with SetActivityState message.

        * Scripts/webkit/messages.py:
        Fix the messages code generator to include DrawingAreaInfo.h for the WebKit
        typedef ActivityStateChangeID.

        * Shared/DrawingAreaInfo.h:
        Define ActivityStateChangeID to be uint64_t. Add a definition for the case
        when the UIProcess won't be blocked for a reply back from the WebProcess.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::activityStateChangeID const):
        (WebKit::RemoteLayerTreeTransaction::setActivityStateChangeID):
        Add a member for activityStateChangeID in the LayerTreeTransaction.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::encode const):
        (WebKit::RemoteLayerTreeTransaction::decode):
        Make LayerTreeTransaction know how to encode and decode activityStateChangeID.

        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
        (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
        Make the DrawingArea in the UIProcess wait the layer tree with a certain
        activityStateChangeID.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        (WebKit::WebPageProxy::waitForDidUpdateActivityState):
        If m_activityStateChangeWantsSynchronousReply is true, generate a new 
        activityStateChangeID and send it in the SetActivityState message.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::takeNextActivityStateChangeID):
        A simple way to generate a new activityStateChangeID.

        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
        Fix the UIProcess functions' prototype for Mac.

        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        (WebKit::AcceleratedDrawingArea::activityStateDidChange):
        * WebProcess/WebPage/AcceleratedDrawingArea.h:
        Fix the UIProcess functions' prototype for GTK.

        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::activityStateDidChange):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        Replace wantsDidUpdateActivityState with activityStateChangeID. Treat
        activityStateChangeID == ActivityStateChangeAsynchronous as if 
        wantsDidUpdateActivityState == false.

        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
        Make the WebPrcess pass the activityStateChangeID which it receives from
        the SetActivityState message to the LayerTreeTransaction.

        (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
        When receiving the SetActivityState, treat activityStateChangeID !=
        ActivityStateChangeAsynchronous as if wantsDidUpdateActivityState == true.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reinitializeWebPage):
        (WebKit::WebPage::setActivityState):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        Replace the boolean wantsDidUpdateActivityState with activityStateChangeID
        in the SetActivityState message.

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
        (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
        Fix the WebProcess functions' prototype for Mac.

2018-07-12  Antti Koivisto  <antti@apple.com>

        REGRESSION (r232356): After zooming a page in and out, it's possible to temporarily have missing tiles (google.com, apple.com)
        https://bugs.webkit.org/show_bug.cgi?id=187553
        <rdar://problem/41863803>

        Reviewed by Simon Fraser.

        We ignore zoom scale from UI process if it doesn't match the last remote layer tree transaction. However nothing
        guarantees that we receive the real scale again until user interacts with the page. This means the web process
        scale and the UI process scale can be wildly out of sync.

        This problem becomes more likely to be visible when
        - we are under memory pressure so we don't update tiles during zooming and rely on the one final update afterwards
        - the page generates lots of layer tree transactions

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

        Remember the last transaction where we actually changed the page scale.

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

        Only reject the UI process scale if there has been a scale changing transaction meanwhile.
        The transaction id test was added in r218149 and the problem it fixed remains fixed. This change also matches better
        what it was purpoted to implement.

2018-07-12  Megan Gardner  <megan_gardner@apple.com>

        Keep Selections within Shadow DOM boundaries
        https://bugs.webkit.org/show_bug.cgi?id=187556
        <rdar://problem/41664567>

        Reviewed by Ryosuke Niwa.

        Update rangeForPosition to take into account both editing and shadow DOM boundries.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeForPoint):
        (WebKit::WebPage::updateSelectionWithTouches):
        (WebKit::rangeForPosition): Deleted.
        
2018-07-12  Jer Noble  <jer.noble@apple.com>

        REGRESSION (r230163): Videos cannot be seen full screen in Complete Anatomy app
        https://bugs.webkit.org/show_bug.cgi?id=187527
        <rdar://problem/40511527>

        Reviewed by Ryosuke Niwa.

        Do not enable element fullscreen mode unless apps specifically opt-in. The Fullscreen API is
        an experimental feature on iOS, but not on Mac, but we can't simply not return the ExperimentalFeature
        object from the list of experimental features, as this keeps Safari from being able to apply a
        NSUserDefault value for that feature. Instead, add a property to API::ExperimentalFeature and
        _WKExperimentalFeature called "hidden", which signals to clients whether to display the feature
        in their UI.

        * Scripts/GeneratePreferences.rb:
        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/APIExperimentalFeature.cpp:
        (API::ExperimentalFeature::create):
        (API::ExperimentalFeature::ExperimentalFeature):
        * UIProcess/API/APIExperimentalFeature.h:
        * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
        * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
        (-[_WKExperimentalFeature isHidden]):

2018-07-12  Alexey Proskuryakov  <ap@apple.com>

        [Mac] Run Unlock Keychain more reliably
        https://bugs.webkit.org/show_bug.cgi?id=187604

        Reviewed by Dan Bernstein.

        Move unlocking to a separate target, and make it a dependency for all targets that
        produce binaries.
        
        This is more than strictly required to fix the build, but this way, we won't need
        to remember about keychain when project structure changes. Another consideration that
        wasn't initially apparent to me is that is should be possible to build any target,
        not just "All", so projects aren't necessarily built in the same order even now.

        * WebKit.xcodeproj/project.pbxproj: 

2018-07-12  Per Arne Vollan  <pvollan@apple.com>

        Add compile guard for enabling NSRunLoop in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=187563

        Reviewed by Chris Dumez.

        Also, replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) where appropriate.

        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Shared/ChildProcess.h:
        * Shared/mac/ChildProcessMac.mm:
        * Shared/mac/HangDetectionDisablerMac.mm:
        (WebKit::setClientsMayIgnoreEvents):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::shouldLeakBoost):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::PDFPlugin):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::stopRunLoop):

2018-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Pass the backend library name as command line parameter to the web process
        https://bugs.webkit.org/show_bug.cgi?id=186841

        Reviewed by Žan Doberšek.

        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess): Add --backend-library parameter when launching the web process.
        * WebProcess/wpe/WebProcessMainWPE.cpp: Call wpe_loader_init() with the library passed as --backend-library parameter.

2018-07-11  Jon Lee  <jonlee@apple.com>

        Update iOS fullscreen alert text
        https://bugs.webkit.org/show_bug.cgi?id=187576
        rdar://problem/42052284

        Reviewed by Ryosuke Niwa.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]): Update text and string keys.

2018-07-11  Aditya Keerthi  <akeerthi@apple.com>

        REGRESSION (231276): Attempting to copy an image fails
        https://bugs.webkit.org/show_bug.cgi?id=187212
        <rdar://problem/41540074>

        Reviewed by Ryosuke Niwa.

        r210683 introduced logic to prevent file URLs from being copied to the clipboard
        in unexpected cases. In order to achieve this functionality,
        checkURLReceivedFromWebProcess was called on all items in the pathnames array
        passed into WebPasteboardProxy::setPasteboardPathnamesForType. However, this
        method is a misnomer, as the pathnames array always contains exactly one URL and
        one title for the URL.

        Renamed methods to make it clear that one URL and one title are being passed in
        and updated logic to ensure that checkURLReceivedFromWebProcess is only called
        on the URL and not the title.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PasteboardURL>::encode):
        (IPC::ArgumentCoder<PasteboardURL>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardURL):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::setURL):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-07-11  Alex Christensen  <achristensen@webkit.org>

        Add SPI for immediate injection of user scripts
        https://bugs.webkit.org/show_bug.cgi?id=173342
        <rdar://problem/29202285>

        Reviewed by Brady Eidson, Youenn Fablet, and Geoff Garen.

        * UIProcess/API/C/WKPageGroup.cpp:
        (WKPageGroupAddUserScript):
        * UIProcess/API/C/WKUserContentControllerRef.cpp:
        (WKUserContentControllerAddUserScript):
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        (-[WKUserContentController addUserScript:]):
        (-[WKUserContentController _addUserScriptImmediately:]):
        * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::addUserScript):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::addUserScripts):
        (WebKit::WebUserContentController::addUserScriptInternal):
        If we are to inject the script internally, inject it into the appropriate pages.
        If we're injecting into the top frame only, there's no need to traverse the frame tree.
        (WebKit::WebUserContentController::addUserScript):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/UserContent/WebUserContentController.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_cpuLimit):

2018-07-11  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] Address a possible cause of missing tiles
        https://bugs.webkit.org/show_bug.cgi?id=187570
        rdar://problem/40941118

        Reviewed by Tim Horton.
        
        If the web process crashes, it's possible for the user to trigger a scroll before
        the process is re-launched. The pre-commit handler will bail early on the _isValid
        check without clearing _hasScheduledVisibleRectUpdate, so that remains YES and we
        get stuck doing no more visible content rect updates.
        
        Fix by adding -[WKWebView _didRelaunchProcess] (WKContentView got this already), and
        in that clear state that could have been set in the UI process while the web process
        connection was invalid.
        
        Also add more release logging around process termination, crash and relaunch.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        (-[WKWebView _didRelaunchProcess]):
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
        (-[WKWebView _updateVisibleContentRects]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::processDidTerminate):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didClose):
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didRelaunchProcess):

2018-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Release logging dumps "Cleaning up dragging state…" every time gesture recognizers are reset in WKContentView
        https://bugs.webkit.org/show_bug.cgi?id=187562

        Reviewed by Tim Horton.

        Tweaks up a release logging statement, such that it only logs when performing a drag or drop.

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

2018-07-11  Commit Queue  <commit-queue@webkit.org>

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

        "WKTR vs exp features, booooooo" (Requested by bradee-oh on
        #webkit).

        Reverted changeset:

        "Make process-swap-on-navigation an experimental feature."
        https://bugs.webkit.org/show_bug.cgi?id=187558
        https://trac.webkit.org/changeset/233741

2018-07-11  Brady Eidson  <beidson@apple.com>

        Make process-swap-on-navigation an experimental feature.
        <rdar://problem/41995053> and https://bugs.webkit.org/show_bug.cgi?id=187558

        Reviewed by Geoff Garen.

        * Shared/WebPreferences.yaml:

        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createWebPage): If the new web page has PSON enabled via WebPreferences,
          absorb that setting into this process pool's configuration.

2018-07-11  Jer Noble  <jer.noble@apple.com>

        Disable all network caching for HLS streams.
        https://bugs.webkit.org/show_bug.cgi?id=187544
        <rdar://problem/41863600>

        Reviewed by Chris Dumez.

        Revert the behavior added in r215263 where Media responses are cached if they are from
        a resource whose expected content length is <4MB.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::makeStoreDecision):
        (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange): Deleted.

2018-07-11  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] AC for fixed-position elements is not enabled
        https://bugs.webkit.org/show_bug.cgi?id=187514

        Reviewed by Carlos Garcia Campos.

        Enable accelerated compositing for fixed-position elements when using
        AcceleratedDrawingArea and AC is force-enabled. This effectively enables
        this option for the WPE port which is using the AcceleratedDrawingArea
        implementation and not DrawingAreaImpl like the GTK+ port.

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

2018-07-11  Christopher Reid  <chris.reid@sony.com>

        [Win][WebKit] Disable accelerated compositing until it is supported
        https://bugs.webkit.org/show_bug.cgi?id=187503

        Reviewed by Žan Doberšek.

        * UIProcess/win/WebView.cpp:

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

        REGRESSION (r233480): Mail contents flash black when activating
        https://bugs.webkit.org/show_bug.cgi?id=187504
        <rdar://problem/41752351>

        Reviewed by Simon Fraser.

        The sequence of events to reproduce the bug originally fixed in r203371
        is either:

        A) the simple background/foreground case

        1] app begins to suspend
        2] app suspension snapshots are taken
        3] WKWebView's surfaces are marked volatile
        4] app completes suspension
            ... time goes by ...
        5] WKWebView's volatile surfaces are purged
            ... time goes by ...
        6] app begins to resume, shows (good) suspension snapshot
        7] app removes suspension snapshot
        8] WKWebView has sublayers with purged (black) surfaces
        9] WKWebView sublayers are repaired by a new commit with nonvolatile surfaces

        B) the re-snapshot while in the background case

        1] app begins to suspend
        2] app suspension snapshots are taken
        3] WKWebView's surfaces are marked volatile
        4] app completes suspension
        ... time goes by ...
        5] WKWebView's volatile surfaces are purged
        ... time goes by ...
        6] app wakes up in the background to update its snapshots
        7] in the updated snapshots, WKWebView has sublayers with purged (black) surfaces
        ... time goes by ...
        8] app begins to resume, shows (bad) suspension snapshot
        9] WKWebView presents layers with purged (black) surfaces until new commit fixes them
        10] WKWebView sublayers are repaired by a new commit with nonvolatile surfaces

        WebKit's current approach to fix this problem is simply to hide the
        WKWebView's sublayers at some point after A2/B2 (suspension snapshots),
        but before A8/B7 (the first time the empty layers would be presented
        or snapshotted).

        Previously, we did this by hiding the layers when the window's CAContext
        was created, which happened early enough in both cases (at A6/B6).
        However, that notification was removed underneath us at some point.

        However, in looking at the timelines, there's a better place to do this:
        immediately after marking the surfaces volatile (A3/B3), which is always
        strictly after the app suspension snapshots are taken, and also always
        before the freshly-made-volatile layers could be presented or snapshotted.

        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
        (WebKit::ApplicationStateTracker::applicationDidCreateWindowContext): Deleted.
        * UIProcess/ios/WKApplicationStateTrackingView.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]): Deleted.
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _applicationDidCreateWindowContext]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
        Remove the didCreateWindowContext notification, and hide content after
        snapshotting after entering the background.

2018-07-10  Youenn Fablet  <youenn@apple.com>

        Make fetch() use "same-origin" credentials by default
        https://bugs.webkit.org/show_bug.cgi?id=176023

        Reviewed by Chris Dumez.

        Before the patch, when changing the credential mode in case of redirection,
        we were not waiting for WebProcess response to restart the load.
        This patch updates the implementation to ask the WebProcess whether to proceed as for other regular asynchronous loads.
        This requires some refactoring in particular we now pass request, redirectRequest and redirectResponse to NetworkLoadChecker
        that will send them back as part of the completion handler.

        To do so, we change manual redirection handling and make it a successful case and not an error case as before.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::redirectionError):
        (WebKit::NetworkLoadChecker::checkRedirection):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::restartNetworkLoad):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):

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

        [IOS] We should prevent WebProcess suspension while the UIProcess is waiting for a reply from its injected bundle
        https://bugs.webkit.org/show_bug.cgi?id=187536
        <rdar://problem/41931912>

        Reviewed by Brady Eidson.

        Update RemoteObjectRegistry to take a background process assertion for each pending reply on the
        UIProcess side. Otherwise, the destination web process may get suspended and the reply block would
        not get called. We already do this in WebPageProxy for callbacks waiting for an IPC from the
        WebProcess.

        * Shared/API/Cocoa/RemoteObjectRegistry.h:
        * Shared/API/Cocoa/RemoteObjectRegistry.mm:
        (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
        (WebKit::RemoteObjectRegistry::sendInvocation):
        (WebKit::RemoteObjectRegistry::callReplyBlock):
        (WebKit::RemoteObjectRegistry::releaseUnusedReplyBlock):
        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _initWithWebPage:]):
        (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
        (-[_WKRemoteObjectRegistry _initWithMessageSender:]): Deleted.
        * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _remoteObjectRegistry]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::remoteObjectRegistry):
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):

2018-07-09  Brian Burg  <bburg@apple.com>

        WebDriver: hang when running Selenium test correct_event_firing_tests.py::testShouldEmitOnChangeEventsWhenSelectingElements[Safari]
        https://bugs.webkit.org/show_bug.cgi?id=187486
        <rdar://problem/41987110>

        Reviewed by Tim Horton.

        This test takes the unusual step of doing Element Click directly on a <select> element,
        despite the specification supporting clicking on <option> elements directly. It hangs
        because we fire a nested run loop when the Carbon popup menu appears, and the nested runloop
        is not exited until the popup menu is clicked or dismissed.

        If a click is being simulated on the <select> via WebDriver, we should just not show
        the popup menu but still deliver all of the events that are fired when clicking the element.

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

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

        Try to fix the build

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):

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

        doAfterNextPresentationUpdate should not be called while content is hidden due to animated resize
        https://bugs.webkit.org/show_bug.cgi?id=187500
        <rdar://problem/41294139>

        Reviewed by Simon Fraser.

        Clients generally expect that after doAfterNextPresentationUpdate, there's
        something vaguely sensible on the screen. They use this to remove snapshots,
        unhide web views, etc.

        During some kinds of resize/rotation, we will hide the WKContentView,
        and asynchronously hide it when the resize/rotation is complete. This
        can cause clients to prematurely expose a blank WKWebView.

        To fix this, avoid calling doAfterNextPresentationUpdate until the
        animated resize completes. Add a variant that does not wait for this
        (to be used for testing purposes).

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        Rename the vector of blocks that we call after animated resize completes
        to be generic rather than just about snapshots.

        (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
        Add this _internal variant of _doAfterNextPresentationUpdate that takes bits determining
        which waits to perform or avoid, to reduce duplication.

        (-[WKWebView _doAfterNextPresentationUpdate:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]):
        (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
        Call _internalDoAfterNextPresentationUpdate with the appropriate bits set for each situation.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        Add _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting to WKWebView(WKTesting).

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

        REGRESSION (r231510): Dismissing PDFPlugin context menu automatically clicks the first item
        https://bugs.webkit.org/show_bug.cgi?id=187507
        <rdar://problem/42007155>

        Reviewed by Per Arne Vollan.

        WebPageProxy::showPDFContextMenu, introduced in r213510, assumes that
        the user always chooses some item from the menu; it does not handle
        the case where the context menu is dismissed without selecting anything.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/WebPageProxyMac.mm:
        (-[WKPDFMenuTarget selectedMenuItem]):
        (-[WKPDFMenuTarget contextMenuAction:]):
        (WebKit::WebPageProxy::showPDFContextMenu):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::handleContextMenuEvent):
        Make showPDFContextMenu return an optional index, instead of always
        returning an index. Don't perform any action if it is nullopt.

2018-07-10  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] Support display of webinspector ui on non-legacy minibrowser
        https://bugs.webkit.org/show_bug.cgi?id=187415

        Reviewed by Brian Burg.

        * UIProcess/WebInspectorProxy.h:
        * UIProcess/win/WebInspectorProxyWin.cpp:
        (WebKit::getInspectedWindowInfo):
        (WebKit::WebInspectorProxy::windowReceivedMessage):
        (WebKit::WebInspectorProxy::wndProc):
        (WebKit::WebInspectorProxy::registerWindowClass):
        (WebKit::decidePolicyForNavigationAction):
        (WebKit::webProcessDidCrash):
        (WebKit::WebInspectorProxy::platformCreateFrontendPage):
        (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
        (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
        (WebKit::WebInspectorProxy::platformAttach):
        (WebKit::WebInspectorProxy::platformDetach):
        (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
        (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
        (WebKit::WebInspectorProxy::platformIsFront):
        (WebKit::WebInspectorProxy::platformHide):
        (WebKit::WebInspectorProxy::platformBringToFront):
        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
        (WebKit::WebInspectorProxy::platformInspectedURLChanged):
        (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
        (WebKit::WebInspectorProxy::platformDidCloseForCrash):
        (WebKit::WebInspectorProxy::platformInvalidate):
        (WebKit::WebInspectorProxy::platformStartWindowDrag):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openFrontendConnection):
        * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL):

2018-07-10  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make testRunner.statisticsResetToConsistentState() take a completion handler
        https://bugs.webkit.org/show_bug.cgi?id=187499
        <rdar://problem/41999431>

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
            Now uses a WTF::CallbackAggregator to call its
            completion handler when both the call to
            WebResourceLoadStatisticsStore::scheduleClearInMemory()
            and to
            WebResourceLoadStatisticsStore::resetParametersToDefaultValues()
            are complete.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
            Now takes a WTF::CompletionHandler so that it can support the
            completion handler in
            WKWebsiteDataStoreStatisticsResetToConsistentState().
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
            Now takes a WTF::CompletionHandler so that it can support the
            completion handler in
            WKWebsiteDataStoreStatisticsResetToConsistentState().
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>

        Disable cross-origin-window-policy by default
        https://bugs.webkit.org/show_bug.cgi?id=187509

        Reviewed by Chris Dumez.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCrossOriginWindowPolicyEnabled):
        (WKPreferencesGetCrossOriginWindowPolicyEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:

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

        REGRESSION (r232416): Flickering when going back to Google search results on back swipe
        https://bugs.webkit.org/show_bug.cgi?id=187506
        <rdar://problem/41939594>

        Reviewed by Chris Dumez.

        Same document navigations won't have a preceding didStartProvisionalLoadForMainFrame,
        so the code introduced in r232416 would immediately remove the snapshot
        upon any same document navigation.

        Instead, adjust r232416 slightly to start tracking snapshot removal events
        after didStartProvisionalLoad OR didSameDocumentNavigation. Call the block
        that starts tracking, then immediately fire the same-document navigation event.

        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
        (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
        (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
        (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
        * UIProcess/Cocoa/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::endSwipeGesture):

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

        Remove cfca.com.npCryptoKit.CGB.MAC.sb and cfca.com.npP11CertEnroll.MAC.CGB.sb
        https://bugs.webkit.org/show_bug.cgi?id=187487
        <rdar://problem/41991584>

        Reviewed by Alexey Proskuryakov.

        * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Removed.
        * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Removed.
        * WebKit.xcodeproj/project.pbxproj:

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

        Add the possibility to run unsandboxed plug-ins
        https://bugs.webkit.org/show_bug.cgi?id=187310
        <rdar://problem/41798808>

        Reviewed by Alexey Proskuryakov.

        Add a utility method to know which plug-ins are allowed to run unsandboxed.
        For such plug-ins, we skip the sandboxing done when starting the plug-in process.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::initializeSandbox):
        * Shared/WebPreferences.yaml:
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::shouldRunPluginUnsandboxed):
        * UIProcess/Plugins/PluginInfoStore.h:
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::shouldRunPluginUnsandboxed):
        (WebKit::PluginInfoStore::shouldUsePlugin):

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

        Remove fullscreen-auto-hide-delay
        https://bugs.webkit.org/show_bug.cgi?id=187493
        <rdar://problem/41830852>

        Reviewed by Antoine Quint.

        Now there is no delay, rename setFullscreenAutoHideTiming to setFullscreenAutoHideDuration,
        and only send that value over to the Web Process.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming): Deleted.
        * UIProcess/WebFullScreenManagerProxy.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController viewWillAppear:]):
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::didExitFullScreen):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideDuration):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming): Deleted.
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/FullScreen/WebFullScreenManager.messages.in:

2018-07-09  Timothy Hatcher  <timothy@apple.com>

        Semantic colors don't update when accessibility Increase Contrast mode is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=187425
        rdar://problem/39948240

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
        (-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
        (-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKView _effectiveAppearanceIsDark]): Deleted.
        (-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
        (WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
        The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
        and dark colors seperatly in RenderThemeMac.

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

        Shrink various loading-related enums to shrink CachedResource
        https://bugs.webkit.org/show_bug.cgi?id=187443

        Reviewed by Chris Dumez.

        * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
        (WebKit::LegacyCustomProtocolManager::wasRedirectedToRequest):
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::continueWillSendRequest):
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::canUseCache const):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::cachePolicyAllowsExpired):
        (WebKit::NetworkCache::makeRetrieveDecision):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
        * Shared/API/c/mac/WKURLRequestNS.mm:
        (WKURLRequestCopyNSURLRequest):
        * Shared/Cocoa/WKNSURLRequest.mm:
        (-[WKNSURLRequest _web_createTarget]):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
        * UIProcess/API/Cocoa/WKFrameInfo.mm:
        (-[WKFrameInfo request]):
        * UIProcess/API/Cocoa/WKNavigation.mm:
        (-[WKNavigation _request]):
        * UIProcess/API/Cocoa/WKNavigationAction.mm:
        (-[WKNavigationAction request]):
        * UIProcess/API/Cocoa/WKNavigationData.mm:
        (-[WKNavigationData originalRequest]):
        * UIProcess/API/Cocoa/WKNavigationResponse.mm:
        (-[WKNavigationResponse _request]):
        * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
        (-[WKURLSchemeTaskImpl request]):
        * UIProcess/API/Cocoa/_WKDownload.mm:
        (-[_WKDownload request]):
        * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
        (WebKit::LegacyCustomProtocolManagerClient::startLoading):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::maximumBufferingTime):
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::platformCanHandleRequest):

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

        WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() fails to protect the page in its lambda
        https://bugs.webkit.org/show_bug.cgi?id=187478
        <rdar://problem/41975998>

        Reviewed by Youenn Fablet.

        Make sure we protect the WebPageProxy when we capture it in the lambda or it might go away by the
        time the lambda gets called.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):

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

        [Curl] Remove unused AuthenticationManager static methods.
        https://bugs.webkit.org/show_bug.cgi?id=187419

        Reviewed by Yusuke Suzuki.

        The file for curl port was added without implementation and never called from anyware.
        Also interfaces only used by the curl port were removed from the shared header file.

        * PlatformWin.cmake:
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Removed.

2018-07-09  Stephan Szabo  <stephan.szabo@sony.com>

        Check that LayerTreeHost was created before use
        https://bugs.webkit.org/show_bug.cgi?id=187404

        Reviewed by Žan Doberšek.

        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):

2018-07-09  Commit Queue  <commit-queue@webkit.org>

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

        Revision caused the api test LinkColorWithSystemAppearance to
        fail on all systems. (Requested by Truitt on #webkit).

        Reverted changeset:

        "Semantic colors don't update when accessibility Increase
        Contrast mode is enabled."
        https://bugs.webkit.org/show_bug.cgi?id=187425
        https://trac.webkit.org/changeset/233612

2018-07-09  Brian Burg  <bburg@apple.com>

        WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
        https://bugs.webkit.org/show_bug.cgi?id=187418
        <rdar://problem/41909520>

        Unreviewed build fix for Sierra.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        According to some compilers, the local 'automationSession' is unused. Change this
        to just convert the return value to boolean rather than assign to an unused local.

2018-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        Introduce a layout milestone to track when the document contains a large number of rendered characters
        https://bugs.webkit.org/show_bug.cgi?id=187412
        <rdar://problem/41744338>

        Reviewed by Ryosuke Niwa.

        Add plumbing for the new significant rendered text layout milestone in the modern WebKit client layer. See
        WebCore/ChangeLog for more details.

        * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
        * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
        (renderingProgressEvents):
        * Shared/API/c/WKPageLoadTypes.h:
        * Shared/API/c/WKSharedAPICast.h:
        (WebKit::toWKLayoutMilestones):
        (WebKit::toLayoutMilestones):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (layoutMilestones):

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

        REGRESSION (r233561): MobileMail crashes when replying to an email
        https://bugs.webkit.org/show_bug.cgi?id=187436
        rdar://problem/41931915

        Reviewed by Alan Bujtas.
        
        r233561 added a RELEASE_ASSERT(isMainThread()) in this function. This is fine most of the time,
        until Mail spawns a WebThread for mail compose, at which point the meaning of isMainThread changes
        and the RELEASE_ASSERT fires.
        
        For now, just remove the RELEASE_ASSERT.

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

2018-07-06  Timothy Hatcher  <timothy@apple.com>

        Semantic colors don't update when accessibility Increase Contrast mode is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=187425
        rdar://problem/39948240

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
        (-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
        (-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
        (-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
        (-[WKView _effectiveAppearanceIsDark]): Deleted.
        (-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
        (WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
        The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
        and dark colors seperatly in RenderThemeMac.

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

        Add release assertions to try and catch a possible HashMap corruption in NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=187417

        Reviewed by Ryosuke Niwa.

        Add assertions to make sure we:
        - Always use NetworkConnectionToWebProcess::m_networkResourceLoaders from the main thread
        - Never use a 0 identifier as key for NetworkConnectionToWebProcess::m_networkResourceLoaders

        We see crashes (rdar://problem/39265927) that only seem to make sense if this HashMap was
        somehow getting corrupted. Let's try and catch the most common reasons for HashMap corruption.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
        (WebKit::NetworkConnectionToWebProcess::setDefersLoading):
        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::messageSenderDestinationID):

2018-07-06  Brian Burg  <bburg@apple.com>

        WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
        https://bugs.webkit.org/show_bug.cgi?id=187418
        <rdar://problem/41909520>

        Reviewed by Timothy Hatcher.

        Per the W3C specification, “User prompts that are spawned from beforeunload event handlers,
        are dismissed implicitly upon navigation or close window, regardless of the defined user prompt handler.”

        This behavior differs from legacy Selenium behavior where (as in the test) it's expected that
        a test can accept or dismiss a beforeunload alert manually.

        Prior to this patch, beforeunload alerts hang because Safari uses a nested modal run loop, which does
        not process incoming Automation messages, so there was no way for the test to manually dismiss
        the alert.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        Don't show beforeunload alerts for pages being controlled by automation.


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

        ASSERTION FAILED: contextConnection under WebCore::SWServer::terminateWorkerInternal
        https://bugs.webkit.org/show_bug.cgi?id=187348
        <rdar://problem/41853270>

        Reviewed by Youenn Fablet.

        Make sure we mark corresponding SWServerWorkers as terminated when we terminate a
        Service Worker context connection once it is no longer needed.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):

2018-07-06  Andy Estes  <aestes@apple.com>

        [iOS] WKPDFView should show the Data Detectors sheet when long-pressing a URL that Data Detectors can handle
        https://bugs.webkit.org/show_bug.cgi?id=187396
        <rdar://problem/41786980>

        Reviewed by Dan Bernstein.

        If a URL can be presented by Data Detectors, show the Data Detectors sheet instead
        of the link sheet. Also implement the optional WKActionSheetAssistantDelegate
        method that asks the UI delegate for its data detection context.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
        (-[WKPDFView dataDetectionContextForActionSheetAssistant:]):

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

        WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler() should take in a CompletionHandler
        https://bugs.webkit.org/show_bug.cgi?id=187392

        Reviewed by Youenn Fablet.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        [iOS] Assertion failure in WebProcessProxy::allProcesses() (isMainThread())
        https://bugs.webkit.org/show_bug.cgi?id=187394

        Reviewed by Dan Bernstein.

        Use RunLoop::isMain() instead of isMainThread() in the assertion to fix issues for
        applications using both WebKit and WebKitLegacy.

        * UIProcess/WebProcessProxy.cpp:

2018-07-06  Daniel Bates  <dabates@apple.com>

        Remove Strong Confirmation Password button
        https://bugs.webkit.org/show_bug.cgi?id=187306
        <rdar://problem/41795185>

        Reviewed by Sam Weinig.

        Remove support for the Strong Confirmation Password button because we never made use of it.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
        (toAutoFillButtonType):
        (toWKAutoFillButtonType):
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
        (toAutoFillButtonType):
        (toWKAutoFillButtonType):
        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:

2018-07-05  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r230843): Flash doesn't work; Produces blue box on page
        https://bugs.webkit.org/show_bug.cgi?id=187346
        <rdar://problem/41773974>

        Reviewed by Ryosuke Niwa.

        Reset page plugins when the load client policies are updated.
        This will ensure that pages will rebuild their plugin lists based on the new policies.

        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):
        (WebKit::WebPluginInfoProvider::clearPluginClientPolicies):

2018-07-05  Brady Eidson  <beidson@apple.com>

        IndexedDB operations in a Page fail after a StorageProcess crash.
        <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123

        Reviewed by Alex Christensen.

        When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
        in the WebProcess about it.
        
        This puts Documents/Workers in an error mode where requests fail instead of timeout.
        It also clears the Page's connection so *new* Documents and Workers will get a fresh 
        new connection that works.
        
        * UIProcess/API/C/WKContext.cpp:
        (WKContextTerminateStorageProcess):
        
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _terminateStorageProcess]):
        
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::terminateForTesting):
        * UIProcess/Storage/StorageProcessProxy.h:
        
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::terminateStorageProcessForTesting):
        (WebKit::WebProcessPool::terminateStorageProcess): Deleted.
        * UIProcess/WebProcessPool.h:
        
        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
        (WebKit::WebToStorageProcessConnection::didClose):
        * WebProcess/Storage/WebToStorageProcessConnection.h:
        (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier):
        
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::webToStorageProcessConnectionClosed):

2018-07-05  Simon Fraser  <simon.fraser@apple.com>

        Address two possible causes of missing tiles in iOS Safari, and add logging to gather more data about other possible causes
        https://bugs.webkit.org/show_bug.cgi?id=187376
        rdar://problem/40941118

        Reviewed by Tim Horton.
        
        We have continual reports of users experiencing missing tiles in MobileSafari, where loading a page
        shows the tiles at the top, but we don't render new tiles as the user scrolls down. This is consistent
        with failing to dispatch visible content rect updates via -[WKWebView _updateVisibleContentRects].
        
        This patch addresses two possible (but unlikely) causes. First, it resets _currentlyAdjustingScrollViewInsetsForKeyboard
        after a web process crash. Second, it catches exceptions thrown by [webView _updateVisibleContentRects]
        and resets _hasScheduledVisibleRectUpdate.
        
        This patch also adds release logging that fires if over 1s has elapsed between scheduling
        a visible content rect update and trying to re-schedule, and logging for all reasons that
        -_updateVisibleContentRects returns early.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _processDidExit]):
        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
        (-[WKWebView _updateVisibleContentRects]):

2018-07-05  Olivia Barnett  <obarnett@apple.com>

        iPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the page, detaches popover
        https://bugs.webkit.org/show_bug.cgi?id=187363
        <rdar://problem/41106306>

        Reviewed by Tim Horton.

        Added extra check to prevent keyboard scrolling when the select box is open.

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

2018-07-05  Timothy Hatcher  <timothy@apple.com>

        Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
        https://bugs.webkit.org/show_bug.cgi?id=187369
        rdar://problem/41870420

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _effectiveAppearanceIsDark]):
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _setUseSystemAppearance:]):
        (-[WKWebView effectiveAppearanceDidChange]):
        (-[WKWebView _defaultAppearance]): Deleted.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _effectiveAppearanceIsDark]):
        (-[WKView effectiveAppearanceDidChange]):
        (-[WKView _setUseSystemAppearance:]):
        (-[WKView _defaultAppearance]): Deleted.
        (-[WKView _setDefaultAppearance:]): Deleted.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::effectiveAppearanceIsDark):
        (WebKit::WebViewImpl::setUseDarkAppearance):
        (WebKit::WebViewImpl::useDefaultAppearance): Deleted.
        (WebKit::WebViewImpl::setDefaultAppearance): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::setUseDarkAppearance):
        (WebKit::WebPageProxy::showPlaybackTargetPicker):
        (WebKit::WebPageProxy::setDefaultAppearance): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::useDarkAppearance const):
        (WebKit::WebPageProxy::defaultAppearance const): Deleted.
        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView drawRect:]):
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::paintControlForLayerInContext):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::WebPage::drawRect):
        (WebKit::WebPage::setUseDarkAppearance):
        (WebKit::WebPage::setDefaultAppearance): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-07-05  Brian Burg  <bburg@apple.com>

        REGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when elementInViewClientCenterPoint returns nullopt
        https://bugs.webkit.org/show_bug.cgi?id=187367
        <rdar://problem/41861346>

        Reviewed by Timothy Hatcher.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        There's no reason to unwrap this optional, as the IPC argument type is std::optional<IntPoint>.

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

        Upstream hover gesture implementation
        https://bugs.webkit.org/show_bug.cgi?id=187366

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):
        (-[WKContentView _hoverGestureRecognizerChanged:]):

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

        Fix some -Wdocumentation warnings in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=187318

        Reviewed by Dan Bernstein.

        Fix most of the -Wdocumentation warnings in WebKit. The remaining
        ones are slightly mysterious, so we can't turn the warning on yet.

        * Configurations/BaseTarget.xcconfig:
        Define U_HIDE_DEPRECATED_API. It's defined in all other WebKit projects,
        and the doc comments in the deprecated ICU API have some errors.

        * UIProcess/API/Cocoa/WKUIDelegate.h:
        * UIProcess/API/Cocoa/WKWebView.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
        Adjust comments or parameter names to be consistent with each other.

2018-07-05  Chris Dumez  <cdumez@apple.com>

        Regression(r232886): WebsiteDataStore objects may get destroyed on a background thread
        https://bugs.webkit.org/show_bug.cgi?id=187356
        <rdar://problem/41854555>

        Reviewed by Geoffrey Garen.

        As of r232886, CallbackAggregators in WebsiteDataStore hold a Ref<> to their WebsiteDataStore. This
        is an issue because CallbackAggregator objects can get destroyed on a background thread and may be
        the last ones holding a ref to the data store. When this happens, the WebsiteDataStore would get
        destroyed on a background store and potentially cause crashes. Note that even if the callback
        aggregator would not be the last one to hold a ref to the store, it still would not be safe to deref
        the store on the background thread since WebsiteDataStore is not ThreadSafeRefCounted.

        To address the issue, this patch updates the CallbackAggregators' destructor to deref their data
        store member on the main thread. Note that we could also have WebsiteDataStore subclass
        ThreadSafeRefCounted<T, DestructionThread::Main> but the data store technically does not need to
        be ThreadSafeRefCounted at the moment.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::WebsiteDataStore):
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        (WebKit::WebsiteDataStore::removeData):

2018-07-05  Dan Bernstein  <mitz@apple.com>

        [macOS] REGRESSION: Development WebContent service has restricted entitlements, rendering it useless for development
        https://bugs.webkit.org/show_bug.cgi?id=187355

        Reviewed by Anders Carlsson.

        * Configurations/WebContentService.Development.xcconfig: Set WK_USE_RESTRICTED_ENTITLEMENTS
          to NO for the Development service.

2018-07-05  Rob Buis  <rbuis@igalia.com>

        [GTK] Remove soup/DownloadSoupErrors.h
        https://bugs.webkit.org/show_bug.cgi?id=187339

        This header is not used anymore.

        Reviewed by Frédéric Wang.

        * NetworkProcess/Downloads/soup/DownloadSoupErrors.h: Removed.
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        * PlatformGTK.cmake:

2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r233325): [GTK] Broke 40 animations tests
        https://bugs.webkit.org/show_bug.cgi?id=187264

        Reviewed by Žan Doberšek.

        Use a different PlatformDisplayID for compositing in the GTK port. This way, when entering AC a window screen
        changed is emitted and the GTK default display refresh monitor is destroyed, ensuring the one created by the
        threaded compositor is used.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::create): Remove unused WebPage parameter and add PlatformDisplayID.
        (WebKit::ThreadedCompositor::ThreadedCompositor): Create the display refresh monitor with the given displayID.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
        (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Pass the given displayID to the parent constructor.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
        (WebKit::ThreadedDisplayRefreshMonitor::create): Add PlatformDisplayID parameter.
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Use compositingDisplayID when
        creating the threaded compositor and notify about the window screen change.
        (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): Use primaryDisplayID when leaving AC and
        compositingDisplayID when re-entering.

2018-07-04  Olivia Barnett  <obarnett@apple.com>

        A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
        https://bugs.webkit.org/show_bug.cgi?id=185257
        <rdar://problem/40819252>

        Reviewed by Tim Horton.

        Call to dismiss the presented modal was being called on the parent and not the child, which caused the file picker to be incorrectly dismissed along with the modal. A test for this bug-fix could not be completed without additional tools as TestWebKitAPI is not a UI application.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _dismissDisplayAnimated:]):

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

        Introduce PLATFORM(IOSMAC)
        https://bugs.webkit.org/show_bug.cgi?id=187315

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        * Configurations/FeatureDefines.xcconfig:
        * Configurations/NetworkService.xcconfig:
        * Configurations/WebContentService.xcconfig:
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::sourceApplicationAuditData const):
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeProcessName):
        (WebKit::overrideSystemProxies):
        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Platform/spi/ios/UIKitSPI.h:
        * Shared/ios/ChildProcessIOS.mm:
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::setApplicationIsDaemon):
        (WebKit::enableSandboxStyleFileQuarantine):
        * Shared/mac/CodeSigning.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _webViewPrintFormatter]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::updateLayerTree):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (-[WKRemoteView initWithFrame:contextID:]):
        * UIProcess/_WKWebViewPrintFormatter.mm:
        * UIProcess/_WKWebViewPrintFormatterInternal.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _didExitStableState]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _defineForWebView:]):
        (-[WKContentView setSelectedTextRange:]):
        (-[WKContentView closestPositionToPoint:]):
        (-[WKContentView _updateChangedSelection:]):
        * UIProcess/ios/WKLegacyPDFView.mm:
        * UIProcess/ios/WKPDFView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::getPositionInformation):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeSandbox):
        * config.h:

2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        50 failing WebDriver tests after r233417
        https://bugs.webkit.org/show_bug.cgi?id=187263

        Reviewed by Frédéric Wang.

        A std::optional value is used while being std::nullopt. This is because the wrong input source is used when
        transitioning keyboard input states.

        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Remove quarantine for Webex plugin
        https://bugs.webkit.org/show_bug.cgi?id=187050
        rdar://problem/41478189

        Reviewed by Brent Fulgham.

        Update the Plugin Info.plist to not do quarantine of downloaded files by default.
        Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

        * Platform/spi/mac/QuarantineSPI.h: Add qtn_proc_init.
        * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
        * PluginProcess/PluginProcess.h:
        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::shouldOverrideQuarantine):
        * Shared/ChildProcess.h:
        (WebKit::ChildProcess::shouldOverrideQuarantine):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox):

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Crash in  WebKit::CacheStorage::Cache::toRecordInformation when running http/tests/cache-storage/cache-persistency.https.html
        https://bugs.webkit.org/show_bug.cgi?id=187243

        Reviewed by Chris Dumez.

        In case a caches object has an engine, it uses the engine to get the salt.
        In case engine/caches are non persistent, no salt was set for the engine, hence the crashes.
        Add an empty salt whenever initializing a non-persistent engine to remove the crash.

        Covered by updated expectations for two tests.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::initialize):

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Fix regression introduced in r233335
        https://bugs.webkit.org/show_bug.cgi?id=187282

        Reviewed by Chris Dumez.

        When checking for navigation loads, we need to return whether the request URL matches the service worker URL.
        Before this patch, if the request URL was not matching the service worker URL, we were using the origin/referrer
        which should only be used for subresource loads.

        Covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https.html
        being no longer flaky.

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

2018-07-03  Chris Dumez  <cdumez@apple.com>

        Make CallbackMap::invalidate() safe to re-enter
        https://bugs.webkit.org/show_bug.cgi?id=187298
        <rdar://problem/41057167>

        Reviewed by Geoffrey Garen.

        Made it safe to re-enter CallbackMap::invalidate(), GenericCallback::performCallbackWithReturnValue(),
        GenericCallback::invalidate() & invalidateCallbackMap() since those execute client blocks which may
        re-enter WebKit.

        * UIProcess/GenericCallback.h:
        (WebKit::GenericCallback::performCallbackWithReturnValue):
        (WebKit::invalidateCallbackMap):

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

        [iOS] Clean up sandbox warnings found during Public Beta
        https://bugs.webkit.org/show_bug.cgi?id=187308
        <rdar://problem/41203914>

        Reviewed by Eric Carlson.

        I made our sandbox overly restrictive during our iOS 12.0 development cycle, and have found a number of missing items.

        This patch adds the missing IOKit properties, and removes a duplicate call to (play-media).

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

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

        [Curl] Embed certificate information into ResourceResponse.
        https://bugs.webkit.org/show_bug.cgi?id=187102

        Reviewed by Youenn Fablet.

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

2018-07-03  Simon Fraser  <simon.fraser@apple.com>

        [iOS WK2] We fail to make surfaces volatile when suspending, increasing memory impact
        https://bugs.webkit.org/show_bug.cgi?id=187285
        rdar://problem/41732391

        Reviewed by Tim Horton.
        
        The "Mach port as layer contents" code path used in iOS WK2 relies on replacing the 
        Mach port layer contents with the actual IOSurface on suspension (otherwise the
        live Mach port will keep the surface in use). However, we were never hitting this
        RemoteLayerTreeHost::mapAllIOSurfaceBackingStore() code path on iOS 11 and later
        because UIKit stopped firing the notification we relied on.
        
        To fix this, use the _UIApplicationDidFinishSuspensionSnapshotNotification notification
        which is fired on UIApp.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):

2018-07-02  Simon Fraser  <simon.fraser@apple.com>

        Clean up the layer volatility code and logging
        https://bugs.webkit.org/show_bug.cgi?id=187286

        Reviewed by Tim Horton.
        
        Fix the layer volatility logging so it doesn't say "succeeded" when it actually failed
        and gave up.
        
        Use a couple of lambda functions in RemoteLayerBackingStore::setBufferVolatility() to
        make the code easier to read.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::setBufferVolatility):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::callVolatilityCompletionHandlers):
        (WebKit::WebPage::layerVolatilityTimerFired):
        (WebKit::WebPage::markLayersVolatile):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::markLayersVolatile):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::actualPrepareToSuspend):
        (WebKit::WebProcess::markAllLayersVolatile):
        * WebProcess/WebProcess.h:

2018-07-03  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make WebsiteDataStore::getAllStorageAccessEntries() call the right network process instead of iterating over the process pools
        https://bugs.webkit.org/show_bug.cgi?id=187277
        <rdar://problem/41745510>

        Reviewed by Chris Dumez.

        Existing tests use this code. The change is for correctness.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
            Now receives a WKWebView from its caller and gets the page ID from it.
        (-[WKWebsiteDataStore _getAllStorageAccessEntries:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
            Now gets a page ID from its caller and gets the right network process
            through it.
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-07-03  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed, rolling out r233461.

        Assertions triggered during iOS 11 debug layout and API tests

        Reverted changeset:

        "[iOS] Add assert to catch improper use of WebCore::Timer in
        UI Process"
        https://bugs.webkit.org/show_bug.cgi?id=185330
        https://trac.webkit.org/changeset/233461

2018-07-03  Youenn Fablet  <youenn@apple.com>

        Update com.cmbchina.CMBSecurity.sb to make it functional
        https://bugs.webkit.org/show_bug.cgi?id=187278

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb:

2018-07-03  Jer Noble  <jer.noble@apple.com>

        Update Fullscreen anti-phishing alert text
        https://bugs.webkit.org/show_bug.cgi?id=187199
        <rdar://problem/41162543>

        Reviewed by Brent Fulgham.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]):

2018-07-03  David Kilzer  <ddkilzer@apple.com>

        [iOS] Add assert to catch improper use of WebCore::Timer in UI Process
        <https://webkit.org/b/185330>
        <rdar://problem/32816079>

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::StorageProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::m_nonVisibleProcessCleanupTimer):
        - Call setWebKitProcessType() to se the global for the current
          process.

2018-07-03  Frederic Wang  <fred.wang@free.fr>

        [iOS] Animations with Bézier timing function not suspended on UI process when animation-play-state is set to "paused"
        https://bugs.webkit.org/show_bug.cgi?id=170784

        Reviewed by Antoine Quint.

        In order to pause a running animation, GraphicsLayerCA::pauseCAAnimationOnLayer calls
        PlatformCALayer::addAnimationForKey, assuming it will replace the current animation.
        This patch fixes PlatformCALayerRemote::addAnimationForKey to ensure this assumption holds.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::addAnimationForKey): If the animation was already sent to
        the UI process, make sure it is properly updated.

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Add sandbox to microdone plugin
        https://bugs.webkit.org/show_bug.cgi?id=187149
        <rdar://problem/41538057>

        Unreviewed.

        * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.sb: Renamed from Source/WebKit/Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.
        * WebKit.xcodeproj/project.pbxproj:

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

        Adjust now-incorrect animated resize logging after r232544
        https://bugs.webkit.org/show_bug.cgi?id=187281
        <rdar://problem/41645347>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _didCompleteAnimatedResize]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        _beginAnimatedResizeWithUpdate: and _didCompleteAnimatedResize are
        not strictly paired; we could instead track the SPI, but it's a bit
        tricky since resizeWithContentHidden has an implicit endAnimatedResize.
        Instead, just log if we still have a resizeAnimationView when we're
        committing outside of an animated resize, which seems to be the original concern,
        and point toward the possibility of unpaired begin/end.
        Also fix logging that has the wrong method name.

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Update com.apple.NPSafeInput.sb to make it functional
        https://bugs.webkit.org/show_bug.cgi?id=187276

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb:

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Update com.cfca.npSecEditCtl.MAC.BOC.plugin.sb to make it functional
        https://bugs.webkit.org/show_bug.cgi?id=187261

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb:

2018-07-02  Brady Eidson  <beidson@apple.com>

        Crash notifying observers of responsiveness state change
        <rdar://problem/41267796> and https://bugs.webkit.org/show_bug.cgi?id=187262

        Reviewed by Tim Horton.

        * UIProcess/PageLoadState.cpp:
        (WebKit::PageLoadState::callObserverCallback): Copy the container ahead of time.

2018-07-02  Sihui Liu  <sihui_liu@apple.com>

        Remove InitWebCoreThreadSystemInterface() in WKProcessPool _initWithConfiguration
        https://bugs.webkit.org/show_bug.cgi?id=187252

        Reviewed by Dan Bernstein.

        Clean up after <rdar://problem/15256572>.

        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (-[WKProcessGroup initWithInjectedBundleURL:]):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _initWithConfiguration:]):

2018-07-02  Zan Dobersek  <zdobersek@igalia.com>

        REGRESSION(r233381): Double WebResourceLoadStatisticsStore destructor invocation
        https://bugs.webkit.org/show_bug.cgi?id=187247

        Reviewed by Chris Dumez.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        Don't call postTask() to dispatch this task, as that keeps a reference
        to this WebResourceLoadStatisticsStore object and thus causes problems
        when invoked from the destructor in the form of a second destructor
        invocation that ends up crashing the process. Blocking nature of this
        call should be enough to avoid WebResourceLoadStatisticsStore lifetime
        issues.

2018-07-02  Per Arne Vollan  <pvollan@apple.com>

        Delete display link when closing page or the WebContent process has crashed.
        https://bugs.webkit.org/show_bug.cgi?id=186895

        Reviewed by Brent Fulgham.

        If there is a running display link in the UI process, there is no need to keep it around if the
        page is being closed or the WebContent process has crashed.

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

2018-06-23  Darin Adler  <darin@apple.com>

        [Cocoa] Improve ARC compatibility of more code in JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=186973

        Reviewed by Dan Bernstein.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
        (WebKit::XPCServiceInitializerDelegate::hasEntitlement): Use WTF::hasEntitlement.

        * Shared/mac/SandboxUtilities.h: Removed connectedProcessHasEntitlement since
        we can now use WTF::hasEntitlement instead.
        * Shared/mac/SandboxUtilities.mm: Ditto.

        * StorageProcess/ios/StorageProcessIOS.mm:
        (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement): Use
        WTF::hasEntitlement.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement): Ditto.

2018-06-30  David Kilzer  <ddkilzer@apple.com>

        Fix clang static analyzer warnings: Garbage return value
        <https://webkit.org/b/187224>

        Reviewed by Eric Carlson.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::changeCount):
        (WebKit::WebPlatformStrategies::addTypes):
        (WebKit::WebPlatformStrategies::setTypes):
        (WebKit::WebPlatformStrategies::setBufferForType):
        (WebKit::WebPlatformStrategies::setPathnamesForType):
        (WebKit::WebPlatformStrategies::setStringForType):
        (WebKit::WebPlatformStrategies::getNumberOfFiles):
        (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
        (WebKit::WebPlatformStrategies::writeCustomData):
        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
        (WebKit::WebEditorClient::substitutionsPanelIsShowing):
        - Use brace initialization for local variables.

2018-06-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, add missing PLATFORM(COCOA) guard after r233207
        https://bugs.webkit.org/show_bug.cgi?id=186788
        <rdar://problem/41094167>

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleExtendClassesForParameterCoder):

2018-06-30  Dan Bernstein  <mitz@apple.com>

        Added a missing availability attribute.

        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:

2018-06-29  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make network process calls only for the process pool that the page belongs to
        https://bugs.webkit.org/show_bug.cgi?id=187206
        <rdar://problem/41659160>

        Reviewed by Chris Dumez.

        Instead of iterating over all process pools, we should resolve which
        process pool the page belongs to and call the network process only for
        that pool. This is especially important since we use WTFMove for the
        completion handlers.

        This patch also renames "callback" to "completionHandler" for
        the functions touched.

        A FIXME comment is added to WebsiteDataStore::getAllStorageAccessEntries()
        where we currently don't have a page ID to do the lookup with.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
        (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
        (WebKit::WebsiteDataStore::grantStorageAccessHandler):
        (WebKit::WebsiteDataStore::hasStorageAccess):
        (WebKit::WebsiteDataStore::requestStorageAccess):
        (WebKit::WebsiteDataStore::grantStorageAccess):

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

        Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads
        https://bugs.webkit.org/show_bug.cgi?id=187200

        Reviewed by Brent Fulgham.

        Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads,
        in order the simplify the code a little bit.

        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::postTask):
        (WebKit::WebResourceLoadStatisticsStore::postTaskReply):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
        (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
        (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
        (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
        https://bugs.webkit.org/show_bug.cgi?id=187183

        Reviewed by Wenson Hsieh.

        r210683 introduced logic to prevent file URLs from being copied to the clipboard
        in unexpected cases. The current logic always crashes the WebProcess if
        webProcessProxy->checkURLReceivedFromWebProcess returns false. Instead of
        crashing, we can fail silently and not copy anything to the clipboard.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Removed call to markCurrentlyDispatchedMessageAsInvalid() which was causing the process to crash.

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

        Regression(r233359): Caused ITP tests to be flaky
        https://bugs.webkit.org/show_bug.cgi?id=187189

        Reviewed by Youenn Fablet.

        r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
        m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
        with what we do for other database paths so that things like '~' in paths get resolved.

        This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
        resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
        Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
        properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-06-29  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=187154
        <rdar://problem/41487250>

        Reviewed by Brent Fulgham and Chris Dumez.

        Most of the changes in this patch remove the boolean parameter for tracking
        ephemeral sessions and the IsReadOnly enum.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
            Now returns early for ephemeral sessions.
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
            Now returns early for ephemeral sessions.
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

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

        Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=187165

        Reviewed by Brent Fulgham.

        Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore. Instead,
        WebResourceLoadStatisticsStore now holds a weak pointer to its WebsiteDataStore and is able to call
        methods on it directly. Reducing the indirection makes the code less complex and more understandable.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
        (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
        (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-06-29  Miguel Gomez  <magomez@igalia.com>

        [WPE] Some frames are dropped when using rAF to animate an element
        https://bugs.webkit.org/show_bug.cgi?id=187175

        Always call renderNextFrame in ThreadedCompositor::requestDisplayRefreshMonitorUpdate()
        so we have to process any pending layer flush request.

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):

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

        Make sure the WebResourceLoadStatisticsStore gets destroyed on the main thread
        https://bugs.webkit.org/show_bug.cgi?id=187143

        Reviewed by Youenn Fablet.

        Have WebResourceLoadStatisticsStore subclass ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>
        instead of IPC::Connection::WorkQueueMessageReceiver. This makes sure that the WebResourceLoadStatisticsStore
        objects get destroyed on the main thread, even if the last ref was held by a background thread.

        Also, methods called by IPC are now called on the main thread instead of the background queue. I think it is clearer for all
        of WebResourceLoadStatisticsStore usage to be on the main thread. Expensive work is still done on the background queue, inside
        the persistent / memory store classes.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
        (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-28  Jiewen Tan  <jiewen_tan@apple.com>

        Add nullptr check for xpc_connection_t in AuthenticationManager::initializeConnection
        https://bugs.webkit.org/show_bug.cgi?id=187110
        <rdar://problem/41536815>

        Reviewed by Brent Fulgham.

        In some rare cases as shown by crash tracers that the passed xpc_connection_t object could be nullptr,
        and xpc_connection_set_event_handler won't do the nullptr check on its parameters. Therefore, we should
        do it by ourselves.

        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection):
        * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
        (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):

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

        [iOS] DataTransfer.getData always returns the empty string when dropping text
        https://bugs.webkit.org/show_bug.cgi?id=187130
        <rdar://problem/41014117>

        Reviewed by Ryosuke Niwa.

        Add plumbing to grab information for each item in the pasteboard. See WebCore ChangeLog for more detail.

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

2018-06-28  Youenn Fablet  <youenn@apple.com>

        Early return when handling fetch event in case service worker origin does not match origin of a subresource load
        https://bugs.webkit.org/show_bug.cgi?id=187153
        <rdar://problem/41329832>

        Reviewed by Chris Dumez.

        Stop crashing the service worker process in case a subresource load origin is not matching a service worker origin.
        Instead, just return early so that the load will be handled by the network process.

        Keep crashing in case a navigation load is not matching its service worker origin.
        Add more logging to help with the debugging.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::logValidFetchError):
        (WebKit::isValidFetch):
        (WebKit::WebSWContextManagerConnection::startFetch):

2018-06-28  Jeremy Jones  <jeremyj@apple.com>

        Fullscreen exits when placeholder is removed then added during a single runloop.
        https://bugs.webkit.org/show_bug.cgi?id=187079

        Reviewed by Jer Noble.

        Instead of closing fullscreen as soon as the placeholder is removed from the view hierarchy,
        give the placeholder until the next runloop to be re-added to the view hierarchy.

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

2018-06-28  Youenn Fablet  <youenn@apple.com>

        Handle the case of registerMDNSNameCallback called several times
        https://bugs.webkit.org/show_bug.cgi?id=187150
        <rdar://problem/41329832>

        Reviewed by Eric Carlson.

        This is a speculative fix on the basis that registerMDNSNameCallback may be called several times.
        In that case, we would have freed the context after the first call and would reuse it for the second call.

        Instead, keep a map of pending requests and pass to registerMDNSNameCallback an identifier to that map.
        If the map has no value for that identifier, return early.

        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
        (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
        (WebKit::pendingRegistrationRequests):
        (WebKit::registerMDNSNameCallback):
        (WebKit::NetworkMDNSRegister::clearPendingRequests):
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        * NetworkProcess/webrtc/NetworkMDNSRegister.h:
        (): Deleted.

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

        Unreviewed attempt to fix Win Cairo build after r233310.

        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        Unreviewed attempt to fix Win Cairo build after r233310.

        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
        https://bugs.webkit.org/show_bug.cgi?id=187055
        <rdar://problem/41584026>

        Unreviewed, temporarily disable main thread assertion added to flushAndDestroyPersistentStore()
        in r233310, until Bug 187143 is fixed.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

2018-06-28  Youenn Fablet  <youenn@apple.com>

        Add sandbox to microdone plugin
        https://bugs.webkit.org/show_bug.cgi?id=187149
        rdar://problem/41538057

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-28  Brian Burg  <bburg@apple.com>

        Web Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified URL doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=187146
        <rdar://problem/41369591>

        Reviewed by Joseph Pecoraro.

        When Web Inspector's page receives a navigation request, it's supposed to redirect any
        non-Inspector navigations to be loaded in the inspected page. When I refactored to use
        modern a policy delegate, the one line that redirects the loads was left out.

        No new tests, because inspector tests can't navigate the inspector or inspected pages.

        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):

2018-06-28  Jeremy Jones  <jeremyj@apple.com>

        Crash when _topConstraint is null in element fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=187075

        Reviewed by Eric Carlson.

        NSArray can't contain a null pointer, so check for null before creating an array from a pointer.
        Use the recommended +deactivateConstraints: instead of -removeConstraints:.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):

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

        Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
        https://bugs.webkit.org/show_bug.cgi?id=187055
        <rdar://problem/41584026>

        Reviewed by Brent Fulgham.

        Split memory store logic out of WebResourceLoadStatisticsStore and into a ResourceLoadStatisticsMemoryStore class
        to clarify the threading model. Previously, some of the methods of the WebResourceLoadStatisticsStore had to be
        called on the main thread and some of them on the background queue, which was confusing and error prone. Now,
        all WebResourceLoadStatisticsStore methods (except for IPC ones which will be addressed in a follow-up) are called
        on the main thread. The ResourceLoadStatisticsMemoryStore objects is constructed / used and destroyed on the
        background queue, similarly to the ResourceLoadStatisticsPersistentStore. The WebResourceLoadStatisticsStore
        objects merely proxies calls from WebKit to those persistent / memory stores and takes care of hopping back and
        forth between the background thread and the work queue.

        While spliting code code, I found several instances where we were calling completion handlers on the wrong thread.
        I fixed those in this patch now that the model is clearer.

        We can likely clean up (organize the code a bit better) in a follow-up). This patch takes care of splitting the
        code as it was. Code that was called on the background queue was moved to ResourceLoadStatisticsMemoryStore class
        and code that was called on the main thread stays in WebResourceLoadStatisticsStore.

        * CMakeLists.txt:
        * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm.
        (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
        * UIProcess/ResourceLoadStatisticsMemoryStore.cpp: Added.
        (WebKit::appendWithDelimiter):
        (WebKit::OperatingDate::fromWallTime):
        (WebKit::OperatingDate::today):
        (WebKit::OperatingDate::secondsSinceEpoch const):
        (WebKit::OperatingDate::operator== const):
        (WebKit::OperatingDate::operator< const):
        (WebKit::OperatingDate::operator<= const):
        (WebKit::OperatingDate::OperatingDate):
        (WebKit::mergeOperatingDates):
        (WebKit::pruneResources):
        (WebKit::computeImportance):
        (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
        (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
        (WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry):
        (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry):
        (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
        (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
        (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
        (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
        (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
        (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest):
        (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
        (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
        (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
        (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
        (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder):
        (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
        (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
        (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree):
        (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved):
        (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain):
        (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
        (WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
        (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction):
        (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies):
        (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains):
        (WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState):
        (WebKit::ResourceLoadStatisticsMemoryStore::processStatistics const):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
        (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
        (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries):
        (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo):
        (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
        (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues):
        (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent):
        (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
        (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
        (WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
        * UIProcess/ResourceLoadStatisticsMemoryStore.h: Added.
        (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
        (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled):
        (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
        (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
        (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
        (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
        (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
        (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
        (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
        (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::sortedPrevalentResourceTelemetry):
        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
        * UIProcess/WebResourceLoadStatisticsTelemetry.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-06-28  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
        https://bugs.webkit.org/show_bug.cgi?id=175602

        Reviewed by Carlos Garcia Campos.

        We check using the GdkDragContext to ensure the DroppingContext is still alive (present in
        m_droppingContexts), but access it via the pointer to the DroppingContext that could be
        dangling. This happens on every drag. I can't actually reproduce the original assertion
        since I'm currently working with an asan build, but I imagine it's probably the same issue
        that I'm fixing here.

        * UIProcess/gtk/DragAndDropHandler.cpp:
        (WebKit::DragAndDropHandler::dragLeave):

2018-06-27  Timothy Hatcher  <timothy@apple.com>

        Don't expose new semantic -apple-system color keywords on iOS.
        https://bugs.webkit.org/show_bug.cgi?id=187080
        rdar://problem/41505699

        Reviewed by Tim Horton.

        * DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.

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

        Fix IBeam issues with iPad apps on Mac
        https://bugs.webkit.org/show_bug.cgi?id=186900

        Reviewed by Wenson Hsieh.

        * Shared/ios/InteractionInformationAtPosition.h:
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        (WebKit::InteractionInformationAtPosition::decode):

        Add functionality to determine what a caret rect should be, but as it is
        expensive, it should only be done for this platform.
        
        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::isApproximateForRequest):
        * Shared/ios/InteractionInformationRequest.h:

        As there is no way to premptively request information on hover, we need to use 
        the last cached information, but only if it is close to the point we are about
        to request information for. So having a way to determine if a point is very close
        to a previous point is a good idea.

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

        UIKit is using this function to determine if we should show an Ibeam or not.
        So we need to implement it, at least for this platform. 

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

        Pass up the calculated caret rect, but only for iPad apps on Mac.

2018-06-27  Yusuke Suzuki  <utatane.tea@gmail.com>

        [GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
        https://bugs.webkit.org/show_bug.cgi?id=187089

        Reviewed by Michael Catanzaro.

        Use LazyNeverDestroyed<XErrorTrapper> instead of global std::unique_ptr<XErrorTrapper>.
        Since this variable's exit time destructor is not important in this code, using
        LazyNeverDestroyed<XErrorTrapper> is fine. This removes the last static initializer
        of libwebkit2gtk.so.

        * PluginProcess/unix/PluginProcessMainUnix.cpp:

2018-06-27  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile for some additional bank plugins
        https://bugs.webkit.org/show_bug.cgi?id=187105

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Added.
        * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Added.
        * Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Added.
        * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Added.
        * Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Added.
        * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Added.
        * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Added.
        * Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-27  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=186551

        Reviewed by Daniel Bates.

        Removed the need for NetworkLoadChecker to reference a NetworkConnectionToWebProcess.
        Instead a CSP client is given to NetworkLoadChecker when needed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::check):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy):
        (WebKit::NetworkLoadChecker::addConsoleMessage): Deleted.
        (WebKit::NetworkLoadChecker::sendCSPViolationReport): Deleted.
        (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Deleted.
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::willPerformHTTPRedirection):
        * NetworkProcess/PingLoad.h:

2018-06-27  Stephan Szabo  <stephan.szabo@sony.com>

        [Wincairo] Add support for context menus to non-legacy minibrowser
        https://bugs.webkit.org/show_bug.cgi?id=186815.

        Reviewed by Ryosuke Niwa.

        * UIProcess/WebPageProxy.h:
        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::viewWidget):
        * UIProcess/win/PageClientImpl.h:
        * UIProcess/win/WebContextMenuProxyWin.cpp:
        (WebKit::WebContextMenuProxyWin::show):
        (WebKit::createMenu):
        (WebKit::createMenuItem):
        (WebKit::populate):
        (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
        (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
        * UIProcess/win/WebContextMenuProxyWin.h:
        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::WebPageProxy::viewWidget):
        * UIProcess/win/WebView.cpp:
        (WebKit::WebView::wndProc):
        (WebKit::WebView::onMenuCommand):
        * UIProcess/win/WebView.h:

2018-06-27  Youenn Fablet  <youenn@apple.com>

        Disable content blockers in NetworkLoadChecker except for ping loads
        https://bugs.webkit.org/show_bug.cgi?id=187083
        <rdar://problem/41440083>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::enableContentExtensionsCheck):
        * NetworkProcess/PingLoad.cpp:

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

        https://hackernoon.com/ uses lots of layer backing store
        https://bugs.webkit.org/show_bug.cgi?id=186909
        rdar://problem/40257540

        Reviewed by Tim Horton.
        
        PlatformCALayerRemote was actually holding onto backing stores for layers with
        backing store detached, which could increase memory use. When told that backing stores
        are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay)
        when attached. This is now similar to what PlatformLayerCACocoa does.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
        (WebKit::PlatformCALayerRemote::setNeedsDisplay):
        (WebKit::PlatformCALayerRemote::hasContents const):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:

2018-06-27  Jonathan Bedard  <jbedard@apple.com>

        Enable WebKit iOS 12 build
        https://bugs.webkit.org/show_bug.cgi?id=187024
        <rdar://problem/39759057>

        Reviewed by David Kilzer.

        * Platform/spi/ios/PDFKitSPI.h: Added PDFKit SPI.
        * Platform/spi/ios/UIKitSPI.h: Add new UIKit SPI and UICompositingMode enumeration.
        * UIProcess/ios/WKPDFView.mm: Use PDFKitSPI header.
        * UIProcess/ios/WKSystemPreviewView.mm: Use CoreGraphicsSPI.h.
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Use QuartzCoreSPI.h.

2018-06-27  Timothy Horton  <timothy_horton@apple.com>

        CSS Animation Triggers is not an experimental feature, should be globally off by default

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2018-06-27  Timothy Horton  <timothy_horton@apple.com>

        Promote the Secure Context API feature from experimental-yet-on-by-default to always-on

        Reviewed by Dan Bates.

        * Shared/WebPreferences.yaml:
        Secure Context API is on by default, it's not experimental anymore.

2018-06-27  Timothy Horton  <timothy_horton@apple.com>

        Make Link Preload an on-by-default feature
        https://bugs.webkit.org/show_bug.cgi?id=187104

        Reviewed by Ryosuke Niwa.

        * Shared/WebPreferences.yaml:
        This should be on, not experimental. It already shipped on in the past.

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

        Regression(r233208): Completion handler does not get called on GTK port
        https://bugs.webkit.org/show_bug.cgi?id=187099

        Reviewed by Antti Koivisto.

        Make sure UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler's completion handler
        gets called on non-COCOA ports.

        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-27  Tim Horton  <timothy_horton@apple.com>

        When trying to print a very long email on iOS, the print preview is blank
        https://bugs.webkit.org/show_bug.cgi?id=187077
        <rdar://problem/41107013>

        Reviewed by Timothy Hatcher.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
        ChildProcessProxy::sendSync has a (surprising) default timeout of 1 second,
        (as opposed to Connection::sendSync's default timeout of ∞ seconds).
        The printing path already waits ∞ seconds for the final PDF, but currently
        uses the default 1 second timeout for page count computation. If page
        count computation takes more than 1 second, the preview will be blank.
        Since the print preview is generated asynchronously, we really want
        to wait until it's done, and not give up after 1 second.

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

        [iPad apps on macOS] Unable to interact with video elements that have started playing
        https://bugs.webkit.org/show_bug.cgi?id=187073
        <rdar://problem/40591107>

        Reviewed by Tim Horton.

        On iOS, we currently force remote hosting contexts to be non-interactive by passing in `kCAContextIgnoresHitTest`
        when creating the CAContext. However, this flag is not respected by CoreAnimation when running iOS apps on macOS.
        This means all HID events dispatched over a video that has been played (which causes WebKit to insert a
        CALayerHost-backed WKRemoteView in the view hierarchy) will be routed to the context ID of the video's CAContext
        rather than the context ID of the key window containing the WKWebView.

        This subsequently causes all gesture recognizers (hover, touch, tap, long press) to fail recognition when
        running iOS apps on macOS. To address this, we set a flag on WKRemoteView's CALayerHost to prevent hit-testing
        to the remote layer. This allows us to avoid routing HID events to the wrong context, and instead target the
        main UIWindow.

        Manually verified that click, touch, and mouseenter/mouseleave events are dispatched when interacting over a
        video element.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
        (-[WKRemoteView initWithFrame:contextID:]):

2018-06-26  Commit Queue  <commit-queue@webkit.org>

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

        "This is breaking launching some plugins" (Requested by youenn
        on #webkit).

        Reverted changeset:

        "Remove quarantine for Webex plugin"
        https://bugs.webkit.org/show_bug.cgi?id=187050
        https://trac.webkit.org/changeset/233232

2018-06-26  Timothy Horton  <timothy_horton@apple.com>

        Rearrange some WebPreferences; move two experimental prefs into the experimental section

        * Shared/WebPreferences.yaml:

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

        Deal better with the network process crashing on startup
        https://bugs.webkit.org/show_bug.cgi?id=187065
        <rdar://problem/41451622>

        Reviewed by Geoffrey Garen.

        When a network process crashes on startup, we would not attempt to relaunch it. If there were web
        processes waiting for a connection to this network process, we would send them an invalid connection
        identifier which would cause them to forcefully crash.

        Instead, we now apply the same policy whether a network process crashes on startup or later:
        - We attempt to relaunch the network process
        - If there were pending connections from WebContent processes, we ask the new Network process instead.

        As a result, WebContent processes no longer crash in this case. Instead, they wait for a valid
        connection to the network process.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _makeNextNetworkProcessLaunchFailForTesting]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getLaunchOptions):
        (WebKit::NetworkProcessProxy::didFinishLaunching):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessCrashed):
        * UIProcess/WebProcessPool.h:

2018-06-26  Daniel Bates  <dabates@apple.com>

        REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
        https://bugs.webkit.org/show_bug.cgi?id=186090
        <rdar://problem/40692595>

        Reviewed by Andy Estes.

        Fixes an issue where a page P delivered with "X-Frame-Options: SAMEORIGIN" loaded in a sub-
        frame would be blocked if we were redirected to it in response to the cross-origin POST
        request regardless of whether P is same-origin with its parent document.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Compare the origin
        of the top frame's document as opposed to the source origin. The latter represents the
        origin of the document that initiated the navigation, which can be cross-origin, and
        should not be considered when applying "X-Frame-Options: SAMEORIGIN". This check exists
        as a performance optimization to avoid traversing over all frame ancestors only to find
        out that the innermost frame (the one that made this request) is cross-origin with the
        top-most frame.
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Exclude the origin of the
        frame that is making the load request from the list of ancestor origins. This makes the
        X-Frame-Options algorithm in WebKit2 match the logic we do in FrameLoader::shouldInterruptLoadForXFrameOptions().

2018-06-26  Youenn Fablet  <youenn@apple.com>

        Remove quarantine for Webex plugin
        https://bugs.webkit.org/show_bug.cgi?id=187050
        rdar://problem/41478189

        Reviewed by Brent Fulgham.

        Update the Plugin Info.plist to not do quarantine of downloaded files by default.
        Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

        * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
        * PluginProcess/PluginProcess.h:
        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::shouldOverrideQuarantine):
        * Shared/ChildProcess.h:
        (WebKit::ChildProcess::shouldOverrideQuarantine):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox):

2018-06-26  Jeremy Jones  <jeremyj@apple.com>

        Ensure element fullscreen animation is always visible.
        https://bugs.webkit.org/show_bug.cgi?id=187068
        rdar://problem/36187369

        Reviewed by Eric Carlson.

        The fullscreen animation is important for communicating to users that they are no longer in inline mode.
        If fullscreen animation's inline rect is not visible, animate from a point in the middle of the screen.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::safeInlineRect):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

2018-06-26  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile for com.google.o1dbrowserplugin plugin
        https://bugs.webkit.org/show_bug.cgi?id=187067

        Reviewed by Brent Fulgham.

        * Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-26  Tim Horton  <timothy_horton@apple.com>

        Promote two more experimental features to traditional features
        https://bugs.webkit.org/show_bug.cgi?id=187063

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:
        Promote some shipped/default-on features to non-experimental.

2018-06-26  Jiewen Tan  <jiewen_tan@apple.com>

        Rollout macOS sandbox change in r232276
        https://bugs.webkit.org/show_bug.cgi?id=186904
        <rdar://problem/41350969>

        Reviewed by Brent Fulgham.

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

2018-06-26  Aditya Keerthi  <akeerthi@apple.com>

        Tap highlight displayed when tapping a field that is already focussed
        https://bugs.webkit.org/show_bug.cgi?id=187004
        <rdar://problem/41428008>
        Reviewed by Tim Horton.

        In the case where fast-clicking is enabled, _singleTapCommited: could be invoked
        before the tap highlight request, causing _potentialTapInProgress to be set to NO.
        This results in the early return for preventing multiple tap highlights on an
        assisted node to be skipped. Since a tap highlight should never be shown for an
        input field that is already focussed, _potentialTapInProgress can be removed from
        the early return condition.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):

2018-06-26  Timothy Horton  <timothy_horton@apple.com>

        Rearrange some WebPreferences; move two non-experimental prefs out of the experimental section

        * Shared/WebPreferences.yaml:

2018-06-26  Tim Horton  <timothy_horton@apple.com>

        Promote some experimental features to traditional features
        https://bugs.webkit.org/show_bug.cgi?id=187047

        Reviewed by Simon Fraser.

        * Shared/WebPreferences.yaml:
        Reindent.
        Promote some shipped/default-on features to non-experimental.

2018-06-26  Eric Carlson  <eric.carlson@apple.com>

        [Mac] AirPlay picker uses incorrect theme in Dark mode
        https://bugs.webkit.org/show_bug.cgi?id=187054
        <rdar://problem/41291093>

        Reviewed by Timothy Hatcher.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass m_defaultAppearance.

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

        Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
        https://bugs.webkit.org/show_bug.cgi?id=186903
        <rdar://problem/41350182>

        Reviewed by Brady Eidson.

        Follow-up fix after r233180 to address an API test crash. We need to keep the
        NetworkProcessProxy alive during the async updatePrevalentDomainsToPartitionOrBlockCookies
        request to make sure it completes.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):

2018-06-26  Brent Fulgham  <bfulgham@apple.com>

        Provide a way for Injected Bundles to indicate classes approved for NSSecureCoding
        https://bugs.webkit.org/show_bug.cgi?id=186788
        <rdar://problem/41094167>

        Reviewed by Chris Dumez.

        InjectedBundles support a mechanism to serialize data between the UIProcess and the
        WebContent process hosting the bundle. In some cases, we want to be able to serialize
        a custom data object that is not part of WebKit's native data types.

        After switching to strict NSSecureCoding, WebKit clients attempting to serialize these
        custom objects trigger a failure.

        This patch makes it possible for the InjectedBundle author to specify one (or more) data
        classes that are allowed to be serialized between the two processes.
        
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleExtendClassesForParameterCoder): Added.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
        (createWKArray): Added.
        (-[WKWebProcessPlugInController extendClassesForParameterCoder:]): Added.
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::extendClassesForParameterCoder): Added.
        (WebKit::InjectedBundle::classesForCoder): New helper function.
        (WebKit::InjectedBundle::setBundleParameter): Modified to use the new set of valid
        classes for NSSecureCoding.

2018-06-26  Eric Carlson  <eric.carlson@apple.com>

        Enable mock capture devices on the iOS simulator
        https://bugs.webkit.org/show_bug.cgi?id=186846
        <rdar://problem/41289134>

        Reviewed by Youenn Fablet.

        * Shared/WebPreferences.yaml: Use DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED.
        * Shared/WebPreferencesDefaultValues.h: Define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED, set to
        true in the iOS simulator only.

2018-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains::<lambda_9d761a6dc12d95db7fa2d6f3f5aa26fa>'
        https://bugs.webkit.org/show_bug.cgi?id=187035

        Unreviewed build fix.

        MSVC can't compile the code using `this` in a generalized lambda
        capture in another lambda.

        In this case, there is no need to copy `protectedThis` for the
        inner lambda. Move `protectedThis` of the outer lambda to the
        inner as well as `completionHandler`.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
        Moved `protectedThis` from the outer lambda to the inner.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
        Ditto.

2018-06-26  Miguel Gomez  <magomez@igalia.com>

        [GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
        https://bugs.webkit.org/show_bug.cgi?id=179304

        Reviewed by Michael Catanzaro.

        Add a way to attach to the CompositingCoordinator layers that were not created by it.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::attachLayer):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:

2018-06-25  Tim Horton  <timothy_horton@apple.com>

        WKThumbnailView fallback background is blindingly bright in Dark Mode
        https://bugs.webkit.org/show_bug.cgi?id=187017
        <rdar://problem/41036209>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        (-[_WKThumbnailView initWithFrame:]):
        (-[_WKThumbnailView wantsUpdateLayer]):
        (-[_WKThumbnailView updateLayer]):
        Use a semantic color for the WKThumbnailView background color
        instead of flat white.

2018-06-25  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
        https://bugs.webkit.org/show_bug.cgi?id=186903
        <rdar://problem/41350182>

        Reviewed by Chris Dumez.

        This patch stores the callback sent to
        WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(),
        sets up a context ID, and sends that ID to the network process when
        asking it to update cookie partitioning and blocking. The network
        process then tells the UI process when it's done, at which point the
        callback is called.

        This change is meant to address layout test flakiness.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
        (WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-06-25  Brent Fulgham  <bfulgham@apple.com>

        Allow access to APTDevice in iOS WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=187021
        <rdar://problem/41339769>

        Reviewed by Youenn Fablet.

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

2018-06-25  Keith Rollin  <krollin@apple.com>
        Unreviewed, rolling out r233087.

        Causes 5% Mac PLT regression.

        Reverted changeset:

        "Recalc styles every time defaultAppearance changes."
        https://bugs.webkit.org/show_bug.cgi?id=186866
        https://trac.webkit.org/changeset/233087

2018-06-25  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile to Hangout plug-in
        https://bugs.webkit.org/show_bug.cgi?id=187005
        <rdar://problem/41428391>

        Reviewed by Brent Fulgham.

        Add a sandbox profile so that this plug-in can be run when UIProcess is sandboxed.

        * Resources/PlugInSandboxProfiles/com.google.googletalkbrowserplugin.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-06-25  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should not check CORS for 304 responses triggered by WebProcess revalidation
        https://bugs.webkit.org/show_bug.cgi?id=186939
        <rdar://problem/40941725>

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateResponse):

2018-06-25  Keith Rollin  <krollin@apple.com>

        Adjust UNEXPORTED_SYMBOL_LDFLAGS for LTO
        https://bugs.webkit.org/show_bug.cgi?id=186949
        <rdar://problem/41386438>

        Reviewed by David Kilzer.

        When building with LTO, WebKit's
        'check-for-weak-vtables-and-externals' script reports weak external
        symbols:

        ERROR: WebKit has a weak external symbol in it (.../OpenSource/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit)
        ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
        ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
        ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
        ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
        ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
        ERROR: symbol __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
        ERROR: symbol __ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
        ERROR: symbol __ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
        Command /bin/sh failed with exit code 1

        Address these by adding those symbols to UNEXPORTED_SYMBOL_LDFLAGS in
        WebKit.xcconfig.

        * Configurations/WebKit.xcconfig:

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

        Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called
        https://bugs.webkit.org/show_bug.cgi?id=187007
        <rdar://problem/41293989>

        Reviewed by Brady Eidson.

        Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called by
        switching its type to WTF::CompletionHandler instead of WTF::Function. This also has the benefit
        of destroying our captured objects when the completion handler gets called by the client on the
        main thread instead of whatever thread the ObjC block gets released on.

        * UIProcess/API/APIIconLoadingClient.h:
        (API::IconLoadingClient::getLoadDecisionForIcon):
        * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
        * UIProcess/API/mac/WKView.mm:
        (-[WKView maybeInstallIconLoadingClient]):
        * UIProcess/Cocoa/IconLoadingDelegate.h:
        * UIProcess/Cocoa/IconLoadingDelegate.mm:
        (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

2018-06-25  Youenn Fablet  <youenn@apple.com>

        Add API to control mock media devices
        https://bugs.webkit.org/show_bug.cgi?id=186958

        Reviewed by Eric Carlson.

        Add API to clear, set, remove and reset mock media devices.
        The mock media center of UIProcess and all WebProcesses are updated.

        * CMakeLists.txt:
        * UIProcess/API/C/WKMockMediaDevice.cpp: Added.
        (typeFromString):
        (WKAddMockMediaDevice):
        (WKClearMockMediaDevices):
        (WKRemoveMockMediaDevice):
        (WKResetMockMediaDevices):
        * UIProcess/API/C/WKMockMediaDevice.h: Added.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addMockMediaDevice):
        (WebKit::WebProcessPool::clearMockMediaDevices):
        (WebKit::WebProcessPool::removeMockMediaDevice):
        (WebKit::WebProcessPool::resetMockMediaDevices):
        * UIProcess/WebProcessPool.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::addMockMediaDevice):
        (WebKit::WebProcess::clearMockMediaDevices):
        (WebKit::WebProcess::removeMockMediaDevice):
        (WebKit::WebProcess::resetMockMediaDevices):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

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

        [iPad apps on macOS] Click events are broken in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=186964
        <rdar://problem/41369145>

        Reviewed by Tim Horton.

        Tapping in WKWebView currently does not dispatch click events to the page. This is because the long press loupe
        gesture (in the text interaction assistant) has a delay of 0 when running iOS apps on macOS, but on iOS, it's
        0.5. The zero delay on macOS means that the loupe gesture will be recognized before the synthetic click gesture;
        this, in turn, causes the synthetic click gesture to be excluded by the loupe gesture. To address this, we
        simply allow the click and loupe gesture to recognize simultaneously.

        Additionally, a new hover gesture was added recently to handle macOS cursor types when hovering over selectable
        text. This patch also allows other gestures to recognize alongside hover gestures, which matches macOS behavior.

        We don't have the capacity to write automated tests for this yet; I manually tested text selection, editing in
        some text form controls, as well as clicking on links, buttons, and other elements with click event handlers.

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

2018-06-23  Brian Burg  <bburg@apple.com>

        [Mac] Web Automation: include correct key code with synthesized NSEvents used for keystrokes
        https://bugs.webkit.org/show_bug.cgi?id=186937

        Reviewed by Timothy Hatcher.

        In some cases, a missing keyCode for an ASCII letter/number can cause synthesized
        NSEvents to not be converted into a key equivalent action like copy: or paste:.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        Drive by, always initialize keyCode.

        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        (WebKit::keyCodeForCharKey): Compute the keyCode as defined by HLTB headers.
        This only needs to be computed for characters with physical keys, excluding the
        number pad and some traditional virtual keys that do not usually have glyphs.

2018-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix GTK debug build after r233131
        https://bugs.webkit.org/show_bug.cgi?id=186899
        <rdar://problem/38222248>

        This assertion was intended to be removed.

        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):

2018-06-21  Brian Burg  <bburg@apple.com>

        Web Automation: key actions should support multiple pressed virtual keys
        https://bugs.webkit.org/show_bug.cgi?id=186899
        <rdar://problem/38222248>

        Reviewed by Timothy Hatcher.

        This patch changes the protocol to allow multiple virtual keys per input source state.
        Chords like Cmd-Shift-A and Shift-F12 must be represented this way as they are encoded
        in the VirtualKey enum rather than as an ASCII char.

        * UIProcess/Automation/Automation.json:
        * UIProcess/Automation/SimulatedInputDispatcher.h:
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::simulateKeyboardInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::performInteractionSequence):

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        Also clean up the signature of WebAutomationSession::platformSimulateKeyboardInteraction
        to use a variant instead of mutually exclusive optional values with different types.

2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Add user-defined literal for ASCIILiteral
        https://bugs.webkit.org/show_bug.cgi?id=186839

        Reviewed by Darin Adler.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        (WebKit::NetworkCORSPreflightChecker::wasBlocked):
        (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::suggestedFilename const):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::checkRequest):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):
        (WebKit::PingLoad::didReceiveChallenge):
        (WebKit::PingLoad::timeoutTimerFired):
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::PreconnectTask):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::initialize):
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::toRecordInformation):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::cachesListFilename):
        (WebKit::CacheStorage::cachesOriginFilename):
        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
        (WebKit::NetworkCache::Statistics::initialize):
        (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
        (WebKit::NetworkCache::Statistics::queryWasEverRequested):
        (WebKit::NetworkCache::Statistics::clear):
        (WebKit::NetworkCache::Statistics::addHashesToDatabase):
        (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer):
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
        (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
        * Shared/Plugins/Netscape/PluginInformation.cpp:
        (WebKit::pluginInformationBundleIdentifierKey):
        (WebKit::pluginInformationBundleVersionKey):
        (WebKit::pluginInformationBundleShortVersionKey):
        (WebKit::pluginInformationPathKey):
        (WebKit::pluginInformationDisplayNameKey):
        (WebKit::pluginInformationDefaultLoadPolicyKey):
        (WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
        (WebKit::pluginInformationHasSandboxProfileKey):
        (WebKit::pluginInformationFrameURLKey):
        (WebKit::pluginInformationMIMETypeKey):
        (WebKit::pluginInformationPageURLKey):
        (WebKit::pluginInformationPluginspageAttributeURLKey):
        (WebKit::pluginInformationPluginURLKey):
        (WebKit::plugInInformationReplacementObscuredKey):
        * Shared/ios/WebIOSEventFactory.mm:
        (WebIOSEventFactory::createWebKeyboardEvent):
        * Shared/linux/WebMemorySamplerLinux.cpp:
        (WebKit::WebMemorySampler::sampleWebKit const):
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (debuggableTypeString):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_set_preferred_languages):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::setSessionPermissions):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::performInteractionSequence):
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/ChildProcessProxy.cpp:
        (WebKit::ChildProcessProxy::getLaunchOptions):
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::selectorExceptionMap):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::pluginsDirectories):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
        (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):
        (WebKit::UserMediaProcessManager::endedCaptureSession):
        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::goToItem):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadHTMLString):
        (WebKit::WebPageProxy::loadPlainTextString):
        (WebKit::WebPageProxy::loadWebArchiveData):
        (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getLaunchOptions):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
        * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::notifyPages):
        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView copyForWebView:]):
        (-[WKContentView cutForWebView:]):
        (-[WKContentView pasteForWebView:]):
        (-[WKContentView selectAllForWebView:]):
        (-[WKContentView deleteBackward]):
        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
        * UIProcess/ios/WKLegacyPDFView.mm:
        (-[WKLegacyPDFView _URLForLinkAnnotation:]):
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
        (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::connectionToServerLost):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        (webkit_dom_document_get_ready_state):
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        (WebKit::uniqueWorldName):
        * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
        (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::pluginInfo):
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::validateResponse):
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        (WebKit::WebContextMenuClient::searchWithGoogle):
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
        (WebKit::RemoteWebInspectorUI::initialize):
        (WebKit::RemoteWebInspectorUI::didSave):
        (WebKit::RemoteWebInspectorUI::didAppend):
        (WebKit::RemoteWebInspectorUI::frontendLoaded):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openInNewTab):
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::setDockSide):
        (WebKit::WebInspectorUI::setDockingUnavailable):
        (WebKit::WebInspectorUI::setIsVisible):
        (WebKit::WebInspectorUI::showConsole):
        (WebKit::WebInspectorUI::showResources):
        (WebKit::WebInspectorUI::showTimelines):
        (WebKit::WebInspectorUI::showMainResourceForFrame):
        (WebKit::WebInspectorUI::startPageProfiling):
        (WebKit::WebInspectorUI::stopPageProfiling):
        (WebKit::WebInspectorUI::startElementSelection):
        (WebKit::WebInspectorUI::stopElementSelection):
        (WebKit::WebInspectorUI::didSave):
        (WebKit::WebInspectorUI::didAppend):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadStringImpl):
        (WebKit::WebPage::loadAlternateHTMLString):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::computeAutocorrectionContext):
        * WebProcess/WebProcess.cpp:
        (WebKit::getWebCoreMemoryCacheStatistics):
        (WebKit::WebProcess::getWebCoreStatistics):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeProcessName):

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

        Regression(r230211): Crash under WebInspectorClient::~WebInspectorClient()
        https://bugs.webkit.org/show_bug.cgi?id=186950
        <rdar://problem/40602069>

        Reviewed by Darin Adler.

        Re-introduce null-check that was accidentally dropped in r230211.

        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::~WebInspectorClient):

2018-06-22  Timothy Hatcher  <timothy@apple.com>

        Corner of two scroll bars is white with dark mode enabled.
        https://bugs.webkit.org/show_bug.cgi?id=186819
        rdar://problem/40434350

        Reviewed by Tim Horton.

        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView drawRect:]): Added LocalDefaultSystemAppearance.
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::paintControlForLayerInContext): Ditto. Dropped ScrollView argument.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::drawRect): Added LocalDefaultSystemAppearance.

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

        Make it possible to add a border around loading or failed-to-load images
        https://bugs.webkit.org/show_bug.cgi?id=186614
        <rdar://problem/39050152>

        Reviewed by Zalan Bujtas.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _setColorFilterEnabled:]):
        (-[WKWebViewConfiguration _incompleteImageBorderEnabled]):
        (-[WKWebViewConfiguration _setIncompleteImageBorderEnabled:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        Plumb the setting to WebKit2.

2018-06-22  Brady Eidson  <beidson@apple.com>

        WKURLSchemeHandler doesn't handle sync XHR.
        <rdar://problem/40955884> and https://bugs.webkit.org/show_bug.cgi?id=186902

        Reviewed by Chris Dumez.

        This patch allows WebProcesses to block on sync loads to a custom scheme,
        and teaches WebURLSchemeTasks how to buffer up data and the response if 
        operating synchronously.

        * Shared/WebErrors.cpp:
        (WebKit::failedCustomProtocolSyncLoad):
        * Shared/WebErrors.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::startURLSchemeTask):
        (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * UIProcess/WebURLSchemeHandler.cpp:
        (WebKit::WebURLSchemeHandler::startTask):
        * UIProcess/WebURLSchemeHandler.h:

        * UIProcess/WebURLSchemeTask.cpp:
        (WebKit::WebURLSchemeTask::create):
        (WebKit::WebURLSchemeTask::WebURLSchemeTask):
        (WebKit::WebURLSchemeTask::didPerformRedirection):
        (WebKit::WebURLSchemeTask::didReceiveResponse):
        (WebKit::WebURLSchemeTask::didReceiveData):
        (WebKit::WebURLSchemeTask::didComplete):
        (WebKit::WebURLSchemeTask::pageDestroyed):
        (WebKit::WebURLSchemeTask::stop):
        * UIProcess/WebURLSchemeTask.h:
        (WebKit::WebURLSchemeTask::isSync const):

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebLoaderStrategy.h:

        * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
        (WebKit::WebURLSchemeHandlerProxy::loadSynchronously):
        * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:

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

        Implement IPC throttling to keep the main thread responsive when a process misbehaves
        https://bugs.webkit.org/show_bug.cgi?id=186607
        <rdar://problem/41073205>

        Reviewed by Geoff Garen and Brady Eidson.

        Implement IPC throttling to keep the main thread responsive when a process misbehaves.
        Instead of doing one main runloop dispatch per incoming message, we now do a single
        runloop dispatch and process incoming messages in batch. We put a limit on the number
        of messages to be processed in a batch (600). If the queue is larger that this limit,
        we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
        to process other events. Additionally, if an IPC connection keeps hitting this maximum
        batch size limit, we implement back off and we'll further decrease the number of messages
        we process in each batch (going as low as 60). This keeps Safari responsive enough to
        allow the user to close the bad tab (even on older devices such as iPhone 5s).

        Finally, if the incoming message queue becomes too large (50000), we go one step further
        and kill the IPC connection in order to maintain performance / battery life.

        Every time we apply throttling or terminate a connection due to throttling, we do a
        RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
        in the future.

        For now, incoming IPC messages throttling is only enabled on the UIProcess' connections
        to the WebProcesses.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::MessagesThrottler::MessagesThrottler):
        (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
        (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
        (IPC::Connection::dispatchIncomingMessages):
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::kill):

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

        REGRESSION (r231850): Cookie file cannot be read or written by network process
        https://bugs.webkit.org/show_bug.cgi?id=186806
        <rdar://problem/41113791>

        Unreviewed. Fix failure after r233084 by adding missing initialization.

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

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

        [Fullscreen] Home indicator should show and hide with status bar
        https://bugs.webkit.org/show_bug.cgi?id=186942
        <rdar://problem/41302190>

        Reviewed by Tim Horton.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):
        (-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):

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

        [Fullscreen] Add a pinch-to-exit gesture
        https://bugs.webkit.org/show_bug.cgi?id=186821

        Reviewed by Tim Horton.

        Add a pinch gesture recognizer that overrides the pan gesture recognizer when active. Hide the
        WKFullscreenViewController's controls while a dismiss gesture is active.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController setAnimating:]):
        (-[WKFullScreenViewController prefersStatusBarHidden]):
        (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
        (-[WKFullScreenViewController _touchDetected:]):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullscreenAnimationController context]):
        (-[WKFullscreenAnimationController updateWithProgress:scale:translation:anchor:]):
        (-[WKFullScreenInteractiveTransition animator]):
        (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withScale:andTranslation:]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController interactionControllerForDismissal:]):
        (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
        (-[WKFullScreenWindowController _dismissFullscreenViewController]):
        (-[WKFullScreenWindowController _interactiveDismissChanged:]):
        (-[WKFullScreenWindowController _interactivePinchDismissChanged:]):

2018-06-22  Brian Burg  <bburg@apple.com>

        [Cocoa] REGRESSION(W3C): actions for key equivalents are not respected
        https://bugs.webkit.org/show_bug.cgi?id=186936

        Reviewed by Timothy Hatcher.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
        This erroneously reported false unless there was both a mouse and key interaction
        being dispatched, which is not possible in the current serial event simulation model.
        As a result, Safari could not tell whether the action came from a simulated event
        or the user, and thus rejected all key equivalents like Cmd-A,V,C,X.

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

        [Fullscreen] Exit fullscreen when opening a new tab
        https://bugs.webkit.org/show_bug.cgi?id=186826
        <rdar://problem/40853211>

        Reviewed by Brent Fulgham.

        Make the fullscreen placeholder view a custom UIView, and exit fullscreen when the
        placeholder is removed from its superview.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenPlaceholderView willMoveToSuperview:]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        (-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):
        (-[WKFullScreenWindowController _exitFullscreenImmediately]):

2018-06-22  Timothy Horton  <timothy_horton@apple.com>

        Fix the build after r233089

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setColorFilterEnabled:]):
        (-[WKPreferences _colorFilterEnabled]):

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

        Crash under WebResourceLoadStatisticsStore::mergeStatistics(WTF::Vector<WebCore::ResourceLoadStatistics, 0ul, WTF::CrashOnOverflow, 16ul>&&)
        https://bugs.webkit.org/show_bug.cgi?id=186905
        <rdar://problem/41266775>

        Reviewed by Brent Fulgham.

        I believe the crash was caused by the WebResourceLoadStatisticsStore object being dead
        when mergeStatistics() is called. In particular, the crash was happening when the
        ResourceLoadStatisticsPersistentStorage's FileMonitor would detect a file change and
        we would re-sync statistics from the disk. The FileMonitor's lambda function was
        capturing |this| without ref'ing it, and the FileMonitor monitors the disk and
        calls the lambda on the background queue, while it gets destroyed on the main thread.

        To make lifetime management less complex, the following changes were made:
        - The ResourceLoadStatisticsPersistentStorage object is now always constructed / used
          and destroyed on the background queue. We no longer have to worry about being on
          the right thread in a given method.
        - Now that ResourceLoadStatisticsPersistentStorage is always used from the background
          queue and no longer needs to be thread-safe, drop its ref() / deref() methods and
          use weak pointers instead to make sure the ResourceLoadStatisticsPersistentStorage
          is still alive when a lamdba gets called on the background queue.
        - For write scheduling use WorkQueue::dispatchAfter() and a WeakPtr instead of a
          RunLoop::Timer. This is more convenient to use as the RunLoop::Timer has to be used
          on the main thread.

        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
        (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
        (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
        (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
        (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        CRASH in WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac()
        https://bugs.webkit.org/show_bug.cgi?id=186892

        Reviewed by Eric Carlson.

        Protect against m_contentMap being mutated while its contents are being invalidated
        by moving the map into a local variable and iterating over it instead.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::invalidate):
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::invalidate):

2018-06-22  Luming Yin  <luming_yin@apple.com>

        Expose colorFilterEnabled SPI in WKPreferencesPrivate.h
        https://bugs.webkit.org/show_bug.cgi?id=186935
        <rdar://problem/41109387>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setColorFilterEnabled:]):
        (-[WKPreferences _colorFilterEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-06-22  Timothy Hatcher  <timothy@apple.com>

        Recalc styles every time defaultAppearance changes.
        https://bugs.webkit.org/show_bug.cgi?id=186866
        rdar://problem/41309805

        Reviewed by Tim Horton.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setDefaultAppearance):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setDefaultAppearance):

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

        REGRESSION (r231850): Cookie file cannot be read or written by network process
        https://bugs.webkit.org/show_bug.cgi?id=186806
        <rdar://problem/41113791>

        Reviewed by Geoffrey Garen.

        Add defaultSessionPendingCookies to NetworkProcessCreationParameters, so pending cookies of default session 
        can be added right after default session is set. This improves the fix r231850 as it does not send additional 
        message and avoids the regression.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::NetworkProcessProxy):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-06-22  Brent Fulgham  <bfulgham@apple.com>

        [iOS Debug] Multiple resourceLoadStatistics redirect tests are flaky timeouts
        https://bugs.webkit.org/show_bug.cgi?id=183216
        <rdar://problem/37992317>

        Reviewed by Chris Dumez.

        Improve consistency of test results by make sure that completion handlers written to run
        on the main thread are only called on the main thread. Add additional assertions to help
        catch any cases where this invariant is not being honored.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Use Completion handler and assert
        we are on the right thread.
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): 
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Update to perform callbacks
        on the main thread (as intended). This function was doing them on a work queue.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Ditto.
        (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): Ditto.
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r230950): [GTK] WebKit::CoordinatedBackingStoreTile::setBackBuffer(): WebKitWebProcess killed by SIGSEGV (ASSERTION FAILED: it != m_tiles.end())
        https://bugs.webkit.org/show_bug.cgi?id=186206

        Unreviewed manual rollout of r230950

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::layerShouldHaveBackingStore):

2018-06-20  Darin Adler  <darin@apple.com>

        [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
        https://bugs.webkit.org/show_bug.cgi?id=186875

        Reviewed by Anders Carlsson.

        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): Use isDirectory:YES to create a URL
        to the temporary directory.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): Use isDirectory:NO to create a URL
        pointing to the write location.
        * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
        (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const): Use isDirectory:YES to
        create a URL for the local storage directory.
        * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
        (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup const): Use isDirectory:NO to
        create a URL for the storage directory.
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _prepareToDragPromisedBlob:]): Use isDirectory:NO to create a URL for the temporary
        file location.
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]): Use isDirectory:NO
        to create a URL for the image file to upload.
        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::inspectorPageURL): Use isDirectory:NO to create a URL for the HTML file.
        (WebKit::WebInspectorProxy::inspectorTestPageURL): Ditto.
        (WebKit::WebInspectorProxy::inspectorBaseURL): Ditto.
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::createIconForFiles): Use isDirectory:NO to create a URL for the image file.
        * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
        (WebKit::webInspectorUILocalizedStringsURL): Use isDirectory:NO to create a URL for the localized
        strings file.

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

        Unreviewed, rolling out r232995.

        Seems to have caused flakiness

        Reverted changeset:

        "Implement IPC throttling to keep the main thread responsive
        when a process misbehaves"
        https://bugs.webkit.org/show_bug.cgi?id=186607
        https://trac.webkit.org/changeset/232995

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

        Address fullscreen api CSS env feedback
        https://bugs.webkit.org/show_bug.cgi?id=186684

        Reviewed by Simon Fraser.

        + Update the phishing alert text to be more explicit about the specific threats
          phishing sites represent.
        + Make the top inset static, rather than dynamic.
        + Add bottom, left, and right insets for completeness.
        + Set the fullscreen animation duration as well as delay.
        + Notify the page when the controls show and hide.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming):
        (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop): Deleted.
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay): Deleted.
        * UIProcess/WebFullScreenManagerProxy.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):
        (-[WKFullScreenViewController viewWillAppear:]):
        (-[WKFullScreenViewController _effectiveFullscreenInsets]):
        (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
        (-[WKFullScreenViewController _showPhishingAlert]):
        (-[WKFullScreenViewController _effectiveFullscreenInsetTop]): Deleted.
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::didExitFullScreen):
        (WebKit::WebFullScreenManager::setFullscreenInsets):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming):
        (WebKit::WebFullScreenManager::setFullscreenControlsHidden):
        (WebKit::WebFullScreenManager::setFullscreenInsetTop): Deleted.
        (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay): Deleted.
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/FullScreen/WebFullScreenManager.messages.in:

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

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

        "Introduced assertion failure in ~DisplayRefreshMonitorMac()."
        (Requested by perarne on #webkit).

        Reverted changeset:

        "DisplayRefreshMonitorMac should hold a weak pointer to
        WebPage."
        https://bugs.webkit.org/show_bug.cgi?id=186683
        https://trac.webkit.org/changeset/232884

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

        [Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=186822

        Reviewed by Simon Fraser.

        Set the minimum zoom, maximum zoom, zoom bouncing, and user scalability settings of the
        WKWebView's UIScrollView upon entering fullscreen, and restore those same settings upon
        exit. Override the viewport arguments upon entering fullscreen, restore them upon exit.

        * Platform/IPC/ArgumentCoder.h:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ViewportArguments>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::forceAlwaysUserScalable const):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setOverrideViewportArguments):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WebKit::WKWebViewState::applyTo):
        (WebKit::WKWebViewState::store):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::forceAlwaysUserScalable const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setOverrideViewportArguments):

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

        [Fullscreen] Use secondary glyph style for fullscreen controls
        https://bugs.webkit.org/show_bug.cgi?id=186862
        <rdar://problem/41212210>

        Reviewed by Tim Horton.

        Adopt AVBackgroundView, and use its predefined enums to set the material and tint styles for
        the fullscreen controls.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController loadView]):
        * UIProcess/ios/fullscreen/WKFullscreenStackView.h:
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        (-[WKFullscreenStackView init]):
        (-[WKFullscreenStackView dealloc]):
        (-[WKFullscreenStackView addArrangedSubview:applyingMaterialStyle:tintEffectStyle:]):
        (-[WKFullscreenStackView layoutSubviews]):
        (+[WKFullscreenStackView baseEffects]): Deleted.
        (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]): Deleted.
        (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]): Deleted.
        (+[WKFullscreenStackView secondaryMaterialOverlayView]): Deleted.
        (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]): Deleted.
        (+[WKFullscreenStackView applySecondaryGlyphTintToView:]): Deleted.
        (-[WKFullscreenStackView initWithArrangedSubviews:axis:]): Deleted.
        (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]): Deleted.
        (-[WKFullscreenStackView contentView]): Deleted.
        (-[WKFullscreenStackView _setArrangedSubviews:axis:]): Deleted.
        (-[WKFullscreenStackView setBounds:]): Deleted.
        (-[WKFullscreenStackView updateConstraints]): Deleted.

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

        [Fullscreen] Suspend page (and pause video) while phishing warning is presented
        https://bugs.webkit.org/show_bug.cgi?id=186856
        <rdar://problem/41212444>

        Reviewed by Tim Horton.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _showPhishingAlert]):

2018-06-21  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r232989.

        Causes API regressions on macOS

        Reverted changeset:

        "REGRESSION (r231850): Cookie file cannot be read or written
        by network process"
        https://bugs.webkit.org/show_bug.cgi?id=186806
        https://trac.webkit.org/changeset/232989

2018-06-21  Zan Dobersek  <zdobersek@igalia.com>

        [GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
        https://bugs.webkit.org/show_bug.cgi?id=186884

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (webkitAutomationSessionCreate): Handle any host-certificate pair that's
        been set for this session, creating a GTlsCertificate object through
        loading from the specified certificate path and marking that certificate
        as allowed for the specified host through the
        webkit_web_context_allow_tls_certificate_for_host() API.

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

        Regression(r226990) : Crash under WebCore::Page::applicationWillResignActive
        https://bugs.webkit.org/show_bug.cgi?id=186850
        <rdar://problem/37394469>

        Reviewed by Eric Carlson.

        Make sure m_page is not null before calling applicationWillResignActive(). m_page
        gets nulled out when WebPage::close() is called. The crash trace seems to indicate
        we're calling applicationWillResignActive() on a Page that is dead since we crash
        accessing Page::mainFrame().

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

2018-06-21  Fujii Hironori  <Hironori.Fujii@sony.com>

        [GTK] http/tests/misc/bubble-drag-events.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=182352

        Reviewed by Carlos Garcia Campos.

        PingLoad::didFinish was called twice if it is used with
        NetworkDataTaskSoup. PingLoad is not a ref-counted object. It is
        destructed when PingLoad::didFinish is called.

        PingLoad::didReceiveChallenge calls the ChallengeCompletionHandler
        with AuthenticationChallengeDisposition::Cancel to cancel the
        challenge and calls PingLoad::didFinish.

        NetworkDataTaskSoup::continueAuthenticate calls
        didReceiveChallenge with a ChallengeCompletionHandler which calls
        didCompleteWithError. PingLoad::didCompleteWithError calls
        PingLoad::didFinish.

        didCompleteWithError callback should not be called in the
        ChallengeCompletionHandler.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::continueAuthenticate): Do not call
        didFail() in the ChallengeCompletionHandler. Call
        invalidateAndCancel() instead.

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

        [WebKit on watchOS] Fixed position elements sometimes flicker when scrolling
        https://bugs.webkit.org/show_bug.cgi?id=186860
        <rdar://problem/39953563>

        Reviewed by Tim Horton.

        Remove conditional guards that are no longer necessary, now that the oldest iOS version our builders support is
        iOS 11. Conditionalizing this logic only for iOS 11+ meant that on watchOS, we're always falling down the path
        where we don't schedule a visible content rect update until the next runloop, which makes it possible for a
        remote layer tree transaction to arrive and cause us to update the scrolling tree with stale viewport geometry.

        Test: WKScrollViewTests.PositionFixedLayerAfterScrolling

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

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

        Restrict Selection in contenteditable the extent of that contenteditable
        https://bugs.webkit.org/show_bug.cgi?id=186792

        Reviewed by Wenson Hsieh.

        We have not been checking to make sure that when we make a selection that it is restricted to 
        a single content editable on iOS. There is functionality to ensure this on mac, so it has been
        exposed and utilized for restricting the extent of a selection.

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

2018-06-19  Dean Jackson  <dino@apple.com>

        Blank viewer comes up and then auto-dismisses when device is not connected to Internet
        https://bugs.webkit.org/show_bug.cgi?id=186825
        <rdar://problem/40294170>

        Reviewed by Tim Horton.

        Handle the case where the network load fails, and send that
        error onto QuickLook.

        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didReceiveResponse): Check for success.
        (WebKit::DownloadClient::processDidCrash): Cancel in the case of a crash.
        (WebKit::DownloadClient::didFail): Propagate the error onto QuickLook.
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource failWithError:]): New method that calls
        the completion handler with the error data.
        (WebKit::SystemPreviewController::fail): New API method.
        * UIProcess/SystemPreviewController.h:

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

        Implement IPC throttling to keep the main thread responsive when a process misbehaves
        https://bugs.webkit.org/show_bug.cgi?id=186607
        <rdar://problem/41073205>

        Reviewed by Geoffrey Garen.

        Implement IPC throttling to keep the main thread responsive when a process misbehaves.
        Instead of doing one main runloop dispatch per incoming message, we now do a single
        runloop dispatch and process incoming messages in batch. We put a limit on the number
        of messages to be processed in a batch (600). If the queue is larger that this limit,
        we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
        to process other events. Additionally, if an IPC connection keeps hitting this maximum
        batch size limit, we implement back off and we'll further decrease the number of messages
        we process in each batch (going as low as 60). This keeps Safari responsive enough to
        allow the user to close the bad tab (even on older devices such as iPhone 5s).

        Finally, if the incoming message queue becomes too large (50000), we go one step further
        and kill the IPC connection in order to maintain performance / battery life.

        Every time we apply throttling or terminate a connection due to throttling, we do a
        RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
        in the future.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::MessagesThrottler::MessagesThrottler):
        (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
        (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
        (IPC::Connection::dispatchIncomingMessages):
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::kill):

2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>

        Make SecItemShim to not send return value for SecItemAdd
        https://bugs.webkit.org/show_bug.cgi?id=186789
        <rdar://problem/40892596>

        Reviewed by Brent Fulgham.

        Return value of SecItemAdd is often ignored. Even if it isn't, we don't have the ability to serialize SecKeychainItemRef.
        Otherwise, it would go through the weird route of serializing SecKeychainItemRef by asking Keychain for its persistent
        reference. This route contradicts the purpose of SecItemShim, which is to proxy all Keychain operations to UIProcess.

        Also, this patch removes the release assertion on encode(Encoder&, SecAccessControlRef) and decode(Decoder&, RetainPtr<SecAccessControlRef>&)
        as they don't query Keychain.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode):
        (IPC::decode):
        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):
        (WebKit::webSecItemAdd):
        * UIProcess/mac/SecItemShimProxy.cpp:
        (WebKit::SecItemShimProxy::secItemRequest):
        * UIProcess/mac/SecItemShimProxy.h:
        * UIProcess/mac/SecItemShimProxy.messages.in:

2018-06-19  Sihui Liu  <sihui_liu@apple.com>

        REGRESSION (r231850): Cookie file cannot be read or written by network process
        https://bugs.webkit.org/show_bug.cgi?id=186806
        <rdar://problem/41113791>

        Reviewed by Geoffrey Garen.

        Default websiteDataStore may be added wrongly to network process before default session was 
        set, as messages were asynchronous, so the cookie storage could be improperly set.   

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

2018-06-19  Don Olmstead  <don.olmstead@sony.com>

        Use getCurrentProcessID over getpid
        https://bugs.webkit.org/show_bug.cgi?id=186813

        Reviewed by Alex Christensen.

        * Shared/WebMemorySampler.cpp:
        (WebKit::WebMemorySampler::initializeTimers):
        (WebKit::WebMemorySampler::stop):
        (WebKit::WebMemorySampler::writeHeaders):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::installServiceWorker):

2018-06-19  Don Olmstead  <don.olmstead@sony.com>

        WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations does not invoke callback when Service Workers disabled
        https://bugs.webkit.org/show_bug.cgi?id=186809

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):

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

        [WebKit on watchOS] Vend username text content type when using scribble in login fields
        https://bugs.webkit.org/show_bug.cgi?id=186791
        <rdar://problem/41226935>

        Reviewed by Beth Dakin.

        Vend additional context to Quickboard when focusing an element that is likely to be a username field.

        Test: fast/forms/watchos/username-text-content-type.html

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:

        Add a new flag to tell the UI process when the currently focused element is an autofillable username input
        field (using existing app autofill heuristics).

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

        Add new testing SPI to grab the computed text content type for the focused element.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (contentTypeFromFieldName):

        If `autocomplete="username"` is specified, return a username text content type. This was not originally added in
        r197626 because UITextContentTypeUsername was only introduced later, in iOS 11.

        (-[WKContentView textContentTypeForListViewController:]):
        (-[WKContentView textContentTypeForTesting]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

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

        Unreviewed, rolling out r232947.

        Caused an API test to time out

        Reverted changeset:

        "Implement IPC throttling to keep the main thread responsive
        when a process misbehaves"
        https://bugs.webkit.org/show_bug.cgi?id=186607
        https://trac.webkit.org/changeset/232947

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

        HTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
        https://bugs.webkit.org/show_bug.cgi?id=186735
        <rdar://problem/41189164>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/cache/NetworkCacheCoders.cpp:
        (WTF::Persistence::Coder<WebCore::HTTPHeaderMap>::decode):

2018-06-19  Youenn Fablet  <youenn@apple.com>

        Network Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=186312
        <rdar://problem/40495434>

        Reviewed by Chris Dumez.

        Add buffering of all request/response of a given load, including redirections and preflights.
        This buffering is switched on/off by a boolean which is switched on in case Web Inspector is launched.

        Buffering is done in NetworkLoadChecker.
        We add ways to retrieve preflight information from NetworkCORSPreflightChecker.

        Implement LoaderStrategy new methods through sync IPC.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
        (WebKit::NetworkCORSPreflightChecker::startPreflight):
        (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
        (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
        (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
        (WebKit::NetworkCORSPreflightChecker::takeInformation):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationRequest):
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadIntermediateInformation):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformation):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::check):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::checkResponse):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        (WebKit::NetworkLoadChecker::storeRedirection):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::takeNetworkLoadInformation):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        * Scripts/webkit/messages.py:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
        * WebProcess/Network/WebLoaderStrategy.h:

2018-06-19  Brent Fulgham  <bfulgham@apple.com>

        MAP_JIT is not present for minimal simulator builds
        https://bugs.webkit.org/show_bug.cgi?id=186608

        Reviewed by Darin Adler.

        * Configurations/WebContent-iOS-minimalsimulator.entitlements:

2018-06-18  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make sure to call callbacks even if there is no store (test infrastructure)
        https://bugs.webkit.org/show_bug.cgi?id=186777
        <rdar://problem/41216181>

        Reviewed by Chris Dumez.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):

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

        Crash under WebProcessPool::networkProcessFailedToLaunch():
        https://bugs.webkit.org/show_bug.cgi?id=186784
        <rdar://problem/33535377>

        Reviewed by Brady Eidson.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (+[WKProcessPool _allProcessPoolsForTesting]):
        Add SPI to retrieve all WebProcessPool for testing purposes.

        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::clearCallbackStates):
        Make iteration over completion handlers robust against completion handlers
        getting removed while we iterate.

        (WebKit::NetworkProcessProxy::didClose):
        Ref the WebProcessPool (which keeps the NetworkProcessProxy alive too)
        as several calls within this method might cause the WebProcessPool /
        NetworkProcessProxy to get destroyed.

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

        Implement IPC throttling to keep the main thread responsive when a process misbehaves
        https://bugs.webkit.org/show_bug.cgi?id=186607

        Reviewed by Geoffrey Garen.

        Implement IPC throttling to keep the main thread responsive when a process misbehaves.
        Instead of doing one main runloop dispatch per incoming message, we now do a single
        runloop dispatch and process incoming messages in batch. We put a limit on the number
        of messages to be processed in a batch (600). If the queue is larger that this limit,
        we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
        to process other events. Additionally, if an IPC connection keeps hitting this maximum
        batch size limit, we implement back off and we'll further decrease the number of messages
        we process in each batch (going as low as 60). This keeps Safari responsive enough to
        allow the user to close the bad tab (even on older devices such as iPhone 5s).

        Finally, if the incoming message queue becomes too large (50000), we go one step further
        and kill the IPC connection in order to maintain performance / battery life.

        Every time we apply throttling or terminate a connection due to throttling, we do a
        RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
        in the future.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::Connection):
        (IPC::Connection::enqueueIncomingMessage):
        (IPC::Connection::MessagesThrottler::MessagesThrottler):
        (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
        (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
        (IPC::Connection::dispatchIncomingMessages):
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::kill):

2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>

        Add a graceful exit for AuthenticationManager::initializeConnection
        https://bugs.webkit.org/show_bug.cgi?id=186632
        <rdar://problem/41041033>

        Reviewed by Brent Fulgham.

        Add a graceful exit for AuthenticationManager::initializeConnection when the provided IPC connection
        is null or the underlying xpc connection is null.

        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection):

2018-06-18  Youenn Fablet  <youenn@apple.com>

        Validate Cross-Origin-Resource-Policy for resources cached in the MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=186639
        <rdar://problem/41106984>

        Reviewed by Geoffrey Garen.

        Make use of WebCore method to check CORP.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:

2018-06-18  Karl Leplat  <karl.leplat_ext@softathome.com>

        [Threaded paintingEngine] Fix rendering glitches
        https://bugs.webkit.org/show_bug.cgi?id=186764

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
        (WebKit::CoordinatedBackingStoreTile::swapBuffers):
        We call Nicosia::Buffer function waitUntilPaintingComplete()
        in order to synchronize of using Nicosia:buffer between MainThread
        and ThreadedCompositor.


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

        Crash under SuspendedPageProxy::~SuspendedPageProxy()
        https://bugs.webkit.org/show_bug.cgi?id=186688
        <rdar://problem/41060769>

        Reviewed by Darin Adler.

        Ref the WebProcessProxy before calling suspendedPageWasDestroyed() on it as this
        might cause the WebProcessProxy / WebProcessPool to get destroyed otherwise, and
        we would crash trying to call unregisterSuspendedPageProxy() on the WebProcessPool
        on the next line.

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):

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

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Darin Adler.

        Rename a category referencing "Extra zoom mode".

        * UIProcess/ios/WKContentViewInteraction.mm:

2018-06-12  Darin Adler  <darin@apple.com>

        [Cocoa] Make some RetainPtr refinements to get more ready for ARC
        https://bugs.webkit.org/show_bug.cgi?id=186526

        Reviewed by Anders Carlsson.

        * Platform/cf/ModuleCF.cpp:
        (WebKit::Module::load): Use move assignment instead of adoptCF/leakRef.

        * Shared/Cocoa/WKNSURLExtras.mm:
        (+[NSURL _web_URLWithWTFString:]): Cast to NSURL * instead of doing the autorelease
        here, since the NSURL * operator already does what we want.
        (+[NSURL _web_URLWithWTFString:relativeToURL:]): Ditto.

        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _wk_printedDocument]): Get rid of incorrect use of
        RetainPtr::autorelease. We don't want to null out _printedDocument each time this
        function is called.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
        (collectIcons): Get rid of unnecessary use of RetainPtr::autorelease in a function
        that returns a RetainPtr.

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

        Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
        https://bugs.webkit.org/show_bug.cgi?id=186681

        Reviewed by Brady Eidson.

        Make sure StorageProcess::unregisterSWServerConnection() does not unnecessarily
        create a SWServer. Otherwise, we were in quick session destroying the SWServer
        and then re-constructing it for the same sessionID, merely to try ot unregister
        a SWServerConnection.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::existingSWOriginStoreForSession const):
        (WebKit::StorageProcess::unregisterSWServerConnection):
        * StorageProcess/StorageProcess.h:

2018-06-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [WinCairo] Move unrelated features of WorkQueueWin into IPC::Connection
        https://bugs.webkit.org/show_bug.cgi?id=186582

        Add EventListener private class to handle signaled tasks for I/O.
        Originally they were in WTF::WorkQueueWin, but those features were not related
        to WorkQueue and only used in IPC::ConnectionWin. Moved logic is more specialized
        than old generalized logic. That was unneeded generalization.

        Reviewed by Brent Fulgham.

        * Platform/IPC/Connection.h:
        (IPC::Connection::EventListener::state):
        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::platformInitialize):
        (IPC::Connection::platformInvalidate):
        (IPC::Connection::readEventHandler):
        (IPC::Connection::writeEventHandler):
        (IPC::Connection::invokeReadEventHandler):
        (IPC::Connection::invokeWriteEventHandler):
        (IPC::Connection::open):
        (IPC::Connection::sendOutgoingMessage):
        (IPC::Connection::EventListener::open):
        (IPC::Connection::EventListener::callback):
        (IPC::Connection::EventListener::close):

2018-06-15  Brady Eidson  <beidson@apple.com>

        Crash in both StorageProcess and UIProcess when using custom WKWebsiteDataStores for data management.
        <rdar://problem/41019893> and https://bugs.webkit.org/show_bug.cgi?id=186682

        Reviewed by Chris Dumez.

        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::didClose): Protect this and the process pool as the cleanup that follows
          might cause either to get destroyed.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply): Protect the operating WebsiteDataStore while async operations
          are in flight. Otherwise if the data store is destroyed, the SessionIDs for those operations will get
          destroyed before they complete.
        (WebKit::WebsiteDataStore::removeData): Ditto.

2018-06-15  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r232634.

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

2018-06-15  Per Arne Vollan  <pvollan@apple.com>

        DisplayRefreshMonitorMac should hold a weak pointer to WebPage.
        https://bugs.webkit.org/show_bug.cgi?id=186683

        Reviewed by Brent Fulgham.

        Instead of DisplayRefreshMonitorMac having a RefPtr to WebPage, it should have a weak pointer.
        Having a RefPtr could in theory create reference cycles. This potential problem has not been
        observed in practice, but it is safer to use a weak pointer.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
        (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):

2018-06-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WKE] Disable memory pressure handling when running layout tests (WTR)
        https://bugs.webkit.org/show_bug.cgi?id=186663

        Reviewed by Michael Catanzaro.

        r196943 added a mechanism to disable the memory pressure handling
        on Mac. This patch enables using that mechanism also for GTK/WPE.
        To do that the environment variable WEBKIT_DISABLE_MEMORY_PRESSURE_MONITOR
        should bet set to 1.
        We want to use this on the layout tests to avoid flaky tests caused
        by accumulated leaks on the WebProcess by different tests.

        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/wpe/WebProcessPoolWPE.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2018-06-15  Per Arne Vollan  <pvollan@apple.com>

        Rollout r231818, as it introduced regression on tickets.com.
        https://bugs.webkit.org/show_bug.cgi?id=186675

        Unreviewed, rolling out.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::pause): Deleted.
        (WebKit::DisplayLink::resume): Deleted.
        * UIProcess/mac/DisplayLink.h:

2018-06-15  Thibault Saunier  <tsaunier@igalia.com>

        [GTK][WPE]: Avoid using uninitialized launchOptions in getLaunchOptions
        https://bugs.webkit.org/show_bug.cgi?id=185611

        Reviewed by Chris Dumez.

        Otherwise we might segfault.

        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::getLaunchOptions):

2018-06-14  Youenn Fablet  <youenn@apple.com>

        Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
        https://bugs.webkit.org/show_bug.cgi?id=186166

        Reviewed by Alex Christensen.

        Make CacheStorage::Engine creation asynchronous.
        Update Engine public methods be static methods taking a SessionID, which will be used to create the engine.

        Add IPC methods to retrieve cache storage parameters from NetworkProcess to UIProcess.

        Add NetworkProcessProxy ability to compute the cache storage parameters based on the SessionID.
        For that purpose, make NetworkProcessProxy store a map of SessionID-to-WebsiteDataStore.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::cacheStorageParameters):
        (WebKit::NetworkProcess::setCacheStorageParameters):
        (WebKit::NetworkProcess::cacheStorageDirectory const): Deleted.
        (WebKit::NetworkProcess::cacheStoragePerOriginQuota const): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::from):
        (WebKit::CacheStorage::Engine::fetchEntries):
        (WebKit::CacheStorage::Engine::open):
        (WebKit::CacheStorage::Engine::remove):
        (WebKit::CacheStorage::Engine::retrieveCaches):
        (WebKit::CacheStorage::Engine::retrieveRecords):
        (WebKit::CacheStorage::Engine::putRecords):
        (WebKit::CacheStorage::Engine::deleteMatchingRecords):
        (WebKit::CacheStorage::Engine::lock):
        (WebKit::CacheStorage::Engine::unlock):
        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
        (WebKit::CacheStorage::Engine::representation):
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        (WebKit::CacheStorage::Engine::Engine):
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::defaultEngine): Deleted.
        * NetworkProcess/cache/CacheStorageEngine.h:
        (WebKit::CacheStorage::Engine::shouldPersist const):
        (WebKit::CacheStorage::Engine::weakPtrFactory):
        (WebKit::CacheStorage::Engine::create): Deleted.
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::remove):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
        (WebKit::CacheStorageEngineConnection::putRecords):
        (WebKit::CacheStorageEngineConnection::reference):
        (WebKit::CacheStorageEngineConnection::dereference):
        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
        (WebKit::CacheStorageEngineConnection::engineRepresentation):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::encode const):
        (WebKit::WebsiteDataStoreParameters::decode):
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * Shared/WebsiteDataStoreParameters.h:
        (): Deleted.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::addSession):
        (WebKit::NetworkProcessProxy::removeSession):
        (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):

2018-06-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Win] Add IPC error case for broken pipe
        https://bugs.webkit.org/show_bug.cgi?id=186445

        Add error handling for ERROR_BROKEN_PIPE on IPC::Connection::readEventHandler.

        Reviewed by Ryosuke Niwa.

        * Platform/IPC/win/ConnectionWin.cpp:
        (IPC::Connection::readEventHandler):

2018-06-14  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Shortcut classification for redirect to prevalent resource
        https://bugs.webkit.org/show_bug.cgi?id=186627
        <rdar://problem/41132308>

        Reviewed by Brent Fulgham.

        This patch shortcuts classification of redirect collusion so that we more seldom
        have to rely on the recursive backtrace of the redirect graph. The initial
        implementation of Resource Load Statistics actually had this classification method.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent):
            Iterates through a non-classified resource's data for where it has redirected
            and classifies it as prevalent if has redirected to 
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
            Now calls WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent()
            before regular classification steps. 
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-06-14  Youenn Fablet  <youenn@apple.com>

        Apply CSP checks before Content blocker checks in NetworkLoadChecker as done by CachedResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=186550

        Reviewed by Alex Christensen.

        Do CSP checks and URL upgrade before content blocker checks.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):

2018-06-14  Brent Fulgham  <bfulgham@apple.com>

        Plug-in Process crashing on Mojave (affects Flash, others)
        https://bugs.webkit.org/show_bug.cgi?id=186628
        <rdar://problem/41120462>

        Reviewed by Eric Carlson.

        Add the missing “com.apple.security.cs.allow-unsigned-executable-memory” entitlement. Also alphabetize
        the entitlements file to make it easier to read.

        * Configurations/PluginService.entitlements:

2018-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] WebDriver: handle acceptInsecureCertificates capability
        https://bugs.webkit.org/show_bug.cgi?id=186560

        Reviewed by Brian Burg.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        (webkitAutomationSessionCreate): Check the acceptInsecureCertificates capability and set the TLS error policy in
        the WebContext accordingly if needed.
        * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
        * UIProcess/API/glib/WebKitWebContext.cpp:
        * UIProcess/Cocoa/AutomationClient.h:
        * UIProcess/Cocoa/AutomationClient.mm:
        (WebKit::AutomationClient::requestAutomationSession): Use SessionCapabilities to fill the session configuration.
        (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): Deleted.

2018-06-13  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Trying to access the remote inspector hits an assertion in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=186588

        Reviewed by Carlos Garcia Campos.

        Make both the WPE and GTK+ ports use /org/webkit/inspector as base prefix
        for resource paths, which avoids needing a switcheroo depending on the port.

        * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml:
        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        * UIProcess/wpe/WebInspectorProxyWPE.cpp:
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
        (WebKit::WebInspectorUI::localizedStringsURL):
        (WebKit::RemoteWebInspectorUI::localizedStringsURL):

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

        Crash under SWServer::unregisterConnection(Connection&)
        https://bugs.webkit.org/show_bug.cgi?id=186584
        <rdar://problem/40931680>

        Reviewed by Youenn Fablet.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/StorageToWebProcessConnection.cpp:
        (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
        (WebKit::StorageToWebProcessConnection::didReceiveMessage):
        (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
        (WebKit::StorageToWebProcessConnection::didClose):
        (WebKit::StorageToWebProcessConnection::unregisterSWConnections):
        (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
        * StorageProcess/StorageToWebProcessConnection.h:

2018-06-13  Dean Jackson  <dino@apple.com>

        Disable AR support in WKWebView clients
        https://bugs.webkit.org/show_bug.cgi?id=186611
        <rdar://problem/39544684>

        Reviewed by Jon Lee.

        Since it hasn't been adequately tested, System Preview (AR) should
        be disabled by default for WKWebViews.

        Add a new WebPreference, and SPI into WKWebViewConfiguration. Also
        don't register the WebViewContentProvider if the feature is
        disabled.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration encodeWithCoder:]):
        (-[WKWebViewConfiguration initWithCoder:]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _contentProviderRegistry]):
        (-[WKWebViewConfiguration _systemPreviewEnabled]):
        (-[WKWebViewConfiguration _setSystemPreviewEnabled:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
        (-[WKWebViewContentProviderRegistry init]): Deleted.

2018-06-13  Youenn Fablet  <youenn@apple.com>

        Supported plugin check should be based on plugin identifier
        https://bugs.webkit.org/show_bug.cgi?id=186578
        <rdar://problem/40523828>

        Reviewed by Darin Adler.

        Refactoring to move from Plugin name to Plugin identifier.
        Set built-in pdf plugin identifier.
        This allows making sure that the PDF plug-in check might not change according localization.

        * Scripts/webkit/messages.py:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PluginInfo>::encode):
        (IPC::ArgumentCoder<PluginInfo>::decode):
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::supportedPluginIdentifiers):
        (WebKit::PluginInfoStore::addSupportedPlugin):
        (WebKit::PluginInfoStore::supportedPluginNames): Deleted.
        * UIProcess/Plugins/PluginInfoStore.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPlugins):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::pluginInfo):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::pluginInfo):
        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
        (WebKit::WebPluginInfoProvider::populatePluginCache):
        * WebProcess/Plugins/WebPluginInfoProvider.h:

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

        PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
        https://bugs.webkit.org/show_bug.cgi?id=186545

        Reviewed by Brady Eidson.

        Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
        This information was previously logged in DocumentLoader::willSendRequest() and was getting
        sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
        statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
        WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
        DocumentLoader::willSendRequest()).

        This is more efficient and will also be needed soon due to the way process swap on navigation 
        deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
        the load and started a new load to the redirected to URL in the new WebProcess. As a result,
        the new WebProcess is not aware that the load is a redirect, which is information that ITP
        requires. By moving the ITP logging to the UIProcess, we still have access to this
        information.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        - We now pass the full redirect response the the delegate method instead of a simple
        isRedirect boolean.
        - Log the navigation in the WebResourceLoadStatisticsStore for ITP purposes.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::areDomainsAssociated):
        Equivalent of ResourceLoadObserver's areDomainsAssociated(). Most of the logic was moved
        to ResourceLoadStatistics::areDomainsAssociated() to avoid code duplication.

        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        This is called whenever a WebProcess sends new resource load statistics to the UIProcess.
        Whenever this happens, we call processStatisticsAndDataRecords() right away, which is
        sometimes the tests currently rely on. As a result, we can cancels any pending statistics
        processing request that was scheduled by logFrameNavigation().

        (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
        (WebKit::WebResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
        Whenever a navigation is logged and statistics have been updated, we need to make sure we
        schedule a "timer" to process the new data. We do this at most every 5 seconds for performance
        reasons. This 5 second interval matches what the ResourceLoadObserver is using in the WebProcess
        to notify the UIProcess of new data.

        (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
        This code was moved from ResourceLoadObserver to WebResourceLoadStatisticsStore now that we
        do this logging in the UIProcess instead of the WebProcess. One difference with WebCore is
        that we use WebPageProxy::pageLoadState().url() as mainFrameURL instead of
        WebPageProxy::mainFrame().url(). The reason for that is that WebPageProxy::mainFrame().url()
        becomes empty in case of process swap but ITP still needs the actual main frame URL when the
        navigation was triggered. WebPageProxy::pageLoadState().url() gives us this information.

        * UIProcess/WebResourceLoadStatisticsStore.h:

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        We now pass the full redirect response the the delegate method instead of a simple
        isRedirect boolean.

2018-06-13  Brent Fulgham  <bfulgham@apple.com>

        Crash during interrupted process termination
        https://bugs.webkit.org/show_bug.cgi?id=185373
        <rdar://problem/40019480>

        Reviewed by Alex Christensen.

        It's possible to encounter a crash if a user agent feature (such as Safari's responsiveness timer) decides
        to kill a Web Process around the same time that a user decides to trigger a new page load. One of the two
        termination operations may attempt to call methods on a nulled process pointer.

        We can avoid this by holding our own reference to the terminating process until the termination steps have
        been completed.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageTerminate): Ref<> the active process while the termination call is performed.
        * UIProcess/API/Cocoa/WKWebView.mm:
        ([WKWebView _killWebContentProcessAndResetState]): Ditto.

2018-06-13  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: wrong modifiers sent for 'Help' virtual key
        https://bugs.webkit.org/show_bug.cgi?id=186600
        <rdar://problem/41088912>

        Reviewed by Timothy Hatcher.

        This fixes a hang when running W3C test:

            special_keys.py::test_webdriver_special_key_sends_keydown[HELP-expected2]

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::eventModifierFlagsForVirtualKey):
        The help modifier doesn't seem to be used when pressing the Help key.
        I verified this using the Help key on the Keyboard Viewer, since no
        keyboards from the past decade actually have this physical button.

2018-06-13  Thibault Saunier  <tsaunier@igalia.com>

        [WPE] Build getUserMedia support
        https://bugs.webkit.org/show_bug.cgi?id=186547

        Reviewed by Alejandro G. Castro.

        * SourcesWPE.txt: Compile files necessary for MediaStream/webrtc.

2018-06-13  Andy Estes  <aestes@apple.com>

        [iOS] Synchronize PDF resizing with device rotation
        https://bugs.webkit.org/show_bug.cgi?id=186587
        <rdar://problem/40922462>

        Reviewed by Darin Adler.

        Both -beginPDFViewRotation and -endPDFViewRotation need to be called as part of
        the transition coordinator's -animateAlongsideTransition: block to be synchronized
        with rotation. Additionally, updateBlock needs to be invoked between the two calls
        so that PDFKit can capture the frame geometry before and after the update.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        * UIProcess/Cocoa/WKWebViewContentProvider.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_beginAnimatedResizeWithUpdates:]):
        (-[WKPDFView web_beginAnimatedResize]): Renamed to web_beginAnimatedResizeWithUpdates:.
        (-[WKPDFView web_endAnimatedResize]): Deleted.

2018-06-12  Brent Fulgham  <bfulgham@apple.com>

        Turn CSS Spring Animations and Link Preload off by default for production builds.
        https://bugs.webkit.org/show_bug.cgi?id=186548
        <rdar://problem/41023774>

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml: Switch these features from 'on' to
        DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.

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

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 2)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Tim Horton.

        Upstream most of the work around form controls on watchOS. Also, rename WKFormControlListViewController.* to
        its intended name, WKQuickboardListViewController.*.

        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/forms/WKDatePickerViewController.h:
        * UIProcess/ios/forms/WKDatePickerViewController.mm:
        (datePickerSetButtonHeight):
        (datePickerVerticalMargin):
        (-[WKDatePickerWheelLabel initWithFrame:]):
        (-[WKDatePickerWheelLabel lastSelectedDate]):
        (-[WKDatePickerWheelLabel setLastSelectedDate:]):
        (-[WKDatePickerWheelLabel needsUpdateForIndex:selectedDate:]):
        (-[WKDatePickerWheel initWithStyle:]):
        (-[WKDatePickerWheel initWithController:style:]):
        (-[WKDatePickerWheel gestureRecognized:]):
        (-[WKDatePickerWheel setDrawsFocusOutline:]):
        (-[WKDatePickerWheel drawsFocusOutline]):
        (-[WKDatePickerWheel gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKDatePickerViewController initWithDelegate:]):
        (-[WKDatePickerViewController viewDidLoad]):
        (-[WKDatePickerViewController prefersStatusBarHidden]):
        (-[WKDatePickerViewController viewWillAppear:]):
        (-[WKDatePickerViewController viewDidAppear:]):
        (-[WKDatePickerViewController viewDidDisappear:]):
        (-[WKDatePickerViewController _handleStatusBarNavigation]):
        (-[WKDatePickerViewController viewWillLayoutSubviews]):
        (-[WKDatePickerViewController becomeFirstResponder]):
        (-[WKDatePickerViewController defaultMinimumDate]):
        (-[WKDatePickerViewController defaultMaximumDate]):
        (-[WKDatePickerViewController _valueForInput]):
        (-[WKDatePickerViewController _dateFromInitialText]):
        (-[WKDatePickerViewController _setButtonPressed]):
        (-[WKDatePickerViewController _updateSelectedPickerViewIndices]):
        (-[WKDatePickerViewController _configurePickerView:]):
        (-[WKDatePickerViewController setMinimumDate:]):
        (-[WKDatePickerViewController minimumDate]):
        (-[WKDatePickerViewController setMaximumDate:]):
        (-[WKDatePickerViewController maximumDate]):
        (-[WKDatePickerViewController setDate:]):
        (-[WKDatePickerViewController setDateFromComponents:]):
        (-[WKDatePickerViewController setDay:month:year:era:]):
        (-[WKDatePickerViewController date]):
        (-[WKDatePickerViewController _dateComponentForDay:month:year:era:]):
        (-[WKDatePickerViewController _adjustDateToValidDateIfNecessary]):
        (-[WKDatePickerViewController _createAndConfigureGranularityLabelWithText:]):
        (-[WKDatePickerViewController _canonicalizeAndUpdateSelectedDate]):
        (-[WKDatePickerViewController numberOfItemsInPickerView:]):
        (-[WKDatePickerViewController pickerView:viewForItemAtIndex:]):
        (-[WKDatePickerViewController didBeginInteractingWithDatePicker:]):
        (-[WKDatePickerViewController pickerView:didSelectItemAtIndex:]):
        (-[WKDatePickerViewController pickerViewWillBeginSelection:]):
        (-[WKDatePickerViewController pickerViewDidEndSelection:]):
        (-[WKDatePickerViewController _dayFromIndex:]):
        (-[WKDatePickerViewController _eraAndYearFromIndex:]):
        (-[WKDatePickerViewController _monthFromIndex:]):
        (-[WKDatePickerViewController _indexFromDay:]):
        (-[WKDatePickerViewController _indexFromYear:era:]):
        (-[WKDatePickerViewController _indexFromMonth:]):
        * UIProcess/ios/forms/WKFormControlListViewController.h: Removed.
        * UIProcess/ios/forms/WKFormControlListViewController.mm: Removed.
        * UIProcess/ios/forms/WKNumberPadViewController.h:
        * UIProcess/ios/forms/WKNumberPadViewController.mm:
        (inputLabelFontSize):
        (-[WKNumberPadViewController initWithDelegate:initialText:inputMode:]):
        (-[WKNumberPadViewController dealloc]):
        (-[WKNumberPadViewController viewDidLoad]):
        (-[WKNumberPadViewController viewWillDisappear:]):
        (-[WKNumberPadViewController viewWillLayoutSubviews]):
        (-[WKNumberPadViewController _reloadHeaderViewFromInputText]):
        (-[WKNumberPadViewController didSelectKey:]):
        (-[WKNumberPadViewController _handleKeyPress:]):
        (-[WKNumberPadViewController _cancelInput]):
        (-[WKNumberPadViewController _deleteLastInputCharacter]):
        (-[WKNumberPadViewController _deleteButtonPressed]):
        (-[WKNumberPadViewController _cancelDeletionTimers]):
        (-[WKNumberPadViewController _startDeletionTimer]):
        (-[WKNumberPadViewController _deletionTimerFired]):
        (-[WKNumberPadViewController addContentViewAnimations:]):
        * UIProcess/ios/forms/WKQuickboardListViewController.h: Added.
        * UIProcess/ios/forms/WKQuickboardListViewController.mm: Added.
        (-[WKQuickboardListItemCell topToLabelBaselineSpecValue]):
        (-[WKQuickboardListItemCell baselineToBottomSpecValue]):
        (-[WKQuickboardListViewController initWithDelegate:]):
        (-[WKQuickboardListViewController updateContextViewIfNeeded]):
        (-[WKQuickboardListViewController prefersStatusBarHidden]):
        (-[WKQuickboardListViewController viewDidLoad]):
        (-[WKQuickboardListViewController viewWillAppear:]):
        (-[WKQuickboardListViewController viewDidDisappear:]):
        (-[WKQuickboardListViewController _handleStatusBarNavigation]):
        (-[WKQuickboardListViewController reloadContextView]):
        (-[WKQuickboardListViewController actionController]):
        (-[WKQuickboardListViewController languageControllerDidChangePrimaryLanguage:]):
        (-[WKQuickboardListViewController headerContentViewHeight]):
        (-[WKQuickboardListViewController headerContentView]):
        (configureStatusBarForController):
        * UIProcess/ios/forms/WKSelectMenuListViewController.h:
        * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
        (-[WKSelectMenuItemCell initWithStyle:reuseIdentifier:]):
        (-[WKSelectMenuItemCell imageView]):
        (-[WKSelectMenuListViewController initWithDelegate:]):
        (-[WKSelectMenuListViewController viewDidLoad]):
        (-[WKSelectMenuListViewController acceptButtonTappedWithCompletion:]):
        (-[WKSelectMenuListViewController shouldShowTrayView]):
        (-[WKSelectMenuListViewController didSelectListItem:]):
        (-[WKSelectMenuListViewController numberOfListItems]):
        (-[WKSelectMenuListViewController heightForListItem:width:]):
        (-[WKSelectMenuListViewController cellForListItem:]):
        (-[WKSelectMenuListViewController selectItemAtIndex:]):
        * UIProcess/ios/forms/WKTimePickerViewController.h:
        * UIProcess/ios/forms/WKTimePickerViewController.mm:
        (-[WKTimePickerViewController initWithDelegate:]):
        (-[WKTimePickerViewController dateFormatter]):
        (-[WKTimePickerViewController timeValueForFormControls]):
        (-[WKTimePickerViewController dateComponentsFromInitialValue]):
        (-[WKTimePickerViewController viewDidAppear:]):
        (-[WKTimePickerViewController viewDidLoad]):
        (-[WKTimePickerViewController becomeFirstResponder]):
        (-[WKTimePickerViewController setHour:minute:]):
        (-[WKTimePickerViewController leftButtonWOTAction]):
        (-[WKTimePickerViewController rightButtonWOTAction]):
        * WebKit.xcodeproj/project.pbxproj:

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

        Make Modern EME An Experimental Feature Again
        https://bugs.webkit.org/show_bug.cgi?id=186569
        <rdar://problem/41054402>

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2018-06-12  Andy Estes  <aestes@apple.com>

        [watchOS] Enable NetworkActivityTracker
        https://bugs.webkit.org/show_bug.cgi?id=186568
        <rdar://problem/41050624>

        Reviewed by Tim Horton.

        * NetworkProcess/NetworkActivityTracker.h:

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

        Add performance logging for slow cache retrieves
        https://bugs.webkit.org/show_bug.cgi?id=186520
        <rdar://problem/41002070>

        Reviewed by Chris Dumez.

        We sometimes see slow cache retrieves in logs. Add some more logging to better analyze these cases.

        This patch adds timings to all cache storage retrieve operations and passes them up to the client.
        We then log the timings on NetworkResourceLoader levels if needed. Items logged include

        - total retrieve time
        - dispatch delay and number of resources dispatched before this one
        - record I/O time
        - blob I/O time
        - whether cache shrink was in progress
        - whether cache synchronization was in progress
        - cancellation

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::logSlowCacheRetrieveIfNeeded):

        Log if the retrieve took more than 1s.

        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::readRecord):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::retrieve):
        (WebKit::NetworkCache::Cache::completeRetrieve):
        (WebKit::NetworkCache::Cache::retrieveData):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
        (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):

        SpeculativeLoadManager does not records specific timings yet but at least we do log when they occur.

        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::ReadOperation::cancel):
        (WebKit::NetworkCache::Storage::ReadOperation::finish):

        Record timing info in ReadOperations.

        (WebKit::NetworkCache::Storage::dispatchReadOperation):
        (WebKit::NetworkCache::retrieveFromMemory):
        (WebKit::NetworkCache::Storage::retrieve):
        * NetworkProcess/cache/NetworkCacheStorage.h:

2018-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.4 release.

        * gtk/NEWS: Add release notes for 2.21.4.

2018-06-11  Youenn Fablet  <youenn@apple.com>

        Improve error messages in case FetchEvent.respondWith has a rejected promise
        https://bugs.webkit.org/show_bug.cgi?id=186368

        Reviewed by Chris Dumez.

        Log in JS console in case of failures.
        Rely on ThreadableLoader to log which client actually failed.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didFail):

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

        http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=186546

        Reviewed by Brady Eidson.

        Disable process swap on navigation in frames that have opened other frames via
        window.open(). These new windows may have a WindowProxy to their opener, and it
        would therefore be unsafe to process swap at this point.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const):
        (WebKit::NavigationActionData::decode):
        * Shared/NavigationActionData.h:
        * UIProcess/API/APINavigation.h:
        (API::Navigation::setHasOpenedFrames):
        (API::Navigation::hasOpenedFrames const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-06-11  Keith Rollin  <krollin@apple.com>

        Add logging around internalError(const URL&)
        https://bugs.webkit.org/show_bug.cgi?id=186369
        <rdar://problem/40872046>

        Reviewed by Brent Fulgham.

        There are times when we receive bug reports where the user says that
        they are simply shown a page saying an internal error occurred. To
        help understand the circumstances of that error, add some logging to
        internalError() in WebErrors.cpp. This logging logs at the Error level
        that internalError() was called and then logs a backtrace.

        * Shared/WebErrors.cpp:
        (WebKit::internalError):

2018-06-11  Tim Horton  <timothy_horton@apple.com>

        Link drag image is inconsistently unreadable in dark mode
        https://bugs.webkit.org/show_bug.cgi?id=186472

        Reviewed by Timothy Hatcher.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::useDefaultAppearance):
        Make defaultAppearance accurate even if useSystemAppearance is false.
        Some parts of WebKit (like the link drag image, but also context menus)
        want to be able to follow the system appearance regardless of whether
        the view or content has opted in.

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

        http/tests/security/cors-post-redirect-307.html fails with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=186441

        Reviewed by Brady Eidson.

        Rename existing flag to something a bit more generic, now that it is used for
        more things than bypassing the navigation policy check.

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcessForReload):
        (WebKit::WebPageProxy::reattachToWebProcessWithItem):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigation):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):
        (WebKit::WebPage::goToBackForwardItem):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-06-11  Nan Wang  <n_wang@apple.com>

        AX: [iOS] accessibility sometimes doesn't know process suspension is canceled
        https://bugs.webkit.org/show_bug.cgi?id=186450

        Reviewed by Chris Fleizach.

        There's some early return condition in WebProcess::cancelPrepareToSuspend() which
        could lead to accessibility failing to post process status notificaiton. Fixed it
        by moving the accessibility notification before the early return condition.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::cancelPrepareToSuspend):

2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
        https://bugs.webkit.org/show_bug.cgi?id=186192

        Reviewed by Michael Catanzaro.

        Add webkit_web_view_run_javascript_in_world() that receives a world name. Also add
        webkit_script_world_new_with_name() to create an isolated world with a name and webkit_script_world_get_name()
        to get the name of a WebKitScriptWorld.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_run_javascript):
        (webkit_web_view_run_javascript_finish):
        (webkit_web_view_run_javascript_in_world):
        (webkit_web_view_run_javascript_in_world_finish):
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): Send RunJavaScriptInMainFrameScriptWorld message to
        the WebProcess.
        * UIProcess/WebPageProxy.h:
        * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
        (webkitScriptWorldCreate):
        (webkit_script_world_new_with_name):
        (webkit_script_world_get_name):
        * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h:
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        (WebKit::InjectedBundleScriptWorld::find): Find an InjectedBundleScriptWorld by its name.
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): Find the InjectedBundleScriptWorld for the given name
        and run the script in its js context.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add RunJavaScriptInMainFrameScriptWorld message.

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

        Reload the Web view in case of crash if the client does not implement webViewWebContentProcessDidTerminate delegate
        https://bugs.webkit.org/show_bug.cgi?id=186468

        Reviewed by Geoffrey Garen.

        We now attempt to reload the Web view if the web content process crashes and the client
        does not implement the webViewWebContentProcessDidTerminate delegate (or any of the similar
        delegates in our SPI).

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::processDidCrash):
        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::processDidTerminate):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/glib/WebKitNavigationClient.cpp:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::processDidTerminate):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_resetRecentCrashCountTimer):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::shouldReloadAfterProcessTermination):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):
        (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
        (WebKit::WebPageProxy::resetRecentCrashCountSoon):
        (WebKit::WebPageProxy::resetRecentCrashCount):
        (WebKit::m_configurationPreferenceValues): Deleted.
        * UIProcess/WebPageProxy.h:

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

        [Xcode] Clean up and modernize some build setting definitions
        https://bugs.webkit.org/show_bug.cgi?id=186463

        Reviewed by Sam Weinig.

        * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
        * Configurations/BaseTarget.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
          now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
        * Configurations/DebugRelease.xcconfig: Removed definition for macOS 10.11.
        * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
          ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
        * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
        * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.

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

        Added missing file references to the Configuration group.

        * WebKit.xcodeproj/project.pbxproj:

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

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
        (-[WKContentView quickboard:textEntered:]):
        (-[WKContentView quickboardInputCancelled:]):
        (-[WKContentView viewController:inputContextViewHeightForSize:]):
        (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
        (-[WKContentView inputContextViewForViewController:]):
        (-[WKContentView inputLabelTextForViewController:]):
        (-[WKContentView initialValueForViewController:]):
        (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
        (-[WKContentView numericInputModeForListViewController:]):
        (-[WKContentView textContentTypeForListViewController:]):
        (-[WKContentView textSuggestionsForListViewController:]):
        (-[WKContentView listViewController:didSelectTextSuggestion:]):
        (-[WKContentView allowsDictationInputForListViewController:]):
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):
        (-[WKScrollView addGestureRecognizer:]):
        (-[WKScrollView _configureDigitalCrownScrolling]):
        (-[WKScrollView _puic_contentOffsetForCrownInputSequencerOffset:]):
        * UIProcess/ios/forms/WKFocusedFormControlView.h:
        * UIProcess/ios/forms/WKFocusedFormControlView.mm:
        (pathWithRoundedRectInFrame):
        (-[WKFocusedFormControlView initWithFrame:delegate:]):
        (-[WKFocusedFormControlView handleWheelEvent:]):
        (-[WKFocusedFormControlView show:]):
        (-[WKFocusedFormControlView hide:]):
        (-[WKFocusedFormControlView delegate]):
        (-[WKFocusedFormControlView setDelegate:]):
        (-[WKFocusedFormControlView dimmingMaskLayer]):
        (-[WKFocusedFormControlView handleTap]):
        (-[WKFocusedFormControlView _wheelChangedWithEvent:]):
        (-[WKFocusedFormControlView didDismiss]):
        (-[WKFocusedFormControlView didSubmit]):
        (-[WKFocusedFormControlView layoutSubviews]):
        (-[WKFocusedFormControlView setHighlightedFrame:]):
        (-[WKFocusedFormControlView computeDimmingViewCutoutPath]):
        (-[WKFocusedFormControlView disengageFocusedFormControlNavigation]):
        (-[WKFocusedFormControlView engageFocusedFormControlNavigation]):
        (-[WKFocusedFormControlView reloadData:]):
        (-[WKFocusedFormControlView setMaskLayerPosition:animated:]):
        (-[WKFocusedFormControlView setHighlightedFrame:animated:]):
        (-[WKFocusedFormControlView submitActionName]):
        (submitActionNameFontAttributes):
        (-[WKFocusedFormControlView setSubmitActionName:]):
        (-[WKFocusedFormControlView scrollViewForCrownInputSequencer]):
        (-[WKFocusedFormControlView updateViewForCurrentCrownInputSequencerState]):
        (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):
        (-[WKFocusedFormControlView _crownInputSequencerTimerFired]):
        (-[WKFocusedFormControlView cancelPendingCrownInputSequencerUpdate]):
        (-[WKFocusedFormControlView scheduleCrownInputSequencerUpdate]):
        (-[WKFocusedFormControlView crownInputSequencerOffsetDidChange:]):
        (-[WKFocusedFormControlView crownInputSequencerDidBecomeIdle:willDecelerate:]):
        (-[WKFocusedFormControlView crownInputSequencerIdleDidChange:]):
        (-[WKFocusedFormControlView suggestions]):
        (-[WKFocusedFormControlView setSuggestions:]):
        (-[WKFocusedFormControlView handleWebViewCredentialsSaveForWebsiteURL:user:password:passwordIsAutoGenerated:]):
        (-[WKFocusedFormControlView selectionWillChange:]):
        (-[WKFocusedFormControlView selectionDidChange:]):
        (-[WKFocusedFormControlView textWillChange:]):
        (-[WKFocusedFormControlView textDidChange:]):

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

        Only display refresh monitors having requested display refresh callback should get notified on screen updates.
        https://bugs.webkit.org/show_bug.cgi?id=186397
        <rdar://problem/40897835>

        Reviewed by Brent Fulgham.

        Since all display refresh monitors in the WebContent process share a single UI process display link,
        we should make sure that only the monitors having requested callback are getting notified on screen
        updates. I have not been able to reproduce a case where a monitor is being notified without having
        requested updates, but we should safeguard the code for future code changes.

        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:

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

        [Datalist] Allow TextFieldInputType to show and hide suggestions
        https://bugs.webkit.org/show_bug.cgi?id=186151

        Reviewed by Tim Horton.

        Added WebDataListSuggestionPicker to send messages to the UIProcess in order to update the suggestions view.
        This object is also responsible for forwarding messages from WebKit into the DataListSuggestionsClient, which
        is the TextFieldInputType in this case. The client needs to know when the suggestions are hidden or if an
        suggestion has been selected.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createDataListSuggestionPicker): Responsible for creating WebDataListSuggestionPicker to send/receive messages.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp: Added. Responsible for sending messages to UIProcess and updating the DataListSuggestionsClient.
        (WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker):
        (WebKit::WebDataListSuggestionPicker::~WebDataListSuggestionPicker):
        (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
        (WebKit::WebDataListSuggestionPicker::didSelectOption):
        (WebKit::WebDataListSuggestionPicker::didCloseSuggestions):
        (WebKit::WebDataListSuggestionPicker::close):
        (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
        * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setActiveDataListSuggestionPicker):
        (WebKit::WebPage::didSelectDataListOption): Called by UIProcess when option selected.
        (WebKit::WebPage::didCloseSuggestions): Called by UIProcess if the suggestions view is closed.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        [Win] Fix initial value of HANDLE to INVALID_HANDLE_VALUE
        https://bugs.webkit.org/show_bug.cgi?id=186405

        The handle was not initialized at all. Initialized with INVALID_HANDLE_VALUE.

        Reviewed by Per Arne Vollan.

        * Platform/IPC/Attachment.h:
        * Platform/IPC/win/AttachmentWin.cpp:
        (IPC::Attachment::decode):

2018-06-08  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: include browser name and version in listing for automation targets
        https://bugs.webkit.org/show_bug.cgi?id=186204
        <rdar://problem/36950423>

        Reviewed by Darin Adler.

        Add a new delegate method that allows the client to set the name and version
        of the browser as returned in the 'browserName' and 'browserVersion' capabilities.
        If the delegate methods are not implemented, try to get this information from
        the main bundle.

        In the RWI protocol, these fields are added to automation target listings.

        * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
        * UIProcess/Cocoa/AutomationClient.h:
        * UIProcess/Cocoa/AutomationClient.mm:
        (WebKit::AutomationClient::AutomationClient):
        (WebKit::AutomationClient::browserName const):
        (WebKit::AutomationClient::browserVersion const):

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

        Run display links in the UI process when ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) is true.
        https://bugs.webkit.org/show_bug.cgi?id=186379

        Reviewed by Brent Fulgham.

        Replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/DisplayLink.cpp:
        * UIProcess/mac/DisplayLink.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        * WebProcess/WebPage/DrawingArea.cpp:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp:

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

        Send display link IPC message from display link thread.
        https://bugs.webkit.org/show_bug.cgi?id=186429

        Reviewed by Geoffrey Garen.

        When the display link callback is firing on the display link thread in the UI process,
        we schedule a function to be called on the main thread to send the IPC message to the
        WebContent process. Since Connection::send is thread-safe, we can just send the message
        from the display link thread, instead. This should be a small performance improvement.

        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::DisplayLink):
        (WebKit::DisplayLink::displayLinkCallback):
        * UIProcess/mac/DisplayLink.h:

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

        Add base class to get WeakPtrFactory member and avoid some boilerplate code
        https://bugs.webkit.org/show_bug.cgi?id=186407

        Reviewed by Brent Fulgham.

        Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
        order to avoid some boilerplate code in every class needing a WeakPtrFactory.
        This also gets rid of old-style createWeakPtr() methods in favor of the newer
        makeWeakPtr().

        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cache/CacheStorageEngine.h:
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::Attachment):
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
        * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateWindowAndViewFrames):
        (WebKit::WebViewImpl::setTopContentInset):
        (WebKit::WebViewImpl::viewDidMoveToWindow):
        (WebKit::WebViewImpl::prepareForMoveToWindow):
        (WebKit::WebViewImpl::validateUserInterfaceItem):
        (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
        (WebKit::WebViewImpl::interpretKeyEvent):
        (WebKit::WebViewImpl::firstRectForCharacterRange):
        (WebKit::WebViewImpl::performKeyEquivalent):
        (WebKit::WebViewImpl::keyUp):
        (WebKit::WebViewImpl::keyDown):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::setOriginatingPage):
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/ProcessAssertion.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::Surface::attachBuffer):
        * UIProcess/gtk/WaylandCompositor.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::displayLinkCallback):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:

2018-06-07  Dan Bernstein  <mitz@apple.com>

        Don’t install process-webcontent-entitlements.sh into the built XPC services.

        * WebKit.xcodeproj/project.pbxproj:

2018-06-07  Andy Estes  <aestes@apple.com>

        [iOS] Inform the client when PDFKit's extension process crashes
        https://bugs.webkit.org/show_bug.cgi?id=186418
        <rdar://problem/40175864>

        Reviewed by Tim Horton.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):

        Separated the dispatching of delegate methods from the rest of the web
        process-specific processDidTerminate logic.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):

        Minor style fix.

        (-[WKPDFView pdfHostViewControllerExtensionProcessDidCrash:]):

        Called WebPageProxy::dispatchProcessDidTerminate on the main thread.

2018-06-07  Andy Estes  <aestes@apple.com>

        [iOS] Unable to present the share sheet after saving a PDF to Files.app
        https://bugs.webkit.org/show_bug.cgi?id=186413
        <rdar://problem/39937488>

        Reviewed by Tim Horton.

        WKApplicationStateTrackingView (WKPDFView's superclass) keeps track of whether
        it's in a window so that it can suspend and resume the web process accordingly.
        However, in WKPDFView's case, PDFKit's host view is in the window instead of
        WKPDFView itself when a PDF is being displayed (WKPDFView is only in a window as a
        placeholder while the PDF loads). Since WKApplicationStateTrackingView doesn't
        think its in a window, it suspends the web process, preventing messages necessary
        to displaying the share sheet from being delivered.

        Fix this by teaching WKApplicationStateTrackingView to consider the in-windowness
        of the proper content view. For all cases other than WKPDFView, this is |self|.
        For WKPDFView, it is the PDFHostViewController's root view if it exists, otherwise
        it's |self|.

        * UIProcess/ios/WKApplicationStateTrackingView.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView willMoveToWindow:]):
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _contentView]):
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _contentView]):
        (-[WKPDFView web_contentView]):

2018-06-07  Dean Jackson  <dino@apple.com>

        Match HI spec for thumbnail view sizing and location
        https://bugs.webkit.org/show_bug.cgi?id=186412
        <rdar://problem/40226192>

        Reviewed by Tim Horton.

        Use the computed obscured inset to position the QuickLook
        view inside the WKSystemPreviewView.

        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):
        (-[WKSystemPreviewView _layoutThumbnailView]):

2018-06-07  Tadeu Zagallo  <tzagallo@apple.com>

        Don't try to allocate JIT memory if we don't have the JIT entitlement
        https://bugs.webkit.org/show_bug.cgi?id=182605
        <rdar://problem/38271229>

        Reviewed by Mark Lam.

        Remove processHasEntitlement, which was moved into WTF and update all call sites.

        * Shared/mac/SandboxUtilities.h:
        * Shared/mac/SandboxUtilities.mm:
        (WebKit::processHasEntitlement): Deleted.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::applicationType):
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (applicationHasAppLinkEntitlements):

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

        REGRESSION (r232544): Pages are blank after homing out and then resuming on iPad
        https://bugs.webkit.org/show_bug.cgi?id=186408
        <rdar://problem/40907111>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
        Clients who use _resizeWhileHidingContentWithUpdates don't call
        _endAnimatedResize; the former API is a one-shot. We can't wait for
        _endAnimatedResize to complete the animation (and don't need to, since
        the content is hidden), but instead should just finish it when the
        commit with the resized tiles arrives.

2018-06-07  Jiewen Tan  <jiewen_tan@apple.com>

        Use the same overloaded addInputString in WKContentViewInteraction
        https://bugs.webkit.org/show_bug.cgi?id=186376
        <rdar://problem/18498360>

        Reviewed by Brent Fulgham.

        Different overloaded variants of [UIKeyboardImpl -addInputString] behaves differently. We should use the same
        overloaded variant consistently: [UIKeyboardImpl -addInputString:withFlags:withInputManagerHint:].

        Sadly, there is no test case for this change as:
        1) UIScriptController has troubles simulating '\r' keyboard event, and
        2) API test couldn't simulate proper UI keyboard events.

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

2018-06-07  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r224134) Client certificate challenges don't always appear
        https://bugs.webkit.org/show_bug.cgi?id=186402
        <rdar://problem/35967150>

        Reviewed by Brian Weinstein.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::completeAuthenticationChallenge):
        Add an exception for all TLS-handshake-related challenges, not just server trust.

2018-06-07  Ryosuke Niwa  <rniwa@webkit.org>

        Release assert in Document::updateLayout() in WebPage::determinePrimarySnapshottedPlugIn()
        https://bugs.webkit.org/show_bug.cgi?id=186383
        <rdar://problem/40849498>

        Reviewed by Jon Lee.

        The release assert was hit because the descendent elemenet iterator, which instantiates ScriptDisallowedScope,
        was alive as determinePrimarySnapshottedPlugIn invoked Document::updateLayout. Avoid this by copying
        the list of plugin image elements into a vector first.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Fixed the release assert, and deployed Ref and RefPtr
        to make this code safe.

2018-06-07  Don Olmstead  <don.olmstead@sony.com>

        [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
        https://bugs.webkit.org/show_bug.cgi?id=186374

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::sceneUpdateFinished):

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

        Remove unused debug mode conditions
        https://bugs.webkit.org/show_bug.cgi?id=186358
        <rdar://problem/39117121>

        Reviewed by Zalan Bujtas.

        Remove some unused code paths related to ResourceLoadStatistics debug mode.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):

2018-06-07  Dan Bernstein  <mitz@apple.com>

        REGRESSION (r232520): Crash under IPC::ArgumentCoder<WebCore::Credential>::encodePlatformData
        https://bugs.webkit.org/show_bug.cgi?id=186385
        <rdar://problem/40853796>

        Reviewed by Daniel Bates.

        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<Credential>::encodePlatformData): Fixed an incorrect cast.

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

        Crash in lambda function WTF::Function<void ()>::CallableWrapper<WebKit::DisplayLink::displayLinkCallback
        https://bugs.webkit.org/show_bug.cgi?id=186370
        <rdar://problem/39791647>

        Reviewed by Brent Fulgham.

        When the display link is firing, the callback function is called on the display link thread, where a lambda function
        is created to be executed on the main thread. The WebPageProxy object is captured as a RefPtr in the lambda. This
        might crash when executing on the main thread, since the WebPageProxy object is possibly deleted then. Capturing
        the WebPageProxy will not prevent the object from being deleted if the destruction of the WebPageProxy object already
        has started on the main thread when the object is captured, which sometimes is the case. Instead, we can create a
        weak pointer to the object, which will work as intended, even if the WebPageProxy object is in the process of being
        deleted. This also matches the display link implementation used when the WebContent process has access to the
        WindowServer. This is not a frequent crash. I have not been able to reproduce it.
 
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::displayLinkCallback):

2018-06-06  Antoine Quint  <graouts@apple.com>

        Rename color-filter to -apple-color-filter and do not expose it to Web content
        https://bugs.webkit.org/show_bug.cgi?id=186306
        <rdar://problem/39874167>

        Reviewed by Simon Fraser.

        Change the ColorFilter setting to no longer be exposed as an experimental feature and ensure it's turned off by default.
        To allow internal clients to use the -apple-color-filter property, we expose a new _colorFilterEnabled property as SPI
        to WKWebViewConfigurationPrivate.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetColorFilterEnabled):
        (WKPreferencesGetColorFilterEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
        (-[WKWebViewConfiguration _colorFilterEnabled]):
        (-[WKWebViewConfiguration _setColorFilterEnabled:]):
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

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

        REGRESSION (r232301) - Unable to enter video fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=186357
        <rdar://problem/40838449>

        Reviewed by Jon Lee.

        Only set up the standby fullscreen element if we are in element fullscreen.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::videoControlsManagerDidChange):

2018-06-06  Jeremy Jones  <jeremyj@apple.com>

        attenuationFactor should be in range [0,1]
        https://bugs.webkit.org/show_bug.cgi?id=186320
        rdar://problem/40821456

        Reviewed by Jer Noble.

        If attenuationFactor is outside of this range it can cause false positives.

        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp:
        (WebKit::FullscreenTouchSecheuristic::attenuationFactor):

2018-06-06  Tim Horton  <timothy_horton@apple.com>

        Move animated resize into the layer tree transaction, and make it asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=186130
        <rdar://problem/38477288>

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        (WebKit::RemoteLayerTreeTransaction::setScrollPosition):
        (WebKit::RemoteLayerTreeTransaction::dynamicViewportSizeUpdateID const):
        (WebKit::RemoteLayerTreeTransaction::setDynamicViewportSizeUpdateID):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::encode const):
        (WebKit::RemoteLayerTreeTransaction::decode):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::willCommitLayerTree):
        Add scrollPosition to the transaction on all platforms, not just Mac.
        Add the optional dynamicViewportSizeUpdateID to the transaction, representing
        the most recent dynamicViewportSizeUpdate that commit contains, if any.

        * Shared/ios/DynamicViewportSizeUpdate.h:
        Added a typedef for DynamicViewportSizeUpdateID, and move the mode enum here.

        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): Deleted.
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::didCommitLayerTree):
        (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): Deleted.
        (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::synchronizeDynamicViewportUpdate): Deleted.
        Remove dynamicViewportUpdateChangedTarget and synchronizeDynamicViewportUpdate.
        Move dynamicViewportSizeUpdateID maintenance into WKWebView.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        Remove _resizeAnimationTransformTransactionID. We now instead pack
        the resize ID inside the transaction, instead of separately sending
        back a transaction ID to wait for.

        (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]):
        (-[WKWebView _didCommitLayerTree:]):
        Added, factored out of _didCommitLayerTree:.
        If the transaction includes the result of the most recently-sent resize,
        store the requisite adjustments required to counter the new scale and
        scroll offset, update the resizeAnimationView, and, if endAnimatedResize
        has already been called, call _didCompleteAnimatedResize to tear down
        the animation view and put things back together.

        Add some code so that if a commit arrives before the resize, we update
        the scale of the resize animation view to keep the width fitting.

        (activeMaximumUnobscuredSize):
        (activeOrientation):
        Move these because the code that depends on them moved.

        (-[WKWebView _didCompleteAnimatedResize]):
        Broken out of _endAnimatedResize. This can now be called from
        either endAnimatedResize or _didCommitLayerTreeDuringAnimatedResize,
        depending on which is called first.

        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        Don't create a new resize view if we still have one. Otherwise, we'll
        get the view ordering all wrong when making the second one. This
        didn't previously cause trouble, because we don't have a lot of
        WKScrollView subviews, but it totally could.

        Adopt _initialContentOffsetForScrollView just to make this code more clear.

        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:


2018-06-05  Per Arne Vollan  <pvollan@apple.com>

        Move OpenGL display mask to screen data struct.
        https://bugs.webkit.org/show_bug.cgi?id=186198
        <rdar://problem/40724854>

        Reviewed by Brent Fulgham.

        Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
        it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
        resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
        display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
        the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
        window is available, the OpenGL display mask of the main display is used.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::windowScreenDidChange):
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::screenPropertiesStateChanged):
        (WebKit::displayReconfigurationCallBack):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::openGLDisplayMaskChanged): Deleted.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2018-06-05  Keith Rollin  <krollin@apple.com>

        Remove tracksResourceLoadMilestones support
        https://bugs.webkit.org/show_bug.cgi?id=186329
        <rdar://problem/40829898>

        Reviewed by Darin Adler.

        Remove the mechanism for enabling/disabling the tracking of
        resource-load milestones. This was initially added in order to enable
        the tracking only for Safari. However, the decision has been made to
        enable the tracking for all WebKit clients, so it's now enabled
        unconditionally.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
        (WebKit::networkActivityTrackingEnabled): Deleted.
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::tracksResourceLoadMilestones const): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationTracksResourceLoadMilestones): Deleted.
        (WKContextConfigurationSetTracksResourceLoadMilestones): Deleted.
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]): Deleted.
        (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-06-05  Darin Adler  <darin@apple.com>

        [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=186324

        Reviewed by Anders Carlsson.

        * NetworkProcess/cache/NetworkCacheData.h: Use OSObjectPtr instead of
        DispatchPtr and also use an rvalue reference in the constructor.
        * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
        (WebKit::NetworkCache::Data::Data): Use adoptOSObject, rvalue reference
        and WTFMove.
        (WebKit::NetworkCache::Data::empty): Use OSObjectPtr.
        (WebKit::NetworkCache::Data::data const): Use adoptOSObject.
        (WebKit::NetworkCache::Data::subrange const): Ditto.
        (WebKit::NetworkCache::concatenate): Ditto.
        (WebKit::NetworkCache::Data::adoptMap): Ditto. Also use WTFMove.

        * NetworkProcess/cache/NetworkCacheIOChannel.h: Use OSObjectPtr.
        * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
        (WebKit::NetworkCache::IOChannel::IOChannel): Use adoptOSObject.
        (WebKit::NetworkCache::IOChannel::read): Use OSObjectPtr.

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

        Adjust compile and runtime flags to match shippable state of features
        https://bugs.webkit.org/show_bug.cgi?id=186319
        <rdar://problem/40352045>

        Reviewed by Maciej Stachowiak, Jon Lee, and others.

        Change the default state of various experimental features so that they are off by default in production
        builds, since they are still under development.

        Turn 'CacheAPIEnabled' and 'SubresourceIntegrityEnabled' on by default, since both features have been
        shipping for a full cycle and have proven to be stable in production.

        * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
        or ENABLE_INPUT_TYPE_COLOR_POPOVER.
        * Shared/WebPreferences.yaml: 
2018-06-05  Timothy Hatcher  <timothy@apple.com>

        Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query

        https://bugs.webkit.org/show_bug.cgi?id=186323
        rdar://problem/38382252

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _defaultAppearance]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _defaultAppearance]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::useDefaultAppearance):

2018-06-05  Sihui Liu  <sihui_liu@apple.com>

        [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies aren't flushed to file
        https://bugs.webkit.org/show_bug.cgi?id=186303
        <rdar://problem/40468716>

        Reviewed by Geoffrey Garen.

        No matter there is an observer or not, cookies in UI process should always be flushed to 
        file when new process pool is created, such that cookies created via API can be synced to
        network process.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::HTTPCookieStore):
        (API::HTTPCookieStore::registerObserver):
        (API::HTTPCookieStore::cookieManagerDestroyed):
        (API::HTTPCookieStore::registerForNewProcessPoolNotifications):

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

        secheuristic should only use touch began and ended, not changed.
        https://bugs.webkit.org/show_bug.cgi?id=186318
        rdar://problem/39781486

        Reviewed by Jer Noble.

        Filter out change events so swiping gestures don't trigger the heuristic.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController _touchDetected:]):

2018-06-05  Darin Adler  <darin@apple.com>

        [Cocoa] More preparation for ARC, focusing on WebKit and smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=186314

        Reviewed by Anders Carlsson.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Use __bridge for cast.
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::overrideSystemProxies): Ditto.
        (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost): Ditto.
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::sendMessage): Ditto.
        (IPC::readFromMachPort): Ditto.

        * Platform/mac/StringUtilities.mm:
        (WebKit::formattedPhoneNumberString): Use __bridge for cast and
        CFBridgingRelease instead of an explicit autorelease.

        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
        (initializeMethods): Use auto instead of an explicit type so that we get
        the correct type for the result of protocol_copyProtocolList.

        * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
        (-[_WKRemoteObjectRegistry _sendInvocation:interface:]): Added a
        bridging cast to void* because that's needed to call _Block_signature
        under ARC and harmless outside ARC.

        * Shared/API/c/cf/WKStringCF.mm:
        (WKStringCreateWithCFString): Use __bridge for cast.
        * Shared/API/c/cf/WKURLCF.mm:
        (WKURLCreateWithCFURL): Ditto.
        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection): Ditto.
        * Shared/Cocoa/DataDetectionResult.mm:
        (WebKit::DataDetectionResult::encode const): Ditto.
        (WebKit::DataDetectionResult::decode): Ditto.
        * Shared/Cocoa/WKNSError.mm:
        (-[WKNSError _web_createTarget]): Ditto.
        * Shared/Cocoa/WKNSURLExtras.mm:
        (-[NSURL _web_originalDataAsWTFString]): Ditto.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
        (WebKit::XPCServiceInitializer): Removed balanced calls to both
        adoptOSObject and xpc_retain and instead rely on the assignment
        operator just added to OSObjectPtr.

        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceEventHandler): Use __bridge for cast.
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): Ditto.
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode): Ditto.
        * Shared/mac/ArgumentCodersMac.mm:
        (IPC::isSerializableValue): Ditto.
        (IPC::encode): Ditto.
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::encodeNSError): Ditto. Also use CFSTR("")" instead of @""
        when we need a CFString.
        (IPC::decodeNSError): Ditto.
        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
        (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
        (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
        (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
        * Shared/mac/WebHitTestResultData.mm:
        (WebKit::WebHitTestResultData::platformEncode const): Ditto.
        (WebKit::WebHitTestResultData::platformDecode): Ditto.
        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextIsPlugInUpdateAvailable): Ditto.
        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController certificateChain]): Ditto.
        (didStartProvisionalLoadForFrame): Ditto.
        (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
        (didFailProvisionalLoadWithErrorForFrame): Ditto.
        (didCommitLoadForFrame): Ditto.
        (didFinishLoadForFrame): Ditto.
        (didFailLoadWithErrorForFrame): Ditto.
        (canAuthenticateAgainstProtectionSpaceInFrame): Ditto.
        (didReceiveAuthenticationChallengeInFrame): Ditto.
        (didStartProgress): Ditto.
        (didChangeProgress): Ditto.
        (didFinishProgress): Ditto.
        (didChangeBackForwardList): Ditto.
        (processDidCrash): Ditto.
        (setUpPageLoaderClient): Ditto.
        (setUpPagePolicyClient): Ditto.
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
        (createWKArray): Ditto.
        (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
        (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
        * UIProcess/API/Cocoa/WKConnection.mm:
        (didReceiveMessage): Ditto.
        (didClose): Ditto.
        (setUpClient): Ditto.
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        (didCreateConnection): Ditto.
        (getInjectedBundleInitializationUserData): Ditto.
        (setUpInjectedBundleClient): Ditto.
        (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setProxyConfiguration:]): Ditto.
        (-[WKWebsiteDataStore _proxyConfiguration]): Ditto.
        * UIProcess/API/Cocoa/_WKThumbnailView.mm:
        (-[_WKThumbnailView _didTakeSnapshot:]): Ditto.

        * UIProcess/API/Cocoa/_WKUserContentFilter.mm: Added a missing include.

        * UIProcess/Authentication/mac/WebCredentialMac.mm:
        (WebKit::chain): Use __bridge for cast.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
        Use CFBridgingRelease instead of adoptNS.
        (WebKit::privateBrowsingSession): Use __bridge for cast.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::provideDataForPasteboard): Use __bridge for cast.
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::pluginPathsInDirectory): Ditto.
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::recursivelyMapIOSurfaceBackingStore): Ditto.
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::beginSwipeGesture): Ditto.
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController enterFullScreen:]): Ditto.
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
        (didCreatePage): Ditto.
        (willDestroyPage): Ditto.
        (setUpBundleClient): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (didStartProvisionalLoadForFrame): Ditto.
        (didReceiveServerRedirectForProvisionalLoadForFrame): Ditto.
        (didFinishLoadForFrame): Ditto.
        (globalObjectIsAvailableForFrame): Ditto.
        (didRemoveFrameFromHierarchy): Ditto.
        (didCommitLoadForFrame): Ditto.
        (didFinishDocumentLoadForFrame): Ditto.
        (didFailProvisionalLoadWithErrorForFrame): Ditto.
        (didFailLoadWithErrorForFrame): Ditto.
        (didSameDocumentNavigationForFrame): Ditto.
        (didLayoutForFrame): Ditto.
        (didReachLayoutMilestone): Ditto.
        (didFirstVisuallyNonEmptyLayoutForFrame): Ditto.
        (didHandleOnloadEventsForFrame): Ditto.
        (userAgentForURL): Ditto.
        (setUpPageLoaderClient): Ditto.
        (willSendRequestForFrame): Ditto.
        (didInitiateLoadForResource): Ditto.
        (didFinishLoadForResource): Ditto.
        (didFailLoadForResource): Ditto.
        (setUpResourceLoadClient): Ditto.
        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::initialize): Ditto.
        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        (WebKit::NetscapePlugin::popUpContextMenu): Ditto.

        * WebProcess/Plugins/PDF/PDFPlugin.h: Put functions that return NSData inside
        an #ifdef __OBJC__ and use __bridge for cast.

        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        (WebKit::WebDragClient::declareAndWriteDragImage): Use __bridge for cast.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::contents const): Added a bridging cast.
        (WebKit::PlatformCALayerRemoteCustom::setContents): Use __bridge for cast.
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::setTopOverhangImage): Ditto.
        (WebKit::WebPage::setBottomOverhangImage): Ditto.

2018-06-05  Youenn Fablet  <youenn@apple.com>

        ServiceWorker registration should store any script fetched through importScripts
        https://bugs.webkit.org/show_bug.cgi?id=182444
        <rdar://problem/37164835>

        Reviewed by Chris Dumez.

        Add C API to kill storage process.
        In case a Storage Process is closed or crashed, ensure that all its related service worker processes also exit.

        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextTerminateStorageProcess):
        * UIProcess/API/C/WKContextPrivate.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::webToStorageProcessConnectionClosed):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::setScriptResource):
        * WebProcess/Storage/WebSWContextManagerConnection.h:

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

        Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
        https://bugs.webkit.org/show_bug.cgi?id=186286
        <rdar://problem/40782992>

        Reviewed by Dan Bernstein.

        Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
        to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
        change this flag when preparing for a production release.

        * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine whether
        experimental features should be enabled, and use it to properly define the feature flag.
        * Shared/WebPreferencesDefaultValues.h:

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

        Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
        https://bugs.webkit.org/show_bug.cgi?id=186287
        <rdar://problem/40783352>

        Reviewed by Youenn Fablet.

        * Shared/WebPreferences.yaml:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::frameBecameRemote):

2018-06-04  Dan Bernstein  <mitz@apple.com>

        Restored code signing behavior when WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.

        * Configurations/DebugRelease.xcconfig: Use ad-hoc code signing when
          WK_USE_RESTRICTED_ENTITLEMENTS isn’t set.

2018-06-04  Dan Bernstein  <mitz@apple.com>

        Removed a reference to a file that was deleted in r231190.

        * WebKit.xcodeproj/project.pbxproj: Removed the reference to WebProcessShim.xcconfig.

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

        Update Fetch code to provide more useful exception messages
        https://bugs.webkit.org/show_bug.cgi?id=186156

        Reviewed by Youenn Fablet.

        Provide more useful error messages in our Loading / Fetch code.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::didFailFetch):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didFailFetch):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didFail):
        (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
        * WebProcess/Storage/ServiceWorkerClientFetch.h:
        * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
        (WebKit::WebServiceWorkerFetchTaskClient::didFail):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

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

        [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag
        https://bugs.webkit.org/show_bug.cgi?id=186279

        Reviewed by Tim Horton.

        Replaces uses of ENABLE(EXTRA_ZOOM_MODE) with PLATFORM(WATCHOS).

        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        * UIProcess/WebProcessProxy.cpp:
        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _willStartScrollingOrZooming]):
        (-[WKContentView _didEndScrollingOrZooming]):
        (-[WKContentView _startAssistingKeyboard]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView reloadContextViewForPresentedListViewController]):
        (-[WKContentView _wheelChangedWithEvent:]):
        (-[WKContentView _simulateTextEntered:]):
        (-[WKContentView selectFormAccessoryPickerRow:]):
        (-[WKContentView formInputLabel]):
        (-[WKContentView setTimePickerValueToHour:minute:]):
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):
        (-[WKScrollView addGestureRecognizer:]):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel platformSupportsPickerViewController]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformPrefersTextLegibilityBasedZoomScaling const):

2018-06-04  Jeremy Jones  <jeremyj@apple.com>

        Disable keyboard in fullscreen ios.
        https://bugs.webkit.org/show_bug.cgi?id=186058

        Reviewed by Jer Noble.

        Disallow keyboard in ios fullscreen. This will still allow select keys useful for playback.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::supportsFullScreen):

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

        NetworkCORSPreflightChecker should set the preflight request User-Agent header
        https://bugs.webkit.org/show_bug.cgi?id=186254
        <rdar://problem/40293504>

        Reviewed by Chris Dumez.

        Some servers misbehave if the User-Agent header is not set properly on preflight requests.
        Set it to the same value as the request triggering the preflight.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::startPreflight):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):

2018-06-03  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Resume assertions when NetworkProcess::cancelPrepareToSuspend is called
        https://bugs.webkit.org/show_bug.cgi?id=186247

        Reviewed by Tim Horton.

        Since we suspended assertions in prepareToSuspend, we need to resume them if
        cancelPrepareToSuspend is called.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::cancelPrepareToSuspend):

2018-06-03  Andy Estes  <aestes@apple.com>

        [iOS] Add a needed networking process entitlement
        https://bugs.webkit.org/show_bug.cgi?id=186246
        <rdar://problem/39578861>

        Reviewed by Brent Fulgham.

        Also sorted the existing entitlements.

        * Configurations/Network-iOS.entitlements:

2018-06-03  Brent Fulgham  <bfulgham@apple.com>

        Make sure that the fencePort received over IPC has the expected disposition (SEND)
        https://bugs.webkit.org/show_bug.cgi?id=186211
        <rdar://problem/37814171>

        Reviewed by Geoffrey Garen.

        It is possible (though very unlikely) for a message to be recevied that has the wrong mach port disposition.
        If this happens, we shouldn't manipulate the passed mach_port_t or pass it on to other API. We already
        drop messages that violate this expectation in the IPC layer, but code handling IPC::Attachment data types
        are not checking this value.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setTopContentInsetFenced):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

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

        Unreviewed, rolling out r232275.

        May have caused a ~1% PLT regression on iOS

        Reverted changeset:

        "Store 0-lifetime stylesheets / scripts into the disk cache
        for faster history navigations"
        https://bugs.webkit.org/show_bug.cgi?id=186060
        https://trac.webkit.org/changeset/232275

2018-06-02  Jeremy Jones  <jeremyj@apple.com>

        Make WKWebView firstResponder after entering or exiting fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=186088
        rdar://problem/40387859

        Reviewed by Jer Noble.

        Update first responder when WKWebView moves to a new window, otherwise there won't be a first responder.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):

2018-06-02  Jeremy Jones  <jeremyj@apple.com>

        Exit fullscreen when javascript alerts are presented.
        https://bugs.webkit.org/show_bug.cgi?id=185619
        rdar://problem/35724264

        Reviewed by Jer Noble.

        Prevent users from being trapped in fullscreen by alert cycles.
        Prevent fullscreen from becoming unresponsive due to alerts hidden behind fullscreen.

        Fullscreen exit is initiated here in the UI process so that fullscreen UI is torn down immediately,
        before the alert is shown.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::exitFullscreenImmediately):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        * UIProcess/WebPageProxy.h:

2018-06-02  Youenn Fablet  <youenn@apple.com>

        Add a sandbox profile for com.cisco.webex.plugin.gpc64 plugin
        https://bugs.webkit.org/show_bug.cgi?id=186110

        Reviewed by Brent Fulgham.

        * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Webex needs to create some symlinks.
        * Resources/PlugInSandboxProfiles/com.cisco.webex.plugin.gpc64.sb: Added.
        * WebKit.xcodeproj/project.pbxproj:

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

        [Extra zoom mode] The user should always be able to double tap to zoom to a scale of at least 1
        https://bugs.webkit.org/show_bug.cgi?id=186209
        <rdar://problem/40529255>

        Reviewed by Tim Horton.

        Tweaks the way double-tap-to-zoom scales are determined in extra zoom mode. Rather than zooming to make the 50th
        and 90th percentiles of text in the document legible, only consider the 90th percentile of text size when
        determining zoom scale, and fix the other potential zoom scale at 1; additionally, if the zoom scales are close
        (within 0.3 of each other), snap the lower zoom scale to the higher value.

        This results in the following changes in behavior:
        -   Enables double tap to zoom in cases where all the text in the page is already legible.
        -   On pages with mobile viewports, usually allows the user to toggle between initial scale and a scale of 1.
        -   If a significant portion of text is unusually small, the zoomed-in scale may exceed 1.

        Test: fast/events/extrazoom/double-tap-to-zoom-with-large-text.html

        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
        (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):

2018-06-01  Jeremy Jones  <jeremyj@apple.com>

        Keyboard focus should exit fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=185617
        rdar://problem/34697938

        Reviewed by Ryosuke Niwa.

        While in element fullscreen, initiating keyboard focus should exit fullscreen in iOS.

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

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

        Regression(r230567): Unable to log into twitter.com in private sessions
        https://bugs.webkit.org/show_bug.cgi?id=186205
        <rdar://problem/40670799>

        Reviewed by Youenn Fablet.

        We were using the same SWServer for all private sessions and the SWServer's sessionID would
        be legacyPrivateSessionID(). As a result, the service worker's sessionID would be legacyPrivateSessionID()
        as well and would not match the sessionID of its client pages. This sessionID mismatch was 
        causing the breakage.

        Instead of using the same SWServer of all private sessions, we now go back to using a SWServer
        per private session. However, we now make sure that the SWServer gets destroyed whenever its
        corresponding session gets destroyed.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::destroySession):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::from):
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::destroySession):
        (WebKit::StorageProcess::swServerForSession):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):

        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::weakPtrFactory const):
        Fix memory leak caused by a reference cycle between the WebsiteDataStore and its
        WebResourceLoadStatisticsStore, by using WeakPtr to break the cycle. This was causing
        us to leak WebsiteDataStore objects, which would prevent the destruction of sessions.


2018-06-01  Youenn Fablet  <youenn@apple.com>

        Add an option to restrict communication to localhost sockets
        https://bugs.webkit.org/show_bug.cgi?id=186208

        Reviewed by Eric Carlson.

        Implement restriction to localhost sockets by setting any IP address to 127.0.0.1.
        This is done on WebProcess side just before requesting to open the socket by NetworkProcess.

        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::disableNonLocalhostConnections):
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::disableNonLocalhostConnections):
        (WebKit::LibWebRTCProvider::registerMDNSName):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::prepareSocketAddress):
        (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
        (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

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

        Regression(r230876): Swipe navigation snapshot may get removed too early
        https://bugs.webkit.org/show_bug.cgi?id=186168
        <rdar://problem/39743617>

        Reviewed by Tim Horton.

        The swipe navigation snapshot would get removed too early when receiving a paint
        event after requesting a history navigation but before the provisional load has
        actually started. This is because of the asynchronous navigation policy decision
        which occurs after requesting to navigate. To address the issue, we now start
        listening for events only after the provisional load has started.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didStartProvisionalLoadForMainFrame]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
        (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
        (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
        * UIProcess/Cocoa/ViewGestureController.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::endSwipeGesture):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::endSwipeGesture):

2018-06-01  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, build fix for r232276.

        iOS sandbox profiles don't preprocess macros. Therefore, remove the whole
        macro condition block.

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

2018-06-01  Sihui Liu  <sihui_liu@apple.com>

        Stop using StorageTracker.db in LocalStorageDatabaseTracker
        https://bugs.webkit.org/show_bug.cgi?id=186104

        Reviewed by Geoffrey Garen.

        Stop using StorageTracker.db and stop caching origins in LocalStorageDatabaseTracker for efficiency 
        and simplicity. Since functions in LocalStorageDatabaseTracker are not frequently called, we get 
        little benefits from caching origins.

        * Platform/Logging.h:
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
        (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
        (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
        (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
        (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
        (WebKit::LocalStorageDatabaseTracker::origins const):
        (WebKit::LocalStorageDatabaseTracker::originDetails):
        (WebKit::LocalStorageDatabaseTracker::databasePath const):
        (WebKit::fileCreationTime): Deleted.
        (WebKit::fileModificationTime): Deleted.
        (WebKit::LocalStorageDatabaseTracker::trackerDatabasePath const): Deleted.
        (WebKit::LocalStorageDatabaseTracker::openTrackerDatabase): Deleted.
        (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers): Deleted.
        (WebKit::LocalStorageDatabaseTracker::updateTrackerDatabaseFromLocalStorageDatabaseFiles): Deleted.
        (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier): Deleted.
        (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier): Deleted.
        (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier): Deleted.
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * UIProcess/WebStorage/StorageManager.h:

2018-06-01  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Crash in WebKitFaviconDatabase when pageURL is unset
        https://bugs.webkit.org/show_bug.cgi?id=186164

        Reviewed by Carlos Garcia Campos.

        PageURL can legitimately be null here if JavaScript does something silly with window.open.

        * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
        (webkitFaviconDatabaseSetIconURLForPageURL):
        (webkitFaviconDatabaseSetIconForPageURL):

2018-05-31  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: use the session delegate to perform window maximize
        https://bugs.webkit.org/show_bug.cgi?id=186167
        <rdar://problem/40544391>

        Reviewed by Timothy Hatcher.

        Add plumbing to hand off window maximizing to the session delegate.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::AutomationSessionClient):
        (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage):

2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Try to fix GTK+ build with old versions of GTK+ after r232390.

        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):

2018-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Switch to use a popup window with a tree view instead of a menu for option menu default implementation
        https://bugs.webkit.org/show_bug.cgi?id=186146

        Reviewed by Michael Catanzaro.

        It's more convenient to use than the menu.

        * UIProcess/API/gtk/WebKitPopupMenu.cpp:
        (WebKit::menuCloseCallback):
        (WebKit::WebKitPopupMenu::activateItem):
        * UIProcess/API/gtk/WebKitPopupMenu.h:
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
        (WebKit::WebPopupMenuProxyGtk::selectItem):
        (WebKit::WebPopupMenuProxyGtk::activateItem):
        (WebKit::WebPopupMenuProxyGtk::activateItemAtPath):
        (WebKit::WebPopupMenuProxyGtk::treeViewRowActivatedCallback):
        (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
        (WebKit::WebPopupMenuProxyGtk::buttonPressEventCallback):
        (WebKit::WebPopupMenuProxyGtk::keyPressEventCallback):
        (WebKit::WebPopupMenuProxyGtk::createPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::show):
        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
        (WebKit::WebPopupMenuProxyGtk::cancelTracking):
        (WebKit::WebPopupMenuProxyGtk::typeAheadFindIndex):
        (WebKit::WebPopupMenuProxyGtk::typeAheadFind):
        * UIProcess/gtk/WebPopupMenuProxyGtk.h:

2018-05-31  Per Arne Vollan  <pvollan@apple.com>

        Add OpenGL display mask to WebPage creation parameters.
        https://bugs.webkit.org/show_bug.cgi?id=186163
        <rdar://problem/40634504>

        Reviewed by Brent Fulgham.

        To make sure the OpenGL display mask is always available, include it in the WebPage creation parameters.
        The OpenGL display mask is sent to the WebProcess when the platform display ID changes, but that is not
        early enough in all cases. If the OpenGL display mask is not set, only OpenGL software rendering is offered
        on some hardware configurations.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):

2018-05-31  Brent Fulgham  <bfulgham@apple.com>

        Add a rule to allow reading files with prefix /private/var/db/CVMS/cvmsCodeSignObj
        https://bugs.webkit.org/show_bug.cgi?id=186157
        <rdar://problem/40666437>

        Reviewed by Eric Carlson.

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

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

        Add setting to allow override screen size to be disabled.
        https://bugs.webkit.org/show_bug.cgi?id=186109

        Reviewed by Andy Estes.

        Pipe the needed settings through to WebCore.

        * Shared/WebPreferences.yaml:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues):

2018-05-31  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Add JIT entitlements to WebContent process and plugin process on macOS
        https://bugs.webkit.org/show_bug.cgi?id=184485
        <rdar://problem/37556535>

        Reviewed by Dan Bernstein.

        This patch builds on the changes from Bug 185526 to add support for a JIT entitlement. It makes the
        following changes:

        1. Adds a new 'WebContent-OSX.entitlements file that unconditionally adds the JIT entitlement for all builds.
        2. Modifies the PluginService.entitlements to unconditionally add the JIT entitlement.

        * Configurations/PluginService.entitlements: Updated to add the JIT entitlement.
        * Configurations/WebContent-OSX.entitlements: Updated to add the JIT entitlement.
        * Configurations/WebContentService.xcconfig: Updated to use the new 'WebContent-OSX.entitlements' file.
        * WebKit.xcodeproj/project.pbxproj:

2018-05-31  Brent Fulgham  <bfulgham@apple.com>

        Don't attempt to extend sandbox when running tests with mock media devices
        https://bugs.webkit.org/show_bug.cgi?id=186150
        <rdar://problem/40690875>

        Reviewed by Alexey Proskuryakov.

        Avoid attempting to issue a sandbox extension to actual media devices when
        running with Mock capture devices.

        Also handle the 'denyNextRequest' test state outside of the USE(APPLE_INTERNAL_SDK)
        guards, since it is needed for Open Source builds as well.

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):

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

        WebKit memory management: Safari jetsams on some websites when zooming and scrolling
        https://bugs.webkit.org/show_bug.cgi?id=186091
        <rdar://problem/36315010>

        Reviewed by Geoff Garen.

        When zooming a page rapidly the visible rect and the page zoom level may get momentarily out of sync.
        When this happens we may generate tiles for a much larger area than needed and run out of memory
        building the next layer tree transaction. Running out of memory is more likely if the page has lots of
        tiled layers in addition to the main content layer.

        We already have code for dealing with the scale mismatch for zoom-out case (where this would cause
        visibly missing tiles). This patch enables the same exact adjustment for zoom-in case (where the
        symptom is creating too many tiles).

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

        Do some renames to make it clear that this can both expand and contract the visible rect.
        Bail out if there is nothing to do.

        (WebKit::WebPage::updateVisibleContentRects):

        Call adjustExposedRectForNewScale directly and unconditionally.

        (WebKit::adjustExposedRectForBoundedScale): Deleted.

2018-05-30  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Pass VM& parameter as much as possible
        https://bugs.webkit.org/show_bug.cgi?id=186085

        Reviewed by Saam Barati.

        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        (WebKit::NPJSObject::hasMethod):
        (WebKit::NPJSObject::construct):
        (WebKit::NPJSObject::invoke):

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

        [macOS] WebProcess needs TCC entitlements for media capture (Take 2)
        https://bugs.webkit.org/show_bug.cgi?id=185526
        <rdar://problem/36674649>

        Reviewed by Alexey Proskuryakov.

        In Bug 181995 I added TCC entitlements for media capture to the macOS entitlements used for
        relocatable builds. These changes also need to apply to system builds of WebKit.

        Previously we had not needed an entitlements file for system builds of WebKit, so only provided
        an entitlements file for our relocatable build targets. Now we need entitlements when building
        on recent macOS targets using internal SDKs.

        Since these various scenarios are beginning to multiple, this patch dynamically generates the
        entitlements file.

        This patch does the following:

        1. Changes the "WebContent-OSX.entitlements" to hold the TCC entitlements needed for media capture, and rename
           to "WebContent-OSX-restricted.entitlements".
        2. Removes the unneeded "com.apple.private.xpc.domain-extension" from WebContent-OSX.entitlement, and dynamically
           adds it using a new build step using the script 'process-webcontent-entitlements.sh'
        3. Updates DebugRelease.xcconfig to use the 'Safari Engineering' signing key for internal builds.
        4. Updates WebContentService.xcconfig to remove the CODE_SIGN_ENTITLEMENTS_OSX_WITH_XPC_DOMAIN_EXTENSION_YES target
           since we no longer need a custom entitlement file for this case.
        5. Updates WebContentService.Development.xcconfig to remove CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO since it is no
           longer needed.
        6. Deletes the file Configurations/WebContent.Development.entitlements since it is no longer needed.
        7. Revises the WebContent process sandbox to allow camera and microphone access without needing TCC
           entitlements, since those cannot be applied without an internal SDK.
        8. Revises the UserMediaProcessManager to not pass dynamic sandbox extensions to the WebContent process
           when building with the public SDK since those entitlements cannot be added or consumed in Open
           Source builds.

        We want to use the TCC entitlements when building with the internal SDK on recent macOS builds.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/WebContent-OSX-restricted.entitlements: Renamed from Source/WebKit/Configurations/WebContent-OSX.entitlements.
        * Configurations/WebContent.Development.entitlements: Removed.
        * Configurations/WebContentService.Development.xcconfig:
        * Configurations/WebContentService.xcconfig:
        * Scripts/process-webcontent-entitlements.sh: Added.
        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't bother creating and sending sandbox extensions for
        camera and microphone control for builds that cannot support them.
        * WebKit.xcodeproj/project.pbxproj:

2018-05-30  Daniel Bates  <dabates@apple.com>

        NavigationAction does not need to hold initiating DOM Event
        https://bugs.webkit.org/show_bug.cgi?id=185958
        <rdar://problem/40531539>

        Reviewed by Simon Fraser.

        Write in terms of NavigationAction::{keyStateEventData, mouseEventDataForFirstMouseEvent}().

        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
        (WebKit::mouseButtonForMouseEventData):
        (WebKit::syntheticClickTypeForMouseEventData):
        (WebKit::clickLocationInRootViewCoordinatesForMouseEventData):
        (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
        (WebKit::mouseEventForNavigationAction): Deleted.
        (WebKit::mouseButtonForMouseEvent): Deleted.
        (WebKit::syntheticClickTypeForMouseEvent): Deleted.
        (WebKit::clickLocationInRootViewCoordinatesForMouseEvent): Deleted.

2018-05-30  Andy Estes  <aestes@apple.com>

        [Cocoa] Add an SPI to suppress connection termination errors from CFNetwork when network interfaces change
        https://bugs.webkit.org/show_bug.cgi?id=186107
        <rdar://problem/39338957>

        Reviewed by Brady Eidson.

        Added an SPI which configures a process pool's networking process to set the
        kCFStreamPropertyAutoErrorOnSystemChange to NO on its NSURLSessionConfigurations.
        This instructs CFNetwork to not terminate active connections when the system's
        network interfaces change.

        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]):
        (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

        Rename FromOrigin runtime flag to CrossOriginResourcePolicy and enable it by default
        https://bugs.webkit.org/show_bug.cgi?id=186082

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCrossOriginResourcePolicyEnabled):
        (WKPreferencesGetCrossOriginResourcePolicyEnabled):
        (WKPreferencesSetFromOriginResponseHeaderEnabled): Deleted.
        (WKPreferencesGetFromOriginResponseHeaderEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

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

        Rename CrossOriginResourcePolicy same to same-origin
        https://bugs.webkit.org/show_bug.cgi?id=186080

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::shouldCrossOriginResourcePolicyPolicyCancelLoad):

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

        [iOS] -[WKFullScreenViewController viewWillAppear:] should call [super viewWillAppeear:]
        <https://webkit.org/b/186103>
        <rdar://problem/40655695>

        Reviewed by Eric Carlson.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
        Drive-by clean up.  For consistency, we always use the same
        variable in the body of the `if` statement that was used in the
        condition.
        (-[WKFullScreenViewController viewWillAppear:]): Call
        [super viewWillAppeear:] to fulfill API contract.

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

        Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
        https://bugs.webkit.org/show_bug.cgi?id=186097
        <rdar://problem/40651225>

        Reviewed by Dan Bernstein.

        Refactor fix landed in r232298 so that we rely on the existing Callback infrastructure
        to take a background process assertion.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::callAfterNextPresentationUpdate):

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

        Fix the ENABLE(DATALIST_ELEMENT) build
        https://bugs.webkit.org/show_bug.cgi?id=186105

        Reviewed by Wenson Hsieh.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:

2018-05-30  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, a quick build fix for r232276.

        Enabled SecItemShim again as it turns out to be useful for CFNetwork APIs that
        query Keychains underneath us.

        * NetworkProcess/ios/NetworkProcessIOS.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcess):

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

        Auto-pip should use main content heuristic.
        https://bugs.webkit.org/show_bug.cgi?id=186065
        <rdar://problem/35862502>

        Reviewed by Eric Carlson.

        Make the m_pipStandbyElement clearable, which will allow the auto-pip mechanism to be torn down. Add
        a WebProcess-side notification when the main content changes, to facilitate this.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
        (WebKit::WebFullScreenManager::setPIPStandbyElement):
        (WebKit::WebFullScreenManager::didEnterFullScreen):
        (WebKit::WebFullScreenManager::willExitFullScreen):
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::videoControlsManagerDidChange):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/cocoa/PlaybackSessionManager.h:
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
        (WebKit::PlaybackSessionManager::clearPlaybackControlsManager):
        (WebKit::PlaybackSessionManager::currentPlaybackControlsElement const):

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

        Fix a few issues in WKFullScreenViewController
        https://bugs.webkit.org/show_bug.cgi?id=186067
        <rdar://problem/40630944>

        Reviewed by Darin Adler.

        The check in setInterface() is checking the wrong pointer:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):

        The check in -_effectiveFullscreenInsetTop is backwards:
        (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):

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

        Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate()
        https://bugs.webkit.org/show_bug.cgi?id=186097
        <rdar://problem/40651225>

        Reviewed by Tim Horton.

        Take a background process assertion in WebPageProxy::callAfterNextPresentationUpdate(). Otherwise,
        apps may get stuck on _doAfterNextPresentationUpdate because the WebProcess got suspended.

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

2018-05-29  Tim Horton  <timothy_horton@apple.com>

        Fix the build
        https://bugs.webkit.org/show_bug.cgi?id=186078

        Unreviewed build fix.

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

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

        [Wi-Fi Assertions] Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion
        https://bugs.webkit.org/show_bug.cgi?id=185983
        <rdar://problem/40205486>

        Reviewed by Tim Horton.

        * Configurations/Network-iOS.entitlements:

        Added a needed entitlement.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/WiFiAssertionHolder.h:
        (WebKit::WiFiAssertionHolder::shouldHoldWiFiAssertion const):

        Track whether WiFiAssertionHolder should actually hold a Wi-Fi assertion.

        * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Renamed from Source/WebKit/NetworkProcess/cocoa/WiFiAssertionHolder.cpp.
        (holdWiFiAssertion):
        (releaseWiFiAssertion):
        (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
        (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):

        Changed holdWiFiAssertion() and releaseWiFiAssertion() to take the
        WiFiAssertionHolder as an argument.

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

        Added a needed sandbox extension.

        * WebKit.xcodeproj/project.pbxproj:

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

        Add a consistency check between URL and CFURL
        https://bugs.webkit.org/show_bug.cgi?id=186057
        <rdar://problem/40258457>

        Reviewed by Geoff Garen.

        * Shared/Cocoa/WKNSURLExtras.mm:
        (+[NSURL _web_URLWithWTFString:relativeToURL:]):
        (urlWithWTFString): Deleted.
        (+[NSURL _web_URLWithWTFString:]): Deleted.

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

        Remove unused WebPage::dummy
        https://bugs.webkit.org/show_bug.cgi?id=186068

        Reviewed by Sam Weinig.

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

2018-05-29  Per Arne Vollan  <pvollan@apple.com>

        Create typedef for HashMap<PlatformDisplayID, ScreenProperties>
        https://bugs.webkit.org/show_bug.cgi?id=186056

        Reviewed by Brent Fulgham.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:

2018-05-25  Jiewen Tan  <jiewen_tan@apple.com>

        Tighten sandbox profiles for Networking Processes to restrict accesses to macOS/iOS Keychains
        https://bugs.webkit.org/show_bug.cgi?id=162948
        <rdar://problem/40558894>

        Reviewed by Brent Fulgham.

        The patch conditionally tighten sandbox profiles for Networking Processes to remove Keychain related
        permissions and some security permisssions that are not needed. Also it conditionally remove the
        Process Privilege for Networking Processes to access Credentials.

        In addition, it remove process privilege assertions for SecItemShim as it is supposed to work in processes
        that don't have privileges to access Keychains and delegate all operations to UI Process via IPC. Also,
        the patch disables SecItemShim for Networking Process conditionally.

        * Configurations/Network-iOS.entitlements:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * Shared/mac/SecItemShim.cpp:
        (WebKit::sendSecItemRequest):
        (WebKit::webSecItemCopyMatching):
        (WebKit::webSecItemAdd):
        (WebKit::webSecItemUpdate):
        (WebKit::webSecItemDelete):
        (WebKit::initializeSecItemShim):

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

        Store 0-lifetime stylesheets / scripts into the disk cache for faster history navigations
        https://bugs.webkit.org/show_bug.cgi?id=186060
        <rdar://problem/40627270>

        Reviewed by Geoffrey Garen.

        Tweak our storeUnconditionallyForHistoryNavigation logic to match resources whose priority
        is High, not just VeryHigh. Per logic in CachedResource::defaultPriorityForResourceType(Type),
        This now matches stylesheets and scripts in addition to main resources.

        I found that in case of a history navigation to apple.com, a significant number of scripts
        and stylesheets had to be loaded from the network because our previous heuristic decided
        not to store them (because their priority was not VeryHigh and because their max-age was
        0).

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::makeStoreDecision):

2018-05-28  Jeff Miller  <jeffm@apple.com>

        Expose additional WKMenuItemIdentifier strings
        https://bugs.webkit.org/show_bug.cgi?id=186041

        Reviewed by Dan Bernstein.

        Expose identifiers for media-related menu items.

        * UIProcess/API/Cocoa/WKMenuItemIdentifiers.mm:
        Define new identifiers.

        * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
        Declare new identifiers.

        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::menuItemIdentifier):
        Map to new identifiers.

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

        Removed some unused WebSQL trackers
        https://bugs.webkit.org/show_bug.cgi?id=186026

        Reviewed by Dan Bernstein.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::m_nonVisibleProcessCleanupTimer):
        (WebKit::m_webSQLiteDatabaseTracker): Deleted.
        * WebProcess/WebProcess.h:

2018-05-29  Per Arne Vollan  <pvollan@apple.com>

        Follow-up fixes after r228907.
        https://bugs.webkit.org/show_bug.cgi?id=183338

        Reviewed by Brent Fulgham.

        Add screen properties to the WebProcess creation parameters, instead of sending
        them in a message to the WebProcess just after starting it up.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

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

        Unable to remove IndexedDB Databases with Cocoa API removeDataOfTypes
        https://bugs.webkit.org/show_bug.cgi?id=185835
        <rdar://problem/39142257>

        Reviewed by Chris Dumez.

        Fix a wrong if condition: databases should be closed and deleted if websiteDataTypes contains 
        WebsiteDataType::IndexedDBDatabases.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::deleteWebsiteDataForOrigins):

2018-05-28  Sam Weinig  <sam@webkit.org>

        Modernize SVGRenderStyleDefs.h
        https://bugs.webkit.org/show_bug.cgi?id=186024

        Reviewed by Daniel Bates.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::applyPropertiesToLayer):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        Update for new enum names.

2018-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.3 release.

        * gtk/NEWS: Add release notes for 2.21.3.

2018-05-27  Dan Bernstein  <mitz@apple.com>

        Reverted the changes made for https://webkit.org/b/186016

        They broke the USE(APPLE_INTERNAL_SDK) Sierra build.

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

        [iOS] Fix warnings about leaks found by clang static analyzer
        <https://webkit.org/b/186009>
        <rdar://problem/40574267>

        Reviewed by Daniel Bates.

        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::WebAutomationSession::platformSimulateKeySequence): Fix
        leak of two WebEvent objects that happened in a loop.
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
        Fix leak of a UIImage.

2018-05-27  Dan Bernstein  <mitz@apple.com>

        [Cocoa] Avoid importing directly from subumbrella frameworks
        https://bugs.webkit.org/show_bug.cgi?id=186016

        Reviewed by Sam Weinig.

        * Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
          OTHER_CPLUSPLUSFLAGS.
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
          HIToolbox header.
        * UIProcess/Cocoa/WebViewImpl.mm: Ditto.
        * UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
        * UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
          header.
        * WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
          PDFKit header.
        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
        * WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
        * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
        * WebProcess/WebPage/mac/WebPageMac.mm: Ditto.

2018-05-25  Timothy Hatcher  <timothy@apple.com>

        Setting drawsBackground to YES on a WKView doesn't take effect immediately
        https://bugs.webkit.org/show_bug.cgi?id=185885
        rdar://problem/39706506

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Removed setBackgroundExtendsBeyondPage(true)
        since it is now the default.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setDrawsBackground): Make sure updateLayer gets called on the web view
        by calling setNeedsDisplay:YES.
        (WebKit::WebViewImpl::setBackgroundColor): Ditto.
        (WebKit::WebViewImpl::updateLayer): Removed dead code.
        * UIProcess/WebPageProxy.h: Make m_backgroundExtendsBeyondPage default to true. WebKit was
        always turning this on during WKWebView initializtion, which would cause the scroll
        shadow layer to be created, flash black because of no background, then destroyed soon
        after once WebKit's message to turn it on got delivered.
        * WebProcess/WebPage/WebPage.cpp:
        (WebPage::WebPage): Call setBackgroundExtendsBeyondPage earlier to avoid creating the scroll
        shadow layer, since backgroundShouldExtendBeyondPage defautls to false in WebCore for WK1.
        (WebKit::WebPage::setDrawsBackground): Use updateBackgroundRecursively to propagate the
        correct base background color.

2018-05-25  Youenn Fablet  <youenn@apple.com>

        Migrate From-Origin to Cross-Origin-Resource-Policy
        https://bugs.webkit.org/show_bug.cgi?id=185840

        Reviewed by Chris Dumez.

        Do Cross-Origin-Resource-Policy (CORP) checks in NetworkLoadChecker instead of NetworkResourceLoader directly.
        Make sure CORP only applies to no-cors loads.
        Remove ancestor checks and only consider the document origin making the load.
        This means that in case of cross-origin redirection to same-origin, the redirection will be CORP-checked,
        the final response will not be CORP-checked but will be opaque.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateCrossOriginResourcePolicyPolicy):
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        Send ancestor information for navigation loads only.

2018-05-25  Daniel Bates  <dabates@apple.com>

        NavigationAction should not hold a strong reference to a Document
        https://bugs.webkit.org/show_bug.cgi?id=185712
        <rdar://problem/40320916>

        Reviewed by Brent Fulgham.

        Update code to make use of NavigationAction::requester().

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-05-25  Tim Horton  <timothy_horton@apple.com>

        Ensure that the Web Content process doesn't sleep during initialization
        https://bugs.webkit.org/show_bug.cgi?id=185975
        <rdar://problem/40548159>

        Reviewed by Geoffrey Garen.

        WebProcessPool::warmInitialProcess isn't worth much (or at least, as much
        as it could be) if the Web Content process goes to sleep in the middle
        of initializeWebProcess.

        Keep the Web Content process alive until it has handled all messages
        sent from WebProcessPool::initializeNewWebProcess.

        This is a significant speedup on some benchmarks I've been running
        that involve prewarming a process long before any content is loaded.

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

2018-05-25  Chris Dumez  <cdumez@apple.com>

        WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
        https://bugs.webkit.org/show_bug.cgi?id=185992

        Reviewed by Geoffrey Garen.

        Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
        to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
        flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

2018-05-25  Chris Dumez  <cdumez@apple.com>

        Drop support for NSURLCache in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=185990

        Reviewed by Geoffrey Garen.

        Drop support for NSURLCache in WebKit2 now that the WebKit network cache is stable.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setCacheModel):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        (WebKit::NetworkProcess::clearDiskCache):
        (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
        (WebKit::clearNSURLCache): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        (): Deleted.
        (WebKit::NetworkSessionCocoa::setUsesNetworkCache): Deleted.
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::platformSetURLCacheSize): Deleted.
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
        (WebKit::WebProcessPool::isNetworkCacheEnabled): Deleted.
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::suggestedFilenameForResourceWithURL const):
        (WebKit::WebFrame::mimeTypeForResourceWithURL const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getResourceDataFromFrame):
        (WebKit::WebPage::hasLocalDataForURL):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::accessibilityRemoteObject):
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::cachedResponseForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:
        (WebKit::WebPage::platformHasLocalDataForURL): Deleted.
        (WebKit::WebPage::cachedResponseMIMETypeForURL): Deleted.
        (WebKit::WebPage::cachedSuggestedFilenameForURL): Deleted.
        (WebKit::WebPage::cachedResponseDataForURL): Deleted.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2018-05-25  Alex Christensen  <achristensen@webkit.org>

        Fix internal iOS builds after r232198
        https://bugs.webkit.org/show_bug.cgi?id=185986

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

2018-05-25  Alex Christensen  <achristensen@webkit.org>

        URL::host should return a StringView to reduce allocations
        https://bugs.webkit.org/show_bug.cgi?id=185986

        Reviewed by Geoff Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::fetchDiskCacheEntries):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::areFrameAncestorsSameSite):
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::overrideSystemProxies):
        * Shared/API/APIURL.h:
        (API::URL::host const):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::deleteAllCookies):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::pluginDidReceiveUserInteraction):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::populatePluginCache):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::needsHiddenContentEditableQuirk):
        (WebKit::needsPlainTextQuirk):
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):

2018-05-25  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.

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

2018-05-25  Chris Dumez  <cdumez@apple.com>

        Minor ApplicationCacheStorage clean up
        https://bugs.webkit.org/show_bug.cgi?id=185984

        Reviewed by Youenn Fablet.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyOriginsWithApplicationCache):

2018-05-25  Chris Dumez  <cdumez@apple.com>

        Avoid triggering network cache speculative revalidation for loads allowing expired content
        https://bugs.webkit.org/show_bug.cgi?id=185985

        Reviewed by Antti Koivisto.

        Avoid triggering network cache speculative revalidation for loads allowing expired content
        (e.g. history loads, restoring pages after crash or safari relaunch). This causes us to do
        unnecessary revalidations, it is both wasteful and bad for performance.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::retrieve):

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

        Fix issues with -dealloc methods found by clang static analyzer
        <https://webkit.org/b/185887>

        Reviewed by Joseph Pecoraro.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Drive-by fix
        to use `copy` for `mimeType` property.
        (-[_WKPreviewControllerDataSource initWithMIMEType:]): Drive-by
        fix to use `instancetype` instead of `id`.  Use -copy for
        `mimeType` argument to match property definition.
        (-[_WKPreviewControllerDataSource dealloc]): Add.  Release
        `_completionHandler` and `_mimeType` to fix leaks.
        * UIProcess/ios/WKPasswordView.mm:
        (-[WKPasswordView dealloc]): Add.  Release
        `_userDidEnterPassword` to fix leak.
        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        Drive-by clean-up to make `location` property `copy` instead of
        `retain`.
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController dealloc]): Release `_target` and
        `_location` to fix leaks.
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullscreenAnimationController dealloc]): Add.  Release
        `_viewController` to fix leak.
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
        (@property secondaryMaterialOverlayView): Mark explicitly as
        `assign` since this isn't a retained variable.
        (@property secondaryMaterialOverlayViewConstraints): Mark
        explicitly as `retain` since there is nothing to keep this
        object alive.
        (+[WKFullscreenStackView secondaryMaterialOverlayView]): Fix
        leak by autoreleasing the return value.
        (-[WKFullscreenStackView dealloc]): Release retained instance
        variables to fix leaks.  Note that `_stackView` and
        `_visualEffectView` are internally retained despite their
        @property declarations.
        (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
        Retain @property targetViewForSecondaryMaterialOverlay to match
        its declaration.

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

        [Web Animations] Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED for Web Animations experimental features
        https://bugs.webkit.org/show_bug.cgi?id=185919

        Reviewed by Dean Jackson.

        * Shared/WebPreferences.yaml:

2018-05-24  Dan Bernstein  <mitz@apple.com>

        ProcessLauncherMac.mm contains a couple of meaningless #ifndef directives
        https://bugs.webkit.org/show_bug.cgi?id=185973

        Reviewed by Tim Horton.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess): Use #if !ASSERT_DISABLED to guard statements that
          are only needed for an assertion, instead of #ifndef _NDEBUG, which is always true.

2018-05-24  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses
        https://bugs.webkit.org/show_bug.cgi?id=184261

        Reviewed by Carlos Garcia Campos.

        On Linux we had two implementations for getting notifications about memory pressure events:
        - The memory cgroup (called systemd here).
        - The UIProcess memory monitor (which delivered events via a shared eventfd)

        The problem with the first is that it was usually not working on a standard machine due to
        the special permissions or configurations required for memory cgroups, so the second one
        (eventfd) was used as a fall-back in that case.
        But this eventfd method is racy with more than one WebKit child process and it wasn't
        reliably delivering the notifications.

        This patch removes the memory cgroup implementation and modifies the UIProcess memory monitor
        to deliver the events via WebKit IPC. This simplifies the code a lot and allows us to have
        only one implementation that should work in any Linux machine.

        The implementation now also triggers the event with information about the criticalness of it.

        Previously a critical event was triggered always at a 95% of pressure.
        Now a non-critical one is triggered at 90% and critical remains at a 95%.

        Start triggering events early should compensate the fact than triggering the event via WebKit IPC is
        a bit slower than doing that via an eventfd (or than listening on the memory cgroup event controller).

        The events are delivered to all WebKit childs: WebProcess, NetworkProcess, StorageProcess, PluginProcess.

        In the case of the StorageProcess a dummy controller is installed, which currently does nothing,
        but leaves a note for a future implementation and at least allows to trigger platformReleaseMemory()
        that on Linux/glibc should end calling malloc_trim()

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::didReceiveMessage):
        (WebKit::PluginProcess::initializePluginProcess):
        * Shared/ChildProcess.cpp:
        (WebKit::ChildProcess::didReceiveMemoryPressureEvent):
        * Shared/ChildProcess.h:
        * Shared/ChildProcess.messages.in:
        * Shared/Plugins/PluginProcessCreationParameters.cpp:
        (WebKit::PluginProcessCreationParameters::encode const):
        (WebKit::PluginProcessCreationParameters::decode):
        * Shared/Plugins/PluginProcessCreationParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::initializeProcess):
        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::sendMemoryPressureEvent):
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::sendMemoryPressureEvent):
        (WebKit::PluginProcessProxy::didFinishLaunching):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::sendMemoryPressureEvent):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebProcessPool.h:
        (WebKit::WebProcessPool::sendToStorageProcess):
        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::pollIntervalForUsedMemoryPercentage): Fix equation for calculating the interval percentage.
        (WebKit::MemoryPressureMonitor::singleton):
        (WebKit::MemoryPressureMonitor::start):
        * UIProcess/linux/MemoryPressureMonitor.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

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

        Update plugin search path to look for user installed plugins
        https://bugs.webkit.org/show_bug.cgi?id=185960

        Reviewed by Brent Fulgham.

        Now that UIProcess may be sandboxed, the home directory is no longer the user home directory.
        Update the path to still look for plugins in the user home directory.

        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::pluginsDirectories):

2018-05-24  Jiewen Tan  <jiewen_tan@apple.com>

        Adopt SecKeyProxy SPI in certificate based challenge response code
        https://bugs.webkit.org/show_bug.cgi?id=185848
        <rdar://problem/34586181>

        Reviewed by Alex Christensen.

        This patch adopts SecKeyProxy SPI in HTTPS client certificate authentication code.
        1) SecKeyProxy is a new SPI to relay crypto operations from one process to another. The owner process of the proxy
        will behave like a server, and other owners of the SecKeys created from the proxy's endpoints will then behave
        like clients. This client-server model allows more restricted sandbox for client processes, and meanwhile permits
        them to relay crypto operations to the server process while maintaining the same SecKey interfaces as used for local operations.
        2) Because of the client-server model, the server process, i.e. the UI Process in our case, needs to keep the proxy
        object alive long enough for the client process, i.e. Network Processes in our case, to finish all operations, and then destroy
        the proxy object afterward. The ideal place to hold such a proxy is WebsiteDataStore such that proxies could live with the
        corresponding network session.
        3) A new class called SecKeyProxyStore is then created to bind the lifetime of SecKeyProxy to the WebsiteDataStore while initializing
        it correctly. At the time the authentication process reaches WebPageProxy::didReceiveAuthenticationChallengeProxy where we have
        accesses to the WebsiteDataStore, we haven't yet been able to determine the Credential to authenticate the challenge. Therefore, we
        have to reserve a place in the WebsiteDataStore ahead and then fill it with the right Credential. That's why SecKeyProxyStore exists.
        In WebPageProxy::didReceiveAuthenticationChallengeProxy, we create a strong reference of SecKeyProxyStore which will eventually hold
        a strong reference of the SecKeyProxy, and move it to the WebsiteDataStore. We also create a weak reference to SecKeyProxyStore
        and move it to the AuthenticationChallenge. In this way, we indirectly bind the lifetime of SecKeyProxy to the WebsiteDataStore through
        the strong reference and also we can initialize the proxy through the weak reference while a credential is finally determined.
        4) Endpoints of the SecKeyProxy will be passed to the Network Process for creating the 'remote' SecKey. However, those endpoints are
        of NSXPCListenerEndpoint type, which can only be passed with xpc connections and are not compatible with our IPC mechanism. In order
        to pass endpoints around, this patch reuses the xpc connection that is used to bootstrap Network Processes from the UI Process. To do
        so, it sends xpc messages at the place where original IPC messages are sent and overwrites the boostrap listener of the xpc connection
        when Network Process is initialized. From the listener, it continues the original authentication code path.
        5) Tests, again, are manually covered by tlstestwebkit.org. Noted, the prompting Keychain dialog in macOS should say Safari instead of
        "com.apple.WebKit.Networking*" now.

        * Shared/AuthenticationManagerCocoa.mm: Added.
        (WebKit::AuthenticationManager::initializeConnection):
        * Shared/Authentication/cocoa/AuthenticationManager.h:
        * Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h:
        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
        (WebKit::AuthenticationChallengeProxy::useCredential):
        (WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore):
        * UIProcess/Authentication/AuthenticationChallengeProxy.h:
        * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm: Added.
        (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):
        * UIProcess/Authentication/cocoa/SecKeyProxyStore.h: Added.
        (WebKit::SecKeyProxyStore::create):
        (WebKit::SecKeyProxyStore::isInitialized const):
        (WebKit::SecKeyProxyStore::get const):
        (WebKit::SecKeyProxyStore::weakPtrFactory const):
        * UIProcess/Authentication/cocoa/SecKeyProxyStore.mm: Added.
        (WebKit::SecKeyProxyStore::initialize):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::addSecKeyProxyStore):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-05-24  Megan Gardner  <megan_gardner@apple.com>

        Fix Issues with Loupe Gesture
        https://bugs.webkit.org/show_bug.cgi?id=185926

        Reviewed by Tim Horton.

        The loupe gesture was not giving us the correct selection in some situations.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView setSelectedTextRange:]):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture):
        (WebKit::WebPage::clearSelection):

2018-05-24  Keith Rollin  <krollin@apple.com>

        Don't track resource load milestones in private sessions
        https://bugs.webkit.org/show_bug.cgi?id=185828
        <rdar://problem/40424197>

        Reviewed by Brent Fulgham.

        Bug 184838 adds the facility for tracing the beginning and ending of
        resources loads and reporting so that historical information can be
        gathered to assess the health of the networking stack. Disable this
        facility for private browsing sessions.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):

2018-05-24  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r224908): [macOS] Media playback not honoring custom caption styles
        https://bugs.webkit.org/show_bug.cgi?id=185955
        <rdar://problem/40339278>

        Reviewed by Eric Carlson.

        In r224908 I removed access to the MediaAccessibility mach port, as well as
        read/write access to various preferences associated with that process, as it
        was no longer needed by modern WebKit media routines.

        Detailed testing reveals that read access is still needed to these preferences
        to properly handle custom caption styles.

        This patch re-enables access to the media accessibility preferences.

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

2018-05-24  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r230269): ASSERTION FAILED: sendRightCount == 1 at ProcessLauncherMac.mm(218)
        https://bugs.webkit.org/show_bug.cgi?id=185687
        <rdar://problem/39386361>

        Reviewed by Brady Eidson.

        In r230269 I added an assertion to help identify cases where we were doing bad
        bookkeeping in our port send rights. I assumed that because we were adding
        one send right, that when we went to close down the connection that we should
        have only one send right.
        
        I have since discovered that this assumption is invalid, and that I should
        only be checking that we have AT LEAST ONE send right at the time we attempt
        to remove it.

        This patch changes the assertion to confirm that we have at least one send
        right before we remove the send right.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):

2018-05-24  Chris Dumez  <cdumez@apple.com>

        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds
        https://bugs.webkit.org/show_bug.cgi?id=185951

        Reviewed by Geoffrey Garen.

        Some of the work in initializeLogChannelsIfNecessary() is unnecessary for release builds and slows down
        launch time. In particular, it is unnecessary to read NSDefaults to figure out which logging channels
        should be enabled.

        * Platform/foundation/LoggingFoundation.mm:
        (WebKit::logLevelString):
        * Platform/unix/LoggingUnix.cpp:
        (WebKit::logLevelString):
        * Platform/win/LoggingWin.cpp:
        (WebKit::logLevelString):

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

        Crash under WebKit::PluginProxy::destroy()
        https://bugs.webkit.org/show_bug.cgi?id=185841
        <rdar://problem/39936896>

        Reviewed by Brent Fulgham.

        A release assert in Connection::sencSync is failing since scripts are not allowed in this context,
        and the WebKit process is allowed to process incoming messages while waiting for the sync reply.
        In this context, scripts are disallowed in the method Element::addShadowRoot. To make sure the
        WebContent process will not wait indefinitely for a reply from the Plugin process, use a timeout
        of 1 second when sending the message.

        * WebProcess/Plugins/PluginProxy.cpp:
        (WebKit::PluginProxy::destroy):

2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK+ input method unit tests after r232049.

        Unit tests don't use a WebPageProxy.

        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::isViewFocused const):
        (WebKit::InputMethodFilter::setEnabled):
        * UIProcess/gtk/InputMethodFilter.h:

2018-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: implement maximize, minimize and fullscreen window commands
        https://bugs.webkit.org/show_bug.cgi?id=180398

        Reviewed by Brian Burg.

        * UIProcess/API/APIAutomationSessionClient.h:
        (API::AutomationSessionClient::requestMaximizeWindowOfPage): Added to allow clients maximize the window.
        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        * UIProcess/API/glib/WebKitWebViewPrivate.h:
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (WindowStateEvent::WindowStateEvent): Struct to handle window state events.
        (WindowStateEvent::~WindowStateEvent): Complete the event.
        (WindowStateEvent::complete): Call the completion handler is not called already.
        (windowStateEventCallback): Handle window state event changes.
        (webkitWebViewMaximizeWindow): Try to maximize the window and wait for the event.
        (webkitWebViewMinimizeWindow): Try to minimize the window and wait for the event.
        (webkitWebViewRestoreWindow): Try to unmaximize or unminimize the window and wait for the event.
        * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
        (webkitWebViewMaximizeWindow):
        (webkitWebViewMinimizeWindow):
        (webkitWebViewRestoreWindow):
        * UIProcess/Automation/Automation.json:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::maximizeWindowOfBrowsingContext): Exit fullscreen, restore the window and then
        maximize it.
        (WebKit::WebAutomationSession::maximizeWindowForPage): Ask the client to maximize the window of page.
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/atoms/EnterFullscreen.js:
        (enterFullscreen): Return early if fullscreen is disabled or if window is already in fullscreen.

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

        Avoid loading AVFoundation to check supported MIME types if possible
        https://bugs.webkit.org/show_bug.cgi?id=185839
        <rdar://problem/40182010>

        Reviewed by Jer Noble.
        
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Encode mediaMIMETypes.
        (WebKit::WebProcessCreationParameters::decode): Decode mediaMIMETypes.
        * Shared/WebProcessCreationParameters.h:

        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::mediaTypeCache): Static Vector of media MIME types.
        (WebKit::WebProcessProxy::cacheMediaMIMETypes): Cache the type list and pass it to every other
        process proxy.
        (WebKit::WebProcessProxy::cacheMediaMIMETypesInternal): Cache the type list and pass it to the
        web process.
        (WebKit::WebProcessProxy::mediaMIMETypes): Return the cached type list.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess): Set parameters.mediaMIMETypes.

        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in: Add CacheMediaMIMETypes.

        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in: Add SetMediaMIMETypes.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Cache the MIME types if the list isn't
        empty, else register with AVFoundationMIMETypeCache to be notified when it loads types.
        AVFoundationMIMETypeCache to 
        (WebKit::WebProcess::platformTerminate): Unregister with AVFoundationMIMETypeCache.
        (WebKit::WebProcess::setMediaMIMETypes): Pass list of types to AVFoundationMIMETypeCache.

2018-05-23  Brian Burg  <bburg@apple.com>

        Web Automation: disable process swap on navigation when an automation session is active
        https://bugs.webkit.org/show_bug.cgi?id=185552

        Reviewed by Tim Horton.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):
        This is not intended to work right now. Opt out to avoid crashing
        later when a process is deallocated unexpectedly.

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

        NetworkLoadChecker should check cached redirections
        https://bugs.webkit.org/show_bug.cgi?id=185849

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        Set the resource error url as done by WebCore SubresourceLoader.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        Pass the resource request to dispatchWillSendRedirectedRequest now needs it.
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        Make sure that m_networkLoad is not null before cancelling it since we might be checking a cached redirection.
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        Ensure the redirect response is coming from the Network before adding it to the cache.
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        Call willSendRedirectedRequest to make sure the cached redirect is validated.
        * NetworkProcess/NetworkResourceLoader.h:

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

        [GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
        https://bugs.webkit.org/show_bug.cgi?id=185866

        Reviewed by Brian Burg.

        To handle the case of the session being closed by the browser, for example in case of a network process
        crash. This is currently causing WebDriver tests to timeout in the bot.

        * UIProcess/API/glib/WebKitAutomationSession.cpp: Add an implementation of didDisconnectFromRemote() to notify
        the WebContext that the session will be closed.
        * UIProcess/API/glib/WebKitWebContext.cpp: Remove the automation session when closed.
        * UIProcess/API/glib/WebKitWebContextPrivate.h:

2018-05-22  Brent Fulgham  <bfulgham@apple.com>

        Close access to "lsopen" for non-UI process
        https://bugs.webkit.org/show_bug.cgi?id=185890
        <rdar://problem/39686511>

        Reviewed by Alexey Proskuryakov.

        Close down access to 'lsopen' in the iOS sandboxes. These operations are
        performed by the UIProcess on behalf of these helper processes.

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

2018-05-22  Dean Jackson  <dino@apple.com>

        Optimized path zoom animation needs a valid UIImage and CGRect
        https://bugs.webkit.org/show_bug.cgi?id=185883
        <rdar://problem/40306056>

        Reviewed by Jon Lee.

        Take the rectangle that was passed into the ResourceRequest and
        use it for the origin of an animation into QuickLook.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceRequest>::encode):
        (IPC::ArgumentCoder<ResourceRequest>::decode):
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:fromRect:]):
        (-[_WKPreviewControllerDelegate presentingViewController]):
        (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
        (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):
        (WebKit::SystemPreviewController::start):
        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]): Deleted.
        * UIProcess/Downloads/DownloadProxy.h:
        (WebKit::DownloadProxy::systemPreviewDownloadRect const):
        * UIProcess/SystemPreviewController.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::syncRootViewToScreen):
        * UIProcess/WebPageProxy.h:

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

        [iOS] TestWebKitAPI.WebKit.WKHTTPCookieStoreWithoutProcessPool fails because cookies use different files with/without processpool
        https://bugs.webkit.org/show_bug.cgi?id=185831

        Reviewed by Chris Dumez.

        Started to use uiProcessCookieStorageIdentifier for iOS: make sure cookies handled without 
        processpool would use the same storage file as when processpool exists.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-05-22  Chris Dumez  <cdumez@apple.com>

        Regression(AsyncPolicyDelegates): Box.app login Window is blank
        https://bugs.webkit.org/show_bug.cgi?id=185832
        <rdar://problem/40307871>

        Reviewed by Geoffrey Garen.

        Moved WeakObjCPtr.h header from WebKit/ to wtf/ so that it can be used in
        WebKitLegacy code.

        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        * UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
        * UIProcess/API/Cocoa/WKConnection.mm:
        * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
        * UIProcess/API/Cocoa/WKProcessGroup.mm:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        * UIProcess/API/Cocoa/WKScriptMessage.mm:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        * UIProcess/API/Cocoa/_WKAutomationSession.mm:
        * UIProcess/API/Cocoa/_WKDownload.mm:
        * UIProcess/API/Cocoa/_WKElementAction.mm:
        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/Cocoa/AutomationClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/DiagnosticLoggingClient.h:
        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/FindClient.h:
        * UIProcess/Cocoa/FullscreenClient.h:
        * UIProcess/Cocoa/IconLoadingDelegate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        * UIProcess/ios/WKContentViewInteraction.mm:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):
        * UIProcess/ios/WKScrollView.mm:
        * UIProcess/mac/WKInspectorViewController.mm:
        * UIProcess/mac/WKInspectorWKWebView.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:

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

        Conversion between SecurityOriginData and DatabaseIdentifier is asymmetric when port is null
        https://bugs.webkit.org/show_bug.cgi?id=185715

        Reviewed by Geoffrey Garen.

        Add getter for origins in WKWebsiteDataRecord for testing.

        * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
        (-[WKWebsiteDataRecord _originsString]):
        * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:


2018-05-22  Brady Eidson  <beidson@apple.com>

        Rename the "Web content is visible" process assertion.
        https://bugs.webkit.org/show_bug.cgi?id=185878

        Reviewed by Chris Dumez.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::ProcessAssertion):

2018-05-22  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Drop assertions on process suspension
        https://bugs.webkit.org/show_bug.cgi?id=185844
        <rdar://problem/40352319>

        Reviewed by Daniel Bates.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::actualPrepareToSuspend):
        (WebKit::NetworkProcess::processDidResume):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformPrepareToSuspend):
        (WebKit::NetworkProcess::platformProcessDidResume):

2018-05-22  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r229093): Re-enable Network Extension support in the WebContent process (Take 2)
        https://bugs.webkit.org/show_bug.cgi?id=185874
        <rdar://problem/40454404>

        Reviewed by Eric Carlson.

        Add back a necessary XPC connection after locking down the network features in r229093.

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

2018-05-22  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r232052.

        Breaks internal builds.

        Reverted changeset:

        "Use more C++17"
        https://bugs.webkit.org/show_bug.cgi?id=185176
        https://trac.webkit.org/changeset/232052

2018-05-22  Alberto Garcia  <berto@igalia.com>

        [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
        https://bugs.webkit.org/show_bug.cgi?id=182622
        <rdar://problem/40292317>

        Reviewed by Michael Catanzaro.

        Move the test to determine whether we need to link against
        libatomic to the common file WebKitCompilerFlags.cmake so it can
        also be used for JavaScriptCore.

        * CMakeLists.txt:

2018-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r231843.

        Broke cross build

        Reverted changeset:

        "[CMake] Properly detect compiler flags, needed libs, and
        fallbacks for usage of 64-bit atomic operations"
        https://bugs.webkit.org/show_bug.cgi?id=182622
        https://trac.webkit.org/changeset/231843

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

        Crash when loading a SVG image
        https://bugs.webkit.org/show_bug.cgi?id=185819

        Reviewed by Brent Fulgham.

        This is happening in WebLoaderStrategy::scheduleLoad() when getting the value of
        FrameLoaderClient::pageID(). SVGImage uses the empty clients for the loader, and
        EmptyFrameLoaderClient::pageID() returns std::nullopt. The same happens with the frameID. This changed in
        r225934, when pageID() and frameID() were changed to return std::optional, EmptyFrameLoaderClient was updated to
        return std::nullopt instead of 0.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad): Use value_or(0) instead of value() to get pageID and frameID from
        FrameLoaderClient.

2018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use more C++17
        https://bugs.webkit.org/show_bug.cgi?id=185176

        Reviewed by JF Bastien.

        * Configurations/Base.xcconfig:
        * DerivedSources.make:

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

        [GTK][Wayland] UI process crash when closing the window
        https://bugs.webkit.org/show_bug.cgi?id=185818

        Reviewed by Michael Catanzaro.

        This happens when a page containing a text field is loaded but the focus remains in the url bar when the window
        is closed. This is because we are sending a notify-in to the IM context, but the focus is still in the URL
        bar. That confuses the wayland input method manager that tries to free the text of the web view IM context that has
        already been deleted.

        * UIProcess/gtk/InputMethodFilter.cpp:
        (WebKit::InputMethodFilter::setEnabled): Only send notify-in if the view is actually focused.

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

        Remove unused and no-op WKContextSetCookieStorageDirectory
        https://bugs.webkit.org/show_bug.cgi?id=185857

        Reviewed by Youenn Fablet.

        Deleted C API which didn't do anything useful, and consequently not used by anyone.

        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetCookieStorageDirectory): Deleted.
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/WebProcessPool.h:

2018-05-21  Chris Nardi  <cnardi@chromium.org>

        Remove dead exception in MediaList.appendMedium
        https://bugs.webkit.org/show_bug.cgi?id=185278

        Reviewed by Chris Dumez.

        Remove code pertaining to an exception being thrown by appendMedium().

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
        (webkit_dom_media_list_append_medium):

2018-05-21  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Click events only fire once when editing
        https://bugs.webkit.org/show_bug.cgi?id=185777

        Reviewed by Tim Horton.

        gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
        edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
        This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
        click event.

        Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
        being shown when the node is already being assisted.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):

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

        REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
        https://bugs.webkit.org/show_bug.cgi?id=185789
        <rdar://problem/40380175>

        Reviewed by Andy Estes.

        Have NetworkLoadChecker implement the ContentSecurityPolicyClient interface and support logging
        console messages, sending CSP reports, and dispatching SecurityPolicyViolation events.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker): Modified to take a reference to the NetworkConnectionToWebProcess,
        the web page ID, the web frame ID, and the resource load identifier. These details are necessary
        in order to implement the ContentSecurityPolicyClient interface.
        (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): Added.
        (WebKit::NetworkLoadChecker::continueCheckingRequest): Write in terms of isAllowedByContentSecurityPolicy().
        (WebKit::NetworkLoadChecker::contentSecurityPolicy): Pass ourself as the client so that we receive
        delegate callbacks.
        (WebKit::NetworkLoadChecker::addConsoleMessage): Added.
        (WebKit::NetworkLoadChecker::sendCSPViolationReport): Added.
        (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Added.
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (NetworkResourceLoader::enqueueSecurityPolicyViolationEvent): Added.
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad): Modified to take a reference to the NetworkConnectionToWebProcess and pass
        this through to the NetworkLoadChecker along with the web page ID, web frame ID and resource load identifier.
        * NetworkProcess/PingLoad.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::enqueueSecurityPolicyViolationEvent): Added.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add message EnqueueSecurityPolicyViolationEvent.

2018-05-21  Brian Burg  <bburg@apple.com>

        Web Automation: always return an empty cookie list if document.cookieURL() is empty
        https://bugs.webkit.org/show_bug.cgi?id=185838
        <rdar://problem/37737526>

        Reviewed by Tim Horton.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
        This crashes in CFNetwork code because an empty cookie URL is not a valid input.
        Just return an empty list since there couldn't be any cookies returned.

2018-05-21  Brian Burg  <bburg@apple.com>

        Web Automation: terminate the automation session if the network or storage process crashes
        https://bugs.webkit.org/show_bug.cgi?id=185827
        <rdar://problem/40424020>

        Reviewed by Tim Horton.

        If one of the processes crashes, the page may be in an undefined state and
        automation will fail in unpredictable ways. It's better to just give up immediately.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessFailedToLaunch):
        (WebKit::WebProcessPool::storageProcessCrashed):

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

        Add a diskCacheSizeOverride accessor function on WKContextConfigurationRef
        https://bugs.webkit.org/show_bug.cgi?id=185826
        <rdar://problem/39732113>

        Reviewed by Alex Christensen.

        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationDiskCacheSizeOverride):
        (WKContextConfigurationSetDiskCacheSizeOverride):
        * UIProcess/API/C/WKContextConfigurationRef.h:

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

        Complete fix for enabling modern EME by default
        https://bugs.webkit.org/show_bug.cgi?id=185770
        <rdar://problem/40368220>

        Reviewed by Eric Carlson.

        * Configurations/FeatureDefines.xcconfig:

2018-05-21  Sam Weinig  <sam@webkit.org>

        Modernize RenderStyleConstants.h - Part 1
        https://bugs.webkit.org/show_bug.cgi?id=185809

        Reviewed by Yusuke Suzuki.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::rangeForWebSelectionAtPosition):
        (WebKit::WebPage::getPositionInformation):
        Update for new enum names.

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

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.2 release.

        * gtk/NEWS: Add release notes for 2.21.2.

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

        Unreviewed, rolling out r222967.

        It's not ready yet

        Reverted changeset:

        "[GTK][WPE] Add API to configure and enable resource load
        statistics"
        https://bugs.webkit.org/show_bug.cgi?id=177943
        https://trac.webkit.org/changeset/222967

2018-05-18  Commit Queue  <commit-queue@webkit.org>

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

        Caused layout test failures (Requested by realdawei on
        #webkit).

        Reverted changeset:

        "Complete fix for enabling modern EME by default"
        https://bugs.webkit.org/show_bug.cgi?id=185770
        https://trac.webkit.org/changeset/231982

2018-05-18  Brian Burg  <bburg@apple.com>

        [Cocoa] Add missing nullability annotations to _WKAutomationSessionDelegate
        https://bugs.webkit.org/show_bug.cgi?id=185791
        <rdar://problem/40279891>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: If there is no dialog shown,
        then the delegate methods to return the dialog text may return a nil NSString.

2018-05-18  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should cancel its content extension retrieval task when being destroyed
        https://bugs.webkit.org/show_bug.cgi?id=185661
        <rdar://problem/39985509>

        Reviewed by Chris Dumez.

        Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive.
        This allows stopping NetworkLoadChecker be ref counted.
        This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well.
        By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::weakPtrFactory):
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        * NetworkProcess/PingLoad.h:

2018-05-18  Per Arne Vollan  <pvollan@apple.com>

        WebProcess fails to launch
        https://bugs.webkit.org/show_bug.cgi?id=185140

        Reviewed by Geoffrey Garen.

        If the NSApplication runloop is not used in the WebContent process, launchServicesCheckIn() needs to be called
        in order for enableSandboxStyleFileQuarantine() to succeed. Determine at runtime if launchServicesCheckIn()
        should be called by checking if the NSApplication event loop is running.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

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

        Complete fix for enabling modern EME by default
        https://bugs.webkit.org/show_bug.cgi?id=185770
        <rdar://problem/40368220>

        Reviewed by Eric Carlson.

        * Configurations/FeatureDefines.xcconfig:

2018-05-18  Brent Fulgham  <bfulgham@apple.com>

        Convert ProcessPrivilege assertions to regular debug-only assertions
        https://bugs.webkit.org/show_bug.cgi?id=185775
        <rdar://problem/40372286>

        Reviewed by Geoffrey Garen.

        In Bug 184322 I added a number of RELEASE_ASSERT checks that certain
        UI-only calls were not being made in the WebContent process.

        Measurements have shown that these RELEASE_ASSERTs have regressed performance
        by around 1% on some benchmarks, so we should convert them to normal asserts.

        This patch changes the RELEASE_ASSERTs into ASSERTs.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl):
        (WebKit::WebViewImpl::becomeFirstResponder):
        (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged):
        (WebKit::WebViewImpl::validateUserInterfaceItem):
        (WebKit::WebViewImpl::startSpeaking):
        (WebKit::WebViewImpl::stopSpeaking):
        (WebKit::applicationFlagsForDrag):
        (WebKit::WebViewImpl::doneWithKeyEvent):
        * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
        (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::enterFullscreen):
        (WebKit::PluginProcessProxy::beginModal):
        (WebKit::PluginProcessProxy::endModal):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::DisplayLink):
        (WebKit::DisplayLink::~DisplayLink):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::getIsSpeaking):
        (WebKit::WebPageProxy::speak):
        (WebKit::WebPageProxy::stopSpeaking):
        (WebKit::WebPageProxy::startDisplayLink):
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):

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

        Handle failure to extend sandbox gracefully
        https://bugs.webkit.org/show_bug.cgi?id=185779
        <rdar://problem/40316349>

        Reviewed by Brent Fulgham.

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

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Don't append
        the request to m_grantedRequests if it failed.
        (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): Deny request if willCreateMediaStream
        fails.
        * UIProcess/UserMediaPermissionRequestManagerProxy.h:

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream): Don't try to extend sandbox if
        we fail to allocate all necessary handles.
        * UIProcess/UserMediaProcessManager.h:
        (WebKit::UserMediaProcessManager::denyNextUserMediaRequest): New, for testing.

2018-05-18  Antoine Quint  <graouts@apple.com>

        [Web Animations] Turn Web Animations with CSS integration on for test runners
        https://bugs.webkit.org/show_bug.cgi?id=184819
        <rdar://problem/39597337>

        Unreviewed. Rolling out the patch for this bug, it caused some flaky timeouts for animation suspension tests.

        * Shared/WebPreferences.yaml:

2018-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Clearing text fields should dispatch input events of type "deleteContent"
        https://bugs.webkit.org/show_bug.cgi?id=185769
        <rdar://problem/40368261>

        Reviewed by Tim Horton.

        When setting the text of the currently focused element to the empty string, just delete the text instead of
        pretending to insert an empty string. This mimics deleting content using the delete key on macOS, and fires an
        input event with inputType "deleteContent" instead of "insertText".

        Test: fast/forms/extrazoom/delete-content-in-text-field.html

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

2018-05-18  Keith Rollin  <krollin@apple.com>

        Renamed "trackNetworkActivity" to "tracksResourceLoadMilestones"
        https://bugs.webkit.org/show_bug.cgi?id=185523
        <rdar://problem/40136361>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::networkActivityTrackingEnabled):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::tracksResourceLoadMilestones const):
        (WebKit::NetworkProcess::trackNetworkActivity const): Deleted.
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationTracksResourceLoadMilestones):
        (WKContextConfigurationSetTracksResourceLoadMilestones):
        (WKContextConfigurationTrackNetworkActivity): Deleted.
        (WKContextConfigurationSetTrackNetworkActivity): Deleted.
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration tracksResourceLoadMilestones]):
        (-[_WKProcessPoolConfiguration setTracksResourceLoadMilestones:]):
        (-[_WKProcessPoolConfiguration trackNetworkActivity]): Deleted.
        (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2018-05-18  Chris Dumez  <cdumez@apple.com>

        Avoid keeping the frame alive when ref'ing a WindowProxy
        https://bugs.webkit.org/show_bug.cgi?id=185737
        <rdar://problem/40004666>

        Reviewed by Sam Weinig.

        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::windowScriptNPObject):

2018-05-18  Youenn Fablet  <youenn@apple.com>

        -Wmemset-elt-size warning in LibWebRTCSocket constructor
        https://bugs.webkit.org/show_bug.cgi?id=185555
        <rdar://problem/40217250>

        Reviewed by Darin Adler.

        GetOption implementation was broken in that it was not initializing properly its array of options.
        This patch fixes it by using an array of optional<int> which are initialized by default.
        When no value is set, we return the error code -1.
        In theory, we should go to NetworkProcess to get the actual value.
        Since GetOption is not used in practice, we just do this best effort implementation of storing previously set values.

        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
        (WebKit::LibWebRTCSocket::LibWebRTCSocket):
        (WebKit::LibWebRTCSocket::GetOption):
        * WebProcess/Network/webrtc/LibWebRTCSocket.h:

2018-05-18  Antoine Quint  <graouts@apple.com>

        [Web Animations] Turn Web Animations with CSS integration on for test runners
        https://bugs.webkit.org/show_bug.cgi?id=184819
        <rdar://problem/39597337>

        Reviewed by Jon Lee.

        * Shared/WebPreferences.yaml: Leave Web Animations off by default, it's up to clients
        to turn it on.

2018-05-18  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Curl] Remove unused SystemProxyWin.cpp
        https://bugs.webkit.org/show_bug.cgi?id=185224

        Reviewed by Antti Koivisto.

        SystemProxyWin is not used at the moment. Remove it.

        * NetworkProcess/win/SystemProxyWin.cpp: Removed.
        * NetworkProcess/win/SystemProxyWin.h: Removed.
        * PlatformWin.cmake: Removed SystemProxyWin.cpp.

2018-05-17  Nan Wang  <n_wang@apple.com>

        AX: [macOS] Expose the primary screen height through AX API
        https://bugs.webkit.org/show_bug.cgi?id=185742

        Reviewed by Chris Fleizach.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):

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

        Use CompletionHandlers for DelayedReplies
        https://bugs.webkit.org/show_bug.cgi?id=182269

        Reviewed by Youenn Fablet.

        DelayedReplies should be a noncopyable, non-refcountable type.  They should be
        called once and only once.  This is what CompletionHandlers are for.

        No change in behavior.  Just cleaner code.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
        (WebKit::sendReplyToSynchronousRequest):
        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
        * NetworkProcess/NetworkResourceLoader.h:
        * Platform/IPC/HandleMessage.h:
        (IPC::callMemberFunctionImpl):
        (IPC::callMemberFunction):
        (IPC::handleMessageDelayed):
        * PluginProcess/PluginControllerProxy.cpp:
        (WebKit::PluginControllerProxy::setInitializationReply):
        (WebKit::PluginControllerProxy::takeInitializationReply):
        * PluginProcess/PluginControllerProxy.h:
        * PluginProcess/WebProcessConnection.cpp:
        (WebKit::WebProcessConnection::destroyPlugin):
        (WebKit::WebProcessConnection::createPlugin):
        (WebKit::WebProcessConnection::createPluginAsynchronously):
        * PluginProcess/WebProcessConnection.h:
        * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
        (Messages::WebPage::GetPluginProcessConnection::send):
        (Messages::WebPage::TestMultipleAttributes::send):
        (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
        (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
        (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
        (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
        (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
        (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
        * Scripts/webkit/LegacyMessages-expected.h:
        * Scripts/webkit/MessageReceiver-expected.cpp:
        (Messages::WebPage::GetPluginProcessConnection::send):
        (Messages::WebPage::TestMultipleAttributes::send):
        (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): Deleted.
        (Messages::WebPage::GetPluginProcessConnection::DelayedReply::~DelayedReply): Deleted.
        (Messages::WebPage::GetPluginProcessConnection::DelayedReply::send): Deleted.
        (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): Deleted.
        (Messages::WebPage::TestMultipleAttributes::DelayedReply::~DelayedReply): Deleted.
        (Messages::WebPage::TestMultipleAttributes::DelayedReply::send): Deleted.
        * Scripts/webkit/Messages-expected.h:
        * Scripts/webkit/messages.py:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::networkProcessCrashed):
        (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
        (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::getPluginProcessConnection):
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::getPluginProcessConnection):
        (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
        (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::getStorageProcessConnection):
        (WebKit::StorageProcessProxy::didClose):
        (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
        * UIProcess/Storage/StorageProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::ExceededDatabaseQuotaRecords::createRecord):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::webGLPolicyForURL):
        (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
        (WebKit::WebPageProxy::getToolbarsAreVisible):
        (WebKit::WebPageProxy::getMenuBarIsVisible):
        (WebKit::WebPageProxy::getStatusBarIsVisible):
        (WebKit::WebPageProxy::getWindowFrame):
        (WebKit::WebPageProxy::screenToRootView):
        (WebKit::WebPageProxy::rootViewToScreen):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::exceededDatabaseQuota):
        (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessCrashed):
        (WebKit::WebProcessPool::getNetworkProcessConnection):
        (WebKit::WebProcessPool::getStorageProcessConnection):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPluginProcessConnection):
        (WebKit::WebProcessProxy::getNetworkProcessConnection):
        (WebKit::WebProcessProxy::getStorageProcessConnection):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):

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

        CRASH in -[WKFullScreenViewController _manager]
        https://bugs.webkit.org/show_bug.cgi?id=185745
        <rdar://problem/39195241>

        Reviewed by Eric Carlson.

        Protect against WKFullScreenViewController outliving WKWebView by making its
        _webView property weak. Additionally, add a sanity-check RetainPtr where _webView
        is referenced multiple times within a function.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController initWithWebView:]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        (-[WKFullScreenWindowController close]):
        (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
        (-[WKFullScreenWindowController _exitFullscreenImmediately]):
        (-[WKFullScreenWindowController _isSecure]):
        (-[WKFullScreenWindowController _serverTrust]):
        (-[WKFullScreenWindowController _updateLocationInfo]):
        (-[WKFullScreenWindowController _manager]):
        (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):

2018-05-17  Brent Fulgham  <bfulgham@apple.com>

        Correct default for StorageAccess API
        https://bugs.webkit.org/show_bug.cgi?id=185748
        <rdar://problem/40220659>

        Reviewed by Dean Jackson.

        Flip the default state to 'true' so that the new "sticky" state
        for Storage Access API and attributing user interaction for
        Storage Access API use is applied by default.

        * Shared/WebPreferences.yaml:

2018-05-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WPE] Implement and enable FULLSCREEN_API
        https://bugs.webkit.org/show_bug.cgi?id=185676

        Reviewed by Žan Doberšek.

        Do the initial implementation of FULLSCREEN_API for WPE and
        enable the CMake option by default.

        Most of the layout tests (55 of 58) are passing and the feature
        seems to work fine on different websites that use it.

        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::fullScreenManagerProxyClient):
        (WebKit::PageClientImpl::closeFullScreenManager):
        (WebKit::PageClientImpl::isFullScreen):
        (WebKit::PageClientImpl::enterFullScreen):
        (WebKit::PageClientImpl::exitFullScreen):
        (WebKit::PageClientImpl::beganEnterFullScreen):
        (WebKit::PageClientImpl::beganExitFullScreen):
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.h:
        (WKWPE::View::isFullScreen):
        (WKWPE::View::setFullScreen):

2018-05-17  Jiewen Tan  <jiewen_tan@apple.com>

        Convert CertificateInfo into Credential in UI Process instead of Networking Process
        https://bugs.webkit.org/show_bug.cgi?id=185662
        <rdar://problem/40275561>

        Reviewed by Alex Christensen.

        Right now we convert CertificateInfo into Credential in the very last stage of client certificate authentication process
        when it reaches Networking Process. This patch moves that conversion earlier in UI Process such that we don't have to
        pass both Credential and CertificateInfo to Networking Process.

        CertificateInfo is only used in macOS for C API specifically. WK2 includes macOS/iOS relies on NSURLCredential/WebCore::Credential
        solely. WK2 has already exercised the ability of using WebCore::Credential to do client certficate authentication. This patch therefore
        takes advantage of that. It converts CertficateInfo objects into Credential objects right after WebCredential is initialized, and then merge
        any code paths that utilizes CertficateInfo into ones that uses WebCore::Credential.

        Covered by existing tests.

        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::useCredentialForChallenge):
        (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
        (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): Deleted.
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Authentication/AuthenticationManager.messages.in:
        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
        (WebKit::AuthenticationChallengeProxy::useCredential):
        * UIProcess/Authentication/WebCredential.cpp:
        (WebKit::WebCredential::WebCredential):
        (WebKit::WebCredential::certificateInfo): Deleted.
        * UIProcess/Authentication/WebCredential.h:
        (WebKit::WebCredential::create):
        * UIProcess/Authentication/mac/WebCredentialMac.mm: Renamed from Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm.
        (WebKit::leafCertificate):
        (WebKit::chain):
        (WebKit::WebCredential::WebCredential):
        * WebKit.xcodeproj/project.pbxproj:

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

        Ensure valid rects for fullsceen animation.
        https://bugs.webkit.org/show_bug.cgi?id=185736
        rdar://problem/40320174

        Reviewed by Jer Noble.

        Protect against zero width and height since those can make for NANs in the animation transforms.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):

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

        Turn Modern EME API on by default and remove it as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=185693
        <rdar://problem/39954396>

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2018-05-17  Dean Jackson  <dino@apple.com>

        Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
        https://bugs.webkit.org/show_bug.cgi?id=185722
        <rdar://problem/40247351>

        Reviewed by Antoine Quint.

        I made a rookie mistake in the original patch: I was holding a strong
        reference to "self" in a block, which was causing a retain cycle.
        Replace that with a WeakObjCPtr.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):

2018-05-16  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r229093)[macOS] Allow network-outbound for syslog use
        https://bugs.webkit.org/show_bug.cgi?id=185703
        <rdar://problem/39778918>

        Reviewed by Eric Carlson.

        In r229093 I removed the 'network-outbound' permission for syslog use.
        Further testing has shown that this is still needed for subsystem
        logging in our bundle loading code.

        This patch re-enabled network-outbound for syslog.

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

2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>

        Add support for Intl NumberFormat formatToParts
        https://bugs.webkit.org/show_bug.cgi?id=185375

        Reviewed by Yusuke Suzuki.

        Add flag for NumberFormat formatToParts.

        * Configurations/FeatureDefines.xcconfig:

2018-05-16  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Adopt WiFiAssertionHolderAdditions
        https://bugs.webkit.org/show_bug.cgi?id=185685
        <rdar://problem/40136681>

        Reviewed by Sam Weinig.

        * NetworkProcess/cocoa/WiFiAssertionHolder.cpp:
        (WebKit::WiFiAssertionHolder::WiFiAssertionHolder):
        (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder):
        (WebKit::ensureWiFiManagerClient): Deleted.

2018-05-16  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] Implement WebPage::handleEditingKeyboardEvent
        https://bugs.webkit.org/show_bug.cgi?id=185327

        Reviewed by Alexey Proskuryakov.

        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::handleEditingKeyboardEvent): Copied from WebKitLegacy.

2018-05-16  Sihui Liu  <sihui_liu@apple.com>

        Session cookies aren't reliably set when using default WKWebSiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=185624
        <rdar://problem/39111626>

        Reviewed by Geoffrey Garen.

        Session cookies of default session were set in UI Process when there was no process pool, 
        but they were not synced (or synced slowly to) Network Process. To make these cookies visible
        as soon as they were set through API, we could manually set those cookies in Network Process
        during its initilization. 

        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::cookies):
        (API::HTTPCookieStore::setCookie):
        (API::HTTPCookieStore::deleteCookie):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::clearPendingCookies):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-05-16  Chris Nardi  <cnardi@chromium.org>

        Remove Document#selectedStylesheetSet/preferredStylesheetSet
        https://bugs.webkit.org/show_bug.cgi?id=185381

        Reviewed by Darin Adler.

        Make API methods for Document#selectedStylesheetSet/preferredStylesheetSet do nothing.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        (webkit_dom_document_set_property):
        (webkit_dom_document_get_property):
        (webkit_dom_document_get_preferred_stylesheet_set):
        (webkit_dom_document_get_selected_stylesheet_set):
        (webkit_dom_document_set_selected_stylesheet_set):

2018-05-16  Alberto Garcia  <berto@igalia.com>

        [CMake] Properly detect compiler flags, needed libs, and fallbacks for usage of 64-bit atomic operations
        https://bugs.webkit.org/show_bug.cgi?id=182622

        Reviewed by Michael Catanzaro.

        Move the test to determine whether we need to link against
        libatomic to the common file WebKitCompilerFlags.cmake so it can
        also be used for JavaScriptCore.

        * CMakeLists.txt:

2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
        https://bugs.webkit.org/show_bug.cgi?id=185601

        Reviewed by Saam Barati.

        * WebProcess/Plugins/Netscape/JSNPObject.h:

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

        StorageManager::deleteLocalStorageOriginsModifiedSince: database files get deleted before database connections close
        https://bugs.webkit.org/show_bug.cgi?id=185671

        Reviewed by Geoffrey Garen.

        We should delete database files before closing databases.

        * UIProcess/WebStorage/LocalStorageDatabase.cpp:
        (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
        (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince): Deleted.
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * UIProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):

2018-05-15  Dean Jackson  <dino@apple.com>

        Launch System Preview as the download starts, rather than waiting for a response
        https://bugs.webkit.org/show_bug.cgi?id=185669
        <rdar://problem/40278181>

        Reviewed by Tim Horton.

        We were waiting for the RequestResponse to get a MIME-type before
        launching the system preview. This causes an annoying delay.

        Instead, assume that the system preview is one of the handled
        mime types and launch the viewer immediately. If it gets something it
        didn't expect, it will show an error.

        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::didStart):
        (WebKit::DownloadClient::didReceiveResponse):
        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
        (WebKit::SystemPreviewController::start): Small cleanup to ensure we
        don't try to present twice (this shouldn't happen).

2018-05-15  Dean Jackson  <dino@apple.com>

        Post-review cleanup for 185459
        https://bugs.webkit.org/show_bug.cgi?id=185665
        <rdar://problem/40276689>

        Reviewed by Tim Horton.

        Jon made some comments in 185459 that I'm addressing here.

        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/DownloadClient.mm: Guard the activity token for iOS
        in a way that means it will still work ok on macOS.
        (WebKit::DownloadClient::didStart):
        (WebKit::DownloadClient::processDidCrash):
        (WebKit::DownloadClient::didFinish):
        (WebKit::DownloadClient::didFail):
        (WebKit::DownloadClient::didCancel):
        (WebKit::DownloadClient::takeActivityToken):
        (WebKit::DownloadClient::releaseActivityTokenIfNecessary):
        (WebKit::DownloadClient::releaseActivityToken): Deleted.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Add an early return.
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):

2018-05-15  Tadeu Zagallo  <tzagallo@apple.com>

        Update touch event tracking types on every touch
        https://bugs.webkit.org/show_bug.cgi?id=184250
        <rdar://problem/39145092>

        Reviewed by Geoffrey Garen.

        The tracking types for touch events were only update on touchstart, which meant that event
        listeners added after the touchstart would always be treated as passive, even if explicitly
        setting passive to false.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleTouchEventSynchronously):
        (WebKit::WebPageProxy::handleTouchEvent):

2018-05-15  Per Arne Vollan  <pvollan@apple.com>

        Pause display links when window is not visible.
        https://bugs.webkit.org/show_bug.cgi?id=185627
        <rdar://problem/39401106>

        Reviewed by Simon Fraser.

        Pause/resume display links created in the UI process when the window is hidden/shown.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dispatchActivityStateChange):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::pause):
        (WebKit::DisplayLink::resume):
        * UIProcess/mac/DisplayLink.h:

2018-05-15  Dean Jackson  <dino@apple.com>

        Provide UIView and UIImage for zoom transition
        https://bugs.webkit.org/show_bug.cgi?id=185655
        <rdar://problem/40267224>

        Reviewed by Antoine Quint.

        Provide a UIView* for the frameForPreviewItem to use as a source view.
        Also implement the transitionImageForPreviewItem delegate, even though
        we're returning nil.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
        (-[_WKPreviewControllerDelegate previewController:transitionImageForPreviewItem:contentRect:]):

2018-05-15  Daniel Bates  <dabates@apple.com>

        Fix the Apple Internal build

        Make a similar change to WebKit as I did for LegacyWebKit in r231777. See <rdar://problem/40237873> for more details.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController enterFullScreen:]):
        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
        (-[WKFullScreenWindowController exitFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
        (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
        (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
        (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):

2018-05-15  Megan Gardner  <megan_gardner@apple.com>

        Clear selections from web content with single tap
        https://bugs.webkit.org/show_bug.cgi?id=185634

        Reviewed by Tim Horton.
        
        With the switch to the single text selection assistant, we were not correctly clearing the selection when a
        single tap happened.

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

2018-05-15  Antoine Quint  <graouts@apple.com>

        [Web Animations] Expose Web Animations CSS integration as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=185647

        Reviewed by Dean Jackson.

        Rename the Web Animations CSS integration flag.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
        (WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
        (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
        (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
        (-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
        (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
        (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
        (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
        * WebProcess/InjectedBundle/InjectedBundle.h:

2018-05-15  Dean Jackson  <dino@apple.com>

        Update animation when presenting QuickLook
        https://bugs.webkit.org/show_bug.cgi?id=185648
        <rdar://problem/39652624>

        Reviewed by Antoine Quint.

        Implement the QuickLook delegate on _WKPreviewControllerDelegate that
        produces a zoom-like animation when the QLPreviewController appears.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
        * UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
        the delegate implementation can access the presentingViewController.
        (WebKit::SystemPreviewController::page):

2018-05-14  Dean Jackson  <dino@apple.com>

        Download and present System Preview
        https://bugs.webkit.org/show_bug.cgi?id=185459
        <rdar://problem/40079228>

        Reviewed by Tim Horton.

        Extend DownloadClient so that it can handle the case where
        the download was triggered by a System Preview. In this situation
        the result (and progress) are piped into QuickLook via the SystemPreviewController.

        The DownloadProxy class is also extended to handle the destination
        filename and the size of the content.

        Lastly, SystemPreviewController is updated to have a start(), show()
        and cancel() interface, and no longer adjusts page navigation.

        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
        doesn't have a download delegate, but instead needs to communicate with
        the SystemPreviewController, if one exists.
        (WebKit::DownloadClient::didStart):
        (WebKit::DownloadClient::didReceiveResponse):
        (WebKit::DownloadClient::didReceiveData):
        (WebKit::DownloadClient::didCreateDestination):
        (WebKit::DownloadClient::processDidCrash):
        (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
        (WebKit::DownloadClient::didFinish):
        (WebKit::DownloadClient::didFail):
        (WebKit::DownloadClient::didCancel):
        (WebKit::DownloadClient::releaseActivityToken):

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
        (-[_WKPreviewControllerDataSource initWithMIMEType:]):
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
        (-[_WKPreviewControllerDataSource setProgress:]):
        (-[_WKPreviewControllerDataSource finish:]):
        (-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
        (WebKit::SystemPreviewController::start):
        (WebKit::SystemPreviewController::updateProgress):
        (WebKit::SystemPreviewController::finish):
        (WebKit::SystemPreviewController::cancel):
        (-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
        (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
        (WebKit::SystemPreviewController::canPreview const): Deleted.
        (WebKit::SystemPreviewController::showPreview): Deleted.
        * UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
        and size. Also expose a helper to identify system preview downloads.
        (WebKit::DownloadProxy::destinationFilename const):
        (WebKit::DownloadProxy::setDestinationFilename):
        (WebKit::DownloadProxy::expectedContentLength const):
        (WebKit::DownloadProxy::setExpectedContentLength):
        (WebKit::DownloadProxy::bytesLoaded const):
        (WebKit::DownloadProxy::setBytesLoaded):
        (WebKit::DownloadProxy::isSystemPreviewDownload const):

        * UIProcess/SystemPreviewController.cpp: New API.
        (WebKit::SystemPreviewController::canPreview const):
        (WebKit::SystemPreviewController::sendPageBack): Deleted.
        (WebKit::SystemPreviewController::showPreview): Deleted.
        * UIProcess/SystemPreviewController.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues):
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:

2018-05-14  Brady Eidson  <beidson@apple.com>

        Add an API test to guard against regressions while re-entering setDefersLoading:.
        <rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630

        Reviewed by Chris Dumez.

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

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

2018-05-14  Tim Horton  <timothy_horton@apple.com>

        Use the system font by default in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=185638
        <rdar://problem/40230277>

        Reviewed by Wenson Hsieh.

        * Shared/WebPreferencesDefaultValues.h:

2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r231755.

        Change is not correct

        Reverted changeset:

        "-Wmemset-elt-size warning in LibWebRTCSocket constructor"
        https://bugs.webkit.org/show_bug.cgi?id=185555
        https://trac.webkit.org/changeset/231755

2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Google search results are excessively zoomed in
        https://bugs.webkit.org/show_bug.cgi?id=185347
        <rdar://problem/39999778>

        Reviewed by Tim Horton.

        Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
        propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
        extra zoom mode.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::disabledAdaptationsDidChange):
        * WebProcess/WebPage/WebPage.h:

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

        Overly aggressive timer throttling in service workers
        https://bugs.webkit.org/show_bug.cgi?id=185575
        <rdar://problem/40219038>

        Reviewed by Geoff Garen.

        After ~30 seconds, the system would put the service worker process in "App Nap",
        causing its timers to get aggressively throttled. This happens because the
        service worker processes are WebProcesses that have no visible WebPages.

        To address the issue, we now disable process suppression for all service worker
        processes. This causes those processes to construct a UserActivity which prevents
        App Nap.

        This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
        suppression logic in now all on ChildProcessProxy / ChildProcess.

        * NetworkProcess/NetworkProcess.messages.in:
        * PluginProcess/PluginProcess.messages.in:
        * Shared/ChildProcess.messages.in:
        * UIProcess/ChildProcessProxy.cpp:
        (WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
        * UIProcess/ChildProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/WebProcessProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.messages.in:

2018-05-14  Andy Estes  <aestes@apple.com>

        [Wi-Fi Assertions] Allow clients to specify a context identifier
        https://bugs.webkit.org/show_bug.cgi?id=185620
        <rdar://problem/39915196>

        Reviewed by Brady Eidson.

        Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
        context identifier.

        * 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 wirelessContextIdentifier]):
        (-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2018-05-11  Brian Burg  <bburg@apple.com>

        Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y
        https://bugs.webkit.org/show_bug.cgi?id=185571
        <rdar://problem/40180785>

        Reviewed by Timothy Hatcher.

        This code path was refactored to use completion handlers. It seems that the window.screenX/Y
        code path converts back to user coordinates but the WebDriver code path does not. Make them
        consistent since that is how it is spec'd and tested.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getWindowFrameWithCallback):
        Convert the window frame to user coordinate space so it's the same as window.screenY.

2018-05-14  Brian Burg  <bburg@apple.com>

        WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
        https://bugs.webkit.org/show_bug.cgi?id=185577
        <rdar://problem/40185478>

        Reviewed by Timothy Hatcher.

        This test is failing because it expects Release Actions to not emit any
        events if nothing has changed from the initial state. Because the two code paths
        for creating empty states don't actually produce the same empty state, a difference
        in location was detected between the two empty states. This generates a mousemove.

        To fix this, unify the code that creates an empty state. For mouse input sources, always
        initialize the location to (0, 0) so that the mouse input source always has
        a location that is valid to click at.

        * UIProcess/Automation/SimulatedInputDispatcher.h:
        Extract the type enum out of the class to avoid circular definitions of
        SimulatedInputSource and SimulatedInputSourceState.

        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputSourceState::emptyStateForSourceType):
        Take the input source type when generating an empty state. We always want location
        set for a mouse input source, but not set it for other input sources like keys.

        (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        (WebKit::SimulatedInputSource::create):
        (WebKit::SimulatedInputSource::SimulatedInputSource):
        (WebKit::SimulatedInputSourceState::emptyState): Deleted.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::WebAutomationSession):
        (WebKit::WebAutomationSession::inputSourceForType const):
        (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
        (WebKit::WebAutomationSession::performInteractionSequence):
        * UIProcess/Automation/WebAutomationSession.h:

2018-05-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        -Wmemset-elt-size warning in LibWebRTCSocket constructor
        https://bugs.webkit.org/show_bug.cgi?id=185555

        Reviewed by Youenn Fablet.

        Add missing multiplication.

        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
        (WebKit::LibWebRTCSocket::LibWebRTCSocket):

2018-05-14  Zan Dobersek  <zdobersek@igalia.com>

        [GTK] REGRESSION(r231170) Build broken with Clang 5.0
        https://bugs.webkit.org/show_bug.cgi?id=185198

        Reviewed by Michael Catanzaro.

        * Shared/RTCNetwork.h: With std::optional forward declaration gone,
        explicitly include the WTF Optional.h header.

2018-05-13  Dean Jackson  <dino@apple.com>

        WebKit2_Sim-7606.1.17.4 introduced dep cycle
        https://bugs.webkit.org/show_bug.cgi?id=185588
        <rdar://problem/40196581>

        Reviewed by Tim Horton.

        Soft link AssetViewer.framework to avoid a dependency cycle.

        * Configurations/WebKit.xcconfig:
        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):

2018-05-11  Daniel Bates  <dabates@apple.com>

        X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
        https://bugs.webkit.org/show_bug.cgi?id=185567
        <rdar://problem/40175008>

        Reviewed by Brent Fulgham.

        Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
        are same-origin with the document that delivered this header. This prevents an intermediary
        malicious frame from clickjacking a child frame whose document is same-origin with the top-
        level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
        the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
        
        Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
        with the top-level frame's document in order to be displayed. This prevents clickjacking by
        a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
        it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
        if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
        document same origin with the victim page. We should protect against such attacks.

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

2018-05-11  Dean Jackson  <dino@apple.com>

        WKWebViewContentProvider should know what MIME type it was created to handle
        https://bugs.webkit.org/show_bug.cgi?id=185574
        <rdar://problem/40183049>

        Reviewed by Tim Horton.

        Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's
        init method, so it can choose to do something based on that information. The
        PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But
        a WKSystemPreviewView can handle multiple types.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on
        to the WKWebViewContentProvider.
        * UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame.
        * UIProcess/ios/WKLegacyPDFView.mm:
        (-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]):
        (-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted.
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_initWithFrame:webView:mimeType:]):
        (-[WKPDFView web_initWithFrame:webView:]): Deleted.
        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use
        the MIME type to tell QuickLook what it will be getting, rather than basing it on
        the file extension.
        (-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted.

2018-05-11  Brent Fulgham  <bfulgham@apple.com>

        Allow the WebContent process to read global ViewBridge preferences
        https://bugs.webkit.org/show_bug.cgi?id=185569
        <rdar://problem/40164339>

        Reviewed by Eric Carlson.

        Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file.

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

2018-05-11  Megan Gardner  <megan_gardner@apple.com>

        Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
        https://bugs.webkit.org/show_bug.cgi?id=185536

        Reviewed by Tim Horton.
        
        The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.
        Remove the check for a webSelection and clean up the logic surrounding those checks.

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

2018-05-11  Brady Eidson  <beidson@apple.com>

        Followup to: Make sure history navigations reuse the existing process when necessary.
        https://bugs.webkit.org/show_bug.cgi?id=185532

        Reviewed by Andy Estes.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process,
          don't change the policy action.

2018-05-11  Charles Vazac  <cvazac@gmail.com>

        Runtime feature flag for Server-Timing
        https://bugs.webkit.org/show_bug.cgi?id=184758

        Reviewed by Youenn Fablet.

        * Shared/WebPreferences.yaml: Added ServerTimingEnabled.
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesGetServerTimingEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
        * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.

2018-05-11  Antti Koivisto  <antti@apple.com>

        Network process should not stat() all cache files on startup to find their sizes
        https://bugs.webkit.org/show_bug.cgi?id=185542
        <rdar://problem/40092953>

        Reviewed by Chris Dumez.

        This is done to compute how much disk space a cache is using. While the operation happens
        in a background priority thread it is still quite a bit of work.

        Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by
        estimating their size instead of counting it exactly.

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

            Use size estimation if blob storage is in use.
            Remove the code that would delete empty files. Normal cache shrinking handles this.

        (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):

2018-05-11  Brady Eidson  <beidson@apple.com>

        Make sure history navigations reuse the existing process when necessary.
        <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532

        Reviewed by Ryosuke Niwa.

        If a view navigates to either a data: or blob: URL, it reuses the existing process.
 
        In such cases we need to also ensure that history navigations back will also reuse the existing process.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const):
        (WebKit::NavigationActionData::decode):
        * Shared/NavigationActionData.h:

        * UIProcess/API/APINavigation.h:
        (API::Navigation::setTargetItem):

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration pageCacheEnabled]):
        (-[_WKProcessPoolConfiguration setPageCacheEnabled:]):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both
          came from the same process, then reuse the existing process.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

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

        REGRESSION(r231057): Encrypted media content playback failures
        https://bugs.webkit.org/show_bug.cgi?id=185537
        <rdar://problem/40038478>

        Reviewed by Eric Carlson.

        Put access to the SecurityServer back in the sandbox so we can validate the
        signatures of media encoder/decoders.

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

2018-05-11  Youenn Fablet  <youenn@apple.com>

        NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge
        https://bugs.webkit.org/show_bug.cgi?id=185522
        <rdar://problem/39987152>

        Reviewed by Brent Fulgham.

        In case of such challenge, refuse to proceed with authentication since preflight is not using credentials.
        Previously, we were failing right away which is not right in case preflight is the request triggering the connection.

        Manually tested.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):

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

        Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
        https://bugs.webkit.org/show_bug.cgi?id=185412

        Reviewed by Ryosuke Niwa.

        Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks()
        instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):
        (WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const):
        (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
        (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted.
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/WebPage/WebPage.cpp:

2018-05-10  Timothy Horton  <timothy_horton@apple.com>

        Fix the build after r231393
        ​https://bugs.webkit.org/show_bug.cgi?id=185519
        <rdar://problem/40131741>

        * Configurations/WebKit.xcconfig:

2018-05-10  John Wilander  <wilander@apple.com>

        Storage Access API: Extend lifetime of cookies on successful user approval
        https://bugs.webkit.org/show_bug.cgi?id=185534
        <rdar://problem/40064547>

        Reviewed by Brent Fulgham.

        * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
        (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
            Picks up the experimental feature flag.
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
            Now updates the domain's user interaction timestamp if the user was
            prompted for this access.
        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        [iOS] Release page load process assertion if the screen is locked
        https://bugs.webkit.org/show_bug.cgi?id=185333

        Reviewed by Geoff Garen.

        We normally take a background process assertion during page loads to allow them to complete
        even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
        is caused by the screen locking. Keeping the process assertion in this case would prevent the
        whole device from sleeping longer than it should, thus negatively impacting power.

        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationState):
        (WebKit::NavigationState::releaseNetworkActivityToken):
        (WebKit::NavigationState::didChangeIsLoading):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackground):

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

        Remove Unused Chinese/Japanese Reanalyze code
        https://bugs.webkit.org/show_bug.cgi?id=185529

        Reviewed by Wenson Hsieh.
        
        The code for this has actually been completely removed from UIKit. This is unreachable 
        dead code that should be removed if just for cleanliness. 

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _reanalyzeForWebView:]): Deleted.

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

        [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
        https://bugs.webkit.org/show_bug.cgi?id=185318

        Reviewed by Geoffrey Garen.

        Whenever there is a page load going on, we take a background process assertion to delay process
        suspension until this load completes. However, there is also a 3 seconds grace period after
        a load is complete to allow the app to trigger a new load shortly after. This grace period was
        introduced to support use cases where a visible app does loads in an offscreen view. However,
        it can be abused by apps running in the background as they could trigger new page loads while
        in the background to delay process suspension. This patch tightens the policy so that only
        apps that are currently visible get to use this grace period. Apps that are in the background
        get to finish their current load and will then get suspended.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::didChangeIsLoading):

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

        'Cross-Origin-Options header implementation follow-up
        https://bugs.webkit.org/show_bug.cgi?id=185520

        Reviewed by Ryosuke Niwa.

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

2018-05-10  Per Arne Vollan  <pvollan@apple.com>

        Drop-down Control borders missing.
        https://bugs.webkit.org/show_bug.cgi?id=185500
        <rdar://problem/40093461>

        Reviewed by Brent Fulgham.

        Open sandbox for reading of some files in temp folder.

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

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

        [MediaStream, iOS] Don't check authorizationStatusForMediaType when using mock capture devices
        https://bugs.webkit.org/show_bug.cgi?id=185516
        <rdar://problem/36328191>

        Reviewed by Youenn Fablet.

        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Don't check
        +[AVCaptureDevice authorizationStatusForMediaType:] when using mock capture devices.

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

        REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes
        https://bugs.webkit.org/show_bug.cgi?id=185515
        <rdar://problem/39627764>

        Reviewed by Chris Fleizach.

        The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the
        WebContent processes that screen properties have changed.

        This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.

        Tested manually with the Accessibility preferences pane.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification
        is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes.
        (WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function.
        * UIProcess/WebProcessPool.h:

2018-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: implement advance user interactions
        https://bugs.webkit.org/show_bug.cgi?id=174616

        Reviewed by Brian Burg.

        Handle origin in case of mouse move transitions.

        * UIProcess/Automation/Automation.json: Add MouseMoveOrigin enum and pass it as parameter of InputSourceState
        together with optional node handle. Also pass the frame handle to performInteractionSequence command to find the
        node in the current browsing context.
        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
        (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources): Ensure we reset the location.
        (WebKit::SimulatedInputDispatcher::resolveLocation): Helper to resolve destination location based on current
        location and mouse move origin.
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Use resolveLocation() in mouse transitions.
        (WebKit::SimulatedInputDispatcher::run): Receive and save the frame ID.
        (WebKit::SimulatedInputDispatcher::finishDispatching): Reset the frame ID.
        * UIProcess/Automation/SimulatedInputDispatcher.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::computeElementLayout): Use even numbers for the callback ID to not conflict with
        viewportInViewCenterPointOfElement() callbacks.
        (WebKit::WebAutomationSession::didComputeElementLayout): Handle computeElementLayout() or
        viewportInViewCenterPointOfElement() requests by calling the right callback depending on whether the ID is odd
        or even number.
        (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement): Send ComputeElementLayout message to the
        WebProcess using odd numbers for the callback ID to not conflict with computeElementLayout() callbacks.
        (WebKit::WebAutomationSession::performInteractionSequence): Handle the mouse origin and element handle.
        (WebKit::WebAutomationSession::cancelInteractionSequence): Pass the frame ID to the input dispatcher.
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSessionMacros.h:

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

        Remove the unused HAVE_OS_ACTIVITY
        https://bugs.webkit.org/show_bug.cgi?id=185501

        Reviewed by Wenson Hsieh.

        * config.h:

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

        Add initial support for 'Cross-Origin-Options' HTTP response header
        https://bugs.webkit.org/show_bug.cgi?id=184996
        <rdar://problem/39664620>

        Reviewed by Geoff Garen.

        * Shared/WebPreferences.yaml:
        Add this as an experimental feature, on by default.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::frameBecameRemote):
        Make sure we pass the cross-origin options from the local Window
        to the remote one when transitioning.

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

        [Extra zoom mode] fast/viewport/extrazoom/viewport-change-min-device-width.html sometimes fails
        https://bugs.webkit.org/show_bug.cgi?id=185490
        <rdar://problem/40097629>

        Reviewed by Tim Horton.

        This test is currently flaky due to incorrect logic when computing the unobscured content rect, in the slice of
        time after a frame load has been committed, and before the first visible content rect update from the UI process
        after the frame load has been committed.

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

        In the case where !m_hasReceivedVisibleContentRectsAfterDidCommitLoad, we try to set the unobscured content size
        to be the view size divided by the initial scale. However, in extra zoom mode, `ViewportConfiguration`'s
        `minimumLayoutSize()` is the layout size, which is larger than the size of the view by default, so dividing this
        by the initial scale yields a bogus value. Instead, use `viewLayoutSize()` instead.

        (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):

        We also try to divide the view size by the initial scale when computing the effective viewport size for `vw` and
        `vh`. Additionally, fix the misleading name of a variable (largestUnobscuredRect) that stores a size.

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

        Restrict unarchiving of bundle parameters to a set of known classes
        https://bugs.webkit.org/show_bug.cgi?id=185489
        <rdar://problem/21912401>

        Reviewed by Ryosuke Niwa.

        Stop accepting anything derived from NSObject, and instead only agree to unarchive objects
        from a set of things we actually pass as InjectedBundle parameters.

        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::setBundleParameter):

2018-05-09  Richard Houle  <rhoule@apple.com>

        [Cocoa] Some fields are not identified as [WKWebProcessPlugInNodeHandle isTextField]
        https://bugs.webkit.org/show_bug.cgi?id=185260
        <rdar://problem/39290394>

        INPUT element are not considered to be text fields when
        calling -[WKWebProcessPlugInNodeHandle isTextField]
        when they are of type number.

        Reviewed by Tim Horton.

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::InjectedBundleNodeHandle::isTextField const):

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

        Allow WebResourceLoader to cancel a load served from a service worker
        https://bugs.webkit.org/show_bug.cgi?id=185274

        Reviewed by Chris Dumez.

        Use FetchIdentifier instead of uint64_t.
        Add IPC support for cancelling a fetch from WebProcess to service worker process.
        Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
        No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
        A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
        or to abort reading the readable stream.

        * Scripts/webkit/messages.py:
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::cancelFetch):
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::didReceiveFetchResponse):
        (WebKit::WebSWServerConnection::didReceiveFetchData):
        (WebKit::WebSWServerConnection::didReceiveFetchFormData):
        (WebKit::WebSWServerConnection::didFinishFetch):
        (WebKit::WebSWServerConnection::didFailFetch):
        (WebKit::WebSWServerConnection::didNotHandleFetch):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didFailFetch):
        (WebKit::StorageProcess::didNotHandleFetch):
        (WebKit::StorageProcess::didReceiveFetchResponse):
        (WebKit::StorageProcess::didReceiveFetchData):
        (WebKit::StorageProcess::didReceiveFetchFormData):
        (WebKit::StorageProcess::didFinishFetch):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::remove):
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::create):
        (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
        (WebKit::ServiceWorkerClientFetch::start):
        (WebKit::ServiceWorkerClientFetch::cancel):
        * WebProcess/Storage/ServiceWorkerClientFetch.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::startFetch):
        (WebKit::WebSWClientConnection::cancelFetch):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::cancelFetch):
        (WebKit::WebSWContextManagerConnection::startFetch):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
        (WebKit::WebServiceWorkerFetchTaskClient::cancel):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::handleFetch):
        (WebKit::WebServiceWorkerProvider::cancelFetch):
        (WebKit::WebServiceWorkerProvider::fetchFinished):
        * WebProcess/Storage/WebServiceWorkerProvider.h:

2018-05-09  Andy Estes  <aestes@apple.com>

        [iOS] Consider the annotation bounds when positioning action sheets near long-pressed PDF links
        https://bugs.webkit.org/show_bug.cgi?id=185472
        <rdar://problem/39967092>

        Reviewed by Daniel Bates.

        Adopted new PDFHostViewControllerDelegate methods that include annotation rects
        when URLs and page indices are long-pressed. This allows us to avoid obscuring
        annotations when positioning action sheet popovers.

        We also no longer need to convert the press location into host view coordinate
        space, as PDFKit now does that for us.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
        (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:withAnnotationRect:]):
        (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:withAnnotationRect:]):
        (-[WKPDFView _showActionSheetForURL:atLocation:]): Deleted.
        (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]): Deleted.
        (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]): Deleted.

2018-05-09  Andy Estes  <aestes@apple.com>

        [iOS] Tell PDFHostViewController when animated resizes begin and end
        https://bugs.webkit.org/show_bug.cgi?id=185477
        <rdar://problem/39875372>

        Reviewed by Anders Carlsson.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        * UIProcess/Cocoa/WKWebViewContentProvider.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_beginAnimatedResize]):
        (-[WKPDFView web_endAnimatedResize]):

2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>

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

        * wpe/NEWS: Added. Add release notes for 2.21.1.

2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Build cleanly with GCC 8 and ICU 60
        https://bugs.webkit.org/show_bug.cgi?id=185462

        Reviewed by Carlos Alberto Lopez Perez.

        * Platform/IPC/glib/GSocketMonitor.cpp:
        (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
        * Shared/API/glib/WebKitContextMenu.cpp:
        (webkit_context_menu_new_with_items): Ditto.

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

        Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
        https://bugs.webkit.org/show_bug.cgi?id=185261
        <rdar://problem/37214391>

        Reviewed by Chris Dumez.

        By adopting new async SPI _savecookies, we can keep networking process active(not suspended)
        until cookies are fully synced to disk with process assertion.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didSyncAllCookies):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::syncAllCookies):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didClose):
        (WebKit::NetworkProcessProxy::syncAllCookies):
        (WebKit::NetworkProcessProxy::didSyncAllCookies):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::syncNetworkProcessCookies):

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

        Set colorspace in the PDF plugin.
        https://bugs.webkit.org/show_bug.cgi?id=185445
        <rdar://problem/40030981>

        Reviewed by Simon Fraser.

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

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

        Don't clear selection until we are actually interacting with a Node.
        https://bugs.webkit.org/show_bug.cgi?id=185455

        Reviewed by Wenson Hsieh.
        
        The presence of TextInteractionAssistant should not be used as a proxy for it we are actually editing content.
        We need to check to see if we have an active node, and then we should clear the selection.

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

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

        Unreviewed, rolling out r231486.

        Caused service worker LayoutTest failures on macOS Debug WK2.

        Reverted changeset:

        "Allow WebResourceLoader to cancel a load served from a
        service worker"
        https://bugs.webkit.org/show_bug.cgi?id=185274
        https://trac.webkit.org/changeset/231486

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

        [iOS] _WKWebViewPrintFormatter should return a page count of 0 for PDF documents that do not allow printing
        https://bugs.webkit.org/show_bug.cgi?id=185133

        Reviewed by Andreas Kling.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _ensureDocumentForPrinting]):
        (-[WKPDFView _wk_pageCountForPrintFormatter:]):
        (-[WKPDFView _wk_printedDocument]):

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

        [iOS] WKPDFView remains in the view hierarchy after navigating away
        https://bugs.webkit.org/show_bug.cgi?id=185449
        <rdar://problem/39693469>

        Reviewed by Tim Horton.

        WKPDFView removes the PDF host view from the view hierarchy in its -dealloc
        method, and relies on WKWebView releasing its last reference in
        -_setHasCustomContentView:loadedMIMEType: when the user navigates.

        However, WKWPDFView was capturing a strong reference to self in the block passed
        to +[PDFHostViewController createHostView:forExtensionIdentifier:], and PDFKit
        (actually UIKit) is retaining this block beyond its being called. This results in
        the PDF host view remaining as a child of the WKScrollView even after the user
        navigates to another page.

        Changed the aforementioned block to a lambda that captures a weak reference to
        self to prevent WKPDFView from outliving the current navigation.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView retain]):
        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):

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

        Storage Access API: Make user opt-in sticky
        https://bugs.webkit.org/show_bug.cgi?id=185454
        <rdar://problem/40003946>

        Reviewed by Alex Christensen.

        This patch persists the user's choice to opt-in to access under specific domains.
        Such storage access should age out with the accessing domain's cookies and website
        data. The opt-in prompt is still an experimental feature.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
        (WebKit::WebResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt const):
        (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction const):
        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        Do not apply X-Frame-Options and CSP frame-ancestors to Quick Look-applicable responses in NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=185442
        <rdar://problem/40067209>

        Reviewed by Andy Estes.

        Just as we exempt responses in WebContent process that will be handled by Quick Look from the Content
        Security Policy frame-ancestors directive and X-Frame-Options checking we need to do the same when
        such checks are performed in NetworkProcess following r231479.

        HTTP responses that will be previewed using Quick Look are not considered web pages and are subject
        to the security model for Quick Look documents. That is, they are exempt from Content Security Policy
        and X-Frame-Options processing.

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

2018-05-08  Brian Burg  <bburg@apple.com>

        REGRESSION(r230743): Mousemove events are not coalesced properly, mousemove/drag is very laggy
        https://bugs.webkit.org/show_bug.cgi?id=185425
        <rdar://problem/39323336>

        Reviewed by Simon Fraser.

        When mousemove events come in faster than they can be processed, we should coalesce
        pending mousemoves that have not yet been sent to WebProcess. This has the effect of
        processing the most recent mousemove location, which is the old behavior that regressed.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleMouseEvent):
        If there is >1 event in the mouse queue, then the first one is being processed by WebProcess
        and the second one is eligible for coalescing. Replace it if the last event and new event
        are both mousemoves.

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

        The PDF context menu should not be created in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=185401

        Reviewed by Tim Horton.

        Send a sync IPC message from the WebContent process to the UI process with the necessary context
        menu information when the menu is requested. The NSMenu will then be created and shown in the
        UI process. The reply will contain the selected menu item index.

        * Shared/mac/PDFContextMenu.h: Added.
        (WebKit::PDFContextMenuItem::encode const):
        (WebKit::PDFContextMenuItem::decode):
        (WebKit::PDFContextMenu::encode const):
        (WebKit::PDFContextMenu::decode):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/WebPageProxyMac.mm:
        (-[WKPDFMenuTarget menuItem]):
        (-[WKPDFMenuTarget contextMenuAction:]):
        (WebKit::WebPageProxy::showPDFContextMenu):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::handleContextMenuEvent):

2018-05-08  Dean Jackson  <dino@apple.com>

        System Preview links should trigger a download
        https://bugs.webkit.org/show_bug.cgi?id=185439
        <rdar://problem/40065545>

        Reviewed by Jon Lee.

        Encode the new field identifying a system preview. And
        if you encounter such a resource request, trigger
        a download.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceRequest>::encode):
        (IPC::ArgumentCoder<ResourceRequest>::decode):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

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

        Storage Access API: Add a request roundtrip to check whether prompting is needed
        https://bugs.webkit.org/show_bug.cgi?id=185368
        <rdar://problem/40011556>

        Reviewed by Alex Christensen and Youenn Fablet.

        This patch adds an enum WebKit::StorageAccessStatus to handle our three access
        states:
        - WebKit::StorageAccessStatus::CannotRequestAccess.
            This means the domain is blocked from cookie access.
        - WebKit::StorageAccessStatus::RequiresUserPrompt.
            This means that access has not been granted yet and a prompt is required.
        - WebKit::StorageAccessStatus::HasAccess.
            This either means that this domain does not need to ask for access,
            access was already granted, or access was granted now.

        If the call to WebResourceLoadStatisticsStore::requestStorageAccess() comes
        back as WebKit::StorageAccessStatus::RequiresUserPrompt, the WebPageProxy
        prompts the user and if the user said yes, calls a direct
        WebResourceLoadStatisticsStore::grantStorageAccess().

        Existing test cases pass because requestStorageAccessConfirm in WKPage.cpp
        does not have m_client.requestStorageAccessConfirm and thus returns true.

        * UIProcess/Network/NetworkProcessProxy.messages.in:
            Added a missing #endif.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestStorageAccess):
            Here we now handle the various cases encoded in WebKit::StorageAccessStatus.
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
            Now covers the optional prompt case.
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
            Granting access is broken out to allow WebKit::WebPageProxy to call it
            directly.
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::requestStorageAccess):
        (WebKit::WebsiteDataStore::grantStorageAccess):
            Piping through calls from from WebKit::WebResourceLoadStatisticsStore
            to WebKit::WebPageProxy.
        * UIProcess/WebsiteData/WebsiteDataStore.h:

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

        Unreviewed, rolling out r231376 and r231458.

        Caused some API tests failures on iOS

        Reverted changesets:

        "[iOS] Apps that are not visible may not get suspended if they
        trigger page loads while in the background"
        https://bugs.webkit.org/show_bug.cgi?id=185318
        https://trac.webkit.org/changeset/231376

        "[iOS] Release page load process assertion if the screen is
        locked"
        https://bugs.webkit.org/show_bug.cgi?id=185333
        https://trac.webkit.org/changeset/231458

2018-05-08  Dean Jackson  <dino@apple.com>

        Use thumbnails in System Previews
        https://bugs.webkit.org/show_bug.cgi?id=185397
        <rdar://problem/40039376>

        Reviewed by Jon Lee.

        A system preview that goes through the WKWebViewContentProvider will
        show a static thumbnail/snapshot of the item, rather than jumping
        directly to QuickLook.

        This means we have to link to the AssetViewer framework. That provides
        a ASVThumbnailView that will trigger QuickLook for us.

        * Configurations/WebKit.xcconfig: Link to AssetViewer.

        * UIProcess/ios/WKSystemPreviewView.h: Better macro use. Remove some unneeded protocols.
        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Update this
        to use an ASVThumbnailView, when on the internal SDK (because it is private).
        (-[WKSystemPreviewView _layoutThumbnailView]): Use the content insets to put
        the thumbnail in the right place.
        (-[WKSystemPreviewView thumbnailView:wantsToPresentPreviewController:forItem:]):
        Delegate method.
        (-[WKSystemPreviewView web_contentView]):
        (-[WKSystemPreviewView web_computedContentInsetDidChange]):
        (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): Deleted.
        (-[WKSystemPreviewView previewController:previewItemAtIndex:]): Deleted.
        (-[WKSystemPreviewView previewControllerWillDismiss:]): Deleted.

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

        Allow WebResourceLoader to cancel a load served from a service worker
        https://bugs.webkit.org/show_bug.cgi?id=185274

        Reviewed by Chris Dumez.

        Use FetchIdentifier instead of uint64_t.
        Add IPC support for cancelling a fetch from WebProcess to service worker process.
        Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled.
        No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed.
        A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load
        or to abort reading the readable stream.

        * Scripts/webkit/messages.py:
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::cancelFetch):
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::didReceiveFetchResponse):
        (WebKit::WebSWServerConnection::didReceiveFetchData):
        (WebKit::WebSWServerConnection::didReceiveFetchFormData):
        (WebKit::WebSWServerConnection::didFinishFetch):
        (WebKit::WebSWServerConnection::didFailFetch):
        (WebKit::WebSWServerConnection::didNotHandleFetch):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didFailFetch):
        (WebKit::StorageProcess::didNotHandleFetch):
        (WebKit::StorageProcess::didReceiveFetchResponse):
        (WebKit::StorageProcess::didReceiveFetchData):
        (WebKit::StorageProcess::didReceiveFetchFormData):
        (WebKit::StorageProcess::didFinishFetch):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::remove):
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::create):
        (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
        (WebKit::ServiceWorkerClientFetch::start):
        (WebKit::ServiceWorkerClientFetch::cancel):
        * WebProcess/Storage/ServiceWorkerClientFetch.h:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::startFetch):
        (WebKit::WebSWClientConnection::cancelFetch):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::cancelFetch):
        (WebKit::WebSWContextManagerConnection::startFetch):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
        (WebKit::WebServiceWorkerFetchTaskClient::cancel):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::handleFetch):
        (WebKit::WebServiceWorkerProvider::cancelFetch):
        (WebKit::WebServiceWorkerProvider::fetchFinished):
        * WebProcess/Storage/WebServiceWorkerProvider.h:

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

        Don't use mapped cache files in case of Class A/B protected app
        https://bugs.webkit.org/show_bug.cgi?id=185422
        <rdar://problem/34001688>

        Reviewed by Chris Dumez.

        Currently we don't use shared memory maps in these cases. This still leaves us open for crashes
        in the network process when the device is locked.

        This patch disables use of blob storage (mapped cache files) in apps that use class A/B protection.
        Normally we use blobs for resources > 16KB. Since use of shared memory is already disabled,
        the only optimization lost for these apps is body data deduplication.

        Any existing cache entries with blobs are ignored and deleted. New entries are created with
        body data inlined with the metadata.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::Cache::store):
        * NetworkProcess/cache/NetworkCache.h:
        (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const): Deleted.
        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):

            Remove the code the prevented use of shared memory in these cases. Non-mapped Data objects
            are never shareable.

        (WebKit::NetworkCache::Entry::setNeedsValidation):
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
        (WebKit::NetworkCache::canUseSharedMemoryForPath): Deleted.
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::Storage):
        (WebKit::NetworkCache::Storage::mayContainBlob const):
        (WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):
        (WebKit::NetworkCache::shouldStoreBodyAsBlob): Deleted.
        * NetworkProcess/cache/NetworkCacheStorage.h:
        (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData const): Deleted.

2018-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Add missing exit not included in r231298.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureWebToStorageProcessConnection):

2018-05-07  Daniel Bates  <dabates@apple.com>

        Check X-Frame-Options and CSP frame-ancestors in network process
        https://bugs.webkit.org/show_bug.cgi?id=185410
        <rdar://problem/37733934>

        Reviewed by Ryosuke Niwa.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const): Always encode the frame ancestor origins.
        (WebKit::NetworkResourceLoadParameters::decode): Always decode the frame ancestor origins.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Added.
        (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): Added.
        (WebKit::NetworkResourceLoader::didReceiveResponse): Check if the load needs to be interrupted due
        to a violation of the CSP frame-ancestors directive or X-Frame-Options. If there is a violation
        then stop the load.
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Ditto.
        (NetworkResourceLoader::addConsoleMessage): Added.
        (NetworkResourceLoader::sendCSPViolationReport): Added.
        * NetworkProcess/NetworkResourceLoader.h:
        * Scripts/webkit/messages.py: Teach the generator about data types MessageLevel and MessageSource
        as they are both defined in file JavaScriptCore/ConsoleTypes.h as opposed to independent headers.
        Also tell the generator that these types should not be forward declared so that we can use these
        types without their JSC:: prefix in WebPage.messages.in.
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage): Route WebPage messages to the appropriate
        web page.
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Added message StopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied.
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Added.
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.messages.in:
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::addConsoleMessage):
        * WebProcess/WebPage/WebFrame.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::addConsoleMessage): Added.
        (WebKit::WebPage::sendCSPViolationReport): Added.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in: Add messages AddConsoleMessage and SendCSPViolationReport
        for adding a console message to Web Inspector and sending a CSP report, respectively.

2018-05-07  Daniel Bates  <dabates@apple.com>

        Abstract logic to log console messages and send CSP violation reports into a client
        https://bugs.webkit.org/show_bug.cgi?id=185393
        <rdar://problem/40036053>

        Reviewed by Brent Fulgham.

        For now, build a URL from the source origin associated with the NetworkResourceLoader
        and pass this to the ContentSecurityPolicy constructor.

        Additionally, make NetworkLoadChecker::contentSecurityPolicy() non-const since it returns
        a non-const pointer to a ContentSecurityPolicy object; => callers can mutate this object
        right from under NetworkLoadChecker. Making this non-const makes this clear to a reader.
        Also remove the mutable keyword from the definition of NetworkLoadChecker::m_contentSecurityPolicy.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::contentSecurityPolicy):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy const): Deleted.
        * NetworkProcess/NetworkLoadChecker.h:

2018-05-07  Alex Christensen  <achristensen@webkit.org>

        WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
        https://bugs.webkit.org/show_bug.cgi?id=185403

        Reviewed by Brent Fulgham.

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

2018-05-07  Chris Dumez  <cdumez@apple.com>

        [iOS] Release page load process assertion if the screen is locked
        https://bugs.webkit.org/show_bug.cgi?id=185333

        Reviewed by Geoffrey Garen.

        We normally take a background process assertion during page loads to allow them to complete
        even if the tab / app is backgrounded. We should however avoid doing so when the backgrounding
        is caused by the screen locking. Keeping the process assertion in this case would prevent the
        whole device from sleeping longer than it should, thus negatively impacting power.

        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationState):
        (WebKit::NavigationState::releaseNetworkActivityToken):
        (WebKit::NavigationState::didChangeIsLoading):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::applicationDidEnterBackground):

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

        Add experimental feature to prompt for Storage Access API use
        https://bugs.webkit.org/show_bug.cgi?id=185335
        <rdar://problem/39994649>

        Reviewed by Alex Christensen and Youenn Fablet.

        Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
        Storage Access API is invoked.

        Currently this feature doesn't have any user-visible impact.

        * Shared/API/APIObject.h:
        * Shared/API/c/WKBase.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/APIUIClient.h:
        (API::UIClient::requestStorageAccessConfirm):
        * UIProcess/API/C/WKPage.cpp:
        (WebKit::RequestStorageAccessConfirmResultListener::create):
        (WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener):
        (WebKit::RequestStorageAccessConfirmResultListener::call):
        (WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener):
        (WKPageRequestStorageAccessConfirmResultListenerGetTypeID):
        (WKPageRequestStorageAccessConfirmResultListenerCall):
        (WKPageSetPageUIClient):
        * UIProcess/API/C/WKPageUIClient.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _storageAccessPromptsEnabled]):
        (-[WKPreferences _setStorageAccessPromptsEnabled:]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestStorageAccessConfirm):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebPreferences.cpp:
        (WebKit::WebPreferences::update):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::requestStorageAccess):

2018-05-07  Dean Jackson  <dino@apple.com>

        Use a dark gray for system preview bbackground
        https://bugs.webkit.org/show_bug.cgi?id=185391
        <rdar://problem/40035120>

        Reviewed by Eric Carlson.

        Throw some darker shade at this view.

        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_initWithFrame:webView:]):

2018-05-07  Don Olmstead  <don.olmstead@sony.com>

        [Win] Add missing methods to WebChromeClient
        https://bugs.webkit.org/show_bug.cgi?id=185325

        Reviewed by Brent Fulgham.

        * WebProcess/WebCoreSupport/WebChromeClient.h:

2018-05-07  Megan Gardner  <megan_gardner@apple.com>

        Allow Web Touch events to timeout
        https://bugs.webkit.org/show_bug.cgi?id=185282

        Reviewed by Tim Horton.
        
        This is backwards, fixing.

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

2018-05-07  Don Olmstead  <don.olmstead@sony.com>

        [Win] LoggingWin is missing includes
        https://bugs.webkit.org/show_bug.cgi?id=185326

        Reviewed by Per Arne Vollan.

        * Platform/win/LoggingWin.cpp:

2018-05-07  Daniel Bates  <dabates@apple.com>

        CSP should be passed the referrer
        https://bugs.webkit.org/show_bug.cgi?id=185367

        Reviewed by Per Arne Vollan.

        Pass the referrer through NetworkLoadChecker so that it can pass it to the ContentSecurityPolicy
        object it instantiates.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::create):
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):

2018-05-07  Daniel Bates  <dabates@apple.com>

        Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
        https://bugs.webkit.org/show_bug.cgi?id=185170

        Reviewed by Per Arne Vollan.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::clearResourceCaches):
        (WebKit::WebProcess::deleteWebsiteData):

2018-05-07  Brian Burg  <bburg@apple.com>

        Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
        https://bugs.webkit.org/show_bug.cgi?id=184861
        <rdar://problem/39153768>

        Reviewed by Timothy Hatcher.

        We need to track how many frontends are attached to the web page (both local and remote).
        InspectorController propagates this out to WebKit via InspectorClient. This is then
        kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
        new process for a navigation, return early with "no" if any frontends are open for the
        page being navigated.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
        (WebKit::WebPageProxy::inspectorFrontendCount const):
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::frontendCountChanged):
        * WebProcess/WebCoreSupport/WebInspectorClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::inspectorFrontendCountChanged):
        * WebProcess/WebPage/WebPage.h:

2018-05-04  Tim Horton  <timothy_horton@apple.com>

        Shift to a lower-level framework for simplifying URLs
        https://bugs.webkit.org/show_bug.cgi?id=185334

        Reviewed by Dan Bernstein.

        * Configurations/WebKit.xcconfig:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController _updateLocationInfo]):

2018-05-04  Per Arne Vollan  <pvollan@apple.com>

        Shutdown WindowServer connections after checking in with launch services
        https://bugs.webkit.org/show_bug.cgi?id=185082
        <rdar://problem/39613173>

        Reviewed by Brent Fulgham.

        When WindowServer access is blocked in the WebContent process, we should shutdown all connections
        after checking in with launch services.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2018-05-04  Don Olmstead  <don.olmstead@sony.com>

        [Win][WebKit] Fix forwarding headers for Windows build
        https://bugs.webkit.org/show_bug.cgi?id=184412

        Reviewed by Alex Christensen.

        * PlatformWin.cmake:
        * UIProcess/API/APIAttachment.h:
        * UIProcess/API/APIContextMenuClient.h:
        * UIProcess/API/C/WKProcessTerminationReason.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:

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

        [iOS] Apps that are not visible may not get suspended if they trigger page loads while in the background
        https://bugs.webkit.org/show_bug.cgi?id=185318

        Reviewed by Geoffrey Garen.

        Whenever there is a page load going on, we take a background process assertion to delay process
        suspension until this load completes. However, there is also a 3 seconds grace period after
        a load is complete to allow the app to trigger a new load shortly after. This grace period was
        introduced to support use cases where a visible app does loads in an offscreen view. However,
        it can be abused by apps running in the background as they could trigger new page loads while
        in the background to delay process suspension. This patch tightens the policy so that only
        apps that are currently visible get to use this grace period. Apps that are in the background
        get to finish their current load and will then get suspended.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::didChangeIsLoading):

2018-05-04  Per Arne Vollan  <pvollan@apple.com>

        Adjust sandbox profile for simulator.
        https://bugs.webkit.org/show_bug.cgi?id=185319

        Reviewed by Brent Fulgham.

        Disable Kerberos rules, as well as rules related to NSApplication initialization.

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

2018-05-04  Tim Horton  <timothy_horton@apple.com>

        Wasted time dlopening Lookup when tearing down a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=185310
        <rdar://problem/39934085>

        Reviewed by Wenson Hsieh.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKWindowVisibilityObserver dealloc]):
        (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
        (WebKit::WebViewImpl::prepareForDictionaryLookup):
        (-[WKWindowVisibilityObserver startObservingLookupDismissal]): Deleted.
        Avoid un-registering as a Lookup dismissal observer if we never
        registered in the first place, because that involves dlopening Lookup.

2018-05-04  Megan Gardner  <megan_gardner@apple.com>

        Allow Web Touch events to timeout
        https://bugs.webkit.org/show_bug.cgi?id=185282
        <rdar://problem/38728319>

        Reviewed by Tim Horton.
        
        Web Touch events currently never time out, which blocks the user from interacting with the UI Process at all.
        We should allow these events to time out so that the user can interact with the rest of the UI.

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

2018-05-04  Wenson Hsieh  <whsieh@berkeley.edu>

        REGRESSION: [ios-simulator] 3 WKWebViewAutofillTests API test failures seen with 11.3 SDK
        https://bugs.webkit.org/show_bug.cgi?id=184196
        <rdar://problem/39054481>

        Reviewed by Tim Horton.

        Remove an unnecessary call to NSClassFromString, now that trunk WebKit only supports iOS 11.3+.

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

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

        NetworkProcessProxy::didReceiveAuthenticationChallenge should take an AuthenticationChallenge r-value
        https://bugs.webkit.org/show_bug.cgi?id=185302

        Reviewed by Geoffrey Garen.

        Pass AuthenticationChallenge as an r-value since it comes from IPC.
        No change of behavior.

        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
        (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
        * UIProcess/Authentication/AuthenticationChallengeProxy.h:
        (WebKit::AuthenticationChallengeProxy::create):
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
        * UIProcess/Downloads/DownloadProxy.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        * UIProcess/Network/NetworkProcessProxy.h:

2018-05-04  Sihui Liu  <sihui_liu@apple.com>

        Assertion failure in NetworkStorageSession::setCookie: privilege of UI process is not set
        https://bugs.webkit.org/show_bug.cgi?id=185262

        Reviewed by Chris Dumez.

        Fix an assertion failure by setting UI process privileges in constructor of WebsiteDataStore
        because UI process may use the cookie API before creating a WebView.

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

2018-05-04  Per Arne Vollan  <pvollan@apple.com>

        Adjust sandbox rules for simulator.
        https://bugs.webkit.org/show_bug.cgi?id=185275

        Reviewed by Brent Fulgham.

        Enable rules related to CoreMedia for minimal simulator.

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

2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
        https://bugs.webkit.org/show_bug.cgi?id=174730

        Reviewed by Michael Catanzaro.

        The problem is that we don't send any User-Agent HTTP header for downloads started by WebProcessPool::download().

        * UIProcess/API/glib/WebKitDownload.cpp:
        (webkitDownloadUpdateRequest): Helper to update the cached request.
        (webkitDownloadStarted): Updated the cached request if we have one.
        (webkit_download_get_request): Use webkitDownloadUpdateRequest().
        * UIProcess/API/glib/WebKitDownloadClient.cpp:
        * UIProcess/API/glib/WebKitDownloadPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download): Set the User-Agent HTTP header if there isn't any.

2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Some event tests failing after r230817
        https://bugs.webkit.org/show_bug.cgi?id=185072

        Reviewed by Michael Catanzaro.

        Do not send mouse move events to the WebProcess for crossing events during testing. WTR never generates crossing
        events and they can confuse tests.

        Fixes: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
               fast/css/user-drag-none.html
               fast/events/context-activated-by-key-event.html
               fast/events/drag-selects-image.html
               fast/events/dropzone-005.html
               fast/events/mouse-click-events.html
               fast/events/mouse-cursor-change.html

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseCrossingNotifyEvent):

2018-05-03  Chris Dumez  <cdumez@apple.com>

        More aggressively terminate child processes when the connection to their parent process is severed
        https://bugs.webkit.org/show_bug.cgi?id=177972
        <rdar://problem/33317607>

        Reviewed by Geoff Garen.

        More aggressively terminate child processes when the connection to their parent process is severed.
        Previously, we would dispatch to the main thread and then exit the process. This would sometimes
        cause the process to say alive for 10 seconds until our watchdog would forcefully terminate the
        process. This could happen in particular when the main thread is blocked on a synchronous IPC.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didClose): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::didClose): Deleted.
        * PluginProcess/PluginProcess.h:
        * Shared/ChildProcess.cpp:
        (WebKit::ChildProcess::didClose):
        (WebKit::didCloseOnConnectionWorkQueue):
        (WebKit::ChildProcess::terminationTimerFired):
        * Shared/ChildProcess.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didClose): Deleted.
        * StorageProcess/StorageProcess.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::didClose): Deleted.
        * WebProcess/WebProcess.h:

2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use default std::optional if it is provided
        https://bugs.webkit.org/show_bug.cgi?id=185159

        Reviewed by Michael Catanzaro.

        * Shared/SandboxExtension.h:
        (WebKit::SandboxExtension::Handle::decode):
        * Shared/TouchBarMenuItemData.cpp:
        (WebKit::TouchBarMenuItemData::decode):

2018-05-03  Justin Fan  <justin_fan@apple.com>

        [WebGL] Add runtime flag for enabling ASTC support in WebGL
        https://bugs.webkit.org/show_bug.cgi?id=184840

        Reviewed by Myles C. Maxfield.

        Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.

        * Shared/WebPreferences.yaml:

2018-05-03  Keith Rollin  <krollin@apple.com>

        Unreviewed build fix after <https://trac.webkit.org/changeset/231282>.

        * NetworkProcess/NetworkActivityTracker.h:

2018-05-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Ads in NYTimes app are shifted downwards by the scroll view's top content inset
        https://bugs.webkit.org/show_bug.cgi?id=185251
        <rdar://problem/39062357>

        Reviewed by Tim Horton.

        The NYTimes app embeds advertisements in each article's WKWebView by adding views in the WKScrollView's view
        hierarchy. These views are positioned using the bounding client rects of elements in the DOM (via Element
        ::getBoundingClientRect). Prior to r229641, WebKit would report bounding client rects inset by the content
        insets of WKScrollView, which means that if a top content inset X is specified on the scroll view, an element
        that is flush against the top of the viewport will have a bounding client rect top of -X (when it should really
        be 0).

        To account for this, NYTimes adds the scroll view content insets back to the bounding client rect when
        determining the position of each advertisement which, after r229641, causes these views to be shifted downwards
        by an amount equal to the scroll view content inset top.

        This new behavior does not affect Safari, since Safari uses SPI to explicitly set obscured insets. As such, we
        address this by gating the scroll view content inset fix with a linked-on-or-after check.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _computedObscuredInset]):
        * UIProcess/Cocoa/VersionChecks.h:

2018-05-03  Chris Dumez  <cdumez@apple.com>

        Load hangs if the WebProcess fails to launch
        https://bugs.webkit.org/show_bug.cgi?id=185225
        <rdar://problem/38249058>

        Reviewed by Geoff Garen.

        When a process fails to launch, ChildProcessProxy::didFinishLaunching() gets called with an
        invalid connection identifier. While NetworkProcessProxy::didFinishLaunching() properly deals with
        this situation, WebProcessProxy::didFinishLaunching() does not. As a result, we do not attempt to
        relaunch the process, we do not notify the client and WebPageProxy::m_isValid stays true.

        This patch thus updates WebProcessProxy::didFinishLaunching() to check if the connection identifier
        is valid and treats it as a crash. As a result, the WebPageProxies properly reset their state and
        the client gets notified of the crash so that it can attempt to reload.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _makeNextWebProcessLaunchFailForTesting]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        Add SPI to make the next WebProcess launch fail, for the purpose of API testing.

        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getLaunchOptions):
        (WebKit::WebProcessProxy::didClose):
        (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
        (WebKit::WebProcessProxy::didFinishLaunching):
        * UIProcess/WebProcessProxy.h:

2018-05-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r231223 and r231288.
        https://bugs.webkit.org/show_bug.cgi?id=185256

        The change in r231223 breaks internal builds, and r231288 is a
        dependent change. (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "Use default std::optional if it is provided"
        https://bugs.webkit.org/show_bug.cgi?id=185159
        https://trac.webkit.org/changeset/231223

        "Use pointer instead of
        std::optional<std::reference_wrapper<>>"
        https://bugs.webkit.org/show_bug.cgi?id=185186
        https://trac.webkit.org/changeset/231288

2018-05-03  Per Arne Vollan  <pvollan@apple.com>

        An error message is written to stderr when the WebContent process is blocking WindowServer access.
        https://bugs.webkit.org/show_bug.cgi?id=184701

        Reviewed by Brent Fulgham.

        Calling 'setApplicationIsDaemon(true)' instead of 'CGSSetDenyWindowServerConnections(true)' to disable
        access to the WindowServer in the WebContent process, will remove this error message. After this change,
        the url of the WebContent process is still showing up in Activity Monitor, which previously was a
        problem when calling 'setApplicationIsDaemon(true)'.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess):

2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r231253.

        The API test added with this change is crashing on the bots.

        Reverted changeset:

        "Web Inspector: opt out of process swap on navigation if a Web
        Inspector frontend is connected"
        https://bugs.webkit.org/show_bug.cgi?id=184861
        https://trac.webkit.org/changeset/231253

2018-05-03  Brent Fulgham  <bfulgham@apple.com>

        Re-eneable Network Extension support in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=185236
        <rdar://problem/39883004>

        Reviewed by Eric Carlson.

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

2018-05-03  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r231014): Entitlements are not applied to XPC services on macOS
        https://bugs.webkit.org/show_bug.cgi?id=185241

        Reviewed by Dan Bernstein.

        * Configurations/BaseXPCService.xcconfig:
        * Configurations/WebContentService.Development.xcconfig:
        * Configurations/WebContentService.xcconfig:

2018-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
        https://bugs.webkit.org/show_bug.cgi?id=183348

        Reviewed by Michael Catanzaro.

        When connection doesn't exit in case of sync message failure, always exit in case of failing to send
        GetNetworkProcessConnection or GetStorageProcessConnection messages. This can happen when the WebView is created
        and destroyed quickly.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):
        (WebKit::WebProcess::ensureWebToStorageProcessConnection):

2018-05-02  Nan Wang  <n_wang@apple.com>

        AX: Missing kAXSWebAccessibilityEventsEnabledNotification causes a crash
        https://bugs.webkit.org/show_bug.cgi?id=185237

        Reviewed by Dan Bernstein.

        When libAccessibility.dylib is missing, the compiler would optimize out the global
        notification and lead to a crash. Fixed it by using the isNullFunction check instead,
        since we are sure the global notification would be there when the corresponding function 
        is available.

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

2018-05-02  Keith Rollin  <krollin@apple.com>

        Add facility for tracking times and results of page and resource loading
        https://bugs.webkit.org/show_bug.cgi?id=184838
        <rdar://problem/36548974>

        Reviewed by Brent Fulgham.

        Add NetworkActivityTracker. The idea behind this facility is to create
        and destroy them around networking activity that we want to track for
        the purpose of measuring overall network health. They can be created
        around the loading of pages or individual resources, and can be
        arranged in a parent/child hierarchy to indicate what pages the
        resources are part of. The NetworkActivity tracker tracks load times
        and results. On Cocoa, it can be integrated with CFNetwork in order to
        associate WebKit activity with low-level networking activity.

        * CMakeLists.txt:
        * Configurations/WebKit.xcconfig:
        * NetworkProcess/NetworkActivityTracker.cpp: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
        (WebKit::NetworkActivityTracker::NetworkActivityTracker):
        (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
        (WebKit::NetworkActivityTracker::setParent):
        (WebKit::NetworkActivityTracker::start):
        (WebKit::NetworkActivityTracker::complete):
        * NetworkProcess/NetworkActivityTracker.h: Added.
        (WebKit::NetworkActivityTracker::getPlatformObject):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didClose):
        (WebKit::NetworkConnectionToWebProcess::pageLoadCompleted):
        (WebKit::networkActivityTrackingEnabled):
        (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopTrackingResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTracking):
        (WebKit::NetworkConnectionToWebProcess::stopAllNetworkActivityTrackingForPage):
        (WebKit::NetworkConnectionToWebProcess::findRootNetworkActivity):
        (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::ResourceNetworkActivityTracker::ResourceNetworkActivityTracker):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create):
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::trackNetworkActivity const):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::cleanup):
        (WebKit::NetworkResourceLoader::abort):
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFailLoading):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cocoa/NetworkActivityTrackerCocoa.mm: Added.
        (WebKit::NetworkActivityTracker::NetworkActivityTracker):
        (WebKit::NetworkActivityTracker::~NetworkActivityTracker):
        (WebKit::NetworkActivityTracker::setParent):
        (WebKit::NetworkActivityTracker::start):
        (WebKit::NetworkActivityTracker::complete):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationTrackNetworkActivity):
        (WKContextConfigurationSetTrackNetworkActivity):
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration trackNetworkActivity]):
        (-[_WKProcessPoolConfiguration setTrackNetworkActivity:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::pageLoadCompleted):
        * WebProcess/Network/WebLoaderStrategy.h:

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

        Open audio/video sandbox services for minimal simulator
        https://bugs.webkit.org/show_bug.cgi?id=185217
        <rdar://problem/39918909>

        Reviewed by Per Arne Vollan.

        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/com.apple.WebProcess.sb.in:

2018-05-02  Daniel Bates  <dabates@apple.com>

        Cleanup NetworkResourceLoader::didReceiveResponse()
        https://bugs.webkit.org/show_bug.cgi?id=185209

        Reviewed by Chris Dumez.

        Use early returns to make the control flow easier to read and reason about. Disregarding a
        From-Origin violation, NetworkResourceLoader::didReceiveResponse() only returns NetworkLoadClient::ShouldContinueDidReceiveResponse::No
        when the load is for a main resource and hence it must wait for the embedding client to allow
        the load before continuing with it. With regards to a From-Origin violation, the network
        process schedules to fail the load in a subsequent turn of the event loop before returning
        NetworkLoadClient::ShouldContinueDidReceiveResponse::No. It return NetworkLoadClient::ShouldContinueDidReceiveResponse::No
        solely to tell the NetworkLoadClient to defer assuming the load is allowed (because we will
        fail it on the next turn of the event loop).

        Additionally, remove all logging about the return value as we no longer have a need for
        such logging.

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

2018-05-02  Alex Christensen  <achristensen@webkit.org>

        Add WKWebsiteDataStorePrivate._proxyConfiguration SPI
        https://bugs.webkit.org/show_bug.cgi?id=185179

        Reviewed by Andy Estes.

        * NetworkProcess/NetworkSessionCreationParameters.h:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode):
        (IPC::decode):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _setProxyConfiguration:]):
        (-[WKWebsiteDataStore _proxyConfiguration]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::setProxyConfiguration):
        (WebKit::WebsiteDataStore::proxyConfiguration):

2018-05-02  Youenn Fablet  <youenn@apple.com>

        Use NetworkLoadChecker for navigation loads
        https://bugs.webkit.org/show_bug.cgi?id=184892
        <rdar://problem/39652686>

        Reviewed by Chris Dumez.

        Compute whether a response is same origin in no-cors case.
        This allows providing more precise filtering.
        In case of navigate loads, set the tainting to basic which will make filtering to the minimum.

        Pass the sourceOrigin for navigation loads as well.
        Enable to restrict HTTP response access for navigation load.

        Content Blockers are disabled for now in NetworkLoadChecker for navigation loads.
        They should be reenabled as a follow-up.

        Add a specific case to allow any redirection to about:// URLs.
        While this does not conform with the spec, this keeps the existing WebKit behavior.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::validateResponse):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):
        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const):
        We only do security checks if this runtime flag is on.
        * WebProcess/Network/WebLoaderStrategy.h:

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

        Make EncryptedMediaAPIEnabled an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=185212

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:

2018-05-02  Per Arne Vollan  <pvollan@apple.com>

        Adjust sandbox profile in simulator mode.
        https://bugs.webkit.org/show_bug.cgi?id=185172
        <rdar://problem/39876860>

        Reviewed by Brent Fulgham.

        Fix some sandbox violations.

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

2018-05-02  Brian Burg  <bburg@apple.com>

        Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
        https://bugs.webkit.org/show_bug.cgi?id=184861
        <rdar://problem/39153768>

        Reviewed by Ryosuke Niwa.

        We need to track how many frontends are attached to the web page (both local and remote).
        InspectorController propagates this out to WebKit via InspectorClient. This is then
        kept in UIProcess as a member of WebPageProxy. When making a decision whether to use a
        new process for a navigation, return early with "no" if any frontends are open for the
        page being navigated.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::didChangeInspectorFrontendCount):
        (WebKit::WebPageProxy::inspectorFrontendCount const):
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::frontendCountChanged):
        * WebProcess/WebCoreSupport/WebInspectorClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::inspectorFrontendCountChanged):
        * WebProcess/WebPage/WebPage.h:

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

        Adopt -destinationWindowToExitFullScreenForWindow:
        https://bugs.webkit.org/show_bug.cgi?id=185204
        <rdar://problem/22486621>

        Reviewed by Eric Carlson.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController destinationWindowToExitFullScreenForWindow:]):

2018-05-02  Per Arne Vollan  <pvollan@apple.com>

        Disable Media capture rules in sandbox for simulator.
        https://bugs.webkit.org/show_bug.cgi?id=185206
        <rdar://problem/39910015>

        Reviewed by Eric Carlson.

        These rules are not relevant in this case.

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

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

        [iOS] Provide audio route information when invoking AirPlay picker
        https://bugs.webkit.org/show_bug.cgi?id=185199
        <rdar://problem/39853103>

        Reviewed by Jer Noble.

        * Scripts/webkit/messages.py:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::showPlaybackTargetPicker):  Pass route sharing policy and routing context UID.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Take same.
        (-[WKContentView _showPlaybackTargetPicker:fromRect:]): Deleted.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.

        * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
        (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Take same.
        (-[WKAirPlayRoutePicker showFromView:]): Deleted.

        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::showPlaybackTargetPicker):

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

        Get the WebKit.framework bundle by asking for WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=185175

        Reviewed by Tim Horton.

        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeSandbox):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox):
        * StorageProcess/mac/StorageProcessMac.mm:
        (WebKit::StorageProcess::initializeSandbox):

2018-05-02  Youenn Fablet  <youenn@apple.com>

        Cannot gather srflx or relay ICE candidates on IPv6 network (ICE agent hangs?)
        https://bugs.webkit.org/show_bug.cgi?id=181009
        <rdar://problem/36144555>

        Reviewed by Eric Carlson.

        On iOS/IPv6 networks, STUN servers name resolution returns a zero IPv6 IP address.
        No error is raised which leads to sending STUN requests with that IP address.
        Once the request times out, the ICE candidate gathering finishes with host candidates only.

        This patch makes WebRTC DNS resolver to send only IPv4 resolved addresses.
        STUN is used for NAT traversal which is for IPv4 addresses.
        Not sending IPv6 addresses allows terminating ICE candidate gathering sooner.

        Manually tested on iOS with IPv4/IPv6 and IPv6 networks.

        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
        (WebKit::resolvedName):

2018-05-02  Youenn Fablet  <youenn@apple.com>

        CacheStorage::Engine should keep a list of initialization callback
        https://bugs.webkit.org/show_bug.cgi?id=185184
        <rdar://problem/38875651>

        Reviewed by Antti Koivisto.

        Keep each initialize callback in a Vector so as to compute the salt only once.
        Call all callbacks then in a loop.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::~Engine):
        (WebKit::CacheStorage::Engine::initialize):
        * NetworkProcess/cache/CacheStorageEngine.h:

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

        Pipe volume through PlaybackSessionManager/Proxy.
        https://bugs.webkit.org/show_bug.cgi?id=185182

        Reviewed by Eric Carlson.

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

2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use default std::optional if it is provided
        https://bugs.webkit.org/show_bug.cgi?id=185159

        Reviewed by JF Bastien.

        * Shared/SandboxExtension.h:
        (WebKit::SandboxExtension::Handle::decode):
        * Shared/TouchBarMenuItemData.cpp:
        (WebKit::TouchBarMenuItemData::decode):

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

        Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
        https://bugs.webkit.org/show_bug.cgi?id=185171

        Reviewed by Timothy Hatcher.

        * Configurations/BaseTarget.xcconfig:

2018-05-01  Per Arne Vollan  <pvollan@apple.com>

        Use correct runloop type in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=185140

        Reviewed by Brent Fulgham.

        Use WK_MACOS_* machinery to determine runloop type for the WebContent process.

        * Configurations/WebContentService.xcconfig:

2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>

        WebAssembly: add support for stream APIs - JavaScript API
        https://bugs.webkit.org/show_bug.cgi?id=183442

        Reviewed by Yusuke Suzuki and JF Bastien.

        Add WEBASSEMBLY_STREAMING_API feature flag

        * Configurations/FeatureDefines.xcconfig:

2018-04-30  Per Arne Vollan  <pvollan@apple.com>

        Use correct runloop type in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=185140
        <rdar://problem/39585037>

        Reviewed by Brent Fulgham.

        The macOS target version should be used to determine the runloop type.

        * Configurations/WebContentService.xcconfig:

2018-04-30  Michael Saboff  <msaboff@apple.com>

        Eliminate WebProcessShim.dylib
        https://bugs.webkit.org/show_bug.cgi?id=185147

        Reviewed by Ryosuke Niwa.

        * Configurations/WebContentService.xcconfig:
        * Configurations/WebProcessShim.xcconfig: Removed.
        * WebKit.xcodeproj/project.pbxproj:

2018-04-30  Michael Saboff  <msaboff@apple.com>

        Remove unused mac/CookieStorageShimLibrary
        https://bugs.webkit.org/show_bug.cgi?id=185146

        Reviewed by Alex Christensen.

        * Shared/mac/CookieStorageShimLibrary.cpp: Removed.
        * Shared/mac/CookieStorageShimLibrary.h: Removed.
        * WebKit.xcodeproj/project.pbxproj:

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

        Add WKUIDelegatePrivate equivalent of WKPageContextMenuClient getContextMenuFromProposedMenuAsync
        https://bugs.webkit.org/show_bug.cgi?id=180955

        Reviewed by Andy Estes.

        * UIProcess/API/APIContextMenuClient.h:
        (API::ContextMenuClient::menuFromProposedMenu):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):

2018-04-30  JF Bastien  <jfbastien@apple.com>

        Use some C++17 features
        https://bugs.webkit.org/show_bug.cgi?id=185135

        Reviewed by Alex Christensen.

        As discussed here [0] let's move WebKit to a subset of C++17. We
        now require GCC 6 [1] which means that, according to [2] we can
        use the following C++17 language features (I removed some
        uninteresting ones):

         - New auto rules for direct-list-initialization
         - static_assert with no message
         - typename in a template template parameter
         - Nested namespace definition
         - Attributes for namespaces and enumerators
         - u8 character literals
         - Allow constant evaluation for all non-type template arguments
         - Fold Expressions
         - Unary fold expressions and empty parameter packs
         - __has_include in preprocessor conditional
         - Differing begin and end types in range-based for
         - Improving std::pair and std::tuple

        Consult the Tony Tables [3] to see before / after examples.

        Of course we can use any library feature if we're willing to
        import them to WTF (and they don't require language support).


          [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
          [1]: https://trac.webkit.org/changeset/231152/webkit
          [2]: https://en.cppreference.com/w/cpp/compiler_support
          [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

        * Configurations/Base.xcconfig:
        * DerivedSources.make:
        * PlatformMac.cmake:

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

        [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
        https://bugs.webkit.org/show_bug.cgi?id=185132
        <rdar://problem/39834562>

        Reviewed by Tim Horton.

        Remove the experimental feature for `min-device-width`.

        * Shared/WebPreferences.yaml:

2018-04-30  Keith Rollin  <krollin@apple.com>

        Include breadcrumb for tracking resource loading into CFNetwork
        https://bugs.webkit.org/show_bug.cgi?id=184837
        rdar://problem/39575411

        Reviewed by Brent Fulgham.

        When starting the network-based loading of a resource, log the
        description provided by NetworkDataTask. On Cocoa, this is implemented
        to return the description property in NSURLSessionTask. This
        information better allows us to track a resource load through the
        WebContent process, the Networking process, and the Cocoa networking
        layers.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::description const):
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::description const):
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::description const):

2018-04-30  Andy Estes  <aestes@apple.com>

        [iOS] Try to unlock PDF documents before printing them
        https://bugs.webkit.org/show_bug.cgi?id=185084
        <rdar://problem/39356622>

        Reviewed by Dan Bernstein.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]):

        Stored the password that successfully unlocked the current PDF document.

        (-[WKPDFView _wk_printedDocument]):

        Used the stored password to unlock the CGPDFDocument we create for printing.

2018-04-28  Andy Estes  <aestes@apple.com>

        [iOS] Present an action sheet when long-pressing on PDF links
        https://bugs.webkit.org/show_bug.cgi?id=185093
        <rdar://problem/39356651>

        Reviewed by Dan Bernstein.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView dealloc]):

        Called -[WKActionSheetAssistant cleanupSheet].

        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):

        Created a WKActionSheetAssistant with the host view as the assistant view and
        ourselves as the delegate.

        (-[WKPDFView _URLWithPageIndex:]):

        Added. Creates a URL to the current page with a page number fragment appended.

        (-[WKPDFView _goToURL:atLocation:]):

        Added. Navigates to a URL with a synthetic mouse click at a location in host view
        coordinates.

        (-[WKPDFView pdfHostViewController:goToURL:]):
        (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):

        Called -_goToURL:atLocation:. Used -_URLWithPageIndex: to construct an NSURL from
        a page index.

        (-[WKPDFView _showActionSheetForURL:atLocation:]):

        Added. Populates _positionInformation with a URL and location and calls
        -[WKActionSheetAssistant showLinkSheet].

        (-[WKPDFView pdfHostViewController:didLongPressURL:atLocation:]):
        (-[WKPDFView pdfHostViewController:didLongPressPageIndex:atLocation:]):

        Called -_showActionSheetForURL:atLocation:. Used -_URLWithPageIndex: to construct
        an NSURL from a page index.

        (-[WKPDFView positionInformationForActionSheetAssistant:]):

        Returned _positionInformation.

        (-[WKPDFView actionSheetAssistant:performAction:]):

        Populated the pasteboard with plain text and URL representations of
        _positionInformation.url.

        (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):

        Called -_goToURL:atLocation.

        (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):

        Created a UIWKSelectionAssistant and called -showShareSheetFor:fromRect:.

        (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):

        Returned API::UIClient::shouldIncludeAppLinkActionsForElement().

        (-[WKPDFView actionSheetAssistant:decideActionsForElement:defaultActions:]):

        Returned API::UIClient::actionsForElement()l

2018-04-28  Andy Estes  <aestes@apple.com>

        [iOS] Allow com.apple.WebKit.Networking to look up com.apple.wifi.manager
        https://bugs.webkit.org/show_bug.cgi?id=185114
        <rdar://problem/39808763>

        Reviewed by Wenson Hsieh.

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

2018-04-28  Brent Fulgham  <bfulgham@apple.com>

        Revise sandboxes to allow additional IOKit property access
        https://bugs.webkit.org/show_bug.cgi?id=185095
        <rdar://problem/39809455>

        Reviewed by Eric Carlson.

        Update the WebContent and Plugin processes to allow additional IOKit property access.

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

2018-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebProcess from WebKitGtk+ 2.19.92 SIGSEVs in WebCore::TextureMapperGL::~TextureMapperGL
        https://bugs.webkit.org/show_bug.cgi?id=184040

        Reviewed by Michael Catanzaro.

        This can happen when using single shared process model or when the process limit is reached in multiple process
        model. In this case, all pages in the same web process with accelerated compositing enabled share the same
        compositing thread. Every page sets its GL context as current when rendering a frame, but not when invalidating
        the threaded compositor when the page is closed. So, if a hidden tab is closed, the threaded compositor is
        invalidated and the GL resources of the current context (the visible page) are destroyed. This is also causing
        the blank pages issue when closing a tab related to another one, the current one stops rendering anything because
        its GL context has been released. We should make the threaded compositor context current when invalidating it.

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

2018-04-27  Timothy Hatcher  <timothy@apple.com>

        REGRESSION: Touch events fail to dispatch to the page in all cases.

        https://bugs.webkit.org/show_bug.cgi?id=185097
        rdar://problem/39731995

        Reviewed by Tim Horton.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        Consult internal gesture recognizers, otherwise NO might get returned.

2018-04-26  Ryosuke Niwa  <rniwa@webkit.org>

        PSON: Triggering a navigation to an invalid URL creates a new WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=185066

        Reviewed by Youenn Fablet.

        Don't create a new WebContent process when the target URL is invalid as well as when the source URL is invalid.

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

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

        Use NetworkLoadChecker for XHR/fetch loads
        https://bugs.webkit.org/show_bug.cgi?id=184741

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
        Pass the preflight error as completion error if any.
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::willPerformHTTPRedirection):
        Set response source to Network so that checks relying on that are correct.
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::validateResponse):
        Adding Oppaqueredirect tainting.
        (NetworkLoadChecker::doesNotNeedCORSCheck):
        Adding a check to only activate CORS checks for CORS enabled schemes.
        Non CORS enabled schemes loads should have failed in WebProcess already.
        (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
        Remove Authorization header as done by SubresourceLoader.
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        If error is cancellation, we still want to call the completion handler.
        * NetworkProcess/NetworkResourceLoader.cpp:
        Activate network load checker for all types of loads.
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        Handle manual redirection by directly calling didReceiveResponse.

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

        Add an experimental feature flag for viewport "min-device-width"
        https://bugs.webkit.org/show_bug.cgi?id=185050
        <rdar://problem/39624038>

        Reviewed by Tim Horton.

        Add MinDeviceWidthEnabled as a new experimental feature, on by default in extra zoom mode and off elsewhere.

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

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

        UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
        https://bugs.webkit.org/show_bug.cgi?id=185079
        <rdar://problem/39794960>

        I inadvertently forgot to move the UIDelegate field webViewDidResignInputElementStrongPasswordAppearanceWithUserInfo
        outside the PLATFORM(MAC)-guard.

        * UIProcess/Cocoa/UIDelegate.h:

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

        UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance() is applicable to both Mac and iOS
        https://bugs.webkit.org/show_bug.cgi?id=185079
        <rdar://problem/39794960>

        Reviewed by Andy Estes.

        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):

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

        Rename minimumLayoutSize to viewLayoutSize
        https://bugs.webkit.org/show_bug.cgi?id=185050
        <rdar://problem/39624038>

        Reviewed by Tim Horton.

        Renames minimumLayoutSize to viewLayoutSize, since the minimum layout size in ViewportConfiguration is now
        different from the minimum layout size that is currently pushed down from the UI process (e.g. WKWebView SPI) in
        the case where `min-device-width` is used to override the minimum layout size.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        (-[WKWebView activeViewLayoutSize:]):
        (-[WKWebView _dispatchSetViewLayoutSize:]):
        (-[WKWebView _frameOrBoundsChanged]):
        (-[WKWebView _minimumLayoutSizeOverride]):
        (-[WKWebView _setViewLayoutSizeOverride:]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
        (-[WKWebView _clearOverrideLayoutParameters]):
        (-[WKWebView _minimumLayoutWidth]):
        (-[WKWebView _setMinimumLayoutWidth:]):
        (-[WKWebView activeMinimumLayoutSize:]): Deleted.
        (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
        (-[WKWebView _setMinimumLayoutSizeOverride:]): Deleted.
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): Deleted.

        Remove unused SPI that has been deprecated since iOS 9, has a simple drop-in replacement, and no longer has any
        internal clients.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
        (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
        (WebKit::WebViewImpl::setIntrinsicContentSize):
        * UIProcess/DrawingAreaProxy.h:
        (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange):
        (WebKit::DrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::setViewLayoutSize):
        (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::viewLayoutSize const):
        (WebKit::WebPageProxy::minimumLayoutSize const): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize):
        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize): Deleted.
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
        (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumLayoutSizeDidChange): Deleted.
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::WebPage::setViewLayoutSize):
        (WebKit::WebPage::setMinimumLayoutSize): Deleted.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::viewLayoutSize const):
        (WebKit::WebPage::minimumLayoutSize const): Deleted.
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):

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

        [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=185050
        <rdar://problem/39624038>

        Reviewed by Tim Horton.

        Remove the forceHorizontalViewportShrinkToFit and minimumAllowedLayoutWidth SPI hooks from WebKit, and
        additionally remove all logic for plumbing viewSize to WebCore. See WebCore/ChangeLog for more information.

        * Shared/VisibleContentRectUpdateInfo.cpp:
        (WebKit::VisibleContentRectUpdateInfo::encode const):
        (WebKit::VisibleContentRectUpdateInfo::decode):
        (WebKit::operator<<):
        * Shared/VisibleContentRectUpdateInfo.h:
        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
        (WebKit::VisibleContentRectUpdateInfo::allowShrinkToFit const):
        (WebKit::operator==):
        (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const): Deleted.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView activeMinimumLayoutSize:]):
        (-[WKWebView _dispatchSetMinimumLayoutSize:]):
        (-[WKWebView _frameOrBoundsChanged]):
        (-[WKWebView _setMinimumLayoutSizeOverride:]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (-[WKWebView _minimumAllowedLayoutWidth]): Deleted.
        (-[WKWebView _setMinimumAllowedLayoutWidth:]): Deleted.
        (-[WKWebView activeMinimumLayoutSizes:]): Deleted.
        (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]): Deleted.
        (-[WKWebView _setForceHorizontalViewportShrinkToFit:]): Deleted.
        (-[WKWebView _forceHorizontalViewportShrinkToFit]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::updateVisibleContentRects):

2018-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r230812): [WPE][GTK] WebKitWebViewSessionState.cpp throws away encoded BackForwardList identifier
        https://bugs.webkit.org/show_bug.cgi?id=184823

        Reviewed by Michael Catanzaro.

        Bump session sate format version to 2 and stop encoding the backfoward list item identifier, since it's always
        regenerated.

        * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
        (encodeBackForwardListItemState): Always encode version 2.
        (encodeBackForwardListState): Ditto.
        (encodeSessionState): Ditto.
        (decodeBackForwardListItemStateV1): Decode list item state for version 1.
        (decodeBackForwardListItemState): Receive the version and call decodeBackForwardListItemStateV1() if it's 1 or
        use the version 2 otherwise.
        (decodeSessionState): Load data for known formats and use the one that worked to decode it.

2018-04-26  Megan Gardner  <megan_gardner@apple.com>

        Add timeout for ensurePositionInformationIsUpToDate
        https://bugs.webkit.org/show_bug.cgi?id=184567

        Reviewed by Wenson Hsieh.
        
        We are having long hang times for WebKit, and this is one of the culprits.
        If we do not get an answer for positionInformation in a reasonable amount of time, we should timeout,
        so as to not hang the UI.

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

2018-04-26  Andy Estes  <aestes@apple.com>

        Try again to fix the iOS build after r231063.

        * Configurations/Base.xcconfig:

2018-04-26  Jer Noble  <jer.noble@apple.com>

        WK_COCOA_TOUCH the WK_ACCESSIBILITY_LDFLAGS
        https://bugs.webkit.org/show_bug.cgi?id=185007
        <rdar://problem/39735943>

        Reviewed by Timothy Hatcher.

        * Configurations/WebKit.xcconfig:

2018-04-26  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; fix iOS TAPI build step after r231063.

        * Configurations/WebKit.xcconfig:

2018-04-26  Jer Noble  <jer.noble@apple.com>

        WK_COCOA_TOUCH all the things.
        https://bugs.webkit.org/show_bug.cgi?id=185006

        Reviewed by Tim Horton.

        * Configurations/BaseTarget.xcconfig:
        * Configurations/WebKit.xcconfig:

2018-04-26  Daniel Bates  <dabates@apple.com>

        Remove WebCore::-qualifier in NetworkLoadChecker.cpp
        https://bugs.webkit.org/show_bug.cgi?id=185037

        Reviewed by Youenn Fablet.

        It is unncesssary to qualify WebCore types in NetworkLoadChecker.cpp as it has a
        "using namespace WebCore" directive.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::validateResponse):
        (WebKit::NetworkLoadChecker::continueCheckingRequest): Removed extra space character and unnecessary
        parentheses from the right-hand side of the assignment to m_storedCredentialsPolicy.
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):

2018-04-26  Daniel Bates  <dabates@apple.com>

        Rename NetworkLoadChecker::returnError() to NetworkLoadChecker::accessControlErrorForValidationHandler()
        https://bugs.webkit.org/show_bug.cgi?id=185035

        Reviewed by Youenn Fablet.

        Substitute NetworkLoadChecker::accessControlErrorForValidationHandler() for NetworkLoadChecker::returnError()
        to better describe that it is a convenience function that returns a wrapped ResourceError object,
        that represents an access control error, suitable to be passed directly to a validation handler.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection): Update as needed for renaming.
        (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): Use auto -> syntax to avoid the need to
        class-qualify the return type. Also renamed parameter from error to message as it represents the message/description
        for the access control error.
        (WebKit::NetworkLoadChecker::checkRequest): Update as needed for renaming. Also substitute "message" for "error"
        to match the argument of accessControlErrorForValidationHandler() with the same name.
        (WebKit::NetworkLoadChecker::continueCheckingRequest): Update as needed for renaming.
        (WebKit::NetworkLoadChecker::returnError): Deleted; renamed to accessControlErrorForValidationHandler().
        * NetworkProcess/NetworkLoadChecker.h:

2018-04-26  Jiewen Tan  <jiewen_tan@apple.com>

        Remove access to keychain from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=184428
        <rdar://problem/13150903>

        Part 3.

        Tighten WebContent Process' sandbox profile to all Security.framework services.

        Reviewed by Brent Fulgham.

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

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

        Make cross origin redirection error messages consistent between SubresourceLoader and NetworkLoadChecker
        https://bugs.webkit.org/show_bug.cgi?id=185023

        Reviewed by Chris Dumez.

        Align NetworkLoadChecker with what SubresourceLoader is doing so that we can keep WK1 and WK2 error messages as consistent as possible.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::validateResponse):

2018-04-25  Megan Gardner  <megan_gardner@apple.com>

        Activate selection when interacting with editable content
        https://bugs.webkit.org/show_bug.cgi?id=185017

        Reviewed by Tim Horton.
        
        Fixes a regression from r231016 where selection now does not work when interacting with
        editable content. When we go into editable content, we should turn on the assistant.
        This fulfills the requirement of user interaction as well, so any javascript selections
        after this point should be valid.

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

2018-04-26  Per Arne Vollan  <pvollan@apple.com>

        Disable content filtering in minimal simulator mode
        https://bugs.webkit.org/show_bug.cgi?id=185027
        <rdar://problem/39736091>

        Reviewed by Jer Noble.

        * Configurations/FeatureDefines.xcconfig:

2018-04-26  Brady Eidson  <beidson@apple.com>

        Add a setting for keeping around all processes and always reusing them per-origin.
        <rdar://problem/39695798> and https://bugs.webkit.org/show_bug.cgi?id=185020

        Reviewed by Andy Estes.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:

        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationAlwaysKeepAndReuseSwappedProcesses):
        (WKContextConfigurationSetAlwaysKeepAndReuseSwappedProcesses):
        * UIProcess/API/C/WKContextConfigurationRef.h:

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setAlwaysKeepAndReuseSwappedProcesses:]):
        (-[_WKProcessPoolConfiguration alwaysKeepAndReuseSwappedProcesses]):

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::SuspendedPageProxy::webProcessDidClose):
        (WebKit::SuspendedPageProxy::destroyWebPageInWebProcess):
        * UIProcess/SuspendedPageProxy.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::suspendedPageClosed):
        (WebKit::WebPageProxy::suspendedPageProcessClosed): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::suspendedPage const):

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::shouldTerminate):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::addProcessToOriginCacheSet):
        (WebKit::WebProcessPool::removeProcessFromOriginCacheSet):
        (WebKit::WebProcessPool::processForNavigation): If a swap will occur, cache the old process.
        (WebKit::WebProcessPool::processForNavigationInternal): Consider re-using a previously cached process.
        * UIProcess/WebProcessPool.h:

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

2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>

        [INTL] Implement Intl.PluralRules
        https://bugs.webkit.org/show_bug.cgi?id=184312

        Reviewed by JF Bastien.

        Added Intl.PluralRules feature flag.

        * Configurations/FeatureDefines.xcconfig:

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

        [GTK][WPE] Initial ASYNC_SCROLLING support
        https://bugs.webkit.org/show_bug.cgi?id=184961

        Reviewed by Carlos Garcia Campos.

        Guard RemoteScrollingCoordinator and RemoteScrollingCoordinatorProxy
        usage in WebChromeClient and WebPageProxy, respectively, with
        PLATFORM(COCOA) in addition to the ASYNC_SCROLLING guards.

        Despite enabling the code at build-time, the feature (as intended) is
        not yet used because of the DrawingArea rejection in the WebPage
        constructor.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::handleWheelEvent):
        (WebKit::WebPageProxy::updateTouchEventTracking):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::createScrollingCoordinator const):

2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
        https://bugs.webkit.org/show_bug.cgi?id=184643

        Reviewed by Žan Doberšek.

        Adapt to single-header WPE includes.

        Null-initialize padding to silence -Wmissing-field-initializers. (Yuck.)

        * Shared/NativeWebTouchEvent.h:
        * Shared/wpe/WebEventFactory.cpp:
        * UIProcess/API/glib/WebKitPrivate.cpp:
        * UIProcess/API/wpe/CompositingManagerProxy.cpp:
        * UIProcess/API/wpe/ScrollGestureController.h:
        * UIProcess/API/wpe/WPEView.cpp:
        (WKWPE::m_backend):
        * UIProcess/API/wpe/WebKitWebViewBackend.h:
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
        (WebKit::AcceleratedSurfaceWPE::initialize):

2018-04-25  Saam Barati  <sbarati@apple.com>

        dlopen the bundle's executable before calling -[NSBundle load] since that will also do a bunch of other things we don't need
        https://bugs.webkit.org/show_bug.cgi?id=184904

        Reviewed by Geoffrey Garen.

        Loading an NSBundle does a lot of work to find the principal class inside
        the bundle. This means it walks all the objective C class names loaded
        by the bundle. Doing this is *really* expensive.
        
        Some users of the injected bundle define a WKBundleInitialize function.
        In such a case, we don't need the principal class, so we can skip loading
        the NSBundle. Now, before we load the bundle, we dlopen and dlsym looking
        for the WKBundleInitialize function. If we find it, we skip loading
        the bundle. If we don't find the WKBundleInitialize function, we fall
        back to loading the bundle and finding the principal class.
        
        This speeds up initializeWebProcess by ~70ms on my MBP.

        * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
        (WebKit::InjectedBundle::initialize):

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

        Use NetworkLoadChecker for all subresource loads except fetch/XHR
        https://bugs.webkit.org/show_bug.cgi?id=184870
        <rdar://problem/39370034>

        Reviewed by Chris Dumez.

        Relax rules to check for non HTTP(s) redirections to throw only when WebProcess says to load it after redirection.
        This allows WebProcess to load redirected non HTTP(s) URLs, such as data URLs.
        We keep these checks when WebProcess asks to continue the load and for all PingLoads.

        Update error messages to be more consistent with WK1.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):
        (WebKit::NetworkLoadChecker::validateResourceResponse):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::shouldUseNetworkLoadChecker):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):

2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>

        PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
        https://bugs.webkit.org/show_bug.cgi?id=184962

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

        Build fix. Revert the change in r231019 to remove the empty URL and about:blank check here.
        These checks are for the source / originating URL, not the target URL.

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

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

        WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier should use DoNotProcessIncomingMessagesWhenWaitingForSyncReply
        https://bugs.webkit.org/show_bug.cgi?id=184978
        <rdar://problem/39667094>

        Reviewed by Simon Fraser.

        Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply to keep a consistent state after the sync IPC call.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
        (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):

2018-04-25  Jiewen Tan  <jiewen_tan@apple.com>

        Remove access to keychain from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=184428
        <rdar://problem/13150903>

        Reviewed by Brent Fulgham.

        This patch does the followings:
        1. Added necessary support to move HTMLKeygenElement's operation from WebContent Process to UI Process.
        2. Craft new SPI copySignedPublicKeyAndChallengeString to supply HTMLKeygenElement with dummy data such
        that WebKitTestRunner tests will not modify the underlying key store (e.g., the macOS Keychain).

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::signedPublicKeyAndChallengeString):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageNavigationClient):
        * UIProcess/API/C/WKPageNavigationClient.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

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

        [Extra zoom mode] The search field on www.bing.com is missing label text
        https://bugs.webkit.org/show_bug.cgi?id=184975
        <rdar://problem/39723081>

        Reviewed by Tim Horton.

        Adds support for displaying the "aria-label" attribute as the input view's label text in extra zoom mode. Also
        adds support for grabbing the input label's text for testing.

        Test: fast/forms/extrazoom/form-control-label-text.html

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView formInputLabel]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView formInputLabel]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>

        PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
        https://bugs.webkit.org/show_bug.cgi?id=184962

        Reviewed by Youenn Fablet.

        Don't create a new WebContent process when navigating to a blob object URL since doing so
        can result in a race condition in which the blog URL is removed from the blob registry of
        the network process by the time the navigation gets commited. This causes a failure in
        fast/dom/HTMLAnchorElement/anchor-download-unset.html and oher layout tests.

        In the future, the network process should verify that a given WebContent process has access
        to a given blob URL. For now, we rely on WebContent process to tell us whether it can
        navigate to a given blob URL or not.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const): Encode newly added treatAsSameOriginNavigation.
        (WebKit::NavigationActionData::decode): Ditto for decoding.
        * Shared/NavigationActionData.h:
        (WebKit::NavigationActionData::treatAsSameOriginNavigation): Added.
        * UIProcess/API/APINavigation.h:
        (API::Navigation::setTreatAsSameOriginNavigation): Added.
        (API::Navigation::treatAsSameOriginNavigation const): Added.
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction): Use the current process when
        treatAsSameOriginNavigation is set to true; i.e. when navigating to a blob URL the current
        document has access.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-04-25  Megan Gardner  <megan_gardner@apple.com>

        Don't activate Selection Assistant unless it is actually needed.
        https://bugs.webkit.org/show_bug.cgi?id=184944
        <rdar://problem/39469671>

        Reviewed by Tim Horton.
        
        Don't activate the selection unless we need to. Activating on init is overeager and allowing Javascript to 
        activate selections without user input.

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

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

        Fix entitlements and sandbox configurations in WebKit after r230778
        https://bugs.webkit.org/show_bug.cgi?id=184960
        <rdar://problem/39662827>

        Reviewed by Tim Horton.

        Build fixes for watchOS and tvOS after r230778.

        * Configurations/BaseXPCService.xcconfig:
        * Configurations/NetworkService.xcconfig:
        * Configurations/WebContentService.xcconfig:

2018-04-25  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed build fix after r231008.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create): Forgot to remove an unneeded constructor argument.

2018-04-25  Brent Fulgham  <bfulgham@apple.com>

        Don't Block First Party Cookies on Redirects
        https://bugs.webkit.org/show_bug.cgi?id=184948
        <rdar://problem/39534099>

        Reviewed by Youenn Fablet.

        Top-level navigations should not be subject to cookie blocking behavior. When performing redirects for main frame
        navigation we are blocking cookies, leading to site breakage.
        
        We need to keep track of which NetworkDataTasks are due to a main frame navigation. When a redirect is performed
        on the main frame, we should treat the new origin as the 'first party for cookies' and avoid blocking cookies for
        that URL.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::preconnectTo): Use the correct parameter type. We actually serialize
        NetworkResourceLoadParameters over IPC, so we should get access to all the members of this child class.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create): Pass new 'loadIsForNavigation' flag to create methods. 
        (WebKit::NetworkDataTask::NetworkDataTask): Capture 'loadIsForNavigation' in constructor.
        * NetworkProcess/NetworkDataTask.h:
        (WebKit::NetworkDataTask::isTopLevelNavigation const): Added.
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): Accept new constructor argument.
        * NetworkProcess/NetworkDataTaskBlob.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::willPerformHTTPRedirection): Retain requester value from old request during redirect.
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (NetworkResourceLoadParameters::decode): Update to pass new flag.
        (NetworkResourceLoadParameters::encode): Ditto.
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
        (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay): Accept new constructor argument.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Accept new constructor argument.
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): Accept new constructor argument.
        * NetworkProcess/curl/NetworkDataTaskCurl.h:
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Accept new constructor argument.
        * NetworkProcess/soup/NetworkDataTaskSoup.h:

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

        Ensure DNT is set for redirections handled in NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=184890

        Reviewed by Ryosuke Niwa.

        Compute whether DNT header should be set on requests based on:
        - request has a DNT header
        - session is ephemeral (aka private browsing mode)
        In both cases, we ensure a DNT header is added for any request triggered by a redirection.

        Covered by http/wpt/fetch/dnt-header-after-redirection.html.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::check):
        (WebKit::NetworkLoadChecker::prepareRedirectedRequest):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Remove deprecated functions and properties from the API
        https://bugs.webkit.org/show_bug.cgi?id=179295

        Reviewed by Žan Doberšek.

        * UIProcess/API/glib/WebKitCookieManager.cpp:
        * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp:
        * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
        (webkitNavigationPolicyDecisionGetProperty):
        (webkit_navigation_policy_decision_class_init):
        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty):
        (webKitSettingsGetProperty):
        (webkit_settings_class_init):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextGetProperty):
        (webkitWebContextSetProperty):
        (webkit_web_context_class_init):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_class_init):
        (webkitWebViewHandleAuthenticationChallenge):
        (webkitWebViewWebProcessTerminated):
        * UIProcess/API/wpe/WebKitCookieManager.h:
        * UIProcess/API/wpe/WebKitFormSubmissionRequest.h:
        * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h:
        * UIProcess/API/wpe/WebKitSettings.h:
        * UIProcess/API/wpe/WebKitWebContext.h:

2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, silence -Wreturn-type warning
        https://bugs.webkit.org/show_bug.cgi?id=184560

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

2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Miscellaneous build cleanups
        https://bugs.webkit.org/show_bug.cgi?id=184399

        Reviewed by Žan Doberšek.

        * PlatformGTK.cmake:

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

        Make a better flag for system preview, and disable it where necessary
        https://bugs.webkit.org/show_bug.cgi?id=184968
        <rdar://problem/39686506>

        Reviewed by Eric Carlson.

        Use USE(SYSTEM_PREVIEW).

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry init]):
        * UIProcess/ios/WKSystemPreviewView.mm:

2018-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Implement MouseEvent.buttons
        https://bugs.webkit.org/show_bug.cgi?id=184913

        Reviewed by Žan Doberšek.

        It's currently returning always 0.

        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::pressedMouseButtons): Helper function to get the pressed mouse buttons.
        (WebKit::WebEventFactory::createWebMouseEvent): Pass presssed mouse buttons to constructor instead of 0.
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Include the mouse buttons state in automation
        synthesized events and update m_currentModifiers with the mouse buttons state.
        (WebKit::keyCodeForVirtualKey): Do not set the state here.
        (WebKit::modifiersForKeyCode): Helper to get the modifiers for a key code.
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Initialize the modifiers also when
        virtualKey is std::nullopt;

2018-04-24  Nan Wang  <n_wang@apple.com>

        AX: soft link libAccessibility.dylb
        https://bugs.webkit.org/show_bug.cgi?id=184919

        Reviewed by Dan Bernstein.

        Weakly linked libAccessibility.dylib on macOS.

        * Configurations/WebKit.xcconfig:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _updateAccessibilityEventsEnabled]):

2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Add WKView and WKAPI
        https://bugs.webkit.org/show_bug.cgi?id=182869

        Reviewed by Alex Christensen.

        Resurrected source files for WebKit for Windows port which was
        removed in r139003.

        * PlatformWin.cmake: Renamed the output name of WebKit to WebKit2
        not to conflict WebKitLegacy. Added source files and include paths.
        * UIProcess/API/C/WKAPICast.h:
        * UIProcess/API/C/win/WKAPICastWin.h: Added.
        * UIProcess/API/C/win/WKView.cpp: Added.
        (WKViewCreate):
        (WKViewGetWindow):
        (WKViewGetPage):
        (WKViewSetParentWindow):
        (WKViewWindowAncestryDidChange):
        (WKViewSetIsInWindow):
        (WKViewSetScrollOffsetOnNextResize):
        * UIProcess/API/C/win/WKView.h: Added.
        * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added.
        (API::WebsiteDataStore::defaultApplicationCacheDirectory):
        (API::WebsiteDataStore::defaultCacheStorageDirectory):
        (API::WebsiteDataStore::defaultNetworkCacheDirectory):
        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        (API::WebsiteDataStore::defaultLocalStorageDirectory):
        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
        (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
        (API::WebsiteDataStore::defaultDataStoreConfiguration):
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/win/ProcessLauncherWin.cpp: Added.
        (WebKit::processName):
        (WebKit::ProcessLauncher::launchProcess):
        (WebKit::ProcessLauncher::terminateProcess):
        (WebKit::ProcessLauncher::platformInvalidate):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
        (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
        * UIProcess/WebsiteData/win/WebsiteDataStoreWin.cpp: Added.
        (WebKit::WebsiteDataStore::platformInitialize):
        (WebKit::WebsiteDataStore::platformDestroy):
        (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
        * UIProcess/win/PageClientImpl.cpp: Added.
        (WebKit::PageClientImpl::PageClientImpl):
        (WebKit::PageClientImpl::createDrawingAreaProxy):
        (WebKit::PageClientImpl::setViewNeedsDisplay):
        (WebKit::PageClientImpl::requestScroll):
        (WebKit::PageClientImpl::viewScrollPosition):
        (WebKit::PageClientImpl::viewSize):
        (WebKit::PageClientImpl::isViewWindowActive):
        (WebKit::PageClientImpl::isViewFocused):
        (WebKit::PageClientImpl::isViewVisible):
        (WebKit::PageClientImpl::isViewInWindow):
        (WebKit::PageClientImpl::PageClientImpl::processDidExit):
        (WebKit::PageClientImpl::didRelaunchProcess):
        (WebKit::PageClientImpl::toolTipChanged):
        (WebKit::PageClientImpl::setCursor):
        (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves):
        (WebKit::PageClientImpl::didChangeViewportProperties):
        (WebKit::PageClientImpl::registerEditCommand):
        (WebKit::PageClientImpl::clearAllEditCommands):
        (WebKit::PageClientImpl::canUndoRedo):
        (WebKit::PageClientImpl::executeUndoRedo):
        (WebKit::PageClientImpl::convertToDeviceSpace):
        (WebKit::PageClientImpl::convertToUserSpace):
        (WebKit::PageClientImpl::screenToRootView):
        (WebKit::PageClientImpl::rootViewToScreen):
        (WebKit::PageClientImpl::doneWithKeyEvent):
        (WebKit::PageClientImpl::createPopupMenuProxy):
        (WebKit::PageClientImpl::createContextMenuProxy):
        (WebKit::createColorPicker):
        (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
        (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
        (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
        (WebKit::PageClientImpl::pageClosed):
        (WebKit::PageClientImpl::preferencesDidChange):
        (WebKit::PageClientImpl::didChangeContentSize):
        (WebKit::PageClientImpl::handleDownloadRequest):
        (WebKit::PageClientImpl::didCommitLoadForMainFrame):
        (WebKit::PageClientImpl::fullScreenManagerProxyClient):
        (WebKit::PageClientImpl::closeFullScreenManager):
        (WebKit::PageClientImpl::isFullScreen):
        (WebKit::PageClientImpl::enterFullScreen):
        (WebKit::PageClientImpl::exitFullScreen):
        (WebKit::PageClientImpl::beganEnterFullScreen):
        (WebKit::PageClientImpl::beganExitFullScreen):
        (WebKit::PageClientImpl::doneWithTouchEvent):
        (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
        (WebKit::PageClientImpl::didFinishLoadingDataForCustomContentProvider):
        (WebKit::PageClientImpl::navigationGestureDidBegin):
        (WebKit::PageClientImpl::navigationGestureWillEnd):
        (WebKit::PageClientImpl::navigationGestureDidEnd):
        (WebKit::PageClientImpl::willRecordNavigationSnapshot):
        (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot):
        (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame):
        (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
        (WebKit::PageClientImpl::didChangeBackgroundColor):
        (WebKit::PageClientImpl::isPlayingAudioWillChange):
        (WebKit::PageClientImpl::isPlayingAudioDidChange):
        (WebKit::PageClientImpl::refView):
        (WebKit::PageClientImpl::derefView):
        * UIProcess/win/PageClientImpl.h: Added.
        * UIProcess/win/TextCheckerWin.cpp: Added.
        (WebKit::checkerState):
        (WebKit::TextChecker::state):
        (WebKit::TextChecker::setTestingMode):
        (WebKit::TextChecker::isTestingMode):
        (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::setGrammarCheckingEnabled):
        (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
        (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
        (WebKit::TextChecker::uniqueSpellDocumentTag):
        (WebKit::TextChecker::closeSpellDocumentWithTag):
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::checkGrammarOfString):
        (WebKit::TextChecker::spellingUIIsShowing):
        (WebKit::TextChecker::toggleSpellingUIIsShowing):
        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        (WebKit::TextChecker::requestCheckingOfString):
        (WebKit::TextChecker::checkTextOfParagraph):
        * UIProcess/win/WebContextMenuProxyWin.cpp: Added.
        (WebKit::WebContextMenuProxyWin::show):
        (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
        (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
        * UIProcess/win/WebContextMenuProxyWin.h: Added.
        (WebKit::WebContextMenuProxyWin::create):
        * UIProcess/win/WebInspectorProxyWin.cpp: Added.
        (WebKit::WebInspectorProxy::platformCreateFrontendPage):
        (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
        (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
        (WebKit::WebInspectorProxy::platformDidCloseForCrash):
        (WebKit::WebInspectorProxy::platformInvalidate):
        (WebKit::WebInspectorProxy::platformHide):
        (WebKit::WebInspectorProxy::platformBringToFront):
        (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
        (WebKit::WebInspectorProxy::platformIsFront):
        (WebKit::WebInspectorProxy::platformInspectedURLChanged):
        (WebKit::WebInspectorProxy::inspectorPageURL):
        (WebKit::WebInspectorProxy::inspectorTestPageURL):
        (WebKit::WebInspectorProxy::inspectorBaseURL):
        (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
        (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
        (WebKit::WebInspectorProxy::platformAttach):
        (WebKit::WebInspectorProxy::platformDetach):
        (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
        (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
        (WebKit::WebInspectorProxy::platformStartWindowDrag):
        (WebKit::WebInspectorProxy::platformSave):
        (WebKit::WebInspectorProxy::platformAppend):
        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
        * UIProcess/win/WebPageProxyWin.cpp: Added.
        (WebKit::WebPageProxy::platformInitialize):
        (WebKit::WebPageProxy::standardUserAgent):
        (WebKit::WebPageProxy::saveRecentSearches):
        (WebKit::WebPageProxy::loadRecentSearches):
        (WebKit::WebPageProxy::editorStateChanged):
        * UIProcess/win/WebPreferencesWin.cpp: Added.
        (WebKit::WebPreferences::platformInitializeStore):
        (WebKit::WebPreferences::platformUpdateStringValueForKey):
        (WebKit::WebPreferences::platformUpdateBoolValueForKey):
        (WebKit::WebPreferences::platformUpdateUInt32ValueForKey):
        (WebKit::WebPreferences::platformUpdateDoubleValueForKey):
        (WebKit::WebPreferences::platformUpdateFloatValueForKey):
        (WebKit::WebPreferences::platformGetStringUserValueForKey):
        (WebKit::WebPreferences::platformGetBoolUserValueForKey):
        (WebKit::WebPreferences::platformGetUInt32UserValueForKey):
        (WebKit::WebPreferences::platformGetDoubleUserValueForKey):
        * UIProcess/win/WebProcessPoolWin.cpp: Added.
        (WebKit::WebProcessPool::platformInitialize):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInvalidateContext):
        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
        (WebKit::WebProcessPool::legacyPlatformDefaultJavaScriptConfigurationDirectory):
        (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
        * UIProcess/win/WebView.cpp: Added.
        (WebKit::WebView::WebViewWndProc):
        (WebKit::WebView::wndProc):
        (WebKit::WebView::registerWebViewWindowClass):
        (WebKit::WebView::WebView):
        (WebKit::WebView::~WebView):
        (WebKit::WebView::initialize):
        (WebKit::WebView::setParentWindow):
        (WebKit::findTopLevelParentWindow):
        (WebKit::WebView::windowAncestryDidChange):
        (WebKit::WebView::onMouseEvent):
        (WebKit::WebView::onWheelEvent):
        (WebKit::WebView::onHorizontalScroll):
        (WebKit::WebView::onVerticalScroll):
        (WebKit::WebView::onKeyEvent):
        (WebKit::drawPageBackground):
        (WebKit::WebView::paint):
        (WebKit::WebView::onPaintEvent):
        (WebKit::WebView::onPrintClientEvent):
        (WebKit::WebView::onSizeEvent):
        (WebKit::WebView::onWindowPositionChangedEvent):
        (WebKit::WebView::onSetFocusEvent):
        (WebKit::WebView::onKillFocusEvent):
        (WebKit::WebView::onTimerEvent):
        (WebKit::WebView::onShowWindowEvent):
        (WebKit::WebView::onSetCursor):
        (WebKit::WebView::updateActiveState):
        (WebKit::WebView::updateActiveStateSoon):
        (WebKit::initCommonControls):
        (WebKit::WebView::initializeToolTipWindow):
        (WebKit::WebView::startTrackingMouseLeave):
        (WebKit::WebView::stopTrackingMouseLeave):
        (WebKit::WebView::shouldInitializeTrackPointHack):
        (WebKit::WebView::close):
        (WebKit::WebView::cursorToShow const):
        (WebKit::WebView::updateNativeCursor):
        (WebKit::WebView::setOverrideCursor):
        (WebKit::WebView::setIsInWindow):
        (WebKit::WebView::setIsVisible):
        (WebKit::WebView::isWindowActive):
        (WebKit::WebView::isFocused):
        (WebKit::WebView::isVisible):
        (WebKit::WebView::isInWindow):
        (WebKit::WebView::setScrollOffsetOnNextResize):
        (WebKit::WebView::setViewNeedsDisplay):
        (WebKit::WebView::createColorChooserProxy):
        (WebKit::WebView::didCommitLoadForMainFrame):
        (WebKit::WebView::customRepresentationZoomFactor):
        (WebKit::WebView::setCustomRepresentationZoomFactor):
        (WebKit::WebView::findStringInCustomRepresentation):
        (WebKit::WebView::countStringMatchesInCustomRepresentation):
        (WebKit::WebView::nativeWindow):
        (WebKit::WebView::windowReceivedMessage):
        * UIProcess/win/WebView.h: Added.
        (WebKit::WebView::create):
        (WebKit::WebView::window const):
        (WebKit::WebView::page const):
        (WebKit::WebView::drawingArea):
        (WebKit::WebView::setWasActivatedByMouseEvent):

2018-04-24  Fujii Hironori  <Hironori.Fujii@sony.com>

        Implement Same-Site cookies
        https://bugs.webkit.org/show_bug.cgi?id=159464
        <rdar://problem/27196358>

        Unreviewed build fix.

        WinCairo WebKit2 can't compile since r230921.

        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::appendCookieHeader):
        CookieJarCurlDatabase::cookieRequestHeaderFieldValue needs
        SameSiteInfo.

2018-04-24  Simon Fraser  <simon.fraser@apple.com>

        Add a new "color-filter" CSS property as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=184940

        Reviewed by Jon Lee.
        
        Add the color-filter property as an experimental feature.

        * Shared/WebPreferences.yaml:

2018-04-24  Saam Barati  <sbarati@apple.com>

        Keep around a pre-warmed process when doing process swap on navigation
        https://bugs.webkit.org/show_bug.cgi?id=184765
        <rdar://problem/39685099>

        Reviewed by Ryosuke Niwa and Brady Eidson.

        This patch makes it so that WebProcessPool prewarms a process when process
        swap on navigation is turned on. When we do a process swap on navigation,
        we first try to grab a prewarmed process before creating a new one.
        
        We try to be smart about when to create these processes. The initial heuristic
        that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
        layout milestone. We're going to try to improve on this heuristic in:
        https://bugs.webkit.org/show_bug.cgi?id=184899
        
        This is a 40% progression on PLT with process swap on navigation turned on.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _prewarmedWebProcessCount]):
        (-[WKProcessPool _webProcessCountIgnoringPrewarmed]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
        (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createNewWebProcess):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::warmInitialProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        (WebKit::WebProcessPool::processForNavigation):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::create):
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::m_isInPrewarmedPool):
        (WebKit::m_userMediaCaptureManagerProxy): Deleted.
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::isInPrewarmedPool const):
        (WebKit::WebProcessProxy::setIsInPrewarmedPool):

2018-04-24  Commit Queue  <commit-queue@webkit.org>

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

        This fix was not appropriate (Requested by n_wang on #webkit).

        Reverted changeset:

        "AX: soft link libAccessibility.dylb"
        https://bugs.webkit.org/show_bug.cgi?id=184919
        https://trac.webkit.org/changeset/230971

2018-04-24  Nan Wang  <n_wang@apple.com>

        AX: soft link libAccessibility.dylb
        https://bugs.webkit.org/show_bug.cgi?id=184919

        Reviewed by Chris Fleizach.

        Make sure we soft link the library so that it won't crash
        if it's missing in the system.

        * Configurations/WebKit.xcconfig:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _updateAccessibilityEventsEnabled]):

2018-04-24  John Wilander  <wilander@apple.com>

        From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
        https://bugs.webkit.org/show_bug.cgi?id=184560
        <rdar://problem/38901344>

        Reviewed by Youenn Fablet and Daniel Bates.

        This patch implements significant parts of https://github.com/whatwg/fetch/issues/687.
        We consume the From-Origin response header and only load the resource if:
        - The header is non-existent, empty, or invalid.
        - The header specifies 'same' and the resource's origin matches the originating
          document's origin and the origins up the frame tree.
        - The header specifies 'same-site' and the resource's eTLD+1 matches the originating
          document's eTLD+1 and the eTLD+1 of the documents up the frame tree.

        This feature is experimental and off by default.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
            Support for the two new load parameters:
            - shouldEnableFromOriginResponseHeader
            - frameAncestorOrigins
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::areFrameAncestorsSameSite):
        (WebKit::areFrameAncestorsSameOrigin):
        (WebKit::shouldCancelCrossOriginLoad):
            The three functions above implement the new blocking logic.
        (WebKit::fromOriginResourceError):
            Convenience function that returns an error with the From-Origin error message.
        (WebKit::NetworkResourceLoader::didReceiveResponse):
            Now checks for a From-Origin response header.
        (WebKit::NetworkResourceLoader::didFailLoading):
            Now checks for a From-Origin response header.
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
            Now checks for a From-Origin response header.
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
            Now checks for a From-Origin response header.
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
            Now checks for a From-Origin response header.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::encode):
        (IPC::ArgumentCoder<Vector<RefPtr<SecurityOrigin>>>::decode):
            Now encodes and decodes vectors of RefPtr<WebCore::SecurityOrigin>.
        * Shared/WebCoreArgumentCoders.h:
        * Shared/WebPreferences.yaml:
            Added From-Origin support as an experimental feature.
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetFromOriginResponseHeaderEnabled):
        (WKPreferencesGetFromOriginResponseHeaderEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
            Sets the two new load parameters:
            - shouldEnableFromOriginResponseHeader
            - frameAncestorOrigins

2018-04-24  Jer Noble  <jer.noble@apple.com>

        Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
        https://bugs.webkit.org/show_bug.cgi?id=184786

        Reviewed by Tim Horton.

        * Configurations/BaseTarget.xcconfig:
        * DerivedSources.make:

2018-04-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r230938.

        Introduced two ProcessSwap API test failures.

        Reverted changeset:

        "Keep around a pre-warmed process when doing process swap on
        navigation"
        https://bugs.webkit.org/show_bug.cgi?id=184765
        https://trac.webkit.org/changeset/230938

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

        [CoordGraphics] Remove dead fixed layer code
        https://bugs.webkit.org/show_bug.cgi?id=184912

        Reviewed by Michael Catanzaro.

        Drop the unused fixed layer handling  code in CoordinatedGraphicsScene.
        The m_fixedLayers container can be removed, along with the
        adjustPositionForFixedLayers() method that operated on that container.

        This was the only method that operated with the m_scrollPosition member
        variable and the contentsPosition argument that's passed to the
        CoordinatedGraphicsScene::paintToCurrentGLContext() method. Both of
        these are removed, along with the scrollPosition attribute on the
        CoordinatedGraphicsState struct.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
        (WebKit::CoordinatedGraphicsScene::setLayerState):
        (WebKit::CoordinatedGraphicsScene::deleteLayer):
        (WebKit::CoordinatedGraphicsScene::commitSceneState):
        (WebKit::CoordinatedGraphicsScene::purgeGLResources):
        (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::renderLayerTree):
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::flushPendingLayerChanges):

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

        REGRESSION(r230950): Faulty commit sequencing in CoordinatedGraphicsScene
        https://bugs.webkit.org/show_bug.cgi?id=184917

        Reviewed by Michael Catanzaro.

        After r230950, current animation state for a given layer is also taken
        into account when determining whether or not the layer requires a
        backing store. For that to work properly, all the animation state has
        to be updated before the backing store work. This patch changes the
        order of helper method invocations in
        CoordinatedGraphicsScene::setLayerState() to address that.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::setLayerState):

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

        [CoordGraphics] Remove unused fixed layout functionality
        https://bugs.webkit.org/show_bug.cgi?id=184908

        Reviewed by Carlos Garcia Campos.

        Ports using the CoordinatedGraphics subsystem don't expose fixed layout
        support. As such, we're able to remove a lot of unused code and
        unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
        in both WebCore and WebKit.

        Remove USE(COORDINATED_GRAPHICS) special-casing from the
        WebPage::setUseFixedLayout() method. This is not possible to enable for
        the GTK+ and WPE ports that use the CoordinatedGraphics subsytem via
        API. Removing all this unlocks removing considerable amounts of dead
        code and complexities in CoordinatedGraphics.

        WebChromeClient::delegatedScrollRequested() method is removed, along
        with the WebPage::pageDidRequestScroll() method that was only called
        from there.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::delegatedScrollRequested): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setUseFixedLayout):
        (WebKit::WebPage::pageDidRequestScroll): Deleted.
        * WebProcess/WebPage/WebPage.h:

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

        [CoordGraphics] Avoid painting backing stores for zero-opacity layers
        https://bugs.webkit.org/show_bug.cgi?id=184143

        Reviewed by Carlos Garcia Campos.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::layerShouldHaveBackingStore):
        Mirror CoordinatedGraphicsLayer's backing store requirements.

2018-04-23  Daniel Bates  <dabates@apple.com>

        Implement Same-Site cookies
        https://bugs.webkit.org/show_bug.cgi?id=159464
        <rdar://problem/27196358>

        Reviewed by Brent Fulgham.

        Pass the Same-Site info through the WebKit abstractions.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation const):
        (WebKit::logBlockedCookieInformation):
        (logCookieInformationInternal):
        (NetworkResourceLoader::logCookieInformation):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::constructRevalidationRequest):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
        (WebKit::NetworkCache::SubresourceInfo::encode const):
        (WebKit::NetworkCache::SubresourceInfo::decode):
        (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
        (WebKit::NetworkCache::SubresourceInfo::isSameSite const):
        (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
        a top-level navigation.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
        (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::cookiesForDOM):
        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
        (WebKit::WebPlatformStrategies::getRawCookies):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

        Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=184763

        Reviewed by Chris Dumez.

        Set all required NetworkResourceLoadParameters for asynchronous loads.
        This includes preflight policy, CSP response headers, SecurityOrigin and content blockers identifier.

        Update NetworkLoadChecker to handle preflight policy.
        This is not needed right now since sync XHR and ping loads are using the default ConsiderPreflight policy.
        But this will be needed for XHR/fetch/EventSource loads. 

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::validateResponse):
        (WebKit::NetworkLoadChecker::checkCORSRequest):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::create):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

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

        [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI
        https://bugs.webkit.org/show_bug.cgi?id=184901
        <rdar://problem/39664797>

        Reviewed by Tim Horton.

        Fixes the bug by falling back to setting the value of the focused input element in the case where the selection
        is not editable. Also adds plumbing to make time pickers testable in extra zoom mode.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView setTimePickerValueToHour:minute:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setTimePickerValueToHour:minute:]):

        Add plumbing to make it possible for WebKitTestRunner to simulate picking a time from the given hours and
        minutes. This is currently only implemented for extra zoom mode, but may be implemented for UIKit's time picker
        as well in the future by adjusting -[WKContentView setTimePickerValueToHour:minute:].

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

2018-04-23  Saam Barati  <sbarati@apple.com>

        Keep around a pre-warmed process when doing process swap on navigation
        https://bugs.webkit.org/show_bug.cgi?id=184765

        Reviewed by Ryosuke Niwa.

        This patch makes it so that WebProcessPool prewarms a process when process
        swap on navigation is turned on. When we do a process swap on navigation,
        we first try to grab a prewarmed process before creating a new one.
        
        We try to be smart about when to create these processes. The initial heuristic
        that this patch chooses is when we reach the DidFirstVisuallyNonEmptyLayout
        layout milestone. We're going to try to improve on this heuristic in:
        https://bugs.webkit.org/show_bug.cgi?id=184899
        
        This is a 40% progression on PLT with process swap on navigation turned on.

        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
        (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::createNewWebProcess):
        (WebKit::WebProcessPool::tryTakePrewarmedProcess):
        (WebKit::WebProcessPool::warmInitialProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
        (WebKit::WebProcessPool::processForNavigation):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::create):
        (WebKit::WebProcessProxy::WebProcessProxy):
        (WebKit::m_isInPrewarmedPool):
        (WebKit::m_userMediaCaptureManagerProxy): Deleted.
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::isInPrewarmedPool const):
        (WebKit::WebProcessProxy::setIsInPrewarmedPool):

2018-04-23  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Remove WlUniquePtr<wl_display> footgun
        https://bugs.webkit.org/show_bug.cgi?id=184405

        Reviewed by Carlos Garcia Campos.

        Switch to std::unique_ptr.

        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::WaylandCompositor):
        * UIProcess/gtk/WaylandCompositor.h:
        (WebKit::WaylandCompositor::DisplayDeleter::operator()):

2018-04-23  Daniel Bates  <dabates@apple.com>

        Attempt to fix the Apple Internal build following r230921
        (https://bugs.webkit.org/show_bug.cgi?id=159464)

        Forward declare some SPI. Add availability guard.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

2018-04-23  Zalan Bujtas  <zalan@apple.com>

        [LayoutFormattingContext] Initial commit.
        https://bugs.webkit.org/show_bug.cgi?id=184896

        Reviewed by Antti Koivisto.

        * Configurations/FeatureDefines.xcconfig:

2018-04-23  Daniel Bates  <dabates@apple.com>

        Implement Same-Site cookies
        https://bugs.webkit.org/show_bug.cgi?id=159464
        <rdar://problem/27196358>

        Reviewed by Brent Fulgham.

        Pass the Same-Site info through the WebKit abstractions.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
        (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
        (WebKit::NetworkConnectionToWebProcess::getRawCookies):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation const):
        (WebKit::logBlockedCookieInformation):
        (logCookieInformationInternal):
        (NetworkResourceLoader::logCookieInformation):
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::constructRevalidationRequest):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
        (WebKit::NetworkCache::SubresourceInfo::encode const):
        (WebKit::NetworkCache::SubresourceInfo::decode):
        (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
        (WebKit::NetworkCache::SubresourceInfo::isSameSite const):
        (WebKit::NetworkCache::SubresourceInfo::isTopSite const): Returns false; subresources do not represent
        a top-level navigation.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
        (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::cookiesForDOM):
        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
        (WebKit::WebPlatformStrategies::getRawCookies):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

        WebProcessProxy frequently re-takes a process assertion for the network process even though is already has one
        https://bugs.webkit.org/show_bug.cgi?id=184889
        <rdar://problem/38151530>

        Reviewed by Brady Eidson.

        In ProcessThrottler::updateAssertionNow(), if the new process assertion state is the same
        as the existing one, then return early. Otherwise, we would end up calling WebProcessProxy::didSetAssertionState()
        for the same assertion state, which would cause duplicate logging but also some unnecessary work.

        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::updateAssertionNow):

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

        [CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
        https://bugs.webkit.org/show_bug.cgi?id=184881

        Reviewed by Michael Catanzaro.

        The CompositingCoordinator::setVisibleContentsRect() method is always
        called with a (0,0) FloatPoint value as the trajectory vector parameter,
        which is already the default value in TiledBackingStore where this ends
        up. Removing this call chain also enables removing some unnecessary and
        odd code in the CoordinatedGraphicsLayer class.

        This doesn't yet touch the trajectory logic in the TiledBackingStore
        class since it's not yet a given this won't be used in the future. But
        if that will be necessary, hope is to not use it this way.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::setVisibleContentsRect):
        (WebKit::CompositingCoordinator::mainContentsLayer): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
        (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport):

2018-04-23  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][WK2] REGRESSION(r230834) 'getpid': identifier not found
        https://bugs.webkit.org/show_bug.cgi?id=184877

        Reviewed by Yusuke Suzuki.

        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::addItem): Use WTF::getCurrentProcessID() instead of getpid().
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::goToBackForwardItem): Ditto.

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

        [TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
        https://bugs.webkit.org/show_bug.cgi?id=184810

        Reviewed by Carlos Garcia Campos.

        CoordinatedBackingStore should inherit directly from RefCounted<> now
        that TextureMapperBackingStore doesn't anymore.

        * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):

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

        [CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
        https://bugs.webkit.org/show_bug.cgi?id=184811

        Reviewed by Carlos Garcia Campos.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::flushPendingLayerChanges): Stop setting
        the removed contentsSize and coveredRect attributes. These were only
        ever set to the appropriate values, but were then never used anywhere.

2018-04-22  Matt Baker  <mattbaker@apple.com>

        Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer
        https://bugs.webkit.org/show_bug.cgi?id=184865
        <rdar://problem/37764960>

        Reviewed by Brian Burg.

        Replace the early return removed in https://bugs.webkit.org/show_bug.cgi?id=177661,
        so that WKWebInspectorProxyObjCAdapter and the view controller can be reused
        when reopening the Inspector while the WebView is still alive.

        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformCreateFrontendPage):

2018-04-22  Paul Knight  <pknight@apple.com>

        Add -[WKInputDelegate _webView:decidePolicyForFocusedElement:] so clients can request default focusing behavior
        https://bugs.webkit.org/show_bug.cgi?id=184844

        Reviewed by Dan Bernstein.

        If a client doesn't implement -[_WKInputDelegate _webView:focusShouldStartInputSession:] the default
        focus behavior only brings up the keyboard if it's already onscreen, the interaction is user driven,
        and other factors that even depend on what feature flags are enabled.

        If a client implements _webView:focusShouldStartInputSession:, they don't have a good way to specifiy
        they'd like to fall back to the default behavior. This makes it difficult for a client to use the
        default in most cases, but sometimes allow programmatic focus from the page, for example.

        Add a new delegate method -_webView:decidePolicyForFocusedElement: that returns a new enum type
        _WKFocusStartsInputSessionPolicy. Clients can return _WKFocusStartsInputSessionPolicyAuto to request
        the default behavior, or _WKFocusStartsInputSessionPolicyAllow / Disallow to directly control whether
        the keyboard appears to assist the focused node.

        * UIProcess/API/Cocoa/_WKInputDelegate.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

2018-04-21  Jeremy Jones  <jeremyj@apple.com>

        Disable backward and forward navigation swipes while in fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=184656
        rdar://problem/36057535

        Reviewed by Tim Horton.

        Disable navigation swipes while in fullscreen.

        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::canSwipeInDirection const):

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

        Activate NetworkLoadChecker for media loads
        https://bugs.webkit.org/show_bug.cgi?id=184841

        Reviewed by Eric Carlson.

        Instantiate a NetworkLoadChecker for NetworkResourceLoader for audio/video loads.

        Move CORS checks for response after handling of 304 checks.
        For 304 checks, we need to do the CORS checks on the validated cached response, not the 304 received response.

        Updated ResourceError argument coder to explicitly pass the error type
        as some errors created by NetworkLoadChecker would otherwise be received as General errors by WebProcess.
        Updated platform data encoding of ResourceError accordingly.

        All changes are covered by regular media loading layout tests.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::shouldUseNetworkLoadChecker):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceError>::encode):
        (IPC::ArgumentCoder<ResourceError>::decode):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
        We need to set the type after decoding the NSError as ResourceError tries to guess the type from NSError data.
        * Shared/soup/WebCoreArgumentCodersSoup.cpp:
        (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceError>::decodePlatformData):

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

        [SOUP] Do TLS error checking on GTlsConnection::accept-certificate
        https://bugs.webkit.org/show_bug.cgi?id=184480

        Reviewed by Michael Catanzaro.

        Connect to GTlsConnection::accept-certificate signal instead of SoupMessage::notify::tls-errors to perform the
        TLS errors check.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::createRequest): Do not connect to SoupMessage::notify::tls-errors.
        (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificateCallback): Call tlsConnectionAcceptCertificate() is
        the task is still ongoing.
        (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): Check TLS errors here.
        (WebKit::NetworkDataTaskSoup::networkEventCallback): Pass the stream to networkEvent.
        (WebKit::NetworkDataTaskSoup::networkEvent): Connect to GTlsConnection::accept-certificate.
        * NetworkProcess/soup/NetworkDataTaskSoup.h:

2018-04-20  Timothy Hatcher  <timothy@apple.com>

        NULL dereference crash sometimes under [super initWithCoder:] in WebView

        https://bugs.webkit.org/show_bug.cgi?id=184851
        rdar://problem/39611236

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView effectiveAppearanceDidChange]):
        Added a null check and call the code later in initialization.

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

        Adjust geolocation feature flag
        https://bugs.webkit.org/show_bug.cgi?id=184856

        Reviewed by Wenson Hsieh.

        * Configurations/FeatureDefines.xcconfig:

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

        Unreviewed attempt to fix GTK build after r230867.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
        (webkit_dom_dom_window_get_self):
        (webkit_dom_dom_window_get_window):
        (webkit_dom_dom_window_get_frames):
        (webkit_dom_dom_window_get_opener):
        (webkit_dom_dom_window_get_parent):
        (webkit_dom_dom_window_get_top):

2018-04-20  Commit Queue  <commit-queue@webkit.org>

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

        Broke the iOS build (Requested by cdumez on #webkit).

        Reverted changeset:

        "Disable backward and forward navigation swipes while in
        fullscreen."
        https://bugs.webkit.org/show_bug.cgi?id=184656
        https://trac.webkit.org/changeset/230873

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

        REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
        https://bugs.webkit.org/show_bug.cgi?id=184210
        <rdar://problem/39072354>

        Reviewed by Wenson Hsieh.

        r229828 tried to have some API tests happy on iOS by freezing the layer tree
        during the navigation policy decision. However, this is observable by the client
        application and a regression from when the policy delegate was synchronous.

        To address the issue, this patch reverts r229828 and instead updates the iOS
        API tests to wait for the next presentation update after navigating
        before interacting with the view.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebKit::WebFrameLoaderClient::cancelPolicyCheck):
        (WebKit::WebFrameLoaderClient::provisionalLoadStarted):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:

2018-04-20  Brent Fulgham  <bfulgham@apple.com>

        Limit cookie header access to Network process
        https://bugs.webkit.org/show_bug.cgi?id=184764
        <rdar://problem/36785285>

        Reviewed by Youenn Fablet.

        Revise the handling of cookie request headers so that we don't interact with them in the
        WebContent process. They are only needed for interaction with the server and the network
        process, so we should limit their scope to just the Network process.

        Instead, we should handle a token that represents the cookie headers in the WebContent
        process, which can be converted to the relevant cookie data in the network process when
        needed.

        * NetworkProcess/NetworkSocketStream.cpp:
        (WebKit::NetworkSocketStream::sendHandshake):
        * NetworkProcess/NetworkSocketStream.h:
        * NetworkProcess/NetworkSocketStream.messages.in:
        * WebProcess/Network/WebSocketStream.cpp:
        (WebKit::WebSocketStream::networkProcessCrashed):
        (WebKit::WebSocketStream::platformSendHandshake):
        (WebKit::WebSocketStream::didSendHandshake):
        * WebProcess/Network/WebSocketStream.h:
        * WebProcess/Network/WebSocketStream.messages.in:

2018-04-20  Jeremy Jones  <jeremyj@apple.com>

        Disable backward and forward navigation swipes while in fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=184656
        rdar://problem/36057535

        Reviewed by Tim Horton.

        Disable navigation swipes while in fullscreen.

        * UIProcess/Cocoa/ViewGestureController.cpp:
        (WebKit::ViewGestureController::canSwipeInDirection const):

2018-04-20  Jeremy Jones  <jeremyj@apple.com>

        Element fullscreen, expose WKWebView _fullScreenPlaceholderView as iOS SPI
        https://bugs.webkit.org/show_bug.cgi?id=184826
        rdar://problem/39600825

        Reviewed by Tim Horton.

        Add _fullScreenPlaceholderView for iOS similar to the one for Mac.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _fullScreenPlaceholderView]):
        (-[WKWebView closeFullScreenWindowController]):
        (-[WKWebView fullScreenPlaceholderView]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController webViewPlaceholder]):

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

        [Extra zoom mode] Injected bundle form client should be notified when editing text fields
        https://bugs.webkit.org/show_bug.cgi?id=184822
        <rdar://problem/38807319>

        Reviewed by Tim Horton.

        Fixes the bug by making a couple of tweaks: (1) don't use a separate codepath for inserting text in text inputs,
        and (2) force a user typing gesture when inserting text using this codepath (i.e. WKTextInputListViewController).
        Also adds plumbing to enable testing text entry with WKTextInputListViewController in extra zoom mode.

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

        Introduce testing SPI to simulate text entry. Additionally, add a missing availability annotation around testing
        SPI added in 2017 to help test drag and drop for iOS 11.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _simulateTextEntered:]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setTextAsync):

2018-04-20  Jeremy Jones  <jeremyj@apple.com>

        EnterFullscreen must update the minimum and maximum layout sizes.
        https://bugs.webkit.org/show_bug.cgi?id=184828
        rdar://problem/38435829

        Reviewed by Jon Lee.

        Without this, the WKWebView won't layout to the full size in fullscreen mode.

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

2018-04-18  Jer Noble  <jer.noble@apple.com>

        Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
        https://bugs.webkit.org/show_bug.cgi?id=184762

        Reviewed by Dan Bernstein.

        * Configurations/BaseTarget.xcconfig:

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

        Refactor NetworkResourceLoader to check for m_networkLoadChecker presence before using it
        https://bugs.webkit.org/show_bug.cgi?id=184755

        Reviewed by Chris Dumez.

        Make NetworkResourceLoader always use m_networkLoadChecker if there is one.
        This is only used now for synchronous loads but will be used in the future for asynchronous loads as well.

        Since we call didFail asynchronously to make sync/async handling more consistent,
        We need to keep track of whether we will do clean-up twice.
        A boolean is added for that purpose in NetworkResourceLoader.

        There is a small change of behavior in the way we return an error.
        Instead of returning a platformBadResponseError, we are now returning the error as computed by NetworkLoadChecker.
        This allows getting some more error logging in the JS console.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:

2018-04-20  Timothy Hatcher  <timothy@apple.com>

        Include missing files in WKContentViewInteraction.{mm,h}

        https://bugs.webkit.org/show_bug.cgi?id=184832
        rdar://problem/35377120

        Reviewed by Wenson Hsieh.

        Some WebDriver files were missing and should be included.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _removeDefaultGestureRecognizers]):
        (-[WKContentView _addDefaultGestureRecognizers]):

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

        WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
        https://bugs.webkit.org/show_bug.cgi?id=184369

        Reviewed by Chris Dumez.

        Use API to check for plugin availability for response at navigation time.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::canShowResponse const):
        (WebKit::WebPage::canShowMIMEType const):
        * WebProcess/WebPage/WebPage.h:

2018-04-20  Daniel Bates  <dabates@apple.com>

        Remove Strong Password decoration when text field type changes
        https://bugs.webkit.org/show_bug.cgi?id=184795
        <rdar://problem/38325108>

        Reviewed by Antti Koivisto.

        Add injected bundle API and WebKit UI delegate SPI to notify the embedding client when the
        Strong Password appearance of an HTML input element is resigned.

        We add C SPI for Safari on Mac.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::didResignInputElementStrongPasswordAppearance):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/API/C/WKPageUIClient.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::didResignInputElementStrongPasswordAppearance):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didResignInputElementStrongPasswordAppearance):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
        (API::InjectedBundle::PageUIClient::didResignInputElementStrongPasswordAppearance):
        * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
        (WebKit::InjectedBundlePageUIClient::didResignInputElementStrongPasswordAppearance):
        * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::inputElementDidResignStrongPasswordAppearance):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2018-04-20  Megan Gardner  <megan_gardner@apple.com>

        Fixes for failing tests associated with switching Text Selection Assistants
        https://bugs.webkit.org/show_bug.cgi?id=184806
        <rdar://problem/39367905>

        Reviewed by Beth Dakin and Wenson Hsieh.
        
        The major fix is the disabling the double tap noneditable text selection gesture.
        The other fixes are small tweaks that shouldn't even be run into with the fix to 
        the double tap gesture, but they are incorrect, so I am taking the opportunity to 
        fix them now, in case we run into them again.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        We should not be allowing a double tap text gestures in non-editable web content.
        We didn't have one with the old assistant. Fortunately, this is easily disabled.
        (-[WKContentView canPerformActionForWebView:withSender:]):
        We should not allow the lookup action if we do not actually have a selection.
        It is meaningless without one.
        (-[WKContentView selectedTextRange]):
        We should not return a selection to UIKit if all we have is caret selection
        in non-editable content. We have this for selections on Mac, but UIKit does
        not know how to properly handle this, and will have incorrect behavior if we 
        return a valid selection.

2018-04-20  Timothy Hatcher  <timothy@apple.com>

        WebEvent fails to convert synthetic WebMouseEvent for automation

        https://bugs.webkit.org/show_bug.cgi?id=184824
        rdar://problem/35377120

        Reviewed by Brian Burg.

        Add WebEvent conversions that existed in PlatformEventFactoryIOS for legacy WebKit,
        but never got added in WebIOSEventFactory and NativeWebMouseEvent for modern WebKit.
        This affected WebDriver, and some events not being deliverd to the page.

        * Shared/NativeWebMouseEvent.h:
        (WebKit::NativeWebMouseEvent::nativeEvent const):
        * Shared/ios/NativeWebMouseEventIOS.mm: Added.
        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
        * Shared/ios/WebIOSEventFactory.h:
        * Shared/ios/WebIOSEventFactory.mm:
        (WebIOSEventFactory::createWebMouseEvent):
        * WebKit.xcodeproj/project.pbxproj:

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

        Unreviewed, fix -Wformat warning

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

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

        Make PluginData cache its web visible plugins
        https://bugs.webkit.org/show_bug.cgi?id=184421

        Reviewed by Chris Dumez.

        Rename methods.
        Pass an URL instead of relying on Page URL as the page URL
        might not always be the URL we want to check against plugins.
        In particular when navigation is on-going, we want to check the
        plugins against the being navigated URL.

        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::pluginInfo):
        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
        * WebProcess/Plugins/WebPluginInfoProvider.h:

2018-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK+ build after r230830.

        Add SimulatedInputDispatcher.cpp to the build.

        * CMakeLists.txt:

2018-04-19  Brady Eidson  <beidson@apple.com>

        Make back forward cache work with process swapping.
        <rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793

        Reviewed by Chris Dumez.

        We previously saved old processes in "SuspendedPageProxy" objects.
        Now we reuse them when going back or forward.

        * Platform/Logging.h:

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::setSuspendedPage):
        (WebKit::WebBackForwardListItem::loggingString):
        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::suspendedPage const):

        Teach Navigation objects their source WebBackForwardListItems:
        * UIProcess/API/APINavigation.cpp:
        (API::Navigation::Navigation):
        (API::Navigation::loggingString const):
        * UIProcess/API/APINavigation.h:
        (API::Navigation::create):
        (API::Navigation::targetItem const):
        (API::Navigation::fromItem const):
        (API::Navigation::backForwardListItem): Deleted.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

        * UIProcess/SuspendedPageProxy.cpp:
        (WebKit::messageNamesToIgnoreWhileSuspended):
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::webProcessDidClose):
        (WebKit::SuspendedPageProxy::didReceiveMessage):
        (WebKit::SuspendedPageProxy::loggingString const):
        * UIProcess/SuspendedPageProxy.h:
        (WebKit::SuspendedPageProxy::origin const):

        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::WebBackForwardList):
        (WebKit::WebBackForwardList::~WebBackForwardList):
        (WebKit::WebBackForwardList::pageClosed):
        (WebKit::WebBackForwardList::addItem):
        (WebKit::WebBackForwardList::goToItem):
        (WebKit::WebBackForwardList::removeAllItems):
        (WebKit::WebBackForwardList::clear):
        (WebKit::WebBackForwardList::restoreFromState):
        (WebKit::WebBackForwardList::filteredItemStates const):
        (WebKit::WebBackForwardList::itemStates const):
        (WebKit::WebBackForwardList::loggingString):
        * UIProcess/WebBackForwardList.h:

        * UIProcess/WebNavigationState.cpp:
        (WebKit::WebNavigationState::createLoadRequestNavigation):
        (WebKit::WebNavigationState::createBackForwardNavigation):
        * UIProcess/WebNavigationState.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::maybeCreateSuspendedPage):
        (WebKit::WebPageProxy::reattachToWebProcessWithItem):
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::didCreateMainFrame):
        (WebKit::WebPageProxy::didCreateSubframe):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::connectionWillOpen):
        (WebKit::WebPageProxy::attachToProcessForNavigation): Deleted.
        * UIProcess/WebPageProxy.h:

        * UIProcess/WebProcessLifetimeTracker.cpp:
        (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
        (WebKit::WebProcessLifetimeTracker::connectionWillOpen): Deleted.
        * UIProcess/WebProcessLifetimeTracker.h:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        (WebKit::WebProcessPool::registerSuspendedPageProxy):
        (WebKit::WebProcessPool::unregisterSuspendedPageProxy):
        * UIProcess/WebProcessPool.h:

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::suspendWebPageProxy):
        (WebKit::WebProcessProxy::updateBackForwardItem):
        (WebKit::WebProcessProxy::frameCreated):
        * UIProcess/WebProcessProxy.h:

        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::attachDrawingArea):

        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
        (WebKit::WebBackForwardListProxy::addItem):
        * WebProcess/WebPage/WebBackForwardListProxy.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::WebPage::reinitializeWebPage):
        (WebKit::WebPage::goToBackForwardItem):
        (WebKit::WebPage::restoreSessionInternal):
        (WebKit::WebPage::restoreSession):
        (WebKit::WebPage::updateBackForwardListForReattach):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
        (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Force a reattachment of the drawing
          area from a resumed WebProcess to the UIProcess (to make the page cache work)

2018-04-19  Brian Burg  <bburg@apple.com>

        Web Automation: add support for mouse/keyboard interaction sequences
        https://bugs.webkit.org/show_bug.cgi?id=184603
        <rdar://problem/39421839>

        Reviewed by Timothy Hatcher.

        Add new protocol methods and WebKit support for implementing the W3C Actions API.
        This is a generic command for sending low-level mouse, key, and touch events to
        test page behavior when performing drag-and-drop, gestures, or specific keydown/keyups.

        To implement this functionality, this patch adds SimulatedInputDispatcher, a class
        for dispatching input events asynchronously. Similar to the WebDriver specification,
        this is designed as a keyframing API. Callers set up several "input sources" such
        as keyboard or mouse, and then specify the states of that input source over time. The
        dispatcher calculates diffs between the previous and current keyframes and generates
        the appropriate events that would happen if a user caused the state transition.

        For example, if a mouse input source's state changes, the dispatcher sends synthetic mousemove,
        mousedown, or mouseup events depending on the pre- and post-state. This is uninteresting
        and overcomplicated for simple key and mouse presses, but it's really designed with an
        eye towards supporting mousemove interpolation and touch event interpolation in later patches.

        The strategy for dispatching events depends on the input source type; right now, these
        map directly to the existing platformSimulate{Mouse, Keyboard}Interaction methods. In
        the future, the dispatch strategy may be elaborated for interpolated mousemove events.

        This patch depends on support added in bug 184462.

        No tests yet. When this command is hooked up to a driver, the code will be exercised by
        W3C actions test suite, which is fairly complex at this point relative to end-user code.

        * UIProcess/Automation/Automation.json: Add new types and commands.

        * UIProcess/Automation/SimulatedInputDispatcher.h: Added.
        (WebKit::SimulatedInputSourceState::emptyState):
        (WebKit::SimulatedInputSource::create):
        (WebKit::SimulatedInputSource::SimulatedInputSource):
        (WebKit::SimulatedInputDispatcher::Client::~Client):
        Add structs for input source, source state, and keyframe.
        The dispatcher's client interface is implemented by WebAutomationSession.

        (WebKit::SimulatedInputDispatcher::create):
        * UIProcess/Automation/SimulatedInputDispatcher.cpp: Added.
        (WebKit::SimulatedInputKeyFrame::SimulatedInputKeyFrame):
        (WebKit::SimulatedInputKeyFrame::maximumDuration const):
        (WebKit::SimulatedInputKeyFrame::keyFrameFromStateOfInputSources):
        (WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
        (WebKit::SimulatedInputDispatcher::SimulatedInputDispatcher):
        (WebKit::SimulatedInputDispatcher::~SimulatedInputDispatcher):
        (WebKit::SimulatedInputDispatcher::isActive const):
        (WebKit::SimulatedInputDispatcher::keyFrameTransitionDurationTimerFired):
        (WebKit::SimulatedInputDispatcher::isKeyFrameTransitionComplete const):
        (WebKit::SimulatedInputDispatcher::transitionToNextKeyFrame):
        (WebKit::SimulatedInputDispatcher::transitionToNextInputSourceState):
        (WebKit::SimulatedInputDispatcher::transitionBetweenKeyFrames):
        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
        (WebKit::SimulatedInputDispatcher::run):
        (WebKit::SimulatedInputDispatcher::cancel):
        (WebKit::SimulatedInputDispatcher::finishDispatching):
        The dispatcher handles one interaction at a time. The interaction is described
        by an array of keyframes, and each keyframe has an array of states. The dispatcher
        transitions between keyframes by sequentially and asynchronously emitting events
        that cause each input source state to transition as desired. Keyframe transitions
        are additionally gated by a "maximum duration" timer. Each step that the dispatcher
        executes is asynchronous, so the dispatcher keeps most state in members and uses
        error argument lambdas as completion handlers for various async things.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::WebAutomationSession):
        (WebKit::WebAutomationSession::inputDispatcherForPage):
        (WebKit::WebAutomationSession::inputSourceForType const):
        Add canonical input sources that are used to keep track of state across
        interaction sequences.

        (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
        (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
        (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
        Remove m_simulatingUserInteraction since it can be computed based on other members.

        (WebKit::WebAutomationSession::willClosePage):
        If the page is being torn down, stop the dispatcher if needed and cancel any
        callbacks waiting for mouse/key events to be retired.

        (WebKit::WebAutomationSession::simulateMouseInteraction):
        (WebKit::WebAutomationSession::simulateKeyboardInteraction):
        Add easy-to-use async methods for simulating mouse and key events. These are
        hooked up to SimulatedInputDispatcher using async completion handlers.

        (WebKit::protocolMouseButtonToWebMouseEventButton):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        Adjust some naming.

        (WebKit::simulatedInputSourceTypeFromProtocolSourceType):
        (WebKit::WebAutomationSession::performInteractionSequence):
        (WebKit::WebAutomationSession::cancelInteractionSequence):
        Add command handlers for the new action commands in Automation protocol.

        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::mouseButtonToGdkButton):
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
        * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
        Rename the keyboard platform method to match the naming of the mouse platform method.
        Take advantage of the 'using' alias to make the tedious switches easier to read.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        (WebKit::virtualKeyHasStickyModifier):
        (WebKit::keyCodeForVirtualKey):
        (WebKit::eventModifierFlagsForVirtualKey):
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
        (WebKit::WebAutomationSession::platformSimulateKeySequence):
        (WebKit::keyHasStickyModifier): Deleted.
        (WebKit::WebAutomationSession::platformSimulateKeyStroke): Deleted.
        Allow the keyboard simulation method to take a virtual key and unichar to better
        match how this is used by the Perform Actions command and its machinery.

        * WebKit.xcodeproj/project.pbxproj:

2018-04-19  Jiewen Tan  <jiewen_tan@apple.com>

        Remove access to keychain from the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=184428
        <rdar://problem/13150903>

        Reviewed by Brent Fulgham.

        Part 1.

        Remove com.apple.identities from WebContent-iOS.entitlements, which is needed to encode/decode NSError’s userInfo[NSErrorClientCertificateChainKey]
        when the corresponding NSErorr is relayed through WebContent Process from Networking Process to UI Process after a HTTPS client certificate
        authentication is rejected becuase of bad certificates. This patch implements corresponding workarounds as well. The workaround works for mac, too.

        Sadly, this change can only be tested manually at this moment. Please refer to the radar for testing steps.

        * Configurations/WebContent-iOS.entitlements:
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::encodeNSError):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize):

2018-04-19  David Kilzer  <ddkilzer@apple.com>

        Enable Objective-C weak references
        <https://webkit.org/b/184789>
        <rdar://problem/39571716>

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        (CLANG_ENABLE_OBJC_WEAK): Enable.

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

        Web Inspector backend should get headers & cookies from network process separately from resource requests
        https://bugs.webkit.org/show_bug.cgi?id=184396
        <rdar://problem/38877384>

        Reviewed by Brian Burg.

        Add support for storing response and network metrics for every resource load.
        This is made conditional on inspector being activated.
        NetworkConnectionToWebProcess keeps a response and network metrics for every load.
        This is cleared when inspector is going away or when a web process requests
        the data.

        WebLoaderStrategy gets this data through synchronous IPC.
        Synchronous IPC is a temporary implementation until Inspector code gets refactored.

        Updated WebLoaderStrategy to pass the sourceOrigin for every NetworkResourceLoader.
        This activates additional sanitization based on cross origin status.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationResponse):
        (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse):
        (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
        (WebKit::NetworkConnectionToWebProcess::removeNetworkLoadInformation):
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFailLoading):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::responseFromResourceLoadIdentifier):
        (WebKit::WebLoaderStrategy::networkMetricsFromResourceLoadIdentifier):
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):

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

        [Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=184782
        <rdar://problem/38346712>

        Reviewed by Tim Horton.

        In extra zoom mode, at initial scale, fixed position elements may take up a large portion of the viewport. This
        leaves little room for non-fixed-position elements; to improve this experience, we introduce a mechanism to
        extend the height of the layout viewport. By default, the layout viewport size is determined by the FrameView's
        baseLayoutViewportSize, and passed into FrameView::computeUpdatedLayoutViewportRect in the client layer; in
        extra zoom mode, if the layout viewport is shorter than the document width, we try to double the height of the
        layout viewport and clamp to the document height if necessary.

        * Shared/WebPreferences.yaml:

        Add a new preference to determine the factor by which we should expand the height of the layout viewport. By
        default, this is 0 (no increase in layout viewport height); in extra zoom mode, this is 1, which means we'll
        increase the layout viewport's height by 1x the default height.

        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView activeMinimumLayoutSizes:]):

        Fixes a bug when computing the active minimum layout size. If a minimum allowed layout width is specified, we
        clamp the active layout width (normally the view size) so that it is no less than the minimum allowed layout
        width. However, the height is currently unaffected, which causes FrameView::baseLayoutViewportSize to return a
        bogus size, where the width is scaled to 320px but the height isn't. Instead, we should scale the layout height
        to match the new width here.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::computeCustomFixedPositionRect const):

        Expand the base viewport layout size if necessary, given the expansion factor in WebPreferences.

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

        Expand the base viewport layout size if necessary, given the expansion factor in Settings.

2018-04-19  Brian Burg  <bburg@apple.com>

        Web Automation: simulated mouse interactions should not be done until associated DOM events have been dispatched
        https://bugs.webkit.org/show_bug.cgi?id=184462
        <rdar://problem/39323336>

        Reviewed by Carlos Garcia Campos and Tim Horton.

        Covered by existing layout tests and actions endpoints in WebDriver test suite.

        In preparation for implementing the W3C WebDriver command "Perform Actions", we need a way to
        know when a simulated mouse event has been fully processed by WebProcess and it is okay to continue
        to dispatch more simulated events.

        This patch makes mouse events go through a queue as they are delivered to WebPageProxy. The approach
        is very similar to how key events are handled. In the key event case, lots of WebEvents can come out
        of typing one keystroke, so these need to be queued up and retired one by one when the WebProcess has
        finished handling each event. In some mouse event cases---particularly fake mouse moves---there can
        also be more than one mouse event waiting to be handled by WebProcess.

        In the past, these queued mouse events were tracked with several member variables as different
        use cases emerged. These are all replaced with ordinary deque operations, such as peeking or
        checking the queue length.

        * Platform/Logging.h: Add logging channel for mouse events.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::AutomationCommandError::toProtocolString): Add type-safe helper class for command errors.
        In future patches we can hide knowledge of how this is sent over the protocol by relying more on
        the convenience constructors and .toProtocolString() method.

        (WebKit::WebAutomationSession::willShowJavaScriptDialog):
        This section needs adjustments. Since performMouseInteraction now depends on key events being processed
        prior to returning from the command, we need to abort any key event callbacks that are pending if an
        alert pops up as a result of sending a mousedown event. Any mouse events that are still queued will
        be handled when the alert is dismissed and the nested run loop exits.

        (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
        (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
        Modernize this a bit. Don't spread knowledge about how commands are sent back out into event handling code.
        Our wrapper callbacks in performXXXInteraction handle the protocol-specific details of the response.

        (WebKit::WebAutomationSession::performMouseInteraction):
        Add code similar to performKeyboardInteractions so that the command doesn't finish until the mouse
        event has been fully handled. Unlike keyboards, sometimes mouse interactions don't turn into WebEvents
        so we also need to handle the case where there is nothing to be waited on because hit testing did
        not return a target to deliver the event to.

        (WebKit::WebAutomationSession::performKeyboardInteractions):
        Modernize a little bit to use generic callbacks rather than protocol-generated callbacks in the
        event waiting/handling code. Now it matches the types used for the mouse event case.

        * UIProcess/Automation/WebAutomationSession.h:
        (WebKit::AutomationCommandError::AutomationCommandError):
        Add a helper struct to hold an enumerated error name and an optional free-form error message.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::webMouseEventTypeString):
        (WebKit::webKeyboardEventTypeString):
        (WebKit::WebPageProxy::handleMouseEvent):
        (WebKit::WebPageProxy::processNextQueuedMouseEvent):
        Split the old method into handleMouseEvent (called by other code) and processNextQueuedMouseEvent.
        The latter sends the next mouse event to WebProcess, and can be triggered in didReceiveEvent
        if there are more mouse events to be sent to WebProcess.

        (WebKit::WebPageProxy::isProcessingMouseEvents const): Added.
        (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent): Reimplemented on top of the deque.
        (WebKit::WebPageProxy::didReceiveEvent):
        Unify the code paths for different mouse event types to all use the deque. They also will
        notify the automation session if there are no more mouse events to send (i.e., interaction is over).

        (WebKit::WebPageProxy::resetStateAfterProcessExited): Add handling for new map.

2018-04-19  Andy Estes  <aestes@apple.com>

        [iOS] Implement find-in-page in the new WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=184654
        <rdar://problem/39331654>

        Reviewed by Tim Horton.

        This is theoretically covered by existing WKPDFView API tests, but that's currently blocked
        by <rdar://problem/39475542>.

        * UIProcess/ios/WKPDFView.mm:
        (stringCompareOptions):

        Mapped _WKFindOptions to NSStringCompareOptions.

        (-[WKPDFView _resetFind]):

        Cancelled an in-progress search and reset the search state.

        (-[WKPDFView _findString:withOptions:maxCount:completion:]):

        Stored the completion block, find string, and max count, then called
        -[PDFHostViewController findString:withOptions:].

        (-[WKPDFView web_countStringMatches:options:maxCount:]):

        Called -_findString:withOptions:maxCount:completion: with a completion block that calls
        FindClient::didCountStringMatches() with _findStringCount.

        (-[WKPDFView _computeFocusedSearchResultIndexWithOptions:didWrapAround:]):

        Computed the focused search result index, taking _findStringCount and wrap-around into
        account. There are two interesting cases to mention here:

        1. We can't change focus while a search is in progress, because we can't properly handle
        wrap-around without a _findStringCount. If a search is in progress, store the requested
        focus change in _focusedSearchResultPendingOffset, which will be applied once the search
        finishes.

        2. If wrap-around is about to happen but the find options do not allow it, we need to call
        FindClient::didFailToFindString(). Handle this by returning NO, which will tell
        -_focusOnSearchResultWithOptions: to call didFailToFindString() if a search is not in
        progress.

        (-[WKPDFView _focusOnSearchResultWithOptions:]):

        If -_computeFocusedSearchResultIndexWithOptions:didWrapAround: failed while a search is in
        progress, just return early. Otherwise, call FindClient::didFailToFindString(). If
        computing the index did not fail, call -[PDFHostViewController focusOnSearchResultAtIndex:]
        to change focus and then call FindClient::didFindString() to inform the client.

        (-[WKPDFView web_findString:options:maxCount:]):

        If the find string is equal to _findString, change focus. Otherwise, start a new search.

        (-[WKPDFView web_hideFindUI]):

        Called -_resetFind.

        (-[WKPDFView pdfHostViewController:findStringUpdate:done:]):

        Stored the count in _findStringCount and called _findCompletion once the search is done.

2018-04-17  Filip Pizlo  <fpizlo@apple.com>

        The InternalFunction hierarchy should be in IsoSubspaces
        https://bugs.webkit.org/show_bug.cgi?id=184721

        Reviewed by Saam Barati.

        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
        (WebKit::JSNPMethod::subspaceForImpl):
        * WebProcess/Plugins/Netscape/JSNPMethod.h:
        (WebKit::JSNPMethod::create): Deleted.
        (WebKit::JSNPMethod::npIdentifier const): Deleted.
        (WebKit::JSNPMethod::createStructure): Deleted.
        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        (WebKit::JSNPObject::subspaceForImpl):
        * WebProcess/Plugins/Netscape/JSNPObject.h:
        (WebKit::JSNPObject::create): Deleted.
        (WebKit::JSNPObject::npObject const): Deleted.
        (WebKit::JSNPObject::createStructure): Deleted.

2018-04-19  Brady Eidson  <beidson@apple.com>

        Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them).
        <rdar://problem/39533949> and https://bugs.webkit.org/show_bug.cgi?id=184750

        Reviewed by Ryosuke Niwa.

        With process swapping, the assumption that "back/forward items belong to a process" is invalid.

        All HistoryItem/WebBackForwardListItems now need to be uniquely identified across all processes,
        no matter which process they originated from, so there will never be a collision in the UIProcess.

        This allows us to:
        - Have the UIProcess to keep a single process-wide map of all WebBackForwardListItems
        - Get rid of the per-WebProcess WebBackForwardListItem map
        - Simplify a lot of WebBackForwardList(Proxy) code that no longer needs to keep that per-process
          map in sync
        - Get rid of a lot of other ancillary code

        * Shared/SessionState.cpp:
        (WebKit::BackForwardListItemState::decode):
        * Shared/SessionState.h:

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::WebBackForwardListItem):
        (WebKit::WebBackForwardListItem::~WebBackForwardListItem):
        (WebKit::WebBackForwardListItem::itemForID):
        (WebKit::WebBackForwardListItem::highestUsedItemID): Deleted.
        * Shared/WebBackForwardListItem.h:
        (WebKit::WebBackForwardListItem::itemID const):

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:

        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::itemForID):
        (WebKit::WebBackForwardList::pageClosed):
        (WebKit::WebBackForwardList::addItem):
        (WebKit::WebBackForwardList::restoreFromState):
        (WebKit::generateWebBackForwardItemID): Deleted.
        * UIProcess/WebBackForwardList.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeCreateSuspendedPage):
        (WebKit::WebPageProxy::initializeWebPage):
        (WebKit::WebPageProxy::willGoToBackForwardListItem):
        (WebKit::WebPageProxy::restoreFromSessionState):
        (WebKit::WebPageProxy::backForwardAddItem):
        (WebKit::WebPageProxy::backForwardGoToItem):
        (WebKit::WebPageProxy::backForwardItemAtIndex):
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::backForwardRemovedItem):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
 
        * UIProcess/WebProcessPool.cpp: Explicitly set the UIProcess Process::Identifier so it starts
          at "1" and then the first child process starts at "2", etc etc.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::removeWebPage):
        (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
        (WebKit::WebProcessProxy::updateBackForwardItem):
        (WebKit::WebProcessProxy::webBackForwardItem const): Deleted.
        (WebKit::WebProcessProxy::registerNewWebBackForwardListItem): Deleted.
        (WebKit::WebProcessProxy::removeBackForwardItem): Deleted.
        (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Deleted.
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:

        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
        (WebKit::toBackForwardListItemState):
        (WebKit::applyFrameState):
        (WebKit::toHistoryItem):
        (WebKit::toPageState): Deleted.
        * WebProcess/WebCoreSupport/SessionStateConversion.h:

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):

        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
        (WebKit::WK2NotifyHistoryItemChanged):
        (WebKit::WebBackForwardListProxy::itemForID):
        (WebKit::WebBackForwardListProxy::removeItem):
        (WebKit::WebBackForwardListProxy::addItem): Previously this was a two-step process of adding an item
          to the process and then associating it with the page. Now it's just directly adding it to the page,
          so we don't need to call updateBackForwardItem first.
        (WebKit::WebBackForwardListProxy::goToItem):
        (WebKit::WebBackForwardListProxy::itemAtIndex):
        (WebKit::WebBackForwardListProxy::close):
        (WebKit::historyItemToIDMap): Deleted.
        (WebKit::generateHistoryItemID): Deleted.
        (WebKit::WebBackForwardListProxy::setHighestItemIDFromUIProcess): Deleted.
        (WebKit::updateBackForwardItem): Deleted.
        (WebKit::WebBackForwardListProxy::idForItem): Deleted.
        * WebProcess/WebPage/WebBackForwardListProxy.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::WebPage::goToBackForwardItem):
        (WebKit::WebPage::restoreSessionInternal):
        (WebKit::WebPage::didRemoveBackForwardItem):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        NetworkProcess should use CSP/content blockers for sync XHR
        https://bugs.webkit.org/show_bug.cgi?id=184760

        Reviewed by Chris Dumez.

        Setting CSP/ContentBlockers parameters for sync XHR loads.
        * NetworkProcess/NetworkResourceLoader.cpp:

2018-04-19  Nan Wang  <n_wang@apple.com>

        AX: AOM: respect the accessibility setting for dispatching the accessible events
        https://bugs.webkit.org/show_bug.cgi?id=184619

        Reviewed by Ryosuke Niwa.

        Linked libAccessibility on iOS and macOS to use the platform accessibility settings
        for allowing dispatching the accessibility events.

        * Configurations/WebKit.xcconfig:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (accessibilityEventsEnabledChangedCallback):
        (-[WKWebView _updateAccessibilityEventsEnabled]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateAccessibilityEventsEnabled):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateAccessibilityEventsEnabled):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        Rename WindowProxyController to WindowProxy
        https://bugs.webkit.org/show_bug.cgi?id=184756

        Reviewed by Sam Weinig.

        Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
        needed use WindowProxyController type, which was a bit confusing.

        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::windowScriptNPObject):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::frameBecameRemote):

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

        Allow SameOrigin credentials handling for synchronous XHR
        https://bugs.webkit.org/show_bug.cgi?id=184723

        Reviewed by Alex Christensen.

        In case of SameOrigin credentials, we need to stop the current load
        in case of cross origin redirection to restart a load with a different session.
        Covered by updated WK2 tests.
        Rebased WK1 tests since this is Wk1 only.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        * NetworkProcess/NetworkResourceLoader.h:

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

        Set RemoteDOMWindow's initial opener
        https://bugs.webkit.org/show_bug.cgi?id=184716

        Reviewed by Sam Weinig.

        When a frame becomes remote, transfer the frame opener from the old
        frame to the new remote one.

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

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

        NetworkResourceLoader should not clean itself inside didReceiveResponse
        https://bugs.webkit.org/show_bug.cgi?id=184754

        Reviewed by Chris Dumez.

        Delay the cleanup to after the didReceiveResponse call so that NetworkLoad can terminate its work.
        Covered by XHR sync tests no longer crashing on GuardMalloc bots.

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

2018-04-18  Jer Noble  <jer.noble@apple.com>

        Fix rendering of WKRemoteView layers in the simulator
        https://bugs.webkit.org/show_bug.cgi?id=184752

        Reviewed by Tim Horton.

        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):

2018-04-18  Jer Noble  <jer.noble@apple.com>

        Fix entitlements and sandboxing for iphoneminimalsimulator
        https://bugs.webkit.org/show_bug.cgi?id=184692

        Reviewed by Tim Horton.

        Use the correct implementations for ChildProcess and NetworkProcess
        when building for iphoneminimalsimulator. Stub out imlementations
        which rely on methods not available in the iphoneminimalsimulator SDK.

        * Configurations/Network-OSX.entitlements: Added.
        * Configurations/NetworkService.xcconfig:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::sourceApplicationAuditData const):
        * NetworkProcess/ios/NetworkProcessIOS.mm:
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeProcessName):
        (WebKit::overrideSystemProxies):
        * Shared/ios/ChildProcessIOS.mm:
        (WebKit::ChildProcess::initializeSandbox):
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::setApplicationIsDaemon):
        (WebKit::enableSandboxStyleFileQuarantine):
        (WebKit::ChildProcess::initializeSandbox):
        (WebKit::ChildProcess::platformStopRunLoop):
        * Shared/mac/CodeSigning.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeSandbox):

2018-04-18  Commit Queue  <commit-queue@webkit.org>

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

        causes mouse clicks to not work on some platforms (Requested
        by brrian on #webkit).

        Reverted changeset:

        "Web Automation: simulated mouse interactions should not be
        done until associated DOM events have been dispatched"
        https://bugs.webkit.org/show_bug.cgi?id=184462
        https://trac.webkit.org/changeset/230743

2018-04-18  Brent Fulgham  <bfulgham@apple.com>

        Avoid crash if ITP Debug mode is on, but ResourceLoadStatistics are not being used
        https://bugs.webkit.org/show_bug.cgi?id=184739
        <rdar://problem/39287964>

        Reviewed by David Kilzer.

        If a user has the ResourceLoadStatistics logic turned off, but has the ITP Debug experimental
        flag turned on, you can cause a crash.

        This is because the WebsiteDataStore for the process doesn't bother creating a ResourceLoadStatisticsStore
        if the statistics machinery is not running. The ITP debug flag was being blindly set without checking
        if the statistics store exists or not, which can cause a crash.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): Check if the statistics store exists
        before calling functions on it.

2018-04-18  Paul Knight  <pknight@apple.com>

        Add -[_WKInputDelegateDelegate willStartInputSession:] for clients that want to configure input session before assisting form node
        https://bugs.webkit.org/show_bug.cgi?id=184662

        Reviewed by Beth Dakin.

        Clients may wish to configure a WKInputSession before we start assisting
        a node. Add a -[_WKInputDelegateDelegate _webView:willStartInputSession:]
        callback.

        For example, clients that wish to present a custom input view will want
        to configure the WKFormInputSession's customInputView before the
        keyboard is presented. Otherwise the standard keyboard will begin to
        animate and then the custom input view will swap in later.

        * UIProcess/API/Cocoa/_WKInputDelegate.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
            Call -_webView:willStartInputSession: before assisting the node.
            Only create the form session if the delegate implements either
            the willStart or didStartInputSession callbacks.

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

        Add support for converting a local window to a remote window
        https://bugs.webkit.org/show_bug.cgi?id=184515
        <rdar://problem/39011318>

        Reviewed by Ryosuke Niwa.

        Add initial support for process-swapping when navigating cross-origin as a result
        of a window.open(). The window object returned by window.open() is initially same
        origin and is for about:blank. The navigation cross-origin then happens and the
        JS wrappers for the window then point to a cross-origin window which is remote (i.e.
        hosted in another WebProcess).

        The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
        exceptions due to our incomplete implementation (e.g. w.location returns null) and
        most of its API is currently not functional. The RemoteDOMWindow API will be implemented
        in a follow-up by relying on IPC.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationProcessSwapsOnWindowOpenWithOpener):
        (WKContextConfigurationSetProcessSwapsOnWindowOpenWithOpener):
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setProcessSwapsOnWindowOpenWithOpener:]):
        (-[_WKProcessPoolConfiguration processSwapsOnWindowOpenWithOpener]):
        Add ProcessPool configuration flag to turn on processSwap on window.open(), even
        if there is an opener.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        If the navigation was triggered via window.open(), then set up on handler for when
        a DOMWindow is constructed for the main frame in the new process.

        (WebKit::WebPageProxy::didCreateWindow):
        When a Window is constructed for the main frame in a new process on process swap,
        notify the old process that its representation of the window should become remote
        and provide it with the Frame / Window identifiers it needs.

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

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        Do process swapping on cross-origin window.open() if the corresponding setting is
        enabled.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::didCreateWindow):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::frameBecameRemote):
        This is called when process swapping has happened due to a window.open() navigation
        cross-origin, when a Frame / Window has been constructed in the new process. We do
        the following:
        - Construct a RemoteFrame / RemoteWindow using the provided global identifiers to
          represent the Frame / Window in the new process.
        - We transfer the WindowProxies from the old Frame's WindowProxyController to the
          new RemoteFrame's WindowProxyController.
        - We update the window proxied by those WindowProxies to be the new RemoteWindow.
        - We detach the old Frame as it is now remote and represented by the new RemoteFrame
          object we constructed.
        - If the old frame was the main frame (always the case currently), we close the page
          as it is no longer needed. The new RemoteFrame is currently owned by the RemoteWindow
          which is kept alive by its JS wrappers.

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

2018-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.1 release.

        * gtk/NEWS: Add release notes for 2.21.1.

2018-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Remove symbols from webkitglib-symbols.map.

        Remove symbols not present in WebKit.

        * webkitglib-symbols.map:

2018-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Add missing symbols to webkitglib-symbols.map.

        Add symbols global in JSC and present in WebKit.

        * webkitglib-symbols.map:

2018-04-18  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][WebKit] Implement InjectedBundleWin.cpp
        https://bugs.webkit.org/show_bug.cgi?id=184525

        Reviewed by Konstantin Tokarev.

        * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
        (WebKit::InjectedBundle::initialize):

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

        [Extra zoom mode] Programmatically changing focus when an element already has focus is a confusing experience
        https://bugs.webkit.org/show_bug.cgi?id=184635
        <rdar://problem/39440642>

        Reviewed by Tim Horton.

        Currently on iOS, we allow element focus to present UI if the keyboard is already shown. In extra zoom mode,
        this would lead to a confusing experience when the focus form control overlay is disabled, since fullscreen
        input view controllers are swapped out from underneath the user. Currently, this also puts the UI process into a
        bad state where the focused form control overlay is active, but still hidden. This patch makes some tweaks to
        input view controller handling in the UI process to address these issues, and also adds WebKitTestRunner support
        for simulating interactions with select menus in extra zoom mode. See comments below for more detail.

        Test: fast/events/extrazoom/change-focus-during-change-event.html

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

        Add new SPI delegate hooks to notify the UI delegate when view controllers are presented or dismissed in extra
        zoom mode. See -presentViewControllerForCurrentAssistedNode and -dismissAllInputViewControllers.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::takeBackgroundActivityTokenForFullscreenInput):
        (WebKit::WebProcessProxy::releaseBackgroundActivityTokenForFullscreenInput):

        See the comment below -dismissAllInputViewControllers.

        * UIProcess/WebProcessProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

        In extra zoom mode, when changing focus from one assisted node to another, only allow the second node to be
        assisted if the focused form control overlay is being shown. Otherwise, (i.e. when a fullscreen input view
        controller is being presented), don't allow focus to start an input session.

        Additionally, make a minor tweak to allow the previous node to blur, even if we are not showing the keyboard for
        the new focused element. Without this adjustment, in the case where the page has programmatically focused
        another element while a fullscreen input view controller is presented, we'll show the old view controller for
        the new focused element.

        (-[WKContentView presentViewControllerForCurrentAssistedNode]):
        (-[WKContentView dismissAllInputViewControllers:]):

        Currently, when a fullscreen input view controller is presented, the web process gets backgrounded. This
        prevents event handlers from executing, which leads to strange behaviors in many cases (for instance: if we
        have a multiple select, and the "change" event handler blurs the select, the user may check or uncheck multiple
        items, but only the first change will actually take effect).

        To fix this, we maintain a background activity token while presenting an input view controller.

        (-[WKContentView focusedFormControlViewDidBeginEditing:]):

        Start hiding the focused form overlay when re-presenting an input view controller. This allows us to bail from
        showing fullscreen input UI for another focused element if focus programmatically changes while the current
        fullscreen input view controller is presented, due to the -isHidden check in -_startAssistingNode:.

        (-[WKContentView selectFormAccessoryPickerRow:]):

        Simulate tapping a given row in select menu UI in extra zoom mode.

2018-04-17  Conrad Shultz  <conrad_shultz@apple.com>

        WebKit::DisplayLink maintains a strong reference to WebPageProxy, creating a reference cycle
        https://bugs.webkit.org/show_bug.cgi?id=184718

        Reviewed by Tim Horton.

        It turns out that the m_webPageProxy back-reference in DisplayLink, which was creating a
        reference cycle, wasn't ever read, so we can just remove it.

        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::DisplayLink):
        * UIProcess/mac/DisplayLink.h:

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

        [Extra zoom mode] Double tap to zoom should account for text legibility in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=184631
        <rdar://problem/39303706>

        Reviewed by Tim Horton.

        Implement the text legibility heuristic alluded to in r230506 by iterating through text runs in the document (up
        to a maximum of 200) and building a histogram of font sizes that appear in the document, where each tally
        represents a character.

        The first and second text legibility zoom scales are then computed based on the zoom scales needed to
        make 50% and 90% of the text legible, respectively. Here, a zoom scale that makes text legible is such that the
        text would have an apparent font size of a hard-coded constant (currently, 12) after zooming. This means the
        first and second text legibility scales may end up being close to one another, or even the same (in the case
        where there is only a single font size in the entire document). In this case, we just snap the first scale to
        the second, so that double tapping will only toggle between two zoom scales. In another case where the document
        has no text (e.g. an image document), we just fall back to a zoom scale of 1.

        Test: fast/events/extrazoom/double-tap-to-zoom-on-full-width-text.html

        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):

2018-04-17  Megan Gardner  <megan_gardner@apple.com>

        Don't activate selection on become first responder
        https://bugs.webkit.org/show_bug.cgi?id=184719

        Reviewed by Tim Horton.
        
        If we activate the selection immediately on becoming first responder, we cause the selection view to delete itself
        since it is not guaranteed to have selection rects immediately due to async/two process architecture. The selection
        is activated already when the selection rects change, so there is no reason to activate it now. This has likely worked
        in the past because this selection assistant was only for editable text, which would immediately set a caret, which 
        is a selection. Now that this is for non-editable text as well, activating the selection is problematic.

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

2018-04-11  Brian Burg  <bburg@apple.com>

        Web Automation: simulated mouse interactions should not be done until associated DOM events have been dispatched
        https://bugs.webkit.org/show_bug.cgi?id=184462
        <rdar://problem/39323336>

        Reviewed by Carlos Garcia Campos and Tim Horton.

        Covered by existing layout tests and actions endpoints in WebDriver test suite.

        In preparation for implementing the W3C WebDriver command "Perform Actions", we need a way to
        know when a simulated mouse event has been fully processed by WebProcess and it is okay to continue
        to dispatch more simulated events.

        This patch makes mouse events go through a queue as they are delivered to WebPageProxy. The approach
        is very similar to how key events are handled. In the key event case, lots of WebEvents can come out
        of typing one keystroke, so these need to be queued up and retired one by one when the WebProcess has
        finished handling each event. In some mouse event cases---particularly fake mouse moves---there can
        also be more than one mouse event waiting to be handled by WebProcess.

        In the past, these queued mouse events were tracked with several member variables as different
        use cases emerged. These are all replaced with ordinary deque operations, such as peeking or
        checking the queue length.

        * Platform/Logging.h: Add logging channel for mouse events.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::AutomationCommandError::toProtocolString): Add type-safe helper class for command errors.
        In future patches we can hide knowledge of how this is sent over the protocol by relying more on
        the convenience constructors and .toProtocolString() method.

        (WebKit::WebAutomationSession::willShowJavaScriptDialog):
        This section needs adjustments. Since performMouseInteraction now depends on key events being processed
        prior to returning from the command, we need to abort any key event callbacks that are pending if an
        alert pops up as a result of sending a mousedown event. Any mouse events that are still queued will
        be handled when the alert is dismissed and the nested run loop exits.

        (WebKit::WebAutomationSession::mouseEventsFlushedForPage):
        (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
        Modernize this a bit. Don't spread knowledge about how commands are sent back out into event handling code.
        Our wrapper callbacks in performXXXInteraction handle the protocol-specific details of the response.

        (WebKit::WebAutomationSession::performMouseInteraction):
        Add code similar to performKeyboardInteractions so that the command doesn't finish until the mouse
        event has been fully handled. Unlike keyboards, sometimes mouse interactions don't turn into WebEvents
        so we also need to handle the case where there is nothing to be waited on because hit testing did
        not return a target to deliver the event to.

        (WebKit::WebAutomationSession::performKeyboardInteractions):
        Modernize a little bit to use generic callbacks rather than protocol-generated callbacks in the
        event waiting/handling code. Now it matches the types used for the mouse event case.

        * UIProcess/Automation/WebAutomationSession.h:
        (WebKit::AutomationCommandError::AutomationCommandError):
        Add a helper struct to hold an enumerated error name and an optional free-form error message.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::webMouseEventTypeString):
        (WebKit::webKeyboardEventTypeString):
        (WebKit::WebPageProxy::handleMouseEvent):
        (WebKit::WebPageProxy::processNextQueuedMouseEvent):
        Split the old method into handleMouseEvent (called by other code) and processNextQueuedMouseEvent.
        The latter sends the next mouse event to WebProcess, and can be triggered in didReceiveEvent
        if there are more mouse events to be sent to WebProcess.

        (WebKit::WebPageProxy::isProcessingMouseEvents const): Added.
        (WebKit::WebPageProxy::currentlyProcessedMouseDownEvent): Reimplemented on top of the deque.
        (WebKit::WebPageProxy::didReceiveEvent):
        Unify the code paths for different mouse event types to all use the deque. They also will
        notify the automation session if there are no more mouse events to send (i.e., interaction is over).

        (WebKit::WebPageProxy::resetStateAfterProcessExited): Add handling for new map.

2018-04-17  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Build failure due to presence of Avahi's <dns_sd.h> header
        https://bugs.webkit.org/show_bug.cgi?id=184711

        Unreviewed build fix.

        * NetworkProcess/webrtc/NetworkMDNSRegister.h: Set ENABLE_MDNS only for PLATFORM(COCOA).

2018-04-17  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed rollout of r230632. Regression in memory usage.

        That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569.

        * Shared/WebPreferences.yaml:

2018-04-17  Timothy Hatcher  <timothy@apple.com>

        Always use LayerContentsType::IOSurface in minimal simulator mode
        https://bugs.webkit.org/show_bug.cgi?id=184710

        Reviewed by Simon Fraser.

        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::updateLayerTree):

2018-04-17  Ryosuke Niwa  <rniwa@webkit.org>

        Release assert in InjectedBundle::postSynchronousMessage
        https://bugs.webkit.org/show_bug.cgi?id=184683

        Reviewed by Wenson Hsieh.

        Some injected bundles sends sync message when it's not safe to execute scripts.

        Use DoNotProcessIncomingMessagesWhenWaitingForSyncReply option in InjectedBundle::postSynchronousMessage
        to avoid processing incoming sync IPC messages so that we don't execute arbitrary scripts in those cases.

        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::postSynchronousMessage):

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

        REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab
        https://bugs.webkit.org/show_bug.cgi?id=184678
        <rdar://problem/39422122>

        Reviewed by Alex Christensen.

        Re-introduce synchronous code path which existed pre-r229831 and use it for fragment navigations.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2018-04-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] GObject introspection annotation fixes: BackForwardList, NetworkProxySettings
        https://bugs.webkit.org/show_bug.cgi?id=184658

        Reviewed by Carlos Garcia Campos.

        Thanks to Dylan Simon for recommending these annotation fixes.

        * UIProcess/API/glib/WebKitBackForwardList.cpp:
        * UIProcess/API/glib/WebKitNetworkProxySettings.cpp:

2018-04-17  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Don't establish unneeded Dock connections (Follow-up)
        https://bugs.webkit.org/show_bug.cgi?id=184664
        <rdar://problem/16863698>

        Reviewed by Per Arne Vollan.

        Because the Plugin process is driven by NSApplication's run loop, we aren't
        setting the 'don't connect to the dock' setting early enough.

        This patch sets the flag in XPCServiceMain for those services that
        are linked to AppKit.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializeProcess): Remove unneeded code.
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
        (main):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Remove unneeded code.

2018-04-17  Saam Barati  <sbarati@apple.com>

        Add system trace points for process launch and for initializeWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=184669

        Reviewed by Simon Fraser.

        * UIProcess/Launcher/ProcessLauncher.cpp:
        (WebKit::ProcessLauncher::ProcessLauncher):
        (WebKit::ProcessLauncher::didFinishLaunchingProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-04-16  Timothy Hatcher  <timothy@apple.com>

        Unreviewed 32-bit build fix for r230673.

        https://bugs.webkit.org/show_bug.cgi?id=184657
        rdar://problem/39463307

        * Configurations/PluginProcessShim.xcconfig: Use the correct names.

2018-04-16  Andy Estes  <aestes@apple.com>

        [iOS] Enable WKPDFView by default
        https://bugs.webkit.org/show_bug.cgi?id=184675
        <rdar://problem/27885452>

        Reviewed by Darin Adler.

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

2018-04-16  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Don't establish unneeded Dock connections
        https://bugs.webkit.org/show_bug.cgi?id=184664
        <rdar://problem/16863698>

        Reviewed by Simon Fraser.

        There is no reason for the WebContent or Plugin processes to interact with
        the Dock. We should tell AppKit that we don't want this connection, and to
        avoid creating such connections.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializeProcess): Tell NSApplication to
        not create a Dock connection.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Ditto.

2018-04-16  Megan Gardner  <megan_gardner@apple.com>

        Switch to UIWKTextInteractionAssistant for non-editable text
        https://bugs.webkit.org/show_bug.cgi?id=182834

        Reviewed by Beth Dakin.
        
        Switch to only using one assistant for text selection.

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

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

        Use NetworkLoadChecker to handle synchronous HTTP loads
        https://bugs.webkit.org/show_bug.cgi?id=184240

        Reviewed by Chris Dumez.

        For every NetworkResourceLoader synchronous load, we create a NetworkLoadChecker.
        NetworkLoadChecker handles all security checks in that case.
        This allows supporting cross-origin loads for synchronous XHR.

        Updated NetworkCORSPreflightChecker to return the result as a ResourceError.
        This is used to convey any error message from NetworkProcess to the JS console.
        Ensure NetworkCORSPreflightChecker computes correctly Access-Control-Request-Headers value
        by providing the headers set by the application plus Referrer/Origin.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
        (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
        (WebKit::NetworkCORSPreflightChecker::wasBlocked):
        (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::validateCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        * WebProcess/Network/WebLoaderStrategy.h:

2018-04-16  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: add SPI to terminate automation session and disconnect the remote end
        https://bugs.webkit.org/show_bug.cgi?id=184523
        <rdar://problem/39368599>

        Reviewed by Simon Fraser.

        When a user breaks the automation glass pane and chooses "Stop Session", there is no way
        for Safari to actually disconnect the remote connection using automation-related ObjC SPI.
        This can lead to sessions getting stuck and safaridriver is unable to request a new session.

        Expose the -terminate method as SPI. This disconnects the remote connection and then notifies
        the session delegate that the remote disconnected. At that point, Safari can uninstall
        the session from the process pool and tear down other session state.

        * UIProcess/API/Cocoa/_WKAutomationSession.h:
        * UIProcess/API/Cocoa/_WKAutomationSession.mm:
        (-[_WKAutomationSession terminate]):

2018-04-16  Timothy Hatcher  <timothy@apple.com>

        Clean up OTHER_LDFLAGS for WebKit processes
        https://bugs.webkit.org/show_bug.cgi?id=184657

        Reviewed by Jer Noble.

        * Configurations/PluginProcessShim.xcconfig:
        * Configurations/PluginService.32.xcconfig:
        * Configurations/PluginService.64.xcconfig:
        * Configurations/WebContentService.xcconfig:

2018-04-15  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Install files needed for WebKitWebExtensions
        https://bugs.webkit.org/show_bug.cgi?id=179915

        Reviewed by Žan Doberšek.

        * PlatformWPE.cmake: Install pkg-config file, injected bundle, and API headers.
        * UIProcess/API/glib/WebKitWebContext.cpp: Load the injected bundle when installed.
        * wpe/wpe-web-extension.pc.in: Added.

2018-04-14  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>

        [GTK][WPE] Build is broken after r230640
        https://bugs.webkit.org/show_bug.cgi?id=184623

        Reviewed by Žan Doberšek.

        UIProcess/SuspendedPageProxy.cpp was not included to CMake build in r230640.

        * CMakeLists.txt: Added UIProcess/SuspendedPageProxy.cpp to WebKit_SOURCES.

2018-04-13  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r230447.

        Caused flaky selection test failures on iOS

        Reverted changeset:

        "Switch to UIWKTextInteractionAssistant for non-editable text"
        https://bugs.webkit.org/show_bug.cgi?id=182834
        https://trac.webkit.org/changeset/230447

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

        Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame
        https://bugs.webkit.org/show_bug.cgi?id=184591

        Reviewed by Sam Weinig.

        Split WindowProxy handling out of ScriptController and into a new class owned by AbstractFrame.
        RemoteFrames do not need a ScriptController but do need to maintain WindowProxies.
        This is work towards fixing Bug 184515.

        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::windowScriptNPObject):

2018-04-13  Brady Eidson  <beidson@apple.com>

        Introduce SuspendedPageProxy to keep old web processes around after their WebPageProxy has been swapped to a new one.
        https://bugs.webkit.org/show_bug.cgi?id=184559

        Reviewed by Alex Christensen.

        Before this patch, when a WebPageProxy navigates and is swapped to a new process, the old process almost always goes away.

        This is not desirable for a few reasons:
        1 - We can't keep the PageCache working for back/forward scenarios
        2 - We throw away a "foo.com" web process, meaning the next time we need to host a "foo.com" web page we have to launch
            and initialize a new web process.

        This patch adds a SuspendedPageProxy object to keep around the old web process and to manage communication with it.

        For now, a WebPageProxy keeps exactly one "suspended page" representing the most recently visited page and its process.
        Additionally, that process is never reused.

        So no benefit is achieved with this patch, but it enables future benefits.

        * Platform/Logging.h:

        * Shared/WebBackForwardListItem.cpp:
        (WebKit::WebBackForwardListItem::setSuspendedPage):
        * Shared/WebBackForwardListItem.h:

        New object to represent the state of a WebPageProxy in an old web process that is not currently hosting the view.
        * UIProcess/SuspendedPageProxy.cpp: Added.
        (WebKit::SuspendedPageProxy::SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
        (WebKit::SuspendedPageProxy::webProcessDidClose):
        (WebKit::SuspendedPageProxy::didFinishLoad):
        (WebKit::SuspendedPageProxy::didReceiveMessage):
        (WebKit::SuspendedPageProxy::loggingString const):
        * UIProcess/SuspendedPageProxy.h: Copied from Source/WebKit/Platform/Logging.h.
        (WebKit::SuspendedPageProxy::create):
        (WebKit::SuspendedPageProxy::page const):
        (WebKit::SuspendedPageProxy::process const):
        (WebKit::SuspendedPageProxy::item const):
        (WebKit::SuspendedPageProxy::finishedSuspending const):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::attachToProcessForNavigation):
        (WebKit::WebPageProxy::maybeCreateSuspendedPage):
        (WebKit::WebPageProxy::suspendedPageProcessClosed):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        * UIProcess/WebPageProxy.h:

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::suspendWebPageProxy):
        (WebKit::WebProcessProxy::suspendedPageWasDestroyed):
        (WebKit::WebProcessProxy::removeWebPage):
        (WebKit::WebProcessProxy::didReceiveMessage): Optionally pass WebPageProxy messages along to SuspendedPageProxy objects.
        (WebKit::WebProcessProxy::didClose):
        (WebKit::WebProcessProxy::maybeShutDown):
        (WebKit::WebProcessProxy::canTerminateChildProcess): Don't terminate child processes if they still have suspended pages.
        * UIProcess/WebProcessProxy.h:

        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setIsSuspended):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::isSuspended const): For now, used only by WebProcess::updateActivePages. Will have more uses soon.
        * WebProcess/WebPage/WebPage.messages.in:

        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updateActivePages): Allow the UIProcess to request an update of the web processes user visible name.

2018-04-13  Daniel Bates  <dabates@apple.com>

        Inline NetworkLoad::sharedWillSendRedirectedRequest() into NetworkLoad::willPerformHTTPRedirection()
        https://bugs.webkit.org/show_bug.cgi?id=184593

        Reviewed by Alex Christensen.

        Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedWillSendRedirectedRequest()
        is only referenced from NetworkLoad::willPerformHTTPRedirection(). We should inline its
        implementation into the NetworkLoad::willPerformHTTPRedirection(), remove a function call,
        and the cognitive load to follow such a function call when reading the code.

        No functionality changed. So, no new tests.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::willPerformHTTPRedirection): Moved the implementation of NetworkLoad::sharedWillSendRedirectedRequest()
        into this function.
        (WebKit::NetworkLoad::sharedWillSendRedirectedRequest): Deleted. Moved its implementation
        into NetworkLoad::willPerformHTTPRedirection().
        * NetworkProcess/NetworkLoad.h:

2018-04-13  Daniel Bates  <dabates@apple.com>

        Inline NetworkLoad::sharedDidReceiveResponse() into NetworkLoad::notifyDidReceiveResponse()
        https://bugs.webkit.org/show_bug.cgi?id=184592

        Reviewed by Alex Christensen.

        Following the removal of the pre-Network Session code in r227364, NetworkLoad::sharedDidReceiveResponse()
        is only referenced from NetworkLoad::notifyDidReceiveResponse(). We should inline its
        implementation into the NetworkLoad::notifyDidReceiveResponse(), remove a function
        call, and the cognitive load to follow such a function call when reading the code.

        No functionality changed. So, no new tests.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::notifyDidReceiveResponse): Moved the implementation of NetworkLoad::sharedDidReceiveResponse()
        into this function.
        (WebKit::NetworkLoad::sharedDidReceiveResponse): Deleted. Moved its implementation into
        NetworkLoad::notifyDidReceiveResponse().
        * NetworkProcess/NetworkLoad.h:

2018-04-13  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r230468): Improper assertion firing under STP
        <rdar://problem/39411676>

        Unreviewed, rolling out an improper assertion.

        I added an assertion in Bug 184322 that should not have been added. I did not notice that this
        call stack was always used in builds where NSApp is still active. Builds where we stop relying
        on AppKit runloops uses a different code path to shut down.

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

2018-04-12  Antoine Quint  <graouts@apple.com>

        [Web Animations] Turn CSS Animations and CSS Transitions as Web Animations on by default
        https://bugs.webkit.org/show_bug.cgi?id=184569
        <rdar://problem/38671301>

        Reviewed by Jon Lee.

        * Shared/WebPreferences.yaml:

2018-04-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer] Convert GStreamerUtilities in GStreamerCommon and include the GStreamer smart pointer traits
        https://bugs.webkit.org/show_bug.cgi?id=184533

        Reviewed by Philippe Normand.

        Renamed GStreamerUtilities* files into GStreamerCommon* and
        modified files including them accordingly. Include
        GRefPtrGStreamer.h and GUniquePtrGStreamer.h in GStreamerCommon.h
        to avoid problems destroying objects when those files are
        forgotten to be included.

        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        * UIProcess/wpe/WebProcessPoolWPE.cpp:
        * WebProcess/soup/WebProcessSoup.cpp:

2018-04-12  Beth Dakin  <bdakin@apple.com>

        Fix the MOBILE_WIFI build
        https://bugs.webkit.org/show_bug.cgi?id=184571
        -and corresponding-
        <rdar://problem/39398181>

        Reviewed by Jer Noble.

        * config.h:

2018-04-12  Beth Dakin  <bdakin@apple.com>

        Use -iframework to ensure that frameworks from user paths and system paths are 
        ordered appropriately
        https://bugs.webkit.org/show_bug.cgi?id=184557
        -and corresponding-
        rdar://problem/39386359

        Reviewed by Dean Jackson.

        * Configurations/WebKit.xcconfig:

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

        [Extra zoom mode] Suppress UI for inputs of type file in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=184556
        <rdar://problem/39062239>

        Reviewed by Andy Estes.

        When running in this mode, we don't have the facilities to present document picker UI. For now, just make this
        feature fail gracefully.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel presentWithParameters:resultListener:]):
        (-[WKFileUploadPanel platformSupportsPickerViewController]):

2018-04-12  Megan Gardner  <megan_gardner@apple.com>

        Remove block selection code
        https://bugs.webkit.org/show_bug.cgi?id=184470

        Reviewed by Timothy Hatcher.
        
        Remove block selection code that isn't run and is currently not even used.
        Had to put this back in for a bug in the mid-year release, but we're past that
        so it's time for this to go away.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::stopAssistingNode):
        (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toSelectionHandlePosition): Deleted.
        (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
        (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
        (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::saveImageToLibrary):
        (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
        (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeAtWordBoundaryForPosition):
        (WebKit::distanceBetweenRectsForPosition): Deleted.
        (WebKit::rectsEssentiallyTheSame): Deleted.
        (WebKit::unionDOMRanges): Deleted.
        (WebKit::computeEdgeCenter): Deleted.
        (WebKit::WebPage::expandedRangeFromHandle): Deleted.
        (WebKit::WebPage::contractedRangeFromHandle): Deleted.
        (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
        (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
        (WebKit::shouldExpand): Deleted.
        (WebKit::WebPage::changeBlockSelection): Deleted.
        (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
        
2018-04-12  Megan Gardner  <megan_gardner@apple.com>

        Don't have selections get stuck in editable elements
        https://bugs.webkit.org/show_bug.cgi?id=184483

        Reviewed by Timothy Hatcher.
        
        When selecting in editable elements, if the keyboard does not come up, which is not required,
        then the selections are stuck in that element. If you try and select something in web content,
        it will only select in the editable element. By clearing the assisted node when clearing a selection,
        it no longer sticks. Also, textSelectionAssistant should not be used as if we are currently editing. 
        Change it to the function we created for that purpose in a pervious patch.

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

2018-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Move libWPEWebInspectorResources.so to pkglibdir
        https://bugs.webkit.org/show_bug.cgi?id=184379

        Reviewed by Žan Doberšek.

        This is important to allow parallel installation.

        * PlatformWPE.cmake:

2018-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Improve include hierarchy
        https://bugs.webkit.org/show_bug.cgi?id=184376

        Reviewed by Žan Doberšek.

        Install our headers under /usr/include/wpe-webkit-0.1/wpe instead of
        /usr/include/wpe-0.1/WPE/wpe. Too much WPE, not enough WebKit!

        * PlatformWPE.cmake:
        * wpe/wpe-webkit.pc.in:

2018-04-11  Andy Estes  <aestes@apple.com>

        [iOS] Add a mechanism for holding Wi-Fi assertions
        https://bugs.webkit.org/show_bug.cgi?id=184520
        <rdar://problem/39025726>

        Reviewed by Sam Weinig.

        Add plumbing for holding a Wi-Fi assertion on iOS as long as there are active
        network data tasks. This functionality is turned off by default right now.

        * Configurations/Network-iOS.entitlements:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        * NetworkProcess/cocoa/WiFiAssertionHolder.cpp: Added.
        (WebKit::ensureWiFiManagerClient): Create a global WiFiManagerClient when needed.
        (WebKit::WiFiAssertionHolder::WiFiAssertionHolder): If this is the first active
        Wi-Fi assertion holder, set the client's type to kWiFiClientTypeBackground.
        (WebKit::WiFiAssertionHolder::~WiFiAssertionHolder): If the last active Wi-Fi
        assertion holder is being destroyed, set the client's type back to
        kWiFiClientTypeNormal.
        * NetworkProcess/cocoa/WiFiAssertionHolder.h: Added.
        * Platform/Logging.h: Added a logging channel for Wi-Fi assertions.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
        * WebKit.xcodeproj/project.pbxproj:

2018-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Switch to use always complex text code path
        https://bugs.webkit.org/show_bug.cgi?id=183285

        Reviewed by Michael Catanzaro.

        Now that we have branched for 2.20, it's a good time to try using complex text path always. We can simply force
        it for GTK+ port and see how it works for the whole release cycle and if we don't notice any issues or
        performance regressions we release 2.22 with complex text path forced. A debug env variable is added to switch
        back to auto without having to recompile. After 2.22 is released we can make a final decision and remove the env
        variable.

        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Force complex text code path unless
        WEBKIT_FORCE_COMPLEX_TEXT is present and set to 0.

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

        [WPE] Make WebKitWebViewBackend object mandatory for webkit_web_view_new*() constructors
        https://bugs.webkit.org/show_bug.cgi?id=184513

        Reviewed by Michael Catanzaro.

        webkit_web_view_new*() constructors should always expect a non-null
        WebKitWebViewBackend object, forcing the user to specify how the
        wpe_view_backend object is managed for the WebKitWebView that's being
        created.

        webkitWebViewBackendCreateDefault() and the default
        _WebKitWebViewBackend() constructor are removed. WPE-specific
        webkit_web_view_new*() entrypoints are updated to bail if the passed-in
        WebKitWebViewBackend object is null. Documentation is updated
        accordingly.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewConstructed):
        * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
        (webkitWebViewBackendCreateDefault): Deleted.
        * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
        * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
        (webkit_web_view_new):
        (webkit_web_view_new_with_context):
        (webkit_web_view_new_with_related_view):
        (webkit_web_view_new_with_settings):
        (webkit_web_view_new_with_user_content_manager):

2018-04-11  Fujii Hironori  <Hironori.Fujii@sony.com>

        [curl][WebKit] Implement NetworkDataTaskCurl
        https://bugs.webkit.org/show_bug.cgi?id=184488

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create):
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp: Added.
        (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
        (WebKit::NetworkDataTaskCurl::~NetworkDataTaskCurl):
        (WebKit::NetworkDataTaskCurl::resume):
        (WebKit::NetworkDataTaskCurl::suspend):
        (WebKit::NetworkDataTaskCurl::cancel):
        (WebKit::NetworkDataTaskCurl::invalidateAndCancel):
        (WebKit::NetworkDataTaskCurl::state const):
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        (WebKit::NetworkDataTaskCurl::curlDidSendData):
        (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
        (WebKit::NetworkDataTaskCurl::curlDidReceiveBuffer):
        (WebKit::NetworkDataTaskCurl::curlDidComplete):
        (WebKit::NetworkDataTaskCurl::curlDidFailWithError):
        (WebKit::NetworkDataTaskCurl::shouldRedirectAsGET):
        (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
        (WebKit::NetworkDataTaskCurl::restartWithCredential):
        (WebKit::NetworkDataTaskCurl::appendCookieHeader):
        (WebKit::NetworkDataTaskCurl::handleCookieHeaders):
        * NetworkProcess/curl/NetworkDataTaskCurl.h: Added.
        * PlatformWin.cmake:

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

        [Extra zoom mode] Support pushing input view controllers onto the navigation stack
        https://bugs.webkit.org/show_bug.cgi?id=184397
        <rdar://problem/39265294>

        Reviewed by Timothy Hatcher.

        Currently, all input view controllers in extra zoom mode are presented modally. However, the latest iteration of
        the HI specification depicts most of these view controllers (with the exception of time pickers) being presented
        and dismissed via navigation stack. Since WebKit's iOS API surface doesn't force clients to embed WKWebViews
        within a view controller with a corresponding UINavigationController, we cannot always guarantee that UI
        presented when focusing form controls in a web view will be pushed onto the navigation stack; as such, the
        approach taken in this patch will automatically allow WKWebView clients that already embed WKWebViews within a
        UINavigationController to hook into this behavior, with modal presentation as a fallback.

        At a high level, this patch makes the following tweaks to implement this behavior:

        1. Store the currently presented view controller using a single member variable
           (_presentedFullScreenInputViewController) instead of having one for each type. This makes bookkeepping around
           which view controller to present or dismiss much more straightforward.

        2. Replace WKFocusedFormControlViewController with just WKFocusedFormControlView. This addresses problems with
           pushing an input view controller onto the navigation stack after presenting the focused form control view
           controller modally. Now, we'll only need to present or push one view controller on the navigation stack.

        3. Remove -handleWheelEvent: forwarding to date and time pickers. Pushing date picker view controllers onto the
           navigation stack rather than presenting them modally means that we end up in a state where neither the
           WKContentView nor WKTimePickerViewController are first responder, which renders time pickers unusable.
           Instead, have the WKTimePickerViewController actually become first responder when presenting.

        4. Lastly, and most importantly: change -presentViewControllerForCurrentAssistedNode and
           -dismissAllInputViewControllers to try and push onto a navigation stack if possible, and fall back to modal
           presentation.

        * UIProcess/ios/WKContentViewInteraction.h:

        Remove the separate member variables for each type of input view controller, and instead have one to keep track
        of the current (and only) presented input view controller.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _willStartScrollingOrZooming]):
        (-[WKContentView _didEndScrollingOrZooming]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _stopAssistingNode]):

        Boilerplate renaming of _focusedFormControlViewController => _focusedFormControlView.

        (-[WKContentView reloadContextViewForPresentedListViewController]):

        Adjust for consolidation of the different input view controller member variables to a single member (see changes
        in WKContentViewInteraction.h).

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

        Add an `animated` argument. In the case where a different view controller was presented after presenting the
        input view controller, this allows us to dismiss the other view controller with animation, and directly reveal
        the web view or focus overlay underneath.

        (-[WKContentView focusedFormControlViewDidSubmit:]):
        (-[WKContentView focusedFormControlViewDidCancel:]):
        (-[WKContentView focusedFormControlViewDidBeginEditing:]):
        (-[WKContentView rectForFocusedFormControlView:]):
        (-[WKContentView nextRectForFocusedFormControlView:]):
        (-[WKContentView previousRectForFocusedFormControlView:]):
        (-[WKContentView scrollViewForFocusedFormControlView:]):
        (-[WKContentView actionNameForFocusedFormControlView:]):
        (-[WKContentView focusedFormControlViewDidRequestNextNode:]):
        (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]):
        (-[WKContentView hasNextNodeForFocusedFormControlView:]):
        (-[WKContentView hasPreviousNodeForFocusedFormControlView:]):
        (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):

        Boilerplate renaming of focus overlay delegate methods.

        (-[WKContentView _wheelChangedWithEvent:]):

        Remove event forwarding hacks for date and time inputs, now that they directly become first responder.

        (-[WKContentView presentFocusedFormControlViewController:]): Deleted.
        (-[WKContentView dismissFocusedFormControlViewController:]): Deleted.

        Renamed to -addFocusedFormControlOverlay and -removeFocusedFormControlOverlay.

        (-[WKContentView dismissAllInputViewControllers]): Deleted.
        (-[WKContentView focusedFormControlControllerDidSubmit:]): Deleted.
        (-[WKContentView focusedFormControlControllerDidCancel:]): Deleted.
        (-[WKContentView focusedFormControlControllerDidBeginEditing:]): Deleted.
        (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
        (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
        (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
        (-[WKContentView scrollViewForFocusedFormControlController:]): Deleted.
        (-[WKContentView actionNameForFocusedFormControlController:]): Deleted.
        (-[WKContentView focusedFormControlControllerDidRequestNextNode:]): Deleted.
        (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]): Deleted.
        (-[WKContentView hasNextNodeForFocusedFormControlController:]): Deleted.
        (-[WKContentView hasPreviousNodeForFocusedFormControlController:]): Deleted.
        * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Removed.
        * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Removed.

        Completely remove WKFocusedFormControlViewController; instead, just directly place the focused form overlay in
        the WKWebView's hierarchy. In the case where we have a navigation stack to push to, we can no longer modally
        present the focused form overlay as a separate view controller using the UINavigationController, and then
        immediately push the input view controller on top of the navigation stack, since the navigation stack isn't
        updated until after the animation of the focused form overlay presentation is complete. Rather than hack around
        this limitation by dispatch_after-ing after presenting the overlay's view controller, we should just make the
        overlay a view. This also fixes the case where a client embedding a WKWebView that is smaller than the bounds of
        the screen will no longer see the entire screen dim when focusing an input, but instead, just the web content.

        * WebKit.xcodeproj/project.pbxproj:

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

        Pass FetchOptions and SecurityOrigin as load parameters from WebProcess to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=184374

        Reviewed by Chris Dumez.

        Pass full FetchOptions parameters as part of NetworkResourceLoadParameters.
        This will allow handling redirection mode as well as credentials in case of cross origin redirections.
        In case of SameOrigin credentials and there is a redirection from same-origin to cross-origin,
        we will be able to stop using credentials without going to WebProcess.

        To handle properly cross-origin checks, we have to be able to use SecurityOrigin as in WebProcess.
        We make WebProcess sends Origin Access White list information to NetworkProcess.
        This allows supporting the white list when doing loading in NetworkProcess.
        This only works consistently if all WebProcesses share the same whitelist.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
        (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
        (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):
        (WebKit::NetworkLoadChecker::checkCORSRequest):
        (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::create):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::willPerformHTTPRedirection):
        * NetworkProcess/PingLoad.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
        (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
        (WebKit::InjectedBundle::resetOriginAccessWhitelists):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::startPingLoad):

2018-04-11  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] WaylandCompositorDisplay leaks its wl_display
        https://bugs.webkit.org/show_bug.cgi?id=184406

        Reviewed by Carlos Garcia Campos.

        Since we allocate our own wl_display here, need to chain up to the parent constructor
        passing NativeDisplayOwned::Yes, or it won't ever be released. Move the initialize call to
        the create function to ensure it's called after the constructor completes.

        * WebProcess/gtk/WaylandCompositorDisplay.cpp:
        (WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
        (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay):

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

        Use more r-values in NetworkResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=184478

        Reviewed by Chris Dumez.

        Pass load parameters as r-values to remove some unneeded copies.
        Ditto for ResourceRequest inside NetworkResourceLoader.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
        (WebKit::NetworkResourceLoader::start):
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        (WebKit::NetworkResourceLoader::continueWillSendRequest):
        (WebKit::NetworkResourceLoader::validateCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:

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

        [Extra zoom mode] Missing label when focusing a <select> with a title attribute but no associated <label>
        https://bugs.webkit.org/show_bug.cgi?id=184352
        <rdar://problem/39237683>

        Reviewed by Andy Estes.

        Currently, AssistedNodeInformation only sends the `title` of input elements to the UI process. This means that
        any information requested in the UI process that is dependent on the `title` of the focused element is broken
        in the case of select elements. An existing example of this is the title of the table view controller used to
        present select menus on iPad.

        To fix this, we simply send the `title` of the focused element across, as long as the focused element is an
        HTMLElement. This ensures that there's label text when focusing unlabeled select elements with titles in extra
        zoom mode, and also fixes a currenly broken codepath where we show the title of the select in the presented view
        controller's title.

        Test: fast/forms/ios/ipad/select-with-title.html

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

        Add new testing SPI to fetch the title of the UITableViewController presented for the currently focused select
        element.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView selectFormPopoverTitle]):
        * UIProcess/ios/forms/WKFormSelectControl.h:
        * UIProcess/ios/forms/WKFormSelectControl.mm:
        (-[WKFormSelectControl selectFormPopoverTitle]):
        * UIProcess/ios/forms/WKFormSelectPopover.h:
        * UIProcess/ios/forms/WKFormSelectPopover.mm:
        (-[WKSelectPopover initWithView:hasGroups:]):
        (-[WKSelectPopover tableViewController]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:

        Always send the title across if the focused node is an HTMLElement.

        (WebKit::WebPage::getAssistedNodeInformation):

2018-04-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r230508.

        Breaks internal builds.

        Reverted changeset:

        "Remove block selection code"
        https://bugs.webkit.org/show_bug.cgi?id=184470
        https://trac.webkit.org/changeset/230508

2018-04-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Turn Web Animations on by default
        https://bugs.webkit.org/show_bug.cgi?id=184491

        Reviewed by Simon Fraser.

        * Shared/WebPreferences.yaml:

2018-04-10  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed test fix after r230468

        Roll out an assertion added in r230468 that should not be present
        until https://bugs.webkit.org/show_bug.cgi?id=184451 is landed.

        * Shared/mac/HangDetectionDisablerMac.mm:
        (WebKit::setClientsMayIgnoreEvents):

2018-04-10  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed follow-up to r230468.

        Switch some RELEASE_ASSERTs in hot codepaths to normal DEBUG asserts.

        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::isViewWindowActive):
        (WebKit::PageClientImpl::setCursor):

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

        [Win] Add UserAgentWin.cpp
        https://bugs.webkit.org/show_bug.cgi?id=184438

        Reviewed by Michael Catanzaro.

        * WebProcess/WebPage/win/WebPageWin.cpp:
        (WebKit::WebPage::platformUserAgent const):
        Use WebCore::standardUserAgentForURL.

2018-04-10  Megan Gardner  <megan_gardner@apple.com>

        Remove block selection code
        https://bugs.webkit.org/show_bug.cgi?id=184470

        Reviewed by Timothy Hatcher.
        
        Remove block selection code that isn't run and is currently not even used.
        Had to put this back in for a bug in the mid-year release, but we're past that
        so it's time for this to go away.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::stopAssistingNode):
        (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toSelectionHandlePosition): Deleted.
        (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
        (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): Deleted.
        (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::saveImageToLibrary):
        (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
        (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::rangeAtWordBoundaryForPosition):
        (WebKit::distanceBetweenRectsForPosition): Deleted.
        (WebKit::rectsEssentiallyTheSame): Deleted.
        (WebKit::unionDOMRanges): Deleted.
        (WebKit::computeEdgeCenter): Deleted.
        (WebKit::WebPage::expandedRangeFromHandle): Deleted.
        (WebKit::WebPage::contractedRangeFromHandle): Deleted.
        (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
        (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
        (WebKit::shouldExpand): Deleted.
        (WebKit::WebPage::changeBlockSelection): Deleted.
        (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.

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

        [Extra zoom mode] Add a mechanism to zoom to fixed scales when double tapping in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=184435
        <rdar://problem/38726260>

        Reviewed by Dean Jackson.

        Adds support for an alternate codepath when computing a zoom rect when double tapping that doesn't take the hit-
        tested node into account, and instead cycles the zoom scale between 2 fixed values (in addition to the initial
        scale). In the next patch, these fixed scales will be determined by computing zoom scales needed to make most of
        the text on the page legible (i.e. the first text legibility zoom scale), and another to make all of the text on
        the page legible, with the exception of outliers (this is the second text legibility zoom scale).

        See comments below for more detail.

        * UIProcess/Cocoa/ViewGestureController.h:
        * UIProcess/Cocoa/ViewGestureController.messages.in:
        * UIProcess/ios/SmartMagnificationController.h:
        * UIProcess/ios/SmartMagnificationController.messages.in:
        * UIProcess/ios/SmartMagnificationController.mm:
        (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
        * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
        (WebKit::ViewGestureGeometryCollector::dispatchDidCollectGeometryForSmartMagnificationGesture):

        Rename the boolean `isReplacedElement` argument to `fitEntireRect` instead. The UI process only uses this on iOS
        to determine whether or not to fit the entire element rect to the viewport and add padding. This patch renames
        this variable because we are not zooming to a replaced element in the case where text legibility on the page
        (rather than element geometry) is being used to figure out the zoom scale, but we still want to fit the entire
        target rect to the viewport.

        (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):

        If text legiblity zoom scaling is preferred, then compute first and second-level text legibility zoom scales to
        zoom to upon double tap (where the second zoom scale is greater than the first). To choose a target zoom
        scale, choose the lowest target zoom scale that is at least a small amount less than the current scale. If
        neither of the two scales fulfill this description, then zoom back out to the initial scale. This has the effect
        of consistently cycling between all three zoom scales as the user double taps.

        (WebKit::ViewGestureGeometryCollector::computeTextLegibilityScales):

        Introduce a new helper method that computes and caches target scales to zoom to when double tapping to zoom. If
        a cached pair of target scales is already present, it skips this computation and immediately returns it.

        (WebKit::ViewGestureGeometryCollector::computeZoomInformationForNode):
        (WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const):

        Factor out logic to compute min and max zoom scales into a separate helper, and call it from both
        computeZoomInformationForNode and computeTextLegibilityScales.

        (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):

        Invalidate cached text legibility scales when layout is triggered.

        * WebProcess/WebPage/ViewGestureGeometryCollector.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::mainFrameDidLayout):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::viewportConfiguration const):

        Expose WebPage's ViewportConfiguration as a const reference.

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

        Adds a platform hook for opting into text-legibility-based zoom scaling instead of regular hit-testing-based
        zoom scaling heuristics.

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

        Fix availability annotations for _WKAttachment SPI
        https://bugs.webkit.org/show_bug.cgi?id=184473
        <rdar://problem/39319732>

        Reviewed by Dan Bernstein.

        _WKAttachmentInfo is available in WK_MAC_TBA and WK_IOS_TBA, but the SPI method -[_WKAttachment requestInfo:]
        is currently available in macOS 10.13.4 and iOS 11.3. Instead, the availability of this SPI should match the
        availability of the SPI object it depends on.

        * UIProcess/API/Cocoa/_WKAttachment.h:

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

        Avoid constructing a service worker RegistrationStore for private sessions
        https://bugs.webkit.org/show_bug.cgi?id=184463
        <rdar://problem/36613948>

        Reviewed by Youenn Fablet.

        Avoid constructing a service worker RegistrationStore for private sessions since there
        is no need for persistence and the registrationDatabaseDirectory is the empty string in
        such cases.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::initializeWebsiteDataStore):

2018-04-10  Andy Estes  <aestes@apple.com>

        [iOS] Navigate to URL and page number annotations in WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=184410

        Reviewed by Timothy Hatcher.

        Implemented navigation to URL and page number (same-document) link annotations in PDFs.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _scrollToURLFragment:]):
        (-[WKPDFView web_didSameDocumentNavigation:]):
        (-[WKPDFView pdfHostViewController:updatePageCount:]):
        (-[WKPDFView pdfHostViewController:goToURL:]):
        (-[WKPDFView pdfHostViewController:goToPageIndex:withViewFrustum:]):

2018-04-10  Andy Estes  <aestes@apple.com>

        [iOS] WKPDFView should conform to _WKWebViewPrintProvider
        https://bugs.webkit.org/show_bug.cgi?id=184471

        Reviewed by Dan Bernstein.

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

        The print provider will always be either _contentView or _customContentView, but
        might not be _currentContentView.

        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _wk_pageCountForPrintFormatter:]):

        Asked _hostViewController for the page count, clamped to 1 if
        -[_WKWebViewPrintFormatter snapshotFirstPage] is YES.

        (-[WKPDFView _wk_printedDocument]):

        Created a CGPDFDocumentRef from _data and returned it.

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

        Beacon redirect responses should be CORS validated
        https://bugs.webkit.org/show_bug.cgi?id=184378

        Reviewed by Chris Dumez.

        Add CORS checks to any redirection response if mode is CORS.
        Update response tainting and redirected accordingly.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::validateResponse):
        * NetworkProcess/NetworkLoadChecker.h:
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::willPerformHTTPRedirection):

2018-04-10  Sihui Liu  <sihui_liu@apple.com>

        Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
        https://bugs.webkit.org/show_bug.cgi?id=184268
        <rdar://problem/39144446>

        Reviewed by Chris Dumez.

        Webpage for multipart stream responses failed to refresh because content policy was set to 
        be ignore when provisonalDocumentLoader was null and navigation ID could not be retrieved. 
        As loading should not stop in this case, we set navigation ID 0 and still ask for content 
        policy.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

2018-04-10  Andy Estes  <aestes@apple.com>

        [iOS] Use PDFKit to render PDFs in WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=184387

        Reviewed by Beth Dakin.

        Adopted PDFHostViewController for rendering PDFs in WKWebView.

        This patch implements rendering the PDF document and page number indicator. Link
        navigation, find-in-page, and printing will be implemented in follow-up patches.

        WKLegacyPDFView is still the default PDF view.

        * Configurations/WebKit.xcconfig:

        Linked WebKit with PDFKit on iOS.

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

        When WKPDFView loads a PDF document, it replaces itself with a view vended by
        PDFHostViewController as the WKScrollView's content view. Abstracted WKWebView's
        concept of the "current content view" to be either the WKContentView or a view of
        the custom content view's choosing (-web_contentView).

        (-[WKWebView scrollViewWillBeginZooming:withView:]):
        (-[WKWebView scrollViewDidZoom:]):
        (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):

        Forwarded these calls to _customContentView if it responds to the equivalent
        WKWebViewContentProvider selectors.

        * UIProcess/Cocoa/WKWebViewContentProvider.h:

        Defined new protocol selectors.

        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry init]):
        * UIProcess/ios/WKLegacyPDFView.h:
        * UIProcess/ios/WKLegacyPDFView.mm:

        Changed ENABLE(WKPDFVIEW) to ENABLE(WKLEGACYPDFVIEW).

        (-[WKLegacyPDFView web_contentView]):

        Added. Returns self as the content view.

        * UIProcess/ios/WKPDFView.h: Added.
        * UIProcess/ios/WKPDFView.mm: Added.
        (-[WKPDFView dealloc]):

        Removed the host view and page number indicator from their superviews.

        (-[WKPDFView gestureRecognizerShouldBegin:]):

        Forwarded to _hostViewController.

        (-[WKPDFView web_initWithFrame:webView:]):

        Set ours and the scroll view's background color to UIColor.grayColor to match
        WKLegacyPDFView.

        (-[WKPDFView web_setContentProviderData:suggestedFilename:]):

        Created a PDFHostViewController and set its root view as the scroll view's content
        view after removing the WKPDFView itself. This allows WKPDFView to act as a
        placeholder content view until the PDF is loaded. Added the host view controller's
        page number indicator to the fixed overlay view. Finally, loaded the PDF document
        by calling -[PDFHostViewController setDocumentData:withScrollView:].

        (-[WKPDFView _offsetForPageNumberIndicator]):

        Computed an offset for the page number indicator like WKLegacyPDFView did, taking
        into account the overlaid accessory views inset, computed unobscured safe area
        inset, and computed obscured inset.

        (-[WKPDFView _movePageNumberIndicatorToPoint:animated:]):

        Moved the page number indicator using the margin and animation duration from
        WKLegacyPDFView.

        (-[WKPDFView _updateLayoutAnimated:]):

        Added a convenience method to update the PDF view layout and position the page
        number indicator.

        (-[WKPDFView web_setMinimumSize:]):

        Updated our own frame in case we are still the placeholder content view.
        Called -_updateLayoutAnimated:.

        (-[WKPDFView web_setOverlaidAccessoryViewsInset:]):

        Stored the inset and called -_updateLayoutAnimated:.

        (-[WKPDFView web_computedContentInsetDidChange]):

        Called -_updateLayoutAnimated:.

        (-[WKPDFView web_setFixedOverlayView:]):

        Stored the fixed overlay view.

        (-[WKPDFView web_didSameDocumentNavigation:]):
        (-[WKPDFView web_countStringMatches:options:maxCount:]):
        (-[WKPDFView web_findString:options:maxCount:]):
        (-[WKPDFView web_hideFindUI]):

        Added FIXMEs.

        (-[WKPDFView web_contentView]):

        If there is a host view controller, return its root view. Otherwise, return self.

        (-[WKPDFView web_scrollViewDidScroll:]):
        (-[WKPDFView web_scrollViewWillBeginZooming:withView:]):
        (-[WKPDFView web_scrollViewDidEndZooming:withView:atScale:]):
        (-[WKPDFView web_scrollViewDidZoom:]):

        Called -[PDFHostViewController updatePDFViewLayout].

        (-[WKPDFView web_dataRepresentation]):

        Returned _data.

        (-[WKPDFView web_suggestedFilename]):

        Returned _suggestedFilename.

        (-[WKPDFView web_isBackground]):

        Returned self.isBackground.

        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView web_contentView]):

        Added. Returns self as the content view.

        * WebKit.xcodeproj/project.pbxproj:

2018-04-10  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Race condition when destroying webprocesses
        https://bugs.webkit.org/show_bug.cgi?id=184445

        Reviewed by Carlos Garcia Campos.

        Ensure that the WebProcess is properly closing its pages when it's exiting because
        the UIProcess has invalidated the IPC connection.

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

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

        Add missing availability macros after r230462
        https://bugs.webkit.org/show_bug.cgi?id=184426

        Reviewed by Timothy Hatcher.

        Annotate new SPI added in r230462 with the appropriate availability macros.

        * UIProcess/API/Cocoa/WKViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

        Add ProcessPrivilege assertions to places that access NSApp
        https://bugs.webkit.org/show_bug.cgi?id=184322
        <rdar://problem/39194560>

        Reviewed by Per Arne Vollan.

        Add ProcessPrivilege assertions to places where we interact with NSApp so
        that we can prevent accidentally using them in the WebContent process.

        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::stopNSAppRunLoop):
        * Shared/mac/HangDetectionDisablerMac.mm:
        (WebKit::setClientsMayIgnoreEvents):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::WebViewImpl):
        (WebKit::WebViewImpl::becomeFirstResponder):
        (WebKit::WebViewImpl::pluginFocusOrWindowFocusChanged):
        (WebKit::WebViewImpl::validateUserInterfaceItem):
        (WebKit::WebViewImpl::startSpeaking):
        (WebKit::WebViewImpl::stopSpeaking):
        (WebKit::applicationFlagsForDrag):
        (WebKit::WebViewImpl::doneWithKeyEvent):
        * UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:
        (WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::enterFullscreen):
        (WebKit::PluginProcessProxy::beginModal):
        (WebKit::PluginProcessProxy::endModal):
        * UIProcess/mac/DisplayLink.cpp:
        (WebKit::DisplayLink::DisplayLink):
        (WebKit::DisplayLink::~DisplayLink):
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::isViewWindowActive):
        (WebKit::PageClientImpl::setCursor):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::getIsSpeaking):
        (WebKit::WebPageProxy::speak):
        (WebKit::WebPageProxy::stopSpeaking):
        (WebKit::WebPageProxy::startDisplayLink):
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):

2018-04-09  John Wilander  <wilander@apple.com>

        Refactor Ignore HSTS code
        https://bugs.webkit.org/show_bug.cgi?id=184433
        <rdar://problem/39298238>

        Reviewed by Darin Adler.

        This patch refactors our ignore HSTS code. The convenience functions are moved
        out of CFNetwork SPI in PAL, and into where they are used. It also switches
        from performSelector: calls to straight function calls, after checking that
        there is a responder.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (schemeWasUpgradedDueToDynamicHSTS):
        (setIgnoreHSTS):
        (ignoreHSTS):
            Add convenience functions here since they were moved out of
            CFNetworkSPI.h.

2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        Rename UNUSED to BUNUSED
        https://bugs.webkit.org/show_bug.cgi?id=184093

        Reviewed by Yusuke Suzuki.

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

2018-04-09  Timothy Hatcher  <timothy@apple.com>

        Add support for setting a background color on WKWebView and WKView
        https://bugs.webkit.org/show_bug.cgi?id=184426

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKViewPrivate.h: Added _backgroundColor property.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _backgroundColor]): Added. Call through to WebViewImpl.
        (-[WKWebView _setBackgroundColor:]): Added. Call through to WebViewImpl.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _backgroundColor property.
        * UIProcess/API/mac/WKView.mm:
        (-[WKView _backgroundColor]): Added. Call through to WebViewImpl.
        (-[WKView _setBackgroundColor:]): Added. Call through to WebViewImpl.
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setBackgroundColor): Added.
        (WebKit::WebViewImpl::backgroundColor const): Added.
        (WebKit::WebViewImpl::updateLayer): Use m_backgroundColor when set.

2018-04-09  Yousuke Kimoto <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Add WebKit Shared/win event files for wincairo webkit
        https://bugs.webkit.org/show_bug.cgi?id=183043

        Reviewed by Brent Fulgham.

        * Shared/NativeWebKeyboardEvent.h:
        (WebKit::NativeWebKeyboardEvent::nativeEvent const):
        * Shared/NativeWebMouseEvent.h:
        (WebKit::NativeWebMouseEvent::nativeEvent const):
        * Shared/NativeWebTouchEvent.h:
        * Shared/NativeWebWheelEvent.h:
        (WebKit::NativeWebWheelEvent::nativeEvent const):
        * Shared/win/NativeWebKeyboardEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
        * Shared/win/NativeWebMouseEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
        * Shared/win/NativeWebTouchEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebTouchEvent.h.
        (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
        * Shared/win/NativeWebWheelEventWin.cpp: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
        (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
        * Shared/win/WebEventFactory.cpp: Added.
        (WebKit::relativeCursorPosition):
        (WebKit::point):
        (WebKit::horizontalScrollChars):
        (WebKit::verticalScrollLines):
        (WebKit::clickCount):
        (WebKit::IsKeyInDownState):
        (WebKit::modifiersForEvent):
        (WebKit::modifiersForCurrentKeyState):
        (WebKit::keyboardEventTypeForEvent):
        (WebKit::isSystemKeyEvent):
        (WebKit::isKeypadEvent):
        (WebKit::textFromEvent):
        (WebKit::unmodifiedTextFromEvent):
        (WebKit::keyIdentifierFromEvent):
        (WebKit::WebEventFactory::createWebMouseEvent):
        (WebKit::WebEventFactory::createWebWheelEvent):
        (WebKit::WebEventFactory::createWebKeyboardEvent):
        (WebKit::WebEventFactory::createWebTouchEvent):
        * Shared/win/WebEventFactory.h: Copied from Source/WebKit/Shared/NativeWebMouseEvent.h.
        (WebKit::createNativeEvent):

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

        WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
        https://bugs.webkit.org/show_bug.cgi?id=184344
        <rdar://problem/39224969>

        Reviewed by Per Arne Vollan.

        The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
        screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
        we do not want to allow in the WebContent process.

        Instead, we should just use the cached screen information the WebContent process already possesses.

        This patch makes the following changes:
        1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
           the WindowServer directly.
        2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
           the user space version of the coordinates. A nil Window just means we want to get coordinates in
           terms of the primary display.
        3. Keep track of the primary display so we can refer to it later.
        4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
        5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
           than whichever screen happened to hash to the lowest value.

        Reviewed by Per Arne Vollan.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::displayReconfigurationCallBack): Update for new getScreenProperties implementation.
        (WebKit::WebProcessPool::initializeNewWebProcess): Ditto.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties): Ditto.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in: Ditto.

2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Add API version to library soname and pkg-config files
        https://bugs.webkit.org/show_bug.cgi?id=180608

        Reviewed by Žan Doberšek.

        * PlatformWPE.cmake:
        * wpe/wpe-webkit.pc.in:

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

        Fix the selection assistant selectionView build
        https://bugs.webkit.org/show_bug.cgi?id=184423
        <rdar://problem/39288235>

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView _didExitStableState]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _updateChangedSelection:]):

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

        Switch to UIWKTextInteractionAssistant for non-editable text
        https://bugs.webkit.org/show_bug.cgi?id=182834

        Switch to only using one assistant for text selection.

        Reviewed by Timothy Hatcher and Andy Estes.

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

2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, move 'using namespace' back to the right place after r230429

        * Shared/glib/ProcessExecutablePathGLib.cpp:

2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r230390.

        Broke accelerated compositing

        Reverted changeset:

        "[GTK] WaylandCompositorDisplay leaks its wl_display"
        https://bugs.webkit.org/show_bug.cgi?id=184406
        https://trac.webkit.org/changeset/230390

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

        [Extra zoom mode] Disable fast clicking by default in extra zoom mode
        https://bugs.webkit.org/show_bug.cgi?id=184411
        <rdar://problem/38726867>

        Reviewed by Andy Estes.

        As it turns out, existing fast-clicking heuristics don't work so well in extra zoom mode. Even at device-width,
        since the page is scaled to fit within the viewport, having single taps take precedence over double taps leads
        to a confusing experience when trying to double tap to zoom further on content that contains links and other
        click targets. Revert to legacy behavior here by disabling these heuristics.

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

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

        [Extra zoom mode] Add an SPI hook for clients to opt in to focus overlay UI
        https://bugs.webkit.org/show_bug.cgi?id=184370
        <rdar://problem/39250494>

        Reviewed by Timothy Hatcher and Andy Estes.

        Add a new SPI hook for internal clients to opt in to showing the focused form control overlay. By default, the
        overlay is not shown.

        * UIProcess/API/Cocoa/_WKInputDelegate.h:

2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Use GNU install directories
        https://bugs.webkit.org/show_bug.cgi?id=184377

        Reviewed by Carlos Garcia Campos.

        Merge ProcessExecutablePathGtk and ProcessExecutablePathWPE into ProcessExecutablePathGLib.
        WPE will now load its secondary processes from PKGLIBEXECDIR, like WebKitGTK+.

        * PlatformWPE.cmake:
        * Shared/glib/ProcessExecutablePathGLib.cpp: Renamed from Source/WebKit/Shared/gtk/ProcessExecutablePathGtk.cpp.
        (WebKit::getExecutablePath):
        (WebKit::findWebKitProcess):
        (WebKit::executablePathOfWebProcess):
        (WebKit::executablePathOfPluginProcess):
        (WebKit::executablePathOfNetworkProcess):
        (WebKit::executablePathOfStorageProcess):
        * Shared/wpe/ProcessExecutablePathWPE.cpp: Removed.
        * SourcesGTK.txt:
        * SourcesWPE.txt:

2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] WaylandCompositorDisplay leaks its wl_display
        https://bugs.webkit.org/show_bug.cgi?id=184406

        Reviewed by Carlos Garcia Campos.

        * WebProcess/gtk/WaylandCompositorDisplay.cpp:
        (WebKit::WaylandCompositorDisplay::create): Fix a log message (drive-by).
        (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay): Fix the leak.

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

        Non-Cocoa ports use default directory for ServiceWorker data during testing
        https://bugs.webkit.org/show_bug.cgi?id=183784

        Reviewed by Youenn Fablet.

        Add API to WKWebsiteDataStore that enables setting and retrieving the
        service worker registration directory for a given data store object.
        This enables setting the temporary directory for testing purposes in
        WebKitTestRunner.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory):
        (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:

2018-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
        https://bugs.webkit.org/show_bug.cgi?id=184127

        Reviewed by Konstantin Tokarev.

        * CMakeLists.txt: Link with WebCore as private,
        WebCoreHeaderInterface as public to WebKit if WebCore is a static
        library.
        * CMakeLists.txt:
        * PlatformGTK.cmake: Added PRIVATE keyword for WebKit_LIBRARIES.
        * PlatformWPE.cmake: Ditto.
        * PlatformWin.cmake: Ditto.

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

        [iOS] WKContentView and WKLegacyPDFView should share application state tracking logic
        https://bugs.webkit.org/show_bug.cgi?id=184402

        Reviewed by Dan Bernstein.

        WKContentView and WKLegacyPDFView have nearly identical logic for tracking
        application foreground state. Let's share it so we can more easily create new
        content views with proper application state tracking.

        * UIProcess/ios/WKApplicationStateTrackingView.h: Added.
        * UIProcess/ios/WKApplicationStateTrackingView.mm: Added.
        (-[WKApplicationStateTrackingView initWithFrame:webView:]):
        (-[WKApplicationStateTrackingView willMoveToWindow:]):
        (-[WKApplicationStateTrackingView didMoveToWindow]):
        (-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
        (-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]):
        (-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
        (-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
        (-[WKApplicationStateTrackingView isBackground]):

        Moved common logic from WKContentView and WKLegacyPDFView into
        WKApplicationStateTrackingView.

        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView initWithFrame:processPool:configuration:webView:]):
        (-[WKContentView willMoveToWindow:]):
        (-[WKContentView _applicationDidCreateWindowContext]):
        (-[WKContentView didMoveToWindow]): Deleted.
        (-[WKContentView isBackground]): Deleted.
        (-[WKContentView _applicationDidEnterBackground]): Deleted.
        (-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.
        (-[WKContentView _applicationWillEnterForeground]): Deleted.

        Made WKContentView a subclass of WKApplicationStateTrackingView.

        * UIProcess/ios/WKLegacyPDFView.h:
        * UIProcess/ios/WKLegacyPDFView.mm:
        (-[WKLegacyPDFView web_initWithFrame:webView:]):
        (-[WKLegacyPDFView web_isBackground]):
        (-[WKLegacyPDFView _applicationWillEnterForeground]):
        (-[WKLegacyPDFView willMoveToWindow:]): Deleted.
        (-[WKLegacyPDFView didMoveToWindow]): Deleted.
        (-[WKLegacyPDFView _applicationDidEnterBackground]): Deleted.
        (-[WKLegacyPDFView _applicationDidCreateWindowContext]): Deleted.
        (-[WKLegacyPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]): Deleted.

        Made WKLegacyPDFView a subclass of WKApplicationStateTrackingView.

        * WebKit.xcodeproj/project.pbxproj:

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

        [Cocoa] Keep library validation disabled for WebContent.Development
        https://bugs.webkit.org/show_bug.cgi?id=184393

        Reviewed by Anders Carlsson.

        * Configurations/WebContent.Development.entitlements: Added. Includes the
          com.apple.security.cs.disable-library-validation entitlement set to true.
        * Configurations/WebContentService.Development.xcconfig: Set CODE_SIGN_ENTITLEMENTS to the
          above.
        * WebKit.xcodeproj/project.pbxproj: Added reference to new file.

2018-04-06  Brian Burg  <bburg@apple.com>

        REGRESSION(r228371): WebAutomationSession::deleteAllCookies doesn't delete some cookies
        https://bugs.webkit.org/show_bug.cgi?id=184334
        <rdar://problem/39212863>

        Reviewed by Timothy Hatcher.

        When WebDriver adds a cookie for 'localhost', it actually uses the domain '.localhost' per RFC.
        When deleting cookies, we first fetch all cookies matching the document's hostname, and
        then delete them one by one. However, this code path does not add the dot prefix. This causes
        no cookies to match the requested domain, and thus none of them are deleted.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::domainByAddingDotPrefixIfNeeded): Extract this helper method.
        (WebKit::WebAutomationSession::addSingleCookie): Use helper method.
        (WebKit::WebAutomationSession::deleteAllCookies): Add a dot prefix when
        requesting to delete all cookies for a hostname.

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

        Response headers should be filtered when sent from NetworkProcess to WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=184310

        Reviewed by Ryosuke Niwa.

        Pass destination parameter to NetworkResourceLoader.
        Use new sanitization routine to filter response headers as needed:
        - Cross-origin routines are filtered by removing any non CORS allowed headers.
        - Same-origin responses are filtered by removing non used headers, except when filtering would be visible by JS (XHR, fetch).
        In all cases, Set-Cookie/Set-Cookie2 headers are filtered out.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didReceiveResponse):
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::updatePreferencesStore):

2018-04-05  Ryosuke Niwa  <rniwa@webkit.org>

        Make all sync IPCs during ScriptDisallowedScope set DoNotProcessIncomingMessagesWhenWaitingForSyncReply
        https://bugs.webkit.org/show_bug.cgi?id=182449
        <rdar://problem/39222541>

        Reviewed by Chris Dumez.

        Release assert that a sync IPC inside ScriptDisallowedScope sets DoNotProcessIncomingMessagesWhenWaitingForSyncReply
        to avoid executing arbitrary scripts as a result of processing incoming sync IPCs.

        * Platform/IPC/Connection.h:
        (IPC::Connection::sendSync): Added the release assertion.

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

        REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=184306

        Reviewed by Ryosuke Niwa.

        * NetworkProcess/NetworkContentRuleListManager.cpp:
        (WebKit::NetworkContentRuleListManager::addContentRuleLists):

2018-04-05  Brent Fulgham  <bfulgham@apple.com>

        WebContent process is calling CGDisplayUsesInvertedPolarity
        https://bugs.webkit.org/show_bug.cgi?id=184337
        <rdar://problem/39215702>

        Reviewed by Zalan Bujtas.

        The PlatformScreenMac code is still calling display-related routines directly, specifically
        CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
        the UIProcess.
        
        There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
        the compile guards so all macOS builds use this behavior.
        
        Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
        routines in the future.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess): Activate screen brokering code for all builds.
        * WebProcess/WebProcess.cpp: Ditto.
        * WebProcess/WebProcess.h: Ditto.
        * WebProcess/WebProcess.messages.in: Ditto.

2018-04-05  Brady Eidson  <beidson@apple.com>

        Process Swap on Navigation causes many webpages to hang due to attempted process swap for iframe navigations.
        <rdar://problem/39162236> and https://bugs.webkit.org/show_bug.cgi?id=184318

        Reviewed by Andy Estes.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision): Don't consider a swap if the navigation is not in the main frame.

2018-04-05  Ryosuke Niwa  <rniwa@webkit.org>

        WebContent process sometimes hangs in WebProcess::ensureNetworkProcessConnection
        https://bugs.webkit.org/show_bug.cgi?id=184326

        Reviewed by Chris Dumez.

        The hang was caused by UI process never sending the reply back to GetNetworkProcessConnection
        due to m_pendingOutgoingMachMessage being set and the event handler for DISPATCH_MACH_SEND_POSSIBLE
        never getting called. This is because the event handler registration happens asynchronously,
        and may not have completed by the time we send the first IPC to the web content process
        in which case it can timeout and we may never get the callback.

        Fixed the hang by waiting for the event handler registration to be completed using
        dispatch_source_set_registration_handler. To do this, this patch adds a new boolean instance variable,
        m_isInitializingSendSource, to Connection which is set to true between the time mach port is created
        and until the event handler registration has been completed. platformCanSendOutgoingMessages returns
        false while m_isInitializingSendSource is set to prevent the attempt to send messages like we do when
        m_pendingOutgoingMachMessage is set to true.

        * Platform/IPC/Connection.h:
        (IPC::Connection::m_isInitializingSendSource): Added.
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::platformInvalidate): Set m_isInitializingSendSource to false.
        (IPC::Connection::sendMessage): Assert that m_isInitializingSendSource is false.
        (IPC::Connection::platformCanSendOutgoingMessages const): Return false if m_isInitializingSendSource
        is set to true.
        (IPC::Connection::sendOutgoingMessage): Assert that m_isInitializingSendSource is false.
        (IPC::Connection::initializeSendSource): Set m_isInitializingSendSource to true temporarily until
        dispatch_source_set_registration_handler's callback is called. Resume and send any pending outgoing
        messages.
        (IPC::Connection::resumeSendSource): Extracted from initializeSendSource.

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

        WebRTC data channel only applications require capture permissions for direct connections
        https://bugs.webkit.org/show_bug.cgi?id=174500
        <rdar://problem/34134281>

        Unreviewed.
        Changed the code to suppress: "error: unused variable 'error' [-Werror,-Wunused-variable]"
        Added some logging to this error case as a side bonus.

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

2018-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r229831): Test WebKit2.ProvisionalURLAfterWillSendRequestCallback times out since r229831
        https://bugs.webkit.org/show_bug.cgi?id=184293

        Reviewed by Alex Christensen.

        The problem is that after willSendRequest callback changes the request, the load is cancelled while
        transitioning to committed state. This happens because the load is not waiting for the response policy check, so
        it continues and when transitioning to committed, FrameLoader::closeURL() invalidates the current policy check
        that causes a load failure. The new request returned by the API doesn't have any requester, so it's no longer
        considered a main resource load. In the network process the resource load task doesn't wait for the response
        policy and continues the load, sending the data to the web process. Once the first data is received, the load
        transitions to commit, but the response policy check is still ongoing. This can only happen when using the C API
        (I don't know about the Cocoa API), but not with the GLib API because it doesn't allow to create a new request,
        only to modify the passed in one. With the C API we loss other internal things of the request like the priority,
        but I guess the most important one is the requester.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):

2018-04-04  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r230283.

        Caused webkitpy test failures.

        Reverted changeset:

        "Use CompletionHandlers for DelayedReplies"
        https://bugs.webkit.org/show_bug.cgi?id=182269
        https://trac.webkit.org/changeset/230283

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

        webrtc/video-update-often.html is flakily crashing on iOS simulator Debug
        https://bugs.webkit.org/show_bug.cgi?id=184022

        Reviewed by Jer Noble.

        Remove client context once the new context identifier is set.
        Covered by test no longer crashing locally.

        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):

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

        WebRTC data channel only applications require capture permissions for direct connections
        https://bugs.webkit.org/show_bug.cgi?id=174500
        <rdar://problem/34134281>

        Reviewed by Eric Carlson.

        Add support for MDNS registration and resolution by NetworkProcess.
        WebProcess gives instruction to do the actual registrations/resolutions.

        * CMakeLists.txt:
        * DerivedSources.make:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        (WebKit::NetworkConnectionToWebProcess::mdnsRegister):
        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Added.
        (WebKit::NetworkMDNSRegister::NetworkMDNSRegister):
        (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
        (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
        (WebKit::PendingRegistrationRequest::PendingRegistrationRequest):
        (WebKit::registerMDNSNameCallback):
        (WebKit::NetworkMDNSRegister::registerMDNSName):
        (WebKit::PendingResolutionRequest::PendingResolutionRequest):
        (WebKit::PendingResolutionRequest::~PendingResolutionRequest):
        (WebKit::PendingResolutionRequest::timeout):
        (WebKit::resolveMDNSNameCallback):
        (WebKit::NetworkMDNSRegister::resolveMDNSName):
        * NetworkProcess/webrtc/NetworkMDNSRegister.h: Added.
        * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: Added.
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebRTCMDNSICECandidatesEnabled):
        (WKPreferencesGetWebRTCMDNSICECandidatesEnabled):
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::didReceiveMessage):
        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        (WebKit::LibWebRTCNetwork::mdnsRegister):
        * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
        (WebKit::LibWebRTCProvider::unregisterMDNSNames):
        (WebKit::LibWebRTCProvider::registerMDNSName):
        (WebKit::LibWebRTCProvider::resolveMDNSName):
        * WebProcess/Network/webrtc/LibWebRTCProvider.h:
        * WebProcess/Network/webrtc/WebMDNSRegister.cpp: Added.
        (WebKit::WebMDNSRegister::finishedRegisteringMDNSName):
        (WebKit::WebMDNSRegister::finishedResolvingMDNSName):
        (WebKit::WebMDNSRegister::unregisterMDNSNames):
        (WebKit::WebMDNSRegister::registerMDNSName):
        (WebKit::WebMDNSRegister::resolveMDNSName):
        * WebProcess/Network/webrtc/WebMDNSRegister.h: Added.
        * WebProcess/Network/webrtc/WebMDNSRegister.messages.in: Added.

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

        Use CompletionHandlers for DelayedReplies
        https://bugs.webkit.org/show_bug.cgi?id=182269

        Reviewed by Youenn Fablet.

        DelayedReplies should be a noncopyable, non-refcountable type.  They should be
        called once and only once.  This is what CompletionHandlers are for.

        No change in behavior.  Just cleaner code.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
        (WebKit::sendReplyToSynchronousRequest):
        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
        * NetworkProcess/NetworkResourceLoader.h:
        * Platform/IPC/Connection.h:
        * Platform/IPC/HandleMessage.h:
        (IPC::callMemberFunctionImpl):
        (IPC::callMemberFunction):
        (IPC::handleMessageDelayed):
        * PluginProcess/PluginControllerProxy.cpp:
        (WebKit::PluginControllerProxy::setInitializationReply):
        (WebKit::PluginControllerProxy::takeInitializationReply):
        * PluginProcess/PluginControllerProxy.h:
        * PluginProcess/WebProcessConnection.cpp:
        (WebKit::WebProcessConnection::destroyPlugin):
        (WebKit::WebProcessConnection::createPlugin):
        (WebKit::WebProcessConnection::createPluginAsynchronously):
        * PluginProcess/WebProcessConnection.h:
        * Scripts/webkit/messages.py:
        (message_to_struct_declaration):
        (generate_message_handler):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
        (WebKit::NetworkProcessProxy::networkProcessCrashed):
        (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch):
        (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::getPluginProcessConnection):
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::getPluginProcessConnection):
        (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
        (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::getStorageProcessConnection):
        (WebKit::StorageProcessProxy::didClose):
        (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
        * UIProcess/Storage/StorageProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::ExceededDatabaseQuotaRecords::createRecord):
        (WebKit::WebPageProxy::createNewPage):
        (WebKit::WebPageProxy::runJavaScriptAlert):
        (WebKit::WebPageProxy::runJavaScriptConfirm):
        (WebKit::WebPageProxy::runJavaScriptPrompt):
        (WebKit::WebPageProxy::webGLPolicyForURL):
        (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
        (WebKit::WebPageProxy::getToolbarsAreVisible):
        (WebKit::WebPageProxy::getMenuBarIsVisible):
        (WebKit::WebPageProxy::getStatusBarIsVisible):
        (WebKit::WebPageProxy::getWindowFrame):
        (WebKit::WebPageProxy::screenToRootView):
        (WebKit::WebPageProxy::rootViewToScreen):
        (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
        (WebKit::WebPageProxy::exceededDatabaseQuota):
        (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::networkProcessCrashed):
        (WebKit::WebProcessPool::getNetworkProcessConnection):
        (WebKit::WebProcessPool::getStorageProcessConnection):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPluginProcessConnection):
        (WebKit::WebProcessProxy::getNetworkProcessConnection):
        (WebKit::WebProcessProxy::getStorageProcessConnection):
        * UIProcess/WebProcessProxy.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):

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

        Remove legacyCustomProtocolManager from NetworkSessionCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=182178

        Reviewed by Youenn Fablet.

        Now that we only make NetworkSessions in the NetworkProcess, we don't need to pass this parameter around.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):

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

        Move PingHandle to WebKitLegacy
        https://bugs.webkit.org/show_bug.cgi?id=184145

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:

2018-04-04  Brent Fulgham  <bfulgham@apple.com>

        Failures from mach port reference handling should be fatal
        https://bugs.webkit.org/show_bug.cgi?id=184202
        <rdar://problem/37771114>

        Reviewed by Anders Carlsson.

        Update for new location of MachSendRight.h. Switch to
        #pragma once in a few places.

        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::platformInvalidate): Adopt new 'safe mach_port_t deallocation' function.
        (IPC::Connection::initializeSendSource): Ditto.
        (IPC::Connection::receiveSourceEventHandler): Ditto.
        * Platform/SharedMemory.h:
        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::SharedMemory::Handle::clear): Ditto.
        (WebKit::makeMemoryEntry): Ditto.
        (WebKit::SharedMemory::createSendRight const): Ditto.
        * Platform/mac/LayerHostingContext.h:
        * Platform/mac/LayerHostingContext.mm:
        * PluginProcess/PluginControllerProxy.h:
        * PluginProcess/PluginProcess.h:
        (WebKit::PluginProcess::compositingRenderServerPort const):
        * Scripts/messages.py:
        (headers_for_type): Update for new location of MachSendRight.
        * Shared/Plugins/PluginProcessCreationParameters.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::encode const):
        * Shared/WebCoreArgumentCoders.h:
        * Shared/WebProcessCreationParameters.h:
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/DrawingAreaProxy.cpp:
        * UIProcess/DrawingAreaProxy.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess): Ditto. Remove uneeded mach_port_dealloc called after
        xpc_dictionary_set_mach_send. While '..._set_mach_send' retains the send right, it gets automatically
        released when the message is handled. We only want to manually deallocate the send right if
        the message failed to send.
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        * UIProcess/mac/WKViewLayoutStrategy.mm:
        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
        * WebProcess/Plugins/PluginController.h:
        * WebProcess/Plugins/PluginView.h:
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::addFence):
        (WebKit::DrawingArea::updateGeometry):
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setTopContentInsetFenced):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
        * WebProcess/WebProcess.h:
        (WebKit::WebProcess::compositingRenderServerPort const):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

2018-04-04  Beth Dakin  <bdakin@apple.com>

        Fix the print formatter build
        https://bugs.webkit.org/show_bug.cgi?id=184289
        -and corresponding-
        rdar://problem/39164641

        Reviewed by Dan Bernstein.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _webViewPrintFormatter]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/_WKWebViewPrintFormatter.h:
        * UIProcess/_WKWebViewPrintFormatter.mm:
        * UIProcess/_WKWebViewPrintFormatterInternal.h:
        * UIProcess/ios/WKContentView.mm:
        * UIProcess/ios/WKPDFView.mm:

2018-04-04  Andy Estes  <aestes@apple.com>

        [iOS] Rename WKPDFView to WKLegacyPDFView
        https://bugs.webkit.org/show_bug.cgi?id=184286

        Rubber-stamped by Wenson Hsieh.

        A series of upcoming patches will implement a new WKPDFView based on PDFKit.

        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry init]):
        * UIProcess/ios/WKLegacyPDFView.h: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.h.
        * UIProcess/ios/WKLegacyPDFView.mm: Renamed from Source/WebKit/UIProcess/ios/WKPDFView.mm.
        (-[WKLegacyPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
        * WebKit.xcodeproj/project.pbxproj:

2018-04-04  Yousuke Kimoto  <yousuke.kimoto@sony.com> and Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Add WebKit Shared/win files for wincairo webkit
        https://bugs.webkit.org/show_bug.cgi?id=183044

        Reviewed by Alex Christensen.

        * Shared/win/ChildProcessMainWin.cpp: Added.

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

        [Extra zoom mode] Remove effective font size constraints when determining focus zoom scale
        https://bugs.webkit.org/show_bug.cgi?id=184287
        <rdar://problem/39063886>

        Reviewed by Timothy Hatcher.

        As it turns out, form controls on some important websites can be very wide, with a small font size, which
        renders the approach taken in <https://trac.webkit.org/r230171> moot, since we'll just end up zooming to a scale
        that is too large anyways. To mitigate this for now, remove the minimum font scaling threshold while we think of
        more clever ways to account for this scenario.

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

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

        [Win] WebFrameLoaderClient: 'getpid': identifier not found
        https://bugs.webkit.org/show_bug.cgi?id=184291

        Reviewed by Konstantin Tokarev.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        Use WTF::getCurrentProcessID() instead of getpid().
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.

2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        ASSERTION FAILED: !m_mainFrame->coreFrame()->loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading
        https://bugs.webkit.org/show_bug.cgi?id=153210

        Reviewed by Alex Christensen.

        The assert happens when WebPage::reload() is called twice and the first time the reload is ignored by
        FrameLoader because the document URL is empty. In that case the pending navigation is not reset, because
        FrameLoader::reload() returns before creating the document loader.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::reload): Check if the pending navigation has been reset after calling FrameLoader::reload()
        and reset it otherwise.

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

        Make NetworkProcess get ContentBlocker information from UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=184205
        <rdar://problem/39146551>

        Unreviewed.
        Updated decode/encode methods to not hit null identifier assertion.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageGroupData.cpp:
        (WebKit::WebPageGroupData::encode const):
        (WebKit::WebPageGroupData::decode):

2018-04-03  Andy Estes  <aestes@apple.com>

        [iOS] WKWebView shouldn't know about WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=184283

        Reviewed by Timothy Hatcher.

        WKWebView shouldn't be checking if _customContentView is a particular kind of
        class (e.g., WKPDFView). Instead, it should interact with the _customContentView
        using the WKWebViewContentProvider protocol.

        Reimplement -_isBackground, -_isDisplayingPDF, -_dataForDisplayedPDF, and
        -_suggestedFilenameForDisplayedPDF using new WKWebViewContentProvider protocol
        methods that WKPDFView implements.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _isBackground]):
        (-[WKWebView _isDisplayingPDF]):
        (-[WKWebView _dataForDisplayedPDF]):
        (-[WKWebView _suggestedFilenameForDisplayedPDF]):
        * UIProcess/Cocoa/WKWebViewContentProvider.h:
        * UIProcess/ios/WKPDFView.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_dataRepresentation]):
        (-[WKPDFView web_suggestedFilename]):
        (-[WKPDFView web_isBackground]):
        (-[WKPDFView suggestedFilename]): Deleted.
        (-[WKPDFView pdfDocument]): Deleted.
        (-[WKPDFView isBackground]): Deleted.

2018-04-03  Brent Fulgham  <bfulgham@apple.com>

        Guard against keychain/certificate access outside the network process
        https://bugs.webkit.org/show_bug.cgi?id=184214
        <rdar://problem/38734795>

        Reviewed by Youenn Fablet.

        Use the ProcessPrivilege assertions to guard against accessing the Keychain from
        a non-Networking process.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode): Assert if we access the keychain from a proces other than the Network or UI process.
        (IPC::decode): Ditto.

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

        NetworkResourceLoader does not need to expose all redirect response headers
        https://bugs.webkit.org/show_bug.cgi?id=184114
        <rdar://problem/39010557>

        Reviewed by Ryosuke Niwa.

        WebProcess instructs NetworkProcess whether to sanitize response headers based on a runtime flag.
        We sanitize redirection response headers in case this is not related to a navigation load.
        Navigation loads may currently require the full response for content blockers.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
        (WebKit::NetworkResourceLoader::sanitizeRedirectResponseIfPossible):
        (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
        * NetworkProcess/NetworkResourceLoader.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetRestrictedHTTPResponseAccess):
        (WKPreferencesGetRestrictedHTTPResponseAccess):
        * UIProcess/API/C/WKPreferencesRef.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):

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

        Make NetworkProcess get ContentBlocker information from UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=184205

        Reviewed by Alex Christensen.

        Make NetworkProcess get content blockers from UIProcess directly.
        Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
        Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.

        This is both more efficient than passing them for each PingLoad and safer in the sense
        that a compromised WebProcess will not be able to bypass any of these.
        In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.

        Covered by existing beacon+content blocker tests.

        Did some refactoring to add a typed content blocker identifier.
        Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
        Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.

        * CMakeLists.txt:
        * DerivedSources.make:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::setContentExtensionController):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didReceiveMessage):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::networkUserContentController):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
        (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
        (WebKit::NetworkContentRuleListManager::addContentRuleLists):
        (WebKit::NetworkContentRuleListManager::removeContentRuleList):
        (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
        (WebKit::NetworkContentRuleListManager::remove):
        * NetworkProcess/NetworkContentRuleListManager.h: Added.
        * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
        * NetworkProcess/PingLoad.cpp:
        * Scripts/webkit/messages.py:
        * Shared/UserContentControllerIdentifier.h: Added.
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPageGroupData.cpp:
        (WebKit::WebPageGroupData::decode):
        * Shared/WebPageGroupData.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::contentExtensionRules):
        (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::get):
        (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
        (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::removeProcess):
        (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
        (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
        (WebKit::WebUserContentControllerProxy::addUserScript):
        (WebKit::WebUserContentControllerProxy::removeUserScript):
        (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
        (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
        (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
        (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
        (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
        (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
        (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
        (WebKit::WebUserContentControllerProxy::addContentRuleList):
        (WebKit::WebUserContentControllerProxy::removeContentRuleList):
        (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        (WebKit::WebUserContentControllerProxy::create):
        (WebKit::WebUserContentControllerProxy::addNetworkProcess):
        (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
        (WebKit::WebUserContentControllerProxy::contentExtensionRules):
        (WebKit::WebUserContentControllerProxy::identifier const):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::startPingLoad):
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::getOrCreate):
        (WebKit::WebUserContentController::WebUserContentController):
        (WebKit::WebUserContentController::~WebUserContentController):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::userContentControllerIdentifier const):

2018-04-03  Andy Estes  <aestes@apple.com>

        [Mac] Prioritize file promises over filenames during drag and drop
        https://bugs.webkit.org/show_bug.cgi?id=184237
        <rdar://problem/38278076>

        Reviewed by Wenson Hsieh.

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

2018-04-03  Brady Eidson  <beidson@apple.com>

        Make SessionStorage work with process swapping.
        https://bugs.webkit.org/show_bug.cgi?id=184270

        Reviewed by Andy Estes.

        Due to a minor process accounting error, WebPageProxys weren't always being reconnected with their
        WebsiteDataStore's StorageManager when doing process swaps.

        Fix that error, and SessionStorage "just works."

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::webProcessWillShutDown):
        (WebKit::WebPageProxy::processDidTerminate): For NavigationSwap termination, make sure to tell the 
          process lifetime tracker that this page was removed.

        * UIProcess/WebProcessLifetimeObserver.h:
        (WebKit::WebProcessLifetimeObserver::webPageWasInvalidated): Renamed from "webPageWasRemoved"
        (WebKit::WebProcessLifetimeObserver::webPageWasRemoved): Deleted.

        * UIProcess/WebProcessLifetimeTracker.cpp:
        (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess): Renamed from "webProcessWillShutDown"
        (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
        (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown): Deleted.
        * UIProcess/WebProcessLifetimeTracker.h:

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::webPageWasInvalidated):
        (WebKit::WebsiteDataStore::webPageWasRemoved): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-04-03  Commit Queue  <commit-queue@webkit.org>

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

        it is breaking internal bots (Requested by youenn on #webkit).

        Reverted changeset:

        "Make NetworkProcess get ContentBlocker information from
        UIProcess"
        https://bugs.webkit.org/show_bug.cgi?id=184205
        https://trac.webkit.org/changeset/230210

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

        [Extra zoom mode] Update time picker to use platform view controller
        https://bugs.webkit.org/show_bug.cgi?id=184252
        <rdar://problem/38804795>

        Reviewed by Andy Estes.

        Adjust for some small WKTimePickerViewController changes, and remove some files that we no longer need.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentViewControllerForCurrentAssistedNode]):
        (-[WKContentView textInputController:didCommitText:]): Deleted.
        (-[WKContentView textInputController:didCommitText:withSuggestion:]): Deleted.
        (-[WKContentView textInputControllerDidRequestDismissal:]): Deleted.
        * UIProcess/ios/forms/WKTextFormControlViewController.h: Removed.
        * UIProcess/ios/forms/WKTextFormControlViewController.mm: Removed.
        * UIProcess/ios/forms/WKTextSuggestionButton.h: Removed.
        * UIProcess/ios/forms/WKTextSuggestionButton.mm: Removed.
        * WebKit.xcodeproj/project.pbxproj:

2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>

        Xcode prepends line comments from WTF/Compiler.h to *.sb files
        https://bugs.webkit.org/show_bug.cgi?id=184166

        Reviewed by Brent Fulgham.

        * DerivedSources.make:
        Strip ;-comments from *.sb.in files before preprocessing so we can stop treating Platform.h/Compiler.h as C89.

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

        Drop MainFrame class
        https://bugs.webkit.org/show_bug.cgi?id=184191

        Reviewed by Darin Adler.

        Drop MainFrame class and move contents into Page / Frame since there is a 1:1
        relationship between the Page and the MainFrame.

        This is ground work for introducing LocalFrame / RemoteFrame concepts.

        * Shared/WebRenderLayer.cpp:
        * Shared/WebRenderObject.cpp:
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::paymentCoordinator):
        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageInstallPageOverlay):
        (WKBundlePageUninstallPageOverlay):
        (WKBundlePageInstallPageOverlayWithAnimation):
        (WKBundlePageUninstallPageOverlayWithAnimation):
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        * WebProcess/Plugins/PluginView.cpp:
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::~WebInspectorClient):
        (WebKit::WebInspectorClient::highlight):
        (WebKit::WebInspectorClient::hideHighlight):
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::updateFindUIAfterPageScroll):
        (WebKit::FindController::hideFindUI):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
        * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        * WebProcess/WebPage/WebFrame.cpp:
        * WebProcess/WebPage/WebInspector.cpp:
        * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::mainFrame const):
        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
        (WebKit::WebPage::plugInIntersectsSearchRect):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp:
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
        (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performImmediateActionHitTestAtLocation):
        (WebKit::WebPage::dataDetectorsDidPresentUI):
        (WebKit::WebPage::dataDetectorsDidChangeUI):
        (WebKit::WebPage::dataDetectorsDidHideUI):
        * WebProcess/WebProcess.cpp:
        * WebProcess/WebStorage/StorageAreaMap.cpp:

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

        Make NetworkProcess get ContentBlocker information from UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=184205

        Reviewed by Alex Christensen.

        Make NetworkProcess get content blockers from UIProcess directly.
        Before that patch, WebProcess sent content blockers to NetworkProcess for each PingLoad.
        Instead, WebProcess sends the content blocker identifier for each PingLoad and NetworkProcess fetches the content blocker once.

        This is both more efficient than passing them for each PingLoad and safer in the sense
        that a compromised WebProcess will not be able to bypass any of these.
        In the future, NetworkProcess should get the content blocker identifier directly from the WebPageID attached to the request.

        Covered by existing beacon+content blocker tests.

        Did some refactoring to add a typed content blocker identifier.
        Once NetworkProcess fetches a given content blocker, the content blocker will send any modification to NetworkProcess.
        Introduced NetworkContentRuleListManager to handle the content blockers in NetworkProcess.

        * CMakeLists.txt:
        * DerivedSources.make:
        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::continueCheckingRequest):
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h:
        (WebKit::NetworkLoadChecker::setContentExtensionController):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didReceiveMessage):
        * NetworkProcess/NetworkProcess.h:
        (WebKit::NetworkProcess::networkUserContentController):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * NetworkProcess/NetworkContentRuleListManager.cpp: Added.
        (WebKit::NetworkContentRuleListManager::contentExtensionsBackend):
        (WebKit::NetworkContentRuleListManager::addContentRuleLists):
        (WebKit::NetworkContentRuleListManager::removeContentRuleList):
        (WebKit::NetworkContentRuleListManager::removeAllContentRuleLists):
        (WebKit::NetworkContentRuleListManager::remove):
        * NetworkProcess/NetworkContentRuleListManager.h: Added.
        * NetworkProcess/NetworkContentRuleListManager.messages.in: Added.
        * NetworkProcess/PingLoad.cpp:
        * Scripts/webkit/messages.py:
        * Shared/UserContentControllerIdentifier.h: Added.
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPageGroupData.cpp:
        (WebKit::WebPageGroupData::decode):
        * Shared/WebPageGroupData.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
        (WebKit::NetworkProcessProxy::contentExtensionRules):
        (WebKit::NetworkProcessProxy::didDestroyWebUserContentControllerProxy):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
        (WebKit::WebUserContentControllerProxy::get):
        (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
        (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
        (WebKit::WebUserContentControllerProxy::addProcess):
        (WebKit::WebUserContentControllerProxy::removeProcess):
        (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
        (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
        (WebKit::WebUserContentControllerProxy::addUserScript):
        (WebKit::WebUserContentControllerProxy::removeUserScript):
        (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
        (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
        (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
        (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
        (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
        (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
        (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
        (WebKit::WebUserContentControllerProxy::addContentRuleList):
        (WebKit::WebUserContentControllerProxy::removeContentRuleList):
        (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
        * UIProcess/UserContent/WebUserContentControllerProxy.h:
        (WebKit::WebUserContentControllerProxy::create):
        (WebKit::WebUserContentControllerProxy::addNetworkProcess):
        (WebKit::WebUserContentControllerProxy::removeNetworkProcess):
        (WebKit::WebUserContentControllerProxy::contentExtensionRules):
        (WebKit::WebUserContentControllerProxy::identifier const):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::startPingLoad):
        * WebProcess/UserContent/WebUserContentController.cpp:
        (WebKit::WebUserContentController::getOrCreate):
        (WebKit::WebUserContentController::WebUserContentController):
        (WebKit::WebUserContentController::~WebUserContentController):
        * WebProcess/UserContent/WebUserContentController.h:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::userContentControllerIdentifier const):

2018-04-02  Beth Dakin  <bdakin@apple.com>

        Fix the managed configurations build
        https://bugs.webkit.org/show_bug.cgi?id=184253
        -and corresponding-
        rdar://problem/39078586

        Reviewed by Dan Bernstein.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformActionForWebView:withSender:]):
        (-[WKContentView _defineForWebView:]):

2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Enchant] Clean up TextCheckerEnchant
        https://bugs.webkit.org/show_bug.cgi?id=184233

        Reviewed by Michael Catanzaro.

        Use TextCheckerEnchant as a singleton now, instead of implementing the singleton here.

        * UIProcess/gtk/TextCheckerGtk.cpp:
        (WebKit::TextChecker::checkSpellingOfString):
        (WebKit::TextChecker::getGuessesForWord):
        (WebKit::TextChecker::learnWord):
        (WebKit::TextChecker::ignoreWord):
        (WebKit::TextChecker::setSpellCheckingLanguages):
        (WebKit::TextChecker::loadedSpellCheckingLanguages):
        (WebKit::enchantTextChecker): Deleted.

2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
        https://bugs.webkit.org/show_bug.cgi?id=183346

        Reviewed by Michael Catanzaro.

        Pass the request cancellable to NetworkStorageSession::getCredentialFromPersistentStorage().

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::authenticate):

2018-04-02  Brady Eidson  <beidson@apple.com>

        Process swapping on navigation needs to handle server redirects.
        <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142

        Reviewed by Alex Christensen.

        The same rules we apply to process swapping for basic navigations need to apply
        to server redirects as well.

        There's three interesting cases we need to support that are covered by new API tests:
        1 - The initial load in a WKWebView redirects cross-origin.
        2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
        3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.

        Supporting all 3 of these brought their own little challenges.

        By teaching Navigation objects more about redirects I was able to support all 3 cases.

        * UIProcess/API/APINavigation.cpp:
        (API::Navigation::Navigation):
        (API::Navigation::setCurrentRequest):
        (API::Navigation::appendRedirectionURL):
        (API::Navigation::loggingString const):
        (API::Navigation::loggingURL const): Deleted.
        * UIProcess/API/APINavigation.h:
        (API::Navigation::originalRequest const):
        (API::Navigation::currentRequest const):
        (API::Navigation::currentRequestProcessIdentifier const):
        (API::Navigation::setCurrentRequestIsRedirect):
        (API::Navigation::currentRequestIsRedirect const):
        (API::Navigation::request const): Deleted.

        * UIProcess/API/Cocoa/WKNavigation.mm:
        (-[WKNavigation _request]):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
          redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
        (WebKit::WebPageProxy::didCreateMainFrame):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
          cross-origin redirect that is just starting back up in a new WebProcess.
        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
          a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
          be used to continue a navigation.
        * UIProcess/WebProcessPool.h:

        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::didCommitProvisionalLoad):
        (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-04-02  Eric Carlson  <eric.carlson@apple.com>

        [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
        https://bugs.webkit.org/show_bug.cgi?id=184188
        <rdar://problem/38940307>

        Reviewed by Youenn Fablet.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenModelContext::willExitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::willExitFullscreen):
        * WebProcess/cocoa/VideoFullscreenManager.h:
        * WebProcess/cocoa/VideoFullscreenManager.messages.in:
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::willExitFullscreen):

2018-04-02  Brian Burg  <bburg@apple.com>

        [Cocoa] Fix some internal builds that consume WebDriver atoms
        https://bugs.webkit.org/show_bug.cgi?id=184197

        Reviewed by Dan Bernstein.

        * WebKit.xcodeproj/project.pbxproj:
        Use a Run Script phase to copy WebDriver atoms to WebKit.framework
        private headers during the installhdrs phase.

2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r230174.

        Caused LayoutTests to exit early with assertion failures.

        Reverted changeset:

        "Process swapping on navigation needs to handle server
        redirects."
        https://bugs.webkit.org/show_bug.cgi?id=184142
        https://trac.webkit.org/changeset/230174

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

        [Extra zoom mode] Update date picker UI to latest specifications
        https://bugs.webkit.org/show_bug.cgi?id=184234
        <rdar://problem/38804760>

        Reviewed by Timothy Hatcher.

        Rename WKTextFormControlListViewControllerDelegate to WKTextInputListViewControllerDelegate and adjust for the
        new initializer of WKDatePickerViewController.

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

2018-04-02  Brady Eidson  <beidson@apple.com>

        Process swapping on navigation needs to handle server redirects.
        <rdar://problem/38690465> and https://bugs.webkit.org/show_bug.cgi?id=184142

        Reviewed by Alex Christensen.

        The same rules we apply to process swapping for basic navigations need to apply
        to server redirects as well.

        There's three interesting cases we need to support that are covered by new API tests:
        1 - The initial load in a WKWebView redirects cross-origin.
        2 - A WKWebView is showing content from a.com, we start a load to b.com, and that redirects to c.com
        3 - A WKWebView is showing content from a.com, we start a load to a.com, that that redirects to b.com.

        Supporting all 3 of these brought their own little challenges.

        By teaching Navigation objects more about redirects I was able to support all 3 cases.

        * UIProcess/API/APINavigation.cpp:
        (API::Navigation::Navigation):
        (API::Navigation::setCurrentRequest):
        (API::Navigation::appendRedirectionURL):
        (API::Navigation::loggingString const):
        (API::Navigation::loggingURL const): Deleted.
        * UIProcess/API/APINavigation.h:
        (API::Navigation::originalRequest const):
        (API::Navigation::currentRequest const):
        (API::Navigation::currentRequestProcessIdentifier const):
        (API::Navigation::setCurrentRequestIsRedirect):
        (API::Navigation::currentRequestIsRedirect const):
        (API::Navigation::request const): Deleted.

        * UIProcess/API/Cocoa/WKNavigation.mm:
        (-[WKNavigation _request]):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess): If this continued navigation is currently in a server
          redirect, save off a lambda to synthesize a "did receive server redirect" callback once the new WebProcess is running.
        (WebKit::WebPageProxy::didCreateMainFrame):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Possibly ignore this notification if it is really a
          cross-origin redirect that is just starting back up in a new WebProcess.
        (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didCommitLoadForFrame):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::resetStateAfterProcessExited): Do not clear pageLoadState if the process is exitting for
          a navigation swap, as we will need to pick up where we left off when the load continues in a new WebProcess.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation): If a process has never committed any provisional load, it can always
          be used to continue a navigation.
        * UIProcess/WebProcessPool.h:

        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::didCommitProvisionalLoad):
        (WebKit::WebProcessProxy::hasCommittedAnyProvisionalLoads const):

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

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

        [Extra zoom mode] Zoom level is sometimes excessive when zooming to focused form controls
        https://bugs.webkit.org/show_bug.cgi?id=184222
        <rdar://problem/39063886>

        Reviewed by Timothy Hatcher.

        Upon interactively focusing an element, we zoom and scroll to reveal that element. The heuristics introduced in
        <https://trac.webkit.org/r168744> work by computing a target scale, and then a point to zoom to given that
        scale. Currently, this scale is dependent on the computed font size of the form control, such that the form
        control would be scaled to have an effective font size of 16.

        However, in extra zoom mode, applying these same heuristics (ironically) results in excessive zoom levels, since
        scaling the font up to 16 would cause most form controls to zoom so far in that we lose context of surrounding
        elements such as labels and other form controls; the fact that the element is highlighted by the focused form
        control overlay makes this even more confusing, since part of the focus overlay highlight rect often ends up
        outside the viewport.

        To fix this, we make a couple of tweaks to focus rect zooming in extra zoom mode. (1) Instead of computing
        target zoom level based on font size, try to zoom such that the focused element rect fills up most of the
        viewport (similar to double-tap zooming). This ensures that the focused form control overlay's highlight rect
        makes sense in most cases, with few exceptions (e.g. the element frame is larger than the viewport). (2)
        Introduce a minimum legible font size of 11, and compute the minimium scale needed such that the form control
        font would appear to be at least this legible font size. Then, clamp the target scale chosen by (1) to this
        minimum scale.

        One additional consideration for (1) is that naively scaling to fit the element rect to the viewport (with some
        fixed margins) would cause the viewport scale to always change when moving focus between form controls of
        different dimensions, even if the current scale is more or less appropriate for all the focusable elements. To
        address this, instead of computing a single target zoom scale for an element rect, compute a range of possible
        target zoom scales (where the minimum and maximum values depend on the margin we add around the element rect).
        If the current scale already falls within this target scale range, then we won't bother adjusting the scale at
        all (unless the font size is too small — see (2)). If the current scale falls outside the target scale range, we
        then make the minimal adjustment needed to ensure that the element rect fits well within the viewport without
        being too small.

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

        Move some logic around so that the target scale is computed after computing the visible size. Also renames some
        constants local to this function (WKWebViewStandardFontSize, kMinimumHeightToShowContentAboveKeyboard,
        UIWebFormAnimationDuration, CaretOffsetFromWindowEdge) such that they now share a consistent naming style.

2018-04-02  Jer Noble  <jer.noble@apple.com>

        Enable Legacy EME for all WebKit & WebKitLegacy clients
        https://bugs.webkit.org/show_bug.cgi?id=184018
        <rdar://problem/34887387>

        Reviewed by Eric Carlson.

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

2018-04-02  Jer Noble  <jer.noble@apple.com>

        REGRESSION (229680): Fullscreen video does not work (youtube, netflix)
        https://bugs.webkit.org/show_bug.cgi?id=184235

        Reviewed by Eric Carlson.

        Enable the Fullscreen API by default.

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

2018-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
        https://bugs.webkit.org/show_bug.cgi?id=184120

        Reviewed by Alex Christensen.

        It seems that MSVC can't compile the code using `this` in a
        generalized lambda capture in another lambda.

        In this case, there is no need to copy `protectedThis` for the
        inner lambda. Move `protectedThis` of the outer lambda to the
        inner as well as `callback`.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        Moved `protectedThis` from the outer lambda to the inner.

2018-04-02  Dan Bernstein  <mitz@apple.com>

        Build fix after r230121

        * Configurations/WebKit.xcconfig: Disabled framework header postprocessing when building for
          iOS 11.*
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Reverted r230159.

2018-04-02  Dan Bernstein  <mitz@apple.com>

        Fixed the build when BOOL is not bool.
        <rdar://problem/39094484>

        Reviewed by Jer Noble.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController videoControlsManagerDidChange]): Removed the write-only ivar
          _hasControlsManager, the assignment to which was causing the compiler error.

2018-04-02  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix.

        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Update availability annotation.

2018-04-02  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] DragAndDropHandler.cpp should include GUniquePtrGtk.h
        https://bugs.webkit.org/show_bug.cgi?id=184119

        Reviewed by Daniel Bates.

        * UIProcess/gtk/DragAndDropHandler.cpp:

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

        Fix warnings for unused lambda captures in Source/WebKit
        https://bugs.webkit.org/show_bug.cgi?id=173555

        Reviewed by Konstantin Tokarev.

        When release logs are disabled, several lambda captures are unused, causing compilation
        failures with -Wunused-lambda-capture. This patch marks the corresponding variables as unused
        in order to fix these warnings.

        Based on initial patch by: Konstantin Tokarev  <annulen@yandex.ru>

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::retrieveCacheEntry):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::fetchWebsiteData):
        (WebKit::NetworkProcessProxy::deleteWebsiteData):
        (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::fetchWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteData):
        (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):

2018-04-02  Alejandro G. Castro  <alex@igalia.com>

        [GTK] Make libwebrtc backend buildable for GTK  port
        https://bugs.webkit.org/show_bug.cgi?id=178860

        Reviewed by Youenn Fablet.

        * CMakeLists.txt: Add RTC network classes to the compilation and
        the libwebrtc includes.
        * PlatformGTK.cmake: Add the libwebrtc directory.
        * SourcesGTK.txt: Add RTC files to the compilation.

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

        REGRESSION (r229828): Facebook login popup is blank
        https://bugs.webkit.org/show_bug.cgi?id=184206
        <rdar://problem/39057006>

        Reviewed by Wenson Hsieh.

        Add assertion to make sure we never try to do a policy check to
        a resource response while a policy check for a navigation is
        pending. This assertion was being hit by several of our redirection
        tests without my fix.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r230125.

        Build fix broke more builds.

        Reverted changeset:

        "Unreviewed build fix, remove unused lambda capture."
        https://trac.webkit.org/changeset/230125

2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix, remove unused lambda capture.

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

2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Adopt list view controller UI for numeric input types
        https://bugs.webkit.org/show_bug.cgi?id=184184
        <rdar://problem/37238916>

        Reviewed by Timothy Hatcher.

        Remove existing logic for presenting a number pad view controller, since number pads will now be handled as a
        special case of general text form controls in extra zoom mode.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentViewControllerForCurrentAssistedNode]):
        (-[WKContentView dismissAllInputViewControllers]):
        (-[WKContentView _wheelChangedWithEvent:]):

2018-03-30  Dan Bernstein  <mitz@apple.com>

        Update availability annotations to match the macOS 10.13.4 and iOS 11.3 GM SDKs
        https://bugs.webkit.org/show_bug.cgi?id=184173

        Reviewed by Alex Christensen.

        Changed WK_MAC_TBA and WK_IOS_TBA to 10.13.4 and 11.3, respectively, in all declarations that
        appear in the GM SDKs.

        * Shared/API/Cocoa/_WKNSWindowExtras.h:
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
        * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/API/Cocoa/_WKApplicationManifest.h:
        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAutomationSession.h:
        * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h:
        * UIProcess/API/Cocoa/_WKDownload.h:
        * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
        * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
        * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
        * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:

2018-03-30  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should upgrade redirects if needed
        https://bugs.webkit.org/show_bug.cgi?id=184098

        Reviewed by Chris Dumez.

        In case of redirections, upgrade URL according CSP.

        * NetworkProcess/NetworkLoadChecker.cpp:
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy const):

2018-03-30  JF Bastien  <jfbastien@apple.com>

        Update messages.py codegen for String, fix tests
        https://bugs.webkit.org/show_bug.cgi?id=184179
        <rdar://problem/39041352>

        Reviewed by Mark Lam.

        I updated some of the code in
        https://trac.webkit.org/changeset/230097 and auto-magically used a
        script to update copyright headers... and that broke the tests
        which checked for a particular date. Update all of the headers.

        Part of this change updates the code generated by messages.py

        * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
        * Scripts/webkit/MessageReceiver-expected.cpp:
        * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
        * Scripts/webkit/MessagesSuperclass-expected.h:
        * Scripts/webkit/messages.py:
        * Scripts/webkit/messages_unittest.py:
        (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
        generate a better error message

2018-03-29  JF Bastien  <jfbastien@apple.com>

        Use Forward.h instead of forward-declaring WTF::String
        https://bugs.webkit.org/show_bug.cgi?id=184172
        <rdar://problem/39026146>

        Reviewed by Yusuke Suzuki.

        As part of #184164 I'm changing WTF::String, and the forward
        declarations are just wrong because I'm making it templated. We
        should use Forward.h anyways, so do that instead.

        * Scripts/webkit/LegacyMessages-expected.h:
        * Scripts/webkit/Messages-expected.h:
        * Scripts/webkit/MessagesSuperclass-expected.h:
        * UIProcess/WebOpenPanelResultListenerProxy.h:

2018-03-29  Brian Burg  <bburg@apple.com>

        Web Automation: clipToViewport is ignored for element screenshots
        https://bugs.webkit.org/show_bug.cgi?id=184158
        <rdar://problem/39014307>

        Reviewed by Timothy Hatcher.

        In §19.2 Take Element Screenshot, step 5.2 says that we should clip
        the element screenshot rect with the visible viewport rect. We don't
        do that right now even though we pass over clipToViewport.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::snapshotRectForScreenshot):
        Clip the rect to viewport if needed.

        (WebKit::WebAutomationSessionProxy::takeScreenshot):
        This scrollIntoView is misplaced; by this point we have already done
        the math to figure out the screenshot rect. Move it before computing the rect.

2018-03-29  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r230035): ASSERT(MACH_PORT_VALID(m_sendPort)) hit in IPC::Connection::initializeSendSource()
        https://bugs.webkit.org/show_bug.cgi?id=184122
        <rdar://problem/39003606>

        Reviewed by Chris Dumez.

        One of the new assertions added in r230035 begin firing while running tests locally. This was happening
        because the WebInspector was attempting to open a new connection to a web process that had already
        terminated its mach port connection (a dead port).
        
        We should avoid opening new connections when the port we were given is already dead.

        * Platform/IPC/Connection.h:
        (IPC::Connection::identifierIsValid): Added.
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::platformInitialize): Do not perform initialization on a dead (or null) port.
        (IPC::Connection::open): Add some assertions that ports are in a valid state.
        (IPC::Connection::sendOutgoingMessage): Assert that the send port is not dead.
        (IPC::Connection::receiveSourceEventHandler): Assert that the receive port is valid.
        * UIProcess/ChildProcessProxy.cpp:
        (WebKit::ChildProcessProxy::didFinishLaunching): Treat a dead port as a signal that the
        child process failed to launch.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didFinishLaunching): Ditto.
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::didFinishLaunching): Ditto.
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::didFinishLaunching): Ditto.
        * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
        (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): Ditto.
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::establishConnection): Ditto.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection): Ditto.
        (WebKit::WebProcess::ensureWebToStorageProcessConnection): Ditto.

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

        Synchronize SecurityOrigin related scheme registries with NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=184140

        Reviewed by Chris Dumez.

        Add syncing of scheme registries that are used by SecurityOrigin and ContentSecurityPolicy
        so that we can properly use them in NetworkProcess as we do in WebProcess.
        The registries that are not synced are:
        - URLSchemeAsEmptyDocument
        - URLSchemeDomainRelaxationForbidden
        - URLSchemeAsCachePartitioned
        - URLSchemeAsCanDisplayOnlyIfCanRequest

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::registerURLSchemeAsSecure const):
        (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const):
        (WebKit::NetworkProcess::registerURLSchemeAsLocal const):
        (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const):
        (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const):
        (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const):
        (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsSecure):
        (WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
        (WebKit::WebProcessPool::registerURLSchemeAsLocal):
        (WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
        (WebKit::WebProcessPool::registerURLSchemeAsDisplayIsolated):
        (WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
        (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):

2018-03-29  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r229480): ERROR: Unhandled web process message 'WebCookieManager:SetHTTPCookieAcceptPolicy'
        https://bugs.webkit.org/show_bug.cgi?id=184124
        <rdar://problem/38998971>

        Reviewed by Chris Dumez.

        Cookie accept policy messages were still being sent to the WebContent process after
        I removed cookie access in r229480. The WebContent process no longer recognizes these
        messages, and generates logging to that effect.
        
        This patch stops sending these unnecessary messages to the WebContent process. Only the
        Network process needs to receive this information.

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

2018-03-29  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>

        [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
        https://bugs.webkit.org/show_bug.cgi?id=184037

        Reviewed by Žan Doberšek.

        * Shared/wpe/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.

2018-03-28  Zalan Bujtas  <zalan@apple.com>

        Make it possible to override the screen size
        https://bugs.webkit.org/show_bug.cgi?id=184111
        <rdar://problem/38972181>

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::overrideScreenSize):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::overrideScreenSize const):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::overrideScreenSize const):

2018-03-28  Chris Dumez  <cdumez@apple.com>

        Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
        https://bugs.webkit.org/show_bug.cgi?id=183962
        <rdar://problem/38817833>

        Reviewed by Brady Eidson.

        Swap WebProcess on for the initial navigation in a new Window that was opened
        via window.open(), when the new URL is cross-origin compared to the opener's
        origin. For now, we only swap process if 'noopener' property is set when calling
        window.open(). This is because we do not support the remote DOMWindows yet.

        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const):
        (WebKit::NavigationActionData::decode):
        * Shared/NavigationActionData.h:
        * UIProcess/API/APINavigation.h:
        (API::Navigation::setIsCrossOriginWindowOpenNavigation):
        (API::Navigation::isCrossOriginWindowOpenNavigation const):
        (API::Navigation::setOpener):
        (API::Navigation::opener const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-03-28  Per Arne Vollan  <pvollan@apple.com>

        Adopt WEBPROCESS_WINDOWSERVER_BLOCKING compiler guard in WebProcess.
        https://bugs.webkit.org/show_bug.cgi?id=183959
        <rdar://problem/38965719>

        Reviewed by Brent Fulgham.

        Use the compile guard to guard the call to CGSSetDenyWindowServerConnections.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeProcess):

2018-03-28  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed build fix after r230045.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm: Add missing include (breaks iOS).

2018-03-28  Brent Fulgham  <bfulgham@apple.com>

        Protect against invalid mach ports returned by mach_port_request_notification
        https://bugs.webkit.org/show_bug.cgi?id=184106
        <rdar://problem/37865316>

        Reviewed by Chris Dumez.

        * Platform/IPC/Connection.h:
        (IPC::Connection::Identifier::Identifier): Use default initializer syntax.
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::open): Drive-by-fix: Include formatted mach error message in logging.
        (IPC::Connection::receiveSourceEventHandler): Check return value from 'mach_port_request_notification'
        and clean up if it experienced an error.
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess): Ditto.

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

        WKWebViewContentProvider shouldn't be a UIScrollViewDelegate
        https://bugs.webkit.org/show_bug.cgi?id=184107
        <rdar://problem/38967492>

        Reviewed by Tim Horton.

        There is no need for this class to be a UIScrollViewDelegate. Instead
        the protocol should have an optional method that is effectively
        scrollViewDidScroll.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView scrollViewDidScroll:]): Call web_scrollViewDidScroll
        if it exists.
        * UIProcess/Cocoa/WKWebViewContentProvider.h: Remove UIScrollViewDelegate
        and add an optional web_scrollViewDidScroll.
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView web_scrollViewDidScroll:]): Renamed from scrollViewDidScroll.
        (-[WKPDFView scrollViewDidScroll:]): Deleted.
        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView scrollViewDidScroll:]): Deleted.

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

        [Extra zoom mode] Make boosted text autosizing values switchable at runtime
        https://bugs.webkit.org/show_bug.cgi?id=184092
        <rdar://problem/38939917>

        Reviewed by Tim Horton.

        Add a private web view preference to switch between normal and boosted text autosizing mode. By default, we use
        normal text autosizing values.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setShouldEnableTextAutosizingBoost:]):
        (-[WKPreferences _shouldEnableTextAutosizingBoost]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-03-28  Brent Fulgham  <bfulgham@apple.com>

        Avoid uninitialized mach ports
        https://bugs.webkit.org/show_bug.cgi?id=184090
        <rdar://problem/37261129>

        Reviewed by Chris Dumez.

        It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
        of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
        there is a potential for us to try to use invalid ports.

        We should always check return values, and ensure that the mach port variables we seek to initialize are
        kept in a valid state.

        Reviewed by Chris Dumez.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): Initialize new port to a safe default and
        check the return state of the allocation function.
        * Platform/IPC/Connection.h:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::open): Ditto.
        (IPC::Connection::initializeSendSource): Ditto.
        (IPC::readFromMachPort): Ditto.
        (IPC::Connection::receiveSourceEventHandler): Ditto.
        * Platform/SharedMemory.h:
        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::makeMemoryEntry): Ditto.
        * Platform/mac/MachUtilities.cpp:
        (setMachPortQueueLength): Ditto.
        (setMachExceptionPort): Ditto.
        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::createWebProcessConnection): Ditto.
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::createStorageToWebProcessConnection): Ditto.
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess): Ditto.
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openFrontendConnection): Ditto.

2018-03-28  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fails to build webkitgtk+ after git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        https://bugs.webkit.org/show_bug.cgi?id=184081

        Unreviewed, switch to use UNUSED_PARAM()

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

2018-03-28  Tim Horton  <timothy_horton@apple.com>

        Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
        https://bugs.webkit.org/show_bug.cgi?id=184072
        <rdar://problem/38946530>

        Reviewed by Dan Bernstein.

        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * UIProcess/mac/ViewSnapshotStore.h:
        * UIProcess/mac/ViewSnapshotStore.mm:
        (WebKit::ViewSnapshot::clearImage):

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

        Revert an unnecessary workaround when zooming focused form controls
        https://bugs.webkit.org/show_bug.cgi?id=184067
        <rdar://problem/38805254>

        Reviewed by Tim Horton.

        Reverts an unintended change introduced in r227984.

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

2018-03-28  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Remove UpdateAtlas
        https://bugs.webkit.org/show_bug.cgi?id=184042

        Reviewed by Žan Doberšek.

        Remove all the code related to UpdateAtlas handling.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
        (WebKit::CoordinatedGraphicsScene::commitSceneState):
        (WebKit::CoordinatedGraphicsScene::purgeGLResources):
        (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases): Deleted.
        (WebKit::CoordinatedGraphicsScene::createUpdateAtlas): Deleted.
        (WebKit::CoordinatedGraphicsScene::removeUpdateAtlas): Deleted.
        (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::renderLayerTree):
        (WebKit::ThreadedCompositor::releaseUpdateAtlases): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::delegatedScrollRequested):
        (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Deleted.
        * WebProcess/WebPage/AcceleratedDrawingArea.h:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::CompositingCoordinator):
        (WebKit::CompositingCoordinator::flushPendingLayerChanges):
        (WebKit::CompositingCoordinator::clearPendingStateChanges):
        (WebKit::CompositingCoordinator::renderNextFrame):
        (WebKit::CompositingCoordinator::purgeBackingStores):
        (WebKit::CompositingCoordinator::createUpdateAtlas): Deleted.
        (WebKit::CompositingCoordinator::removeUpdateAtlas): Deleted.
        (WebKit::CompositingCoordinator::getCoordinatedBuffer): Deleted.
        (): Deleted.
        (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases): Deleted.
        (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): Deleted.
        (WebKit::CompositingCoordinator::releaseAtlases): Deleted.
        (WebKit::CompositingCoordinator::clearUpdateAtlases): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
        (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
        * WebProcess/WebPage/DrawingArea.h:
        * WebProcess/WebPage/LayerTreeHost.h:
        (WebKit::LayerTreeHost::setIsDiscardable):

2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
        https://bugs.webkit.org/show_bug.cgi?id=184075

        Reviewed by Žan Doberšek.

        This is because we are using a value after it has been moved.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
        before using it when it's also going to be moved in the lambda capture.

2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix typo in variable name

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseCrossingNotifyEvent):

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

        The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
        https://bugs.webkit.org/show_bug.cgi?id=183923
        <rdar://problem/38756869>

        Reviewed by Brent Fulgham.

        Send OpenGL display mask to the WebContent process when the display ID is changing.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::windowScreenDidChange):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::openGLDisplayMaskChanged):

2018-03-27  Youenn Fablet  <youenn@apple.com>

        Move request checking out of PingLoad for future reuse in NetworkLoad
        https://bugs.webkit.org/show_bug.cgi?id=183865

        Reviewed by Chris Dumez.

        Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
        Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.

        Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.

        Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
        Ensure this callback is called even if preflight is not completed by returning a Canceled error.

        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
        (WebKit::NetworkCORSPreflightChecker::returnResult):
        (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
        (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkLoadChecker.cpp: Added.
        (WebKit::NetworkLoadChecker::NetworkLoadChecker):
        (WebKit::NetworkLoadChecker::check):
        (WebKit::NetworkLoadChecker::checkRedirection):
        (WebKit::NetworkLoadChecker::returnError):
        (WebKit::NetworkLoadChecker::checkRequest):
        (WebKit::NetworkLoadChecker::checkCORSRequest):
        (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
        (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
        (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
        (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
        (WebKit::NetworkLoadChecker::contentExtensionsBackend):
        (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
        * NetworkProcess/NetworkLoadChecker.h: Added.
        (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
        (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
        (WebKit::NetworkLoadChecker::url const):
        (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
        (WebKit::NetworkLoadChecker::isChecking const):
        (WebKit::NetworkLoadChecker::isRedirected const):
        * NetworkProcess/PingLoad.cpp:
        (WebKit::PingLoad::PingLoad):
        (WebKit::PingLoad::~PingLoad):
        (WebKit::PingLoad::willPerformHTTPRedirection):
        (WebKit::PingLoad::didReceiveChallenge):
        (WebKit::PingLoad::wasBlocked):
        (WebKit::PingLoad::cannotShowURL):
        (WebKit::PingLoad::timeoutTimerFired):
        (WebKit::PingLoad::currentURL const):
        * NetworkProcess/PingLoad.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Implement authenticatorGetAssertion
        https://bugs.webkit.org/show_bug.cgi?id=183881
        <rdar://problem/37258628>

        Reviewed by Brent Fulgham.

        * Shared/WebPreferences.yaml:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
        (WebKit::WebCredentialsMessenger::getAssertion):
        (WebKit::WebCredentialsMessenger::getAssertionReply):
        * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

2018-03-27  Chris Dumez  <cdumez@apple.com>

        Avoid constructing SecurityOrigin objects from non-main threads
        https://bugs.webkit.org/show_bug.cgi?id=184024

        Reviewed by Youenn Fablet.

        Avoid constructing SecurityOrigin objects from non-main threads as much as possible.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
        (WebKit::WebSWClientConnection::matchRegistration):
        (WebKit::WebSWClientConnection::getRegistrations):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWOriginTable.cpp:
        (WebKit::WebSWOriginTable::contains const):
        * WebProcess/Storage/WebSWOriginTable.h:

2018-03-27  Chris Dumez  <cdumez@apple.com>

        Move online state detection from the WebProcess to the NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=183989
        <rdar://problem/37093299>

        Reviewed by Youenn Fablet.

        Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
        EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
        and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
        its connected WebProcesses via IPC.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::setOnLineState):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::setOnLineState):
        * WebProcess/Network/NetworkProcessConnection.h:
        * WebProcess/Network/NetworkProcessConnection.messages.in:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::isOnLine const):
        (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
        (WebKit::WebLoaderStrategy::setOnLineState):
        * WebProcess/Network/WebLoaderStrategy.h:

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

        [Extra zoom mode] Add support for new focused form control overlay behaviors
        https://bugs.webkit.org/show_bug.cgi?id=184043
        <rdar://problem/38758727>

        Reviewed by Tim Horton.

        See below for more details.

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

        Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
        when moving from one focused form control to another).

        (-[WKContentView textInputController:didCommitText:withSuggestion:]):

        When dismissing an input view controller, allow focused form control navigation only after updating assisted
        node information to ensure that focus rects aren't stale as the user begins to navigate between forms.

        (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
        (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
        (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
        (-[WKContentView scrollViewForFocusedFormControlController:]):
        (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.

        Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
        previous focusable form controls.

2018-03-27  Brent Fulgham  <bfulgham@apple.com>

        Further refine cookie read/write logging
        https://bugs.webkit.org/show_bug.cgi?id=184044
        <rdar://problem/38915610>

        Reviewed by Chris Dumez.

        Cookie logging was passing the partition, rather than the first party, when logging, which
        prevented logging in cases where partitioning or blocking was active. This patch corrects
        these calls so that logging is generated in these cases, too.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::escapeIDForJSON): Make available to use in multiple functions.
        (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
        convenience functions.
        (WebKit::logBlockedCookieInformation): Added.
        (WebKit::logCookieInformationInternal): Added.
        (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
        convenience functions.
        * NetworkProcess/NetworkResourceLoader.h:

2018-03-27  Brian Burg  <bburg@apple.com>

        Web Automation: support enter/exit fullscreen and hide/restore window operations
        https://bugs.webkit.org/show_bug.cgi?id=182837
        <rdar://problem/37580732>

        Reviewed by Tim Horton.

        The W3C specification is more explicit about when to exit fullscreen and
        restore the window for a browsing context. So, WebKit needs to have support
        for performing these operations on behalf of a driver.

        Based on prototyping, it is sufficient to use a JavaScript atom to enter
        fullscreen mode. This is included in the patch as EnterFullscreen.js and
        can be used to implement the §10.7.5 Fullscreen Window command.

        Other window operations cannot be peformed from JavaScript, so we need to
        delegate these operations to the session client (i.e., Safari).
        This patch adds session client callouts for restoring, minimizing, and
        switching to a browsing context.

        Exiting fullscreen happens implicitly (per specification) when setting a
        window frame without an actual frame, or when switching/restoring/minimizing a window.
        If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
        Similarly, a driver can restore a minimized window using Set Window Rect.

        * UIProcess/API/APIAutomationSessionClient.h:
        (API::AutomationSessionClient::requestHideWindowOfPage):
        (API::AutomationSessionClient::requestRestoreWindowOfPage):
        (API::AutomationSessionClient::requestSwitchToPage):
        Add new API client methods.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
        Add new Cocoa API delegate methods.

        * UIProcess/Automation/Automation.json:
        Make the switch to browsing context command asynchronous, since this functionality
        is not always synchronous, and we prefer to use completion handlers in the delegates.

        Add new protocol method for hiding the window of a browsing context.
        This is expected to minimize/miniaturize a window for desktop window managers.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::switchToBrowsingContext):
        Make this function asynchronous. Call out to the session client.

        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
        Follow the steps in the specification to restore window and exit fullscreen.

        (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
        Exit fullscreen and call out to the session client.

        (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
        This is a little strange. Because there is no async API for exiting fullscreen
        from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
        out the response if the page exited fullscreen after we requested it to do so.
        Because the W3C specification mandates that drivers only process one command at
        a time, there will only ever be one callback installed by this method at a time.

        (WebKit::WebAutomationSession::restoreWindowForPage):
        (WebKit::WebAutomationSession::hideWindowForPage):
        Call out to the session client.

        (WebKit::WebAutomationSession::didEnterFullScreenForPage):
        (WebKit::WebAutomationSession::didExitFullScreenForPage):
        Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.

        * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
        (enterFullscreen):

        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::AutomationSessionClient):
        (WebKit::AutomationSessionClient::requestSwitchToPage):
        (WebKit::AutomationSessionClient::requestHideWindowOfPage):
        (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
        (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
        Add boilerplate to convert C++ API client to Objective-C delegate methods.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
        (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
        Notify the automation session if the page is under automation and
        enters or exits fullscreen.

        * WebKit.xcodeproj/project.pbxproj:
        Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
        as WebKit2 private headers and used by driver implementations.

2018-03-27  Eric Carlson  <eric.carlson@apple.com>

        Make AVFoundationEnabled preference available on iOS
        https://bugs.webkit.org/show_bug.cgi?id=183876
        <rdar://problem/38726459>

        Reviewed by Youenn Fablet.

        * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
        * Shared/WebPreferencesDefaultValues.h:

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
        (-[WKPreferences _avFoundationEnabled]): Ditto.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-03-26  Tim Horton  <timothy_horton@apple.com>

        Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=184030
        <rdar://problem/38895281>

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        * Configurations/BaseTarget.xcconfig:
        * Configurations/WebKit.xcconfig:

2018-03-26  Tim Horton  <timothy_horton@apple.com>

        Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
        https://bugs.webkit.org/show_bug.cgi?id=184026
        <rdar://problem/38883321>

        Reviewed by Sam Weinig.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _takeViewSnapshot]):
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

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

        [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
        https://bugs.webkit.org/show_bug.cgi?id=184020
        Work towards <rdar://problem/38758727>

        Reviewed by Tim Horton.

        We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
        a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
        (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
        the focused form control overlay.

        This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
        form control view controller can receive forwarded events from the web view. See below for more detail.

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

        Remove logic to restore the web view as first responder.

        (-[WKContentView presentViewControllerForCurrentAssistedNode]):
        (-[WKContentView dismissAllInputViewControllers]):

        Restore first responder after dismissing a view controller that was presented when focusing a form control, only
        if the web view was first responder before presentation.

        (-[WKContentView presentDatePickerViewController:]): Deleted.
        (-[WKContentView dismissDatePickerViewController:]): Deleted.
        (-[WKContentView presentTimePickerViewController:]): Deleted.
        (-[WKContentView dismissTimePickerViewController:]): Deleted.
        (-[WKContentView presentSelectMenuViewController:]): Deleted.
        (-[WKContentView dismissSelectMenuViewController:]): Deleted.
        (-[WKContentView dismissNumberPadViewController:]): Deleted.
        (-[WKContentView presentNumberPadViewController:]): Deleted.
        (-[WKContentView presentTextInputViewController:]): Deleted.
        (-[WKContentView dismissTextInputViewController:]): Deleted.

2018-03-06  Brian Burg  <bburg@apple.com>

        Web Automation: provide a way to ask clients for a new tab or window
        https://bugs.webkit.org/show_bug.cgi?id=183381
        <rdar://problem/38167301>

        Reviewed by Timothy Hatcher.

        Add support for specifying browsing context options when requesting
        a new browsing context from the automation session client/delegate.
        This is currently just used for specifying tab vs window, but could
        also be used for things like toggling certain browser chrome or features.

        There is no guarantee that the client has a notion of tabs vs windows,
        so this option is purely advisory and should not cause the command to
        fail if it cannot be honored.

        This behavior caused by specifying this option is client-specific, so no
        new tests are included in WebKit for this change.

        * UIProcess/API/APIAutomationSessionClient.h:
        (API::AutomationSessionClient::didRequestNewPageWithOptions):
        (API::AutomationSessionClient::didRequestNewWindow): Deleted.
        Add options parameter.

        * UIProcess/API/glib/WebKitAutomationSession.cpp:
        Adjust to new signature. More work is needed to plumb this information
        to the public API for GTK/WPE and support it in WebKitGTK driver.

        * UIProcess/Automation/Automation.json: Add new optional parameter.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::createBrowsingContext):
        Convert the protocol option to an API option.

        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::AutomationSessionClient):
        (WebKit::toAPI):
        (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
        (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
        Convert the internal option to a Cocoa SPI option and pass it along.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
        Adjust delegate methods to include options. Clients need to adopt the new signature(s).

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

        [Extra zoom mode] Add plumbing for next and previous focusable element rects
        https://bugs.webkit.org/show_bug.cgi?id=184016
        Work towards <rdar://problem/38758727>

        Reviewed by Tim Horton.

        When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
        as well as flags indicating whether or not there are next or previous focusable elements. For
        <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):

        IPC support for nextNodeRect and previousNodeRect.

        * Shared/AssistedNodeInformation.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::elementRectInRootViewCoordinates):

        Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
        current focused element as well as those of the next and previous elements, if any.

        (WebKit::WebPage::getAssistedNodeInformation):
        (WebKit::hasAssistableElement): Deleted.

        Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.

2018-03-26  Chris Dumez  <cdumez@apple.com>

        Use SecurityOriginData more consistently in Service Worker code
        https://bugs.webkit.org/show_bug.cgi?id=183969

        Reviewed by Darin Adler.

        Use SecurityOriginData more consistently in Service Worker code to avoid constructing
        SecurityOrigin objects unnecessarily.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * Shared/API/c/WKSecurityOriginRef.cpp:
        (WKSecurityOriginCopyDatabaseIdentifier):
        * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
        (WebKit::WebSWOriginStore::addToStore):
        (WebKit::WebSWOriginStore::removeFromStore):
        * StorageProcess/ServiceWorker/WebSWOriginStore.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::connectionToContextProcessWasClosed):
        (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
        (WebKit::StorageProcess::createStorageToWebProcessConnection):
        (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
        (WebKit::StorageProcess::serverToContextConnectionForOrigin):
        (WebKit::StorageProcess::createServerToContextConnection):
        (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
        * StorageProcess/StorageProcess.h:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::create):
        * UIProcess/API/C/WKApplicationCacheManager.cpp:
        (WKApplicationCacheManagerDeleteEntriesForOrigin):
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerDeleteEntriesForOrigin):
        * UIProcess/API/C/WKResourceCacheManager.cpp:
        (WKResourceCacheManagerClearCacheForOrigin):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
        (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::create):
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::getStorageProcessConnection):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::updateProcessAssertions):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyOriginsWithApplicationCache):
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
        (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        (WebKit::WebSWClientConnection::matchRegistration):
        (WebKit::WebSWClientConnection::whenRegistrationReady):
        (WebKit::WebSWClientConnection::getRegistrations):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::exceededDatabaseQuota):
        (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::fetchWebsiteData):
        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::securityOrigin const):
        * WebProcess/WebStorage/StorageAreaImpl.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::StorageAreaMap):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):

2018-03-26  Brent Fulgham  <bfulgham@apple.com>

        Warn against cookie access in the WebContent process using ProcessPrivilege assertions
        https://bugs.webkit.org/show_bug.cgi?id=183911
        <rdar://problem/38762306>

        Reviewed by Youenn Fablet.

        Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
        should never call Cookie API directly. That should only happen in the Networking or
        UIProcess. 

        * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
        (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
        (WebKit::NetworkProcess::syncAllCookies):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::initializeProcess):
        * Shared/cf/CookieStorageUtilsCF.mm:
        (WebKit::cookieStorageFromIdentifyingData):
        (WebKit::identifyingDataFromCookieStorage):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
        (WebKit::privateBrowsingSession):
        * UIProcess/WebProcessPool.cpp:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/mac/WebCookieManagerProxyMac.mm:
        (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::createNetworkingContext):
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
        (WebKit::WebFrameNetworkingContext::storageSession const):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeProcess):

2018-03-26  Alex Christensen  <achristensen@webkit.org>

        Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
        https://bugs.webkit.org/show_bug.cgi?id=183965

        Reviewed by Chris Dumez.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::willCacheResponse const):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to convert between DOM and JSCValue
        https://bugs.webkit.org/show_bug.cgi?id=183448

        Reviewed by Michael Catanzaro.

        Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
        most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
        * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
        (WebKit::kit):
        (WebKit::core):
        (WebKit::wrapDocument):
        (webkit_dom_document_class_init):
        (webkit_dom_document_init):
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
        (WebKit::kit):
        (WebKit::core):
        (WebKit::wrapElement):
        (webkit_dom_element_class_init):
        (webkit_dom_element_init):
        (webkit_dom_element_html_input_element_is_user_edited):
        (webkit_dom_element_html_input_element_get_auto_filled):
        (webkit_dom_element_html_input_element_set_auto_filled):
        (webkit_dom_element_html_input_element_set_editing_value):
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
        (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
        (WebKit::kit):
        (WebKit::core):
        (WebKit::wrapNode):
        (webkitDOMNodeConstructor):
        (webkitDOMNodeFinalize):
        (webkit_dom_node_init):
        (webkit_dom_node_class_init):
        (webkitDOMNodeSetCoreObject):
        (webkitDOMNodeGetCoreObject):
        (webkit_dom_node_for_js_value):
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
        (webkitDOMObjectSetProperty):
        (webkit_dom_object_class_init):
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
        (WebKit::wrap):
        * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
        * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
        (webkit_frame_get_js_value_for_dom_object):
        (webkit_frame_get_js_value_for_dom_object_in_script_world):
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkit_web_page_class_init):
        (webkitWebPageCreate):
        (webkit_web_page_get_dom_document):
        * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
        (WebKit::GObjectEventListener::handleEvent):
        * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
        (webkitDOMDocumentDOMEventTargetInit):
        (webkitDOMDocumentInstallProperties):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
        (webkitDOMElementDOMEventTargetInit):
        (webkitDOMElementInstallProperties):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
        (webkitDOMNodeDOMEventTargetInit):
        (webkitDOMNodeInstallProperties):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
        (WebKit::wrapNodeGtk):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
        * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
        * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
        * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
        * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
        * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
        * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
        * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
        * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
        * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
        * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
        * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:

2018-03-26  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
        https://bugs.webkit.org/show_bug.cgi?id=184002

        Reviewed by Carlos Garcia Campos.

        Move the CoordinatedGraphicsScene constant-expression initializations
        from constructor to the point of declaration.

        Default the CoordinatedGraphicsScene destructor.

        The m_scrollPosition member variable is unused in this class, while the
        similarly-named m_renderedContentsScrollPosition tracks scroll position
        of the scene. Remove the latter and use m_scrollPosition in its place.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
        (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
        (WebKit::CoordinatedGraphicsScene::commitSceneState):
        (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
        https://bugs.webkit.org/show_bug.cgi?id=183998

        Reviewed by Carlos Garcia Campos.

        * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:

2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Unresolved type warnings when generating gir
        https://bugs.webkit.org/show_bug.cgi?id=183926

        Reviewed by Michael Catanzaro.

        Skip deprecated functions using JSC C API from introspection.

        * UIProcess/API/glib/WebKitJavascriptResult.cpp:
        * UIProcess/API/glib/WebKitWebView.cpp:
        * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:

2018-03-25  Commit Queue  <commit-queue@webkit.org>

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

        Caused many layout tests to crash on Apple High Sierra,
        Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
        by dydz on #webkit).

        Reverted changeset:

        "Use SecurityOriginData more consistently in Service Worker
        code"
        https://bugs.webkit.org/show_bug.cgi?id=183969
        https://trac.webkit.org/changeset/229954

2018-03-23  Brian Burg  <bburg@apple.com>

        Web Automation: remove unnecessary member variable WebAutomationSession
        https://bugs.webkit.org/show_bug.cgi?id=183971

        Reviewed by Timothy Hatcher.

        The concept of the "active" browsing context is something in the WebDriver
        specification, but we were a bit too literal when first implementing this.
        There's no actual need for this on the browser side since most commands
        require implicitly switching to the target window passed in with the
        Automation command. The driver, however, still needs to track the current
        browsing context and current top-level browsing context.

        For returning whether a browsing context is active,  we can just look at
        the page's activity state to know whether the page is active or not. For
        a normal browser, only one page is going to be visible and focused at a time.

        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::buildBrowsingContextForPage):
        Consult the page's activity state to determine whether it's active.

        (WebKit::WebAutomationSession::createBrowsingContext):
        (WebKit::WebAutomationSession::closeBrowsingContext):
        (WebKit::WebAutomationSession::switchToBrowsingContext):
        (WebKit::WebAutomationSession::handleRunOpenPanel):
        Stop reading and writing the current browsing context handle.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isViewFocused const):
        (WebKit::WebPageProxy::isViewWindowActive const):
        Add new accessor.

2018-03-25  Tim Horton  <timothy_horton@apple.com>

        Add and adopt ENABLE(AIRPLAY_PICKER)
        https://bugs.webkit.org/show_bug.cgi?id=183992

        Reviewed by Daniel Bates.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
        * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:

2018-03-25  Tim Horton  <timothy_horton@apple.com>

        Move WKAnimationDelegate to its own header
        https://bugs.webkit.org/show_bug.cgi?id=183976
        <rdar://problem/38822299>

        Reviewed by Dan Bernstein.

        * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
        so we're just getting lucky that an -invalidate method exists on
        some other object. Instead, move WKAnimationDelegate to its own
        header, and include it in the places we use it.

2018-03-24  Tim Horton  <timothy_horton@apple.com>

        Adopt WK_PLATFORM_NAME in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=183978

        Reviewed by Dan Bernstein.

        * Configurations/WebKit.xcconfig:
        * WebKit.xcodeproj/project.pbxproj:
        * mac/MigrateHeadersFromWebKitLegacy.make:
        * mac/postprocess-framework-headers.sh:

2018-03-24  Tim Horton  <timothy_horton@apple.com>

        Ignore sandbox_init_with_parameters deprecation warnings
        https://bugs.webkit.org/show_bug.cgi?id=183979

        Reviewed by Dan Bernstein.

        * Shared/ios/ChildProcessIOS.mm:
        (WebKit::ChildProcess::initializeSandbox):

2018-03-24  Chris Dumez  <cdumez@apple.com>

        Use SecurityOriginData more consistently in Service Worker code
        https://bugs.webkit.org/show_bug.cgi?id=183969

        Reviewed by Darin Adler.

        Use SecurityOriginData more consistently in Service Worker code to avoid constructing
        SecurityOrigin objects unnecessarily.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * Shared/API/c/WKSecurityOriginRef.cpp:
        (WKSecurityOriginCopyDatabaseIdentifier):
        * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
        (WebKit::WebSWOriginStore::addToStore):
        (WebKit::WebSWOriginStore::removeFromStore):
        * StorageProcess/ServiceWorker/WebSWOriginStore.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::connectionToContextProcessWasClosed):
        (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
        (WebKit::StorageProcess::createStorageToWebProcessConnection):
        (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
        (WebKit::StorageProcess::serverToContextConnectionForOrigin):
        (WebKit::StorageProcess::createServerToContextConnection):
        (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
        * StorageProcess/StorageProcess.h:
        * UIProcess/API/APIFrameInfo.cpp:
        (API::FrameInfo::create):
        * UIProcess/API/C/WKApplicationCacheManager.cpp:
        (WKApplicationCacheManagerDeleteEntriesForOrigin):
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerDeleteEntriesForOrigin):
        * UIProcess/API/C/WKResourceCacheManager.cpp:
        (WKResourceCacheManagerClearCacheForOrigin):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
        (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::create):
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::getStorageProcessConnection):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::updateProcessAssertions):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply):
        * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
        (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyOriginsWithApplicationCache):
        * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
        (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
        (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        (WebKit::WebSWClientConnection::matchRegistration):
        (WebKit::WebSWClientConnection::whenRegistrationReady):
        (WebKit::WebSWClientConnection::getRegistrations):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::exceededDatabaseQuota):
        (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::fetchWebsiteData):
        * WebProcess/WebStorage/StorageAreaImpl.cpp:
        (WebKit::StorageAreaImpl::securityOrigin const):
        * WebProcess/WebStorage/StorageAreaImpl.h:
        * WebProcess/WebStorage/StorageAreaMap.cpp:
        (WebKit::StorageAreaMap::StorageAreaMap):
        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
        * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
        (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):

2018-03-24  Tim Horton  <timothy_horton@apple.com>

        Fix the !ENABLE(MEDIA_STREAM) build
        https://bugs.webkit.org/show_bug.cgi?id=183977

        Reviewed by Wenson Hsieh.

        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        * WebProcess/cocoa/UserMediaCaptureManager.messages.in:

2018-03-24  Tim Horton  <timothy_horton@apple.com>

        WKFileUploadPanel shouldn't depend on WebKitLegacy
        https://bugs.webkit.org/show_bug.cgi?id=183981

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
        Just use the underlying WebCore function instead of the
        unnecessary NSFileManager category method.

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

        Fix the build with no pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=183973

        Reviewed by Dan Bernstein.

        * Configurations/FeatureDefines.xcconfig:

2018-03-23  Megan Gardner  <megan_gardner@apple.com>

        Enable unified text selection in select cases for gradual testing
        https://bugs.webkit.org/show_bug.cgi?id=183967
        <rdar://problem/38815328>

        Reviewed by Tim Horton.
        
        Enable in select places for a more gradual switch, as this is a big change and we want to make sure
        it works before switching completely.

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

2018-03-23  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Pick up ITP debug mode flag from defaults
        https://bugs.webkit.org/show_bug.cgi?id=183956
        <rdar://problem/38559574>

        Reviewed by Brent Fulgham.

        * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
        (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):

2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Adopt list view controller UI for select menus
        https://bugs.webkit.org/show_bug.cgi?id=183944
        <rdar://problem/38799062>

        Reviewed by Tim Horton.

        Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.

        * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
        * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
        * WebKit.xcodeproj/project.pbxproj:

2018-03-23  Chris Dumez  <cdumez@apple.com>

        Promptly terminate service worker processes when they are no longer needed
        https://bugs.webkit.org/show_bug.cgi?id=183873
        <rdar://problem/38676995>

        Reviewed by Youenn Fablet.

        The StorageProcess now keeps track of service worker clients for each security
        origin. When there is no longer any clients for a given security origin, the
        StorageProcess asks the service worker process for the given origin to terminate
        and severs its connection to it.

        * Shared/Storage/StorageProcessCreationParameters.h:
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
        (WebKit::WebSWServerToContextConnection::terminate):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::connectionToContextProcessWasClosed):
        (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
        (WebKit::StorageProcess::initializeWebsiteDataStore):
        (WebKit::StorageProcess::swServerForSession):
        (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
        (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
        (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::terminateProcess):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

2018-03-23  Brady Eidson  <beidson@apple.com>

        Go to back/forward list items after a process-swapped navigation.
        <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920

        Reviewed by Andy Estes.

        This takes the initial work of "process swap a normal navigation" and extends it to
        process swapping for back/forward item navigations.

        * Scripts/webkit/messages.py:

        Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
        they will be lost in process-swap scenarios:
        * Shared/SessionState.cpp:
        (WebKit::PageState::encode const):
        (WebKit::PageState::decode):
        * Shared/SessionState.h:

        Make a new variant of APINavigation specifically for back/forward list items.
        * UIProcess/API/APINavigation.cpp:
        (API::Navigation::Navigation):
        (API::Navigation::loggingURL const):
        * UIProcess/API/APINavigation.h:
        (API::Navigation::create):
        (API::Navigation::backForwardListItem):
        (API::Navigation::backForwardFrameLoadType const):

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

        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
        (-[WKBrowsingContextController goToBackForwardListItem:]):

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

        * UIProcess/WebNavigationState.cpp:
        (WebKit::WebNavigationState::createLoadRequestNavigation):
        (WebKit::WebNavigationState::createBackForwardNavigation):
        * UIProcess/WebNavigationState.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcessForReload):
        (WebKit::WebPageProxy::reattachToWebProcessWithItem):
        (WebKit::WebPageProxy::goForward):
        (WebKit::WebPageProxy::goBack):
        (WebKit::WebPageProxy::goToBackForwardItem):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
        (WebKit::WebPageProxy::restoreFromSessionState):
        * UIProcess/WebPageProxy.h:

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
        (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:

        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::endSwipeGesture):

        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::endSwipeGesture):

        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
        (WebKit::toPageState):
        (WebKit::toHistoryItem):

        * WebProcess/WebPage/WebBackForwardListProxy.cpp:
        (WebKit::updateBackForwardItem):

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
          passing the appropriate FrameLoadType around as needed to remember the specific type.
        (WebKit::WebPage::goForward): Deleted.
        (WebKit::WebPage::goBack): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2018-03-23  Megan Gardner  <megan_gardner@apple.com>

        Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
        https://bugs.webkit.org/show_bug.cgi?id=183804

        Reviewed by Tim Horton.

        We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
        or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
        be more direct in checking what we actually need to know i.e. are we selecting in a content editable.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (hasAssistedNode):
        (-[WKContentView inputView]):
        (-[WKContentView _selectionClipRect]):
        (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKContentView gestureRecognizerShouldBegin:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        (-[WKContentView webSelectionRects]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _autofillContext]):

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

        WebProcessPool should not ask to register all clients for each service worker process creation
        https://bugs.webkit.org/show_bug.cgi?id=183941

        Reviewed by Chris Dumez.

        Call registerServiceWorkerClients when there is no service worker process.
        Update service worker clients to register all of them no matter the session ID.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::registerServiceWorkerClients):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Adopt list view controller UI for select menus
        https://bugs.webkit.org/show_bug.cgi?id=183944
        <rdar://problem/38799062>

        Reviewed by Andy Estes.

        Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
        WebKitAdditions harness files. See corresponding changes for more details.

        * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
        * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentSelectMenuViewController:]):
        (-[WKContentView dismissSelectMenuViewController:]):
        (-[WKContentView selectMenu:didSelectItemAtIndex:]):
        (-[WKContentView numberOfItemsInSelectMenu:]):
        (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
        (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
        (-[WKContentView selectMenuUsesMultipleSelection:]):
        (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
        (-[WKContentView _wheelChangedWithEvent:]):

        Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
        handling for select menus here.

        (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
        (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
        (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
        (-[WKContentView startingIndexForSelectMenu:]): Deleted.

        The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
        just remove this delegate hook altogether.

        * WebKit.xcodeproj/project.pbxproj:

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

        CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
        https://bugs.webkit.org/show_bug.cgi?id=183945

        Reviewed by Chris Dumez.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
        In case we clear Caches in the middle of the initialization, m_caches might not be empty
        but m_isInitialized is not yet set to true since we are computing the Caches size.
        Update the assertion and clear m_caches in that case.

2018-03-23  David Kilzer  <ddkilzer@apple.com>

        Stop using dispatch_set_target_queue()
        <https://webkit.org/b/183908>
        <rdar://problem/33553533>

        Reviewed by Daniel Bates.

        * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
        (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
        dispatch_set_target_queue() since this is handled in the
        dispatch_io_create() call above.

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

        CacheStorage::Engine should not ref itself when hopping to a background thread
        https://bugs.webkit.org/show_bug.cgi?id=183925
        <rdar://problem/38580483>

        Reviewed by Chris Dumez.

        Add support for weak pointers to CacheStorage Engine.
        Use weak pointer when hopping to background threads.
        Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
        Made some callbacks CompletionHandler as a bonus.

        Made sure to use just one Engine for all private sessions.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::~Engine):
        (WebKit::CacheStorage::Engine::from):
        (WebKit::CacheStorage::Engine::initialize):
        (WebKit::CacheStorage::Engine::writeFile):
        (WebKit::CacheStorage::Engine::readFile):
        * NetworkProcess/cache/CacheStorageEngine.h:
        (WebKit::CacheStorage::Engine::weakPtrFactory):

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

        Unreviewed build fix.

        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2018-03-23  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
        https://bugs.webkit.org/show_bug.cgi?id=183892

        Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().

        Reviewed by Žan Doberšek.

        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
        (WebKit::CoordinatedBackingStoreTile::swapBuffers):

2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Fix -Wswitch warnings after r229778
        https://bugs.webkit.org/show_bug.cgi?id=183927

        Reviewed by Carlos Garcia Campos.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
        received as a PolicyAction
        * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
        which should be invisible to WebKit clients

2018-03-22  Chris Dumez  <cdumez@apple.com>

        Include security origin in the service worker process name
        https://bugs.webkit.org/show_bug.cgi?id=183913

        Reviewed by Youenn Fablet.

        Include security origin in the service worker process name to facilitate debugging. This way, we
        can differentiate which service worker process is used for which origin in activity monitor.

        * Shared/ChildProcess.h:
        * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
        (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::initializeProcessName):

2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, silence unused variable warning

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

2018-03-22  Dan Bernstein  <mitz@apple.com>

        WKWebView doesn’t expose its spellCheckerDocumentTag
        https://bugs.webkit.org/show_bug.cgi?id=183797
        <rdar://problem/38678089>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.

2018-03-22  Chris Dumez  <cdumez@apple.com>

        Use the same SWServer for all ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=183921
        <rdar://problem/36873075>

        Reviewed by Youenn Fablet.

        Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
        one per sessionID. When browsing doing private browsing in Safari (and other fetching
        favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
        constructing new SWServers that would never go away. Each SWServer has a thread so we
        would eventually hit the thread limit for the storage process.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::swServerForSession):

2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix format string warnings in service worker code

        On Linux x86_64, uint64_t is unsigned long, not unsigned long long.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::didFinishFetch):
        (WebKit::WebSWServerConnection::didFailFetch):
        (WebKit::WebSWServerConnection::didNotHandleFetch):

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

        Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
        https://bugs.webkit.org/show_bug.cgi?id=183907
        <rdar://problem/38759127>

        Reviewed by Alex Christensen.

        Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
        whose content should be displayed/loaded if and only if it can be requested. Disregarding an
        app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
        content for the registered schemes.

        We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
        C API/SPI.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

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

        Improve readability of WebCore's OTHER_LDFLAGS
        https://bugs.webkit.org/show_bug.cgi?id=183909
        <rdar://problem/38760992>

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        * Configurations/FeatureDefines.xcconfig:

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

        [TexMap] Make TextureMapperContextAttributes thread-specific
        https://bugs.webkit.org/show_bug.cgi?id=183895

        Reviewed by Carlos Garcia Campos.

        CoordinatedGraphicsScene, as an implementor of the
        TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
        implement the texmapGL() method anymore.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
        (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

2018-03-21  Frederic Wang  <fwang@igalia.com>

        Unreviewed, update comment added in r229801.

        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.

2018-03-21  Chris Dumez  <cdumez@apple.com>

        Regression(r229831): ProcessSwap.Basic API test is crashing
        https://bugs.webkit.org/show_bug.cgi?id=183884

        Reviewed by Brady Eidson.

        This code should only be called for navigation policy decisions.
        It used to work without this check because of an early return, which
        was dropped in r229831.

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

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

        [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
        https://bugs.webkit.org/show_bug.cgi?id=183866
        <rdar://problem/38692256>

        Reviewed by Tim Horton.

        Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
        when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
        delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
        the actual view is then queried.

        If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
        to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
        text input list view controller).

        * UIProcess/API/Cocoa/_WKFormInputSession.h:
        * UIProcess/API/Cocoa/_WKInputDelegate.h:

        Add the new SPI hooks, described above.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFormInputSession reloadFocusedElementContextView]):

        Plumb the context view reload hook through WKContentView to WKTextInputListViewController.

        (-[WKContentView setupInteraction]):
        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView reloadContextViewForPresentedListViewController]):
        (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):

        Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
        condition, the list view controller's inner table view would get reloaded when the form input session's text
        suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
        dismissal animation of view controller.

2018-03-21  Chris Dumez  <cdumez@apple.com>

        WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
        https://bugs.webkit.org/show_bug.cgi?id=183875

        Reviewed by Brent Fulgham.

        Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
        each service worker process. It is possible for the WebProcess pool to get destroyed
        as a result of terminating a service worker process.

        This change is covered by layout tests that are currently crashing on the ASAN bots.

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

2018-03-21  Eric Carlson  <eric.carlson@apple.com>

        Fix typo in inactive media stream timeout default value
        https://bugs.webkit.org/show_bug.cgi?id=183872
        <rdar://problem/38723903>

        Reviewed by Jer Noble.

        * Shared/WebPreferences.yaml: Fix typo.
        * Shared/WebPreferencesDefaultValues.h: Ditto.

2018-03-21  Chris Dumez  <cdumez@apple.com>

        Make policy decisions asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=180568
        <rdar://problem/37131297>

        Reviewed by Alex Christensen.

        Get rid of synchronous IPC and synchronous code paths for policy delegates.
        Policy decisions are now all made asynchronously and rely on asynchronous
        IPC.

        This code change is based on work by Alex Christensen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-03-21  Chris Dumez  <cdumez@apple.com>

        ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
        https://bugs.webkit.org/show_bug.cgi?id=183787

        Reviewed by Wenson Hsieh.

        Without asynchronous policy delegates, when the client requests a navigation, we would:
        1. Do a synchronous navigation policy check
        2. If the client allows the navigation, start the provisional load

        Starting the provisional load would freeze the layer tree until first meaningful
        layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().

        When constructing a WebView and then requesting a load right away. This would make sure
        we do not commit a layer tree for the initial about:blank page because the layer tree
        would be frozen until we have something meaningful to show for the following load.

        However, with asynchronous policy delegates, we are able to do a layer tree commit
        during the asynchronous navigation policy check because the layer tree is not frozen
        yet (provisional load has not started) and the process is not stuck on synchronous
        IPC. When constructing a WebView and then requesting a load right away, this would
        allow a layer tree commit for about:blank to happen before we've even started the
        load. This would cause some API tests to fail on iOS.

        To address the issue, we try and maintain pre-existing behavior by freezing the
        layer tree during navigation policy decision.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didStartNavigationPolicyCheck):
        (WebKit::WebPage::didCompleteNavigationPolicyCheck):
        * WebProcess/WebPage/WebPage.h:

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

        Allow the WebContent process to read ViewBridge preferences
        https://bugs.webkit.org/show_bug.cgi?id=183862
        <rdar://problem/38459456>

        Reviewed by Eric Carlson.

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

2018-03-21  Frederic Wang  <fwang@igalia.com>

        [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
        https://bugs.webkit.org/show_bug.cgi?id=183658

        Reviewed by Tim Horton.

        On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
        text inside a scrollable overflow node. To workaround that issue, this commit changes the
        behavior so that the text is revealed at the center of the overflow node.

        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.

2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] JSC bindings not introspectable
        https://bugs.webkit.org/show_bug.cgi?id=136989

        Reviewed by Michael Catanzaro.

        Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
        port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
        to every view. We can simply create a temporary global context on demand and release it after 1 second. This
        also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * UIProcess/API/glib/WebKitJavascriptResult.cpp:
        (_WebKitJavascriptResult::_WebKitJavascriptResult):
        (webkitJavascriptResultCreate):
        (webkit_javascript_result_get_global_context):
        (webkit_javascript_result_get_value):
        (webkit_javascript_result_get_js_value):
        * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
        (SharedJavascriptContext::singleton):
        (SharedJavascriptContext::SharedJavascriptContext):
        (SharedJavascriptContext::getOrCreateContext):
        (SharedJavascriptContext::releaseContext):
        * UIProcess/API/glib/WebKitUserContentManager.cpp:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkit_web_view_get_javascript_global_context):
        (webkitWebViewRunJavaScriptCallback):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitJavascriptResult.h:
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/APIViewClient.h:
        (API::ViewClient::handleDownloadRequest):
        * UIProcess/API/wpe/PageClientImpl.cpp:
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/API/wpe/WPEView.cpp:
        * UIProcess/API/wpe/WPEView.h:
        * UIProcess/API/wpe/WebKitJavascriptResult.h:
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
        (webkit_frame_get_js_context):
        (webkit_frame_get_js_context_for_script_world):
        * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
        * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:

2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
        https://bugs.webkit.org/show_bug.cgi?id=164061

        Reviewed by Michael Catanzaro.

        Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
        libraries.

        * PlatformGTK.cmake:

2018-03-21  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Simplify CoordinatedGraphicsScene activation
        https://bugs.webkit.org/show_bug.cgi?id=183772

        Reviewed by Carlos Garcia Campos.

        Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
        the m_isActive member variable. We don't have to call renderNextFrame()
        anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
        but that can be avoided if m_isWaitingForRenderer in that class is
        initialized to false.

        CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
        ThreadedCompositor implementation are removed. renderNextFrame() in the
        CoordinatedGraphicsScene class can also be removed, along with the
        unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
        the associated m_clientRunLoop member variable.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
        (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
        (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
        (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
        (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
        (WebKit::CoordinatedGraphicsScene::setActive):
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::m_displayRefreshMonitor):
        (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
        (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:

2018-03-21  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
        https://bugs.webkit.org/show_bug.cgi?id=183771

        Reviewed by Carlos Garcia Campos.

        In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
        information about any running animation in the scene via the
        TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
        value at the end up the method, instead of again traversing the
        TextureMapperLayer tree to determine whether any running animations are
        present.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):

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

        Enable the minimal simulator feature flag when appropriate
        https://bugs.webkit.org/show_bug.cgi?id=183807

        Reviewed by Dan Bernstein.

        * Configurations/FeatureDefines.xcconfig:

2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>

        Expose content attributes on _WKLinkIconParameters
        https://bugs.webkit.org/show_bug.cgi?id=183768

        Reviewed by Alex Christensen.

        Added _WKLinkIconParameters.attributes to expose content attributes of a link element
        which defined a favicon, touch icon, or pre-compressed touch icon.

        * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
        (_WKLinkIconParameters.attributes): Added.
        * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
        (_WKLinkIconParameters._attributes): Added.
        (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
        (-[_WKLinkIconParameters attributes]): Added.

2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add AssistedNodeInformation plumbing for form control placeholder text and label text
        https://bugs.webkit.org/show_bug.cgi?id=183802
        <rdar://problem/38686273>

        Reviewed by Tim Horton.

        Surfaces some additional information about the currently focused element to the input delegate in the UI process.
        See comments below for more details.

        Test: WebKit.FocusedElementInfo

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:

        Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
        and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
        decoder support for these members.

        * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:

        Augment _WKFocusedElementInfo to include placeholder and label.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
        (-[WKFocusedElementInfo label]):
        (-[WKFocusedElementInfo placeholder]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getAssistedNodeInformation):

        For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
        elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
        that are `display: none` (i.e. not being rendered).

2018-03-20  Brady Eidson  <beidson@apple.com>

        First piece of process swapping on navigation.
        https://bugs.webkit.org/show_bug.cgi?id=183665

        Reviewed by Andy Estes.

        This patch adds the first pieces of the following feature:
        "When a navigation originating inside a WKWebView goes to a different origin,
         swap to a new WebProcess for that navigation"

        There are significant bugs to be resolved and significant optimizations to be made.
        Which is why the feature is disabled by default.

        Besides the core logic implementing the feature, this patch does a lot of related 
        work such as:
        - Removing some now-invalid ASSERTs
        - Adding some ASSERTs
        - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
          process termination reason

        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):

        * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
        (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (toNSURLSessionResponseDisposition):

        * Platform/Logging.h:

        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/LoadParameters.h:

        * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.

        * UIProcess/API/APINavigation.h:

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):

        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toAPI):

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::wkProcessTerminationReason):

        * UIProcess/WebFramePolicyListenerProxy.cpp:
        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
        * UIProcess/WebFramePolicyListenerProxy.h:
        (WebKit::WebFramePolicyListenerProxy::create):
        (WebKit::WebFramePolicyListenerProxy::policyListenerType const):

        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
        (WebKit::WebFrameProxy::activePolicyListenerProxy):
        * UIProcess/WebFrameProxy.h:

        * UIProcess/WebNavigationState.cpp:
        (WebKit::WebNavigationState::navigation):
        (WebKit::WebNavigationState::takeNavigation):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
          terminated using the new "NavigationSwap" reason, then manually start the next load.
        (WebKit::WebPageProxy::loadRequest):
        (WebKit::WebPageProxy::loadRequestWithNavigation):
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::continueNavigationInNewProcess):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::resetState):
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        * UIProcess/WebPageProxy.h:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
          for a proposed navigation, creating a new one if necessary.
        * UIProcess/WebProcessPool.h:

        * UIProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):

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

2018-03-20  Youenn Fablet  <youenn@apple.com>

        ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
        https://bugs.webkit.org/show_bug.cgi?id=183668

        Reviewed by Chris Dumez.

        Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
        It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
        Either when receiving an IPC call or as part of completion handler for the response validation check.
        At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
        The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveData):

2018-03-20  Jeff Miller  <jeffm@apple.com>

        Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
        https://bugs.webkit.org/show_bug.cgi?id=183790

        Reviewed by Alex Christensen.
        
        Expose this property on macOS only.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
        (-[WKPreferences _aggressiveTileRetentionEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

        Add and adopt WK_PLATFORM_NAME and adjust default feature defines
        https://bugs.webkit.org/show_bug.cgi?id=183758
        <rdar://problem/38017644>

        Reviewed by Dan Bernstein.

        * Configurations/FeatureDefines.xcconfig:

2018-03-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r229726 and r229763.

        Caused some API test failures on iOS

        Reverted changesets:

        "Make policy decisions asynchronous"
        https://bugs.webkit.org/show_bug.cgi?id=180568
        https://trac.webkit.org/changeset/229726

        "Rebaseline three webarchive tests for WK2 after r229726."
        https://bugs.webkit.org/show_bug.cgi?id=180568
        https://trac.webkit.org/changeset/229763

2018-03-20  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Grant IOKit preference access for the Home button
        https://bugs.webkit.org/show_bug.cgi?id=183754
        <rdar://problem/38179704>

        Reviewed by Eric Carlson.

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

2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Adopt updated input view controller machinery for text input
        https://bugs.webkit.org/show_bug.cgi?id=183765
        <rdar://problem/36926269>

        Reviewed by Tim Horton.

        Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
        Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
        WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
        extra zoom mode.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentTextInputViewController:]):
        (-[WKContentView dismissTextInputViewController:]):
        (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
        (-[WKContentView _wheelChangedWithEvent:]):
        * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
        * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
        * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
        * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
        * WebKit.xcodeproj/project.pbxproj:

2018-03-19  Megan Gardner  <megan_gardner@apple.com>

        Clear style colors when setting default appearance
        https://bugs.webkit.org/show_bug.cgi?id=183759

        Reviewed by Tim Horton.

        Colors are cached and need to be cleared and recalculated.

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

2018-03-19  Chris Dumez  <cdumez@apple.com>

        WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
        https://bugs.webkit.org/show_bug.cgi?id=181546
        <rdar://problem/36444327>

        Reviewed by Ryosuke Niwa.

        in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
        to originIdentifiersToDelete if we cannot determine the last modification
        time of the database file. This likely means the database file does not
        exist. However, we still needs to make sure the origin gets removed from
        the origins database and there may be *.wal / *.shm variants of the database
        that are still on disk and need to be deleted.

        * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):

2018-03-19  Chris Dumez  <cdumez@apple.com>

        Have one service worker process per security origin
        https://bugs.webkit.org/show_bug.cgi?id=183600
        <rdar://problem/35280128>

        Reviewed by Brady Eidson.

        Split service workers from different origins into their own processes
        for security reasons.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
        (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
        * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
        (WebKit::StorageProcess::didClose):
        (WebKit::StorageProcess::connectionToContextProcessWasClosed):
        (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
        (WebKit::StorageProcess::didReceiveMessage):
        (WebKit::StorageProcess::createStorageToWebProcessConnection):
        (WebKit::StorageProcess::serverToContextConnectionForOrigin):
        (WebKit::StorageProcess::createServerToContextConnection):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * StorageProcess/StorageToWebProcessConnection.cpp:
        (WebKit::StorageToWebProcessConnection::didReceiveMessage):
        (WebKit::StorageToWebProcessConnection::didClose):
        * StorageProcess/StorageToWebProcessConnection.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextTerminateServiceWorkerProcess):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _terminateServiceWorkerProcesses]):
        (-[WKProcessPool _webPageContentProcessCount]):
        (-[WKProcessPool _serviceWorkerProcessCount]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
        (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::create):
        (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
        * UIProcess/ServiceWorkerProcessProxy.h:
        (isType):
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::getStorageProcessConnection):
        (WebKit::StorageProcessProxy::didFinishLaunching):
        (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
        (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
        * UIProcess/Storage/StorageProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::getStorageProcessConnection):
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        (WebKit::WebProcessPool::createNewWebProcess):
        (WebKit::WebProcessPool::disconnectProcess):
        (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
        (WebKit::WebProcessPool::createWebPage):
        (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
        (WebKit::WebProcessPool::updateProcessAssertions):
        (WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getStorageProcessConnection):

2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, another quick fix for r229699

        Restricts ENABLE_WEB_AUTHN to only macOS and iOS.

        * Configurations/FeatureDefines.xcconfig:

2018-03-19  Chris Dumez  <cdumez@apple.com>

        Make policy decisions asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=180568
        <rdar://problem/37131297>

        Reviewed by Alex Christensen.

        Get rid of synchronous IPC and synchronous code paths for policy delegates.
        Policy decisions are now all made asynchronously and rely on asynchronous
        IPC.

        This code change is based on work by Alex Christensen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-03-19  Brian Burg  <bburg@apple.com>

        Web Inspector: clean up WKWebView configuration code
        https://bugs.webkit.org/show_bug.cgi?id=183747
        <rdar://problem/38629343>

        Reviewed by Timothy Hatcher.

        * UIProcess/mac/WKInspectorViewController.mm:
        (-[WKInspectorViewController webView]): Always use system
        appearance for Inspector's web content.

2018-03-19  Eric Carlson  <eric.carlson@apple.com>

        [Extra zoom mode] Require fullscreen for video playback
        https://bugs.webkit.org/show_bug.cgi?id=183742
        <rdar://problem/38235862>

        Reviewed by Jer Noble.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
        (-[WKVideoFullScreenViewController viewDidLoad]):
        (-[WKVideoFullScreenViewController prefersStatusBarHidden]):
        (WebKit::VideoFullscreenModelContext::presentingViewController):
        (WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::didEnterFullscreen):

2018-03-19  Daniel Bates  <dabates@apple.com>

        test-webkitpy no longer runs WebKit2 tests
        https://bugs.webkit.org/show_bug.cgi?id=183724

        Reviewed by Alexey Proskuryakov.

        Fixes an issue where Python emits errors "global name reset_results is not defined" when
        running tests in messages_unittest.py using test-webkitpy.

        Currently messages_unittest.py conditionally defines the global variable reset_results
        when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
        imported as a module as test-webkitpy does then it is not considered the main program
        ;=> the top-level script environment is not __main__ ;=> we do not define the global
        variable reset_results. Instead we should unconditionally define the global variable
        reset_results.

        * Scripts/webkit/messages_unittest.py:

2018-03-19  Per Arne Vollan  <pvollan@apple.com>

        When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
        https://bugs.webkit.org/show_bug.cgi?id=183604
        <rdar://problem/38305109>

        Reviewed by Brent Fulgham.

        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/mac/DisplayLink.cpp: Added.
        (WebKit::DisplayLink::DisplayLink):
        (WebKit::DisplayLink::~DisplayLink):
        (WebKit::DisplayLink::displayLinkCallback):
        * UIProcess/mac/DisplayLink.h: Added.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::startDisplayRefreshMonitor):
        (WebKit::WebPageProxy::stopDisplayRefreshMonitor):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/DrawingArea.cpp:
        (WebKit::DrawingArea::createDisplayRefreshMonitor):
        * WebProcess/WebPage/DrawingArea.h:
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
        (WebKit::DisplayRefreshMonitorMac::create):
        (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
        (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
        (WebKit::DisplayRefreshMonitorMac::displayLinkFired):
        (WebKit::DrawingArea::screenWasRefreshed):
        (WebKit::DrawingArea::createDisplayRefreshMonitor):

2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Implement authenticatorMakeCredential
        https://bugs.webkit.org/show_bug.cgi?id=183527
        <rdar://problem/35275886>

        Reviewed by Brent Fulgham.

        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
        (WebKit::WebCredentialsMessengerProxy::exceptionReply):
        (WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
        * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
        (WebKit::WebCredentialsMessenger::makeCredential):
        (WebKit::WebCredentialsMessenger::makeCredentialReply):
        * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

2018-03-17  Daniel Bates  <dabates@apple.com>

        Tests fail in messages_unittest.py
        https://bugs.webkit.org/show_bug.cgi?id=183725

        Partial revert of r222113. The messages generator machinery does not know when
        it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
        header.

        * Scripts/webkit/LegacyMessages-expected.h:
        * Scripts/webkit/Messages-expected.h:

2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, rolling out r229688.

        There's a solution that doesn't require this SPI.

        Reverted changeset:

        "Add SPI to expose width and height anchors for WKWebView's
        content view"
        https://bugs.webkit.org/show_bug.cgi?id=183711
        https://trac.webkit.org/changeset/229688

2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add SPI to expose width and height anchors for WKWebView's content view
        https://bugs.webkit.org/show_bug.cgi?id=183711
        <rdar://problem/38562899>

        Reviewed by Tim Horton.

        Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
        about the size of the content view on iOS using autolayout.

        Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.

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

2018-03-16  Megan Gardner  <megan_gardner@apple.com>

        Add _useSystemAppearance to WKView
        https://bugs.webkit.org/show_bug.cgi?id=183706
        <rdar://problem/38516584>

        Reviewed by Tim Horton.

        Plumb useSystemAppearance and other supporting functions to WKView

        * UIProcess/API/Cocoa/WKViewPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _useSystemAppearance]):
        (-[WKWebView _setUseSystemAppearance:]):
        (-[WKWebView effectiveAppearanceDidChange]):
        * UIProcess/API/mac/WKView.mm:
        (-[WKView effectiveAppearanceDidChange]):
        (-[WKView _setUseSystemAppearance:]):
        (-[WKView _useSystemAppearance]):
        (-[WKView _setDefaultAppearance:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setUseSystemAppearance):
        (WebKit::WebViewImpl::useSystemAppearance):
        (WebKit::WebViewImpl::setDefaultAppearance):

2018-03-16  Brent Fulgham  <bfulgham@apple.com>

        Set a trap to catch an infrequent form-related nullptr crash
        https://bugs.webkit.org/show_bug.cgi?id=183704
        <rdar://problem/37579354>

        Reviewed by Ryosuke Niwa.

        Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):

2018-03-16  Jer Noble  <jer.noble@apple.com>

        Make Fullscreen API an Experimental Feature
        https://bugs.webkit.org/show_bug.cgi?id=183662

        Reviewed by Jon Lee.

        Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
        whether the preference is available, for definining platform-specific Experimental Features.

        * Scripts/GeneratePreferences.rb:
        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
        * Shared/WebPreferences.yaml:

2018-03-16  Megan Gardner  <megan_gardner@apple.com>

        Ensure that style is updated when the effective appearance changes
        https://bugs.webkit.org/show_bug.cgi?id=183690
        <rdar://problem/38385900>

        Reviewed by Tim Horton and Wenson Hsieh.

        Respond to and respect the effective appearance changing.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView effectiveAppearanceDidChange]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setDefaultAppearance):

2018-03-16  Chris Dumez  <cdumez@apple.com>

        URLSchemeHandler.Basic API test fails with async policy delegates
        https://bugs.webkit.org/show_bug.cgi?id=183678

        Reviewed by Alex Christensen.

        The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
        on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
        asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
        for an async policy delegate.

        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
        (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
        (WebKit::WebURLSchemeTaskProxy::didReceiveData):
        (WebKit::WebURLSchemeTaskProxy::didComplete):
        (WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
        * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
        (WebKit::WebURLSchemeTaskProxy::queueTask):

2018-03-16  Claudio Saavedra  <csaavedra@igalia.com>

        Suppress GCC warnings by using #include instead of #import

        Unreviewed.
        * UIProcess/SystemPreviewController.cpp:

2018-03-15  Keith Rollin  <krollin@apple.com>

        Telemetry for stalled webpage loads
        https://bugs.webkit.org/show_bug.cgi?id=183221
        <rdar://problem/36549013>

        Reviewed by Chris Dumez.

        Add telemetry for page loads, tracking the pages that succeed, fail,
        or are canceled. This information will be used to track the overall
        health of our page loading as time goes on.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close):
        (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        (WebKit::WebPageProxy::reportPageLoadResult):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::reportPageLoadResult):

2018-03-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] Hit-testing fails when specifying a large top content inset
        https://bugs.webkit.org/show_bug.cgi?id=183648
        <rdar://problem/38421894>

        Reviewed by Tim Horton.

        Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
        of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
        _computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
        insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
        the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
        page to be uninteractible, since WKWebView erroneously thinks it's obscured.

        To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
        scroll view's content insets. From code inspection and testing, all but one of the former call sites of
        _computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
        _adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
        UIScrollView (see below for more details).

        Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
                ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
                ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
                ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
        (-[WKWebView _initialContentOffsetForScrollView]):

        See -_contentOffsetAdjustedForObscuredInset: below.

        (-[WKWebView _contentOffsetAdjustedForObscuredInset:]):

        Formerly -_adjustedContentOffset:. -_contentOffsetAdjustedForObscuredInset: no longer takes scroll view content
        inset into account, and only cares about insets that obscure the view. This means that the scroll position
        (0, 0) in the document now maps to the content offset in the inner UIScrollView, such that the top of the page
        is aligned with the top of the viewport.

        However, many call sites of -_adjustedContentOffset: were intended to compute the initial, top-left-most content
        offset in the scroll view to scroll to when resetting the web view (i.e., they pass in CGPointZero for the
        scroll position). An example of this is the scroll position to jump to after web content process termination, or
        the scroll position after main frame navigation. In these cases, we actually want to jump to the top of the
        scroll view, so we do want to use the version of the computed content insets that accounts for scroll view
        insets.

        Since these cases are limited to finding the top-left-most scroll position, we pull this out into a separate
        helper method (-_initialContentOffsetForScrollView) and replace calls to
        `-[self _adjustedContentOffset:CGPointZero]` with this instead.

        (-[WKWebView _computedObscuredInset]):

        A version of -_computeContentInset that doesn't care about scroll view insets. Used whereever we need to account
        for obscured insets rather than the combination of content insets and unobscured insets (e.g.
        -_initialContentOffsetForScrollView).

        (-[WKWebView _processDidExit]):
        (-[WKWebView _didCommitLayerTree:]):
        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
        (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
        (-[WKWebView _updateVisibleContentRects]):
        (-[WKWebView _navigationGestureDidBegin]):

        In all these places where we inset the view bounds to compute the unobscured region of the viewport, it doesn't
        make sense to additionally inset by the scroll view's content insets, since (1) the scroll view's content insets
        don't obscure the viewport, and (2) it's perfectly valid for the inner scroll view to have arbitrarily large
        content insets.

        (-[WKWebView _adjustedContentOffset:]): Deleted.

        Renamed to -_contentOffsetAdjustedForObscuredInset:.

        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/ios/WKPDFView.mm:
        (-[WKPDFView _offsetForPageNumberIndicator]):

        Similar to -_scrollToFragment: (see below).

        (-[WKPDFView _scrollToFragment:]):

        This helper figures out which content offset to scroll to, given the y-origin of a page in a PDF document. If
        insets are added to the scroll view, we end up scrolling to the wrong content offset since we'll add the height
        of the top content inset (imagine that the top content inset is enormous — then we'll scroll an amount equal to
        the top content inset _past_ the point where the y-origin of the page is at the top of the viewport).

2018-03-15  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Correct sandbox violations during Flash playback under ToT WebKit
        https://bugs.webkit.org/show_bug.cgi?id=183672
        <rdar://problem/38510839>

        Reviewed by Eric Carlson.

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

2018-03-15  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r229484): Plugins often require CGS Connections to draw
        https://bugs.webkit.org/show_bug.cgi?id=183663
        <rdar://problem/38439218>

        Reviewed by Per Arne Vollan.

        Flash requires an active CGSConnection to work properly. Since we don't want the WebContent
        process to have on, create a new plugin process-specific layer host creation method that
        gives this access.

        * Platform/mac/LayerHostingContext.h:
        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalPluginHostingProcess): Added.
        * PluginProcess/mac/PluginControllerProxyMac.mm:
        (WebKit::PluginControllerProxy::updateLayerHostingContext): Use the new creation
        method.

2018-03-15  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Remove TextureMapperLayer::texture()
        https://bugs.webkit.org/show_bug.cgi?id=183635

        Reviewed by Michael Catanzaro.

        Remove the CoordinatedBackingStore::texture() override since the virtual
        method is also being removed.

        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
        (WebKit::CoordinatedBackingStore::texture const): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:

2018-03-14  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
        https://bugs.webkit.org/show_bug.cgi?id=183641
        <rdar://problem/38469497>

        Reviewed by Brent Fulgham and Chris Dumez.

        This change is to stabilize existing layout tests by removing
        all storage access entries on a call to 
        WebResourceLoadStatisticsStore::clearInMemory().
        See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.

        Almost all of the code changes are piping to get this
        call from the WebResourceLoadStatisticsStore to
        WebCore::NetworkStorageSession where entries reside.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removeAllStorageAccess):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::removeAllStorageAccess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
            Now also clears all storage access entries in the network process.
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-03-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r229613.

        Caused API test failures

        Reverted changeset:

        "Make policy decisions asynchronous"
        https://bugs.webkit.org/show_bug.cgi?id=180568
        https://trac.webkit.org/changeset/229613

2018-03-14  Chris Dumez  <cdumez@apple.com>

        Reduce use of SWServerToContextConnection::globalServerToContextConnection()
        https://bugs.webkit.org/show_bug.cgi?id=183626

        Reviewed by Youenn Fablet.

        Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving
        towards having multiple context connections.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):

2018-03-14  Chris Dumez  <cdumez@apple.com>

        Make policy decisions asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=180568
        <rdar://problem/37131297>

        Reviewed by Alex Christensen.

        Get rid of synchronous IPC and synchronous code paths for policy delegates.
        Policy decisions are now all made asynchronously and rely on asynchronous
        IPC.

        This code change is based on work by Alex Christensen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForResponse):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2018-03-14  Chris Dumez  <cdumez@apple.com>

        Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
        https://bugs.webkit.org/show_bug.cgi?id=183624

        Reviewed by Youenn Fablet.

        Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
        since it was going through all SWServers. Calling workerContextProcessConnectionCreated()
        on every StorageToWebProcessConnection was thus doing redundant work.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::createStorageToWebProcessConnection):
        * StorageProcess/StorageToWebProcessConnection.cpp:
        (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
        (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): Deleted.
        * StorageProcess/StorageToWebProcessConnection.h:

2018-03-14  Tim Horton  <timothy_horton@apple.com>

        Fix the build after r229567

        * Configurations/FeatureDefines.xcconfig:

2018-03-13  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
        https://bugs.webkit.org/show_bug.cgi?id=183620
        <rdar://problem/38431469>

        Reviewed by Brent Fulgham.

        It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
        wasn't enough to address the compatibility issues with popups. Some of
        them just detect their unpartitioned cookies, auto-dismiss themselves,
        and expect their unpartitioned cookies to be available under the opener
        afterwards. We should grant them access if the popup's domain has had
        user interaction _previously_.

        Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
        because if the popup's domain has not received user interaction
        previously, we will not grant it storage access on just the window open.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener): Deleted.
            Renamed WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener()
            to WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
            since there is now a case where access will not be granted, i.e. when
            the popup domain has not had user interaction previously.
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebResourceLoadStatisticsStore.messages.in:
             Similar renaming.
        * WebProcess/WebProcess.cpp:
        (WebProcess::WebProcess):
             Similar renaming.

2018-03-13  Jer Noble  <jer.noble@apple.com>

        Add missing artwork for fullscreen mode.
        https://bugs.webkit.org/show_bug.cgi?id=183618

        Reviewed by Jon Lee.

        * Resources/ios/iOS.xcassets/Done.imageset/Contents.json: Added.
        * Resources/ios/iOS.xcassets/Done.imageset/Done.pdf: Added.
        * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/Contents.json: Added.
        * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png: Added.
        * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png: Added.
        * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png: Added.
        * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/Contents.json: Added.
        * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png: Added.
        * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png: Added.
        * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png: Added.

2018-03-13  Brian Burg  <bburg@apple.com>

        [WK2] Web Inspector: NavigationAction for opening a link in a new tab should have a UserGestureIndicator
        https://bugs.webkit.org/show_bug.cgi?id=183612
        <rdar://problem/38388641>

        Reviewed by Timothy Hatcher.

        The current gesture token will be attached to the NavigationAction at construction time,
        so set up a UserGestureIndicator when creating the action and sending it out.

        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openInNewTab):

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

        WKSystemPreviewView needs to implement some of UIScrollViewDelegate
        https://bugs.webkit.org/show_bug.cgi?id=183607
        <rdar://problem/38427622>

        Reviewed by Antoine Quint.

        Add an empty implementation of scrollViewDidScroll.

        * UIProcess/ios/WKSystemPreviewView.mm:
        (-[WKSystemPreviewView scrollViewDidScroll:]):

2018-03-13  Jiewen Tan  <jiewen_tan@apple.com>

        Soft-link LocalAuthentication.Framework
        https://bugs.webkit.org/show_bug.cgi?id=183587
        <rdar://problem/38219763>

        Reviewed by Brian Burg.

        * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
        (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
        * WebKit.xcodeproj/project.pbxproj:

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

        Add a WKWebViewContentProvider for system previews
        https://bugs.webkit.org/show_bug.cgi?id=183582
        <rdar://problem/38393569>

        Reviewed by Tim Horton.

        Implement WKSystemPreviewView, which conforms to WKWebViewContentProvider, in
        order to view content as a "system preview". This effectively replaces the
        SystemPreviewController, which will be removed soon.

        Some of the required methods of WKWebViewContentProvider are not necessary on
        this instance, so a follow-up patch will clean the protocol up a bit.

        * UIProcess/Cocoa/NavigationState.mm: Don't trigger a SystemPreview when downloading.
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):

        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry init]): Register the WKSystemPreviewView for
        MIME types retrieved from WebKitAdditions.

        * UIProcess/ios/WKSystemPreviewView.h: Added.
        * UIProcess/ios/WKSystemPreviewView.mm: Added.

        (-[WKSystemPreviewView web_initWithFrame:webView:]):
        (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): This is the
        method that actually creates a QuickLook preview and provides the data.
        (-[WKSystemPreviewView web_setMinimumSize:]):
        (-[WKSystemPreviewView web_setOverlaidAccessoryViewsInset:]):
        (-[WKSystemPreviewView web_computedContentInsetDidChange]):
        (-[WKSystemPreviewView web_setFixedOverlayView:]):
        (-[WKSystemPreviewView web_didSameDocumentNavigation:]):
        (-[WKSystemPreviewView web_countStringMatches:options:maxCount:]):
        (-[WKSystemPreviewView web_findString:options:maxCount:]):
        (-[WKSystemPreviewView web_hideFindUI]):

        (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): QuickLook delegates.
        (-[WKSystemPreviewView previewController:previewItemAtIndex:]):
        (-[WKSystemPreviewView provideDataForItem:]):
        (-[WKSystemPreviewView previewControllerWillDismiss:]):

        * WebKit.xcodeproj/project.pbxproj: Add new files.

2018-03-12  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
        https://bugs.webkit.org/show_bug.cgi?id=183577
        <rdar://problem/38266987>

        Reviewed by Brent Fulgham.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::hasStorageAccessForFrame):
            Now also checks for general page access.
        (WebKit::NetworkProcess::grantStorageAccess):
            Renamed from grantStorageAccessForFrame since the frameID now is optional.
        (WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
            Renamed since the frameID now is optional.
        * NetworkProcess/NetworkProcess.h:
            Renaming since the frameID now is optional.
        * NetworkProcess/NetworkProcess.messages.in:
            Renaming since the frameID now is optional.
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation):
            Consequence of function renaming.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::grantStorageAccess):
        (WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
            Renaming since the frameID now is optional.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
            Renaming since the frameID now is optional.
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
            Handler renaming since the frameID now is optional.
        (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
            New function for that grants cookie access under a whole page.
        * UIProcess/WebResourceLoadStatisticsStore.h:
            Member renaming since the frameID now is optional.
        * UIProcess/WebResourceLoadStatisticsStore.messages.in:
            New message received straight from WebCore::ResourceLoadObserver.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::grantStorageAccessHandler):
            Renamed and made frameID optional.
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
            Consequence of renaming and making frameID optional.
        (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
            Renamed and made frameID optional.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebProcess.cpp:
        (WebProcess::WebProcess):
            Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
            WebCore::ResourceLoadObserver.

2018-03-12  Tim Horton  <timothy_horton@apple.com>

        Stop using SDK conditionals to control feature definitions
        https://bugs.webkit.org/show_bug.cgi?id=183430
        <rdar://problem/38251619>

        Reviewed by Dan Bernstein.

        * Configurations/FeatureDefines.xcconfig:
        * Configurations/WebKitTargetConditionals.xcconfig: Renamed.

2018-03-12  Yoav Weiss  <yoav@yoav.ws>

        Runtime flag for link prefetch and remove link subresource.
        https://bugs.webkit.org/show_bug.cgi?id=183540

        Reviewed by Chris Dumez.

        Remove the LINK_PREFETCH build time flag.

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::maximumBufferingTime):

2018-03-12  Chris Dumez  <cdumez@apple.com>

        Load may get committed before receiving policy for the resource response
        https://bugs.webkit.org/show_bug.cgi?id=183579
        <rdar://problem/38268780>

        Reviewed by Youenn Fablet.

        r228852 updated WebResourceLoader::didReceiveResponse to only send the
        ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
        policy decision for the resource response has been made. This is necessary
        now that policy decisions can be made asynchronously.

        However, one of the 2 code paths in NetworkProcess side (code path when
        the resource is already in the HTTP disk cache) failed to wait for the
        ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
        As a result, the WebProcess could commit the load before even receiving the
        policy response from the client.        

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
        (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
        * NetworkProcess/NetworkResourceLoader.h:
        Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
        until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):
        (WebKit::WebResourceLoader::didReceiveData):
        * WebProcess/Network/WebResourceLoader.h:
        Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
        completion handler has been called. If this hits, then the load may get committed even
        though the client did not reply to the policy for the resource response yet.

2018-03-12  Ali Juma  <ajuma@chromium.org>

        http/tests/workers/service/service-worker-download.https.html times out with async policy delegates
        https://bugs.webkit.org/show_bug.cgi?id=183479

        Reviewed by Youenn Fablet.

        Ensure that ServiceWorkerFetchClient::m_isCheckingResponse is set before code that depends on it
        executes. This bit was set by code that's posted to the runloop using 'callOnMainThread' in
        ServiceWorkerFetchClient::didReceiveResponse. But when didReceiveResponse is executing, tasks for
        handling didReceiveData, didFail, or didFinish may already have been posted to the runloop, and in
        that case would execute before m_isCheckingResponse gets set, and then incorrectly fail to 
        early-out. Fix this by directly setting m_isCheckingResponse in didReceiveResponse.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::start):
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):

2018-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION(r211643): Dismissing WKActionSheet should not also dismiss its presenting view controller
        https://bugs.webkit.org/show_bug.cgi?id=183549
        <rdar://problem/34960698>

        Reviewed by Andy Estes.

        Fixes the bug by dismissing the presented view controller (i.e. the action sheet or the view controller being
        presented during rotation) rather than the presenting view controller.

        Test: ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController

        * UIProcess/ios/WKActionSheet.mm:
        (-[WKActionSheet doneWithSheet:]):

2018-03-12  Javier Fernandez  <jfernandez@igalia.com>

        Remove GridLayout runtime flag
        https://bugs.webkit.org/show_bug.cgi?id=183484

        Reviewed by Myles C. Maxfield.

        The Grid Layout feature has been enabled by default for almost a
        year, so I think it's time to remove the runtime flag and the
        codepath run when the feature is disabled.

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

2018-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix the internal iOS build after r229512
        https://bugs.webkit.org/show_bug.cgi?id=183550

        Reviewed by Zalan Bujtas.

        Fixes a typo in a header import, as well as a nullability error. `SecTrustEvaluate()` takes in a nonnull outparam,
        which was removed in r229512; this adds the outparam back, but does not consult its value when setting the
        `infoDictionary`.

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

2018-03-10  Jer Noble  <jer.noble@apple.com>

        Improvements to fullscreen; new UI and security features
        https://bugs.webkit.org/show_bug.cgi?id=183503

        Reviewed by Dean Jackson.

        Now that the iOS Fullscreen code has more than one major class, move it into an ios/
        directory.

        Clean up the WKFullScreenWindowControllerIOS class to more clearly separate external
        facing API from purely internal functions.

        Move the WKFullScreenViewController out into its own file. Add support for fullscreen
        top inset and fullscreen autohide duration CSS constants.

        Add a heuristic to distinguish between media control related touches and ones that look
        more keyboard interactions.

        Add a new UIStackView based control to hold the fullscreen controls.

        * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Removed.
        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp: Added.
        (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
        (WebKit::FullscreenTouchSecheuristic::reset):
        (WebKit::FullscreenTouchSecheuristic::distanceScore):
        (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
        * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h: 
        (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
        (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
        (WebKit::FullscreenTouchSecheuristic::setXWeight):
        (WebKit::FullscreenTouchSecheuristic::setYWeight):
        (WebKit::FullscreenTouchSecheuristic::setSize):
        (WebKit::FullscreenTouchSecheuristic::setGamma):
        (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Added.
        (WKFullScreenViewControllerPlaybackSessionModelClient::setParent):
        (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
        (-[_WKExtrinsicButton setExtrinsicContentSize:]):
        (-[_WKExtrinsicButton intrinsicContentSize]):
        (-[WKFullScreenViewController initWithWebView:]):
        (-[WKFullScreenViewController dealloc]):
        (-[WKFullScreenViewController showUI]):
        (-[WKFullScreenViewController hideUI]):
        (-[WKFullScreenViewController videoControlsManagerDidChange]):
        (-[WKFullScreenViewController setPrefersStatusBarHidden:]):
        (-[WKFullScreenViewController setPlaying:]):
        (-[WKFullScreenViewController setPictureInPictureActive:]):
        (-[WKFullScreenViewController loadView]):
        (-[WKFullScreenViewController viewWillAppear:]):
        (-[WKFullScreenViewController viewDidLayoutSubviews]):
        (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
        (-[WKFullScreenViewController preferredStatusBarStyle]):
        (-[WKFullScreenViewController prefersStatusBarHidden]):
        (-[WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
        (-[WKFullScreenViewController _manager]):
        (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
        (-[WKFullScreenViewController _cancelAction:]):
        (-[WKFullScreenViewController _togglePiPAction:]):
        (-[WKFullScreenViewController _touchDetected:]):
        (-[WKFullScreenViewController _statusBarFrameDidChange:]):
        (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
        (-[WKFullScreenViewController _showPhishingAlert]):
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: Added.
        (WebKit::replaceViewWithView):
        (WebKit::WKWebViewState::applyTo):
        (WebKit::WKWebViewState::store):
        (-[WKFullscreenAnimationController transitionDuration:]):
        (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
        (-[WKFullscreenAnimationController animateTransition:]):
        (-[WKFullscreenAnimationController animationEnded:]):
        (-[WKFullscreenAnimationController startInteractiveTransition:]):
        (-[WKFullscreenAnimationController updateWithPercent:]):
        (-[WKFullscreenAnimationController updateWithPercent:translation:anchor:]):
        (-[WKFullscreenAnimationController end:]):
        (-[WKFullScreenInteractiveTransition initWithAnimator:anchor:]):
        (-[WKFullScreenInteractiveTransition wantsInteractiveStart]):
        (-[WKFullScreenInteractiveTransition startInteractiveTransition:]):
        (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withTranslation:]):
        (-[WKFullScreenInteractiveTransition cancelInteractiveTransition]):
        (-[WKFullScreenInteractiveTransition finishInteractiveTransition]):
        (-[WKFullScreenWindowController initWithWebView:]):
        (-[WKFullScreenWindowController dealloc]):
        (-[WKFullScreenWindowController isFullScreen]):
        (-[WKFullScreenWindowController webViewPlaceholder]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController requestExitFullScreen]):
        (-[WKFullScreenWindowController exitFullScreen]):
        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        (-[WKFullScreenWindowController close]):
        (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
        (-[WKFullScreenWindowController videoControlsManagerDidChange]):
        (-[WKFullScreenWindowController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
        (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
        (-[WKFullScreenWindowController animationControllerForDismissedController:]):
        (-[WKFullScreenWindowController interactionControllerForDismissal:]):
        (-[WKFullScreenWindowController _exitFullscreenImmediately]):
        (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
        (-[WKFullScreenWindowController _isSecure]):
        (-[WKFullScreenWindowController _serverTrust]):
        (-[WKFullScreenWindowController _EVOrganizationName]):
        (-[WKFullScreenWindowController _updateLocationInfo]):
        (-[WKFullScreenWindowController _manager]):
        (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
        (-[WKFullScreenWindowController _interactiveDismissChanged:]):
        * UIProcess/ios/fullscreen/WKFullscreenStackView.h: Renamed from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
        * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Added.
        (+[WKFullscreenStackView baseEffects]):
        (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]):
        (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]):
        (+[WKFullscreenStackView secondaryMaterialOverlayView]):
        (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]):
        (+[WKFullscreenStackView applySecondaryGlyphTintToView:]):
        (-[WKFullscreenStackView initWithArrangedSubviews:axis:]):
        (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
        (-[WKFullscreenStackView contentView]):
        (-[WKFullscreenStackView _setArrangedSubviews:axis:]):
        (-[WKFullscreenStackView setBounds:]):
        (-[WKFullscreenStackView updateConstraints]):
        * WebKit.xcodeproj/project.pbxproj:

2018-03-10  Megan Gardner  <megan_gardner@apple.com>

        Media query for default appearance
        https://bugs.webkit.org/show_bug.cgi?id=183539
        <rdar://problem/38326388>

        Reviewed by Tim Horton.

        Write a media query to evaluate appearance.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        (-[WKWebView _setUseSystemAppearance:]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::setDefaultAppearance):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::defaultAppearance const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::WebPage::setDefaultAppearance):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        Unconditionalize more methods in VideoFullscreenInterface (and related classes)
        https://bugs.webkit.org/show_bug.cgi?id=183501
        <rdar://problem/38312038>

        Unreviewed build fix; add correct pragmas to code referencing m_playbackSessionManager.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
        (WebKit::WebPageProxy::requestControlledElementID const):
        (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):

2018-03-09  Brian Burg  <bburg@apple.com>

        Web Inspector: there should only be one way for async backend commands to send failure
        https://bugs.webkit.org/show_bug.cgi?id=183524

        Reviewed by Timothy Hatcher.

        Remove useless ErrorString argument from async commands.

        For Automation protocol, introduce sync and async macros for filling
        in and sending a failure response. Now that async commands don't have
        an ErrorString and sync commands don't have a callback, trying to send
        an error with the wrong macro is a compile-time error.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::getBrowsingContexts):
        (WebKit::WebAutomationSession::getBrowsingContext):
        (WebKit::WebAutomationSession::createBrowsingContext):
        (WebKit::WebAutomationSession::closeBrowsingContext):
        (WebKit::WebAutomationSession::switchToBrowsingContext):
        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
        (WebKit::WebAutomationSession::waitForNavigationToComplete):
        (WebKit::WebAutomationSession::navigateBrowsingContext):
        (WebKit::WebAutomationSession::goBackInBrowsingContext):
        (WebKit::WebAutomationSession::goForwardInBrowsingContext):
        (WebKit::WebAutomationSession::reloadBrowsingContext):
        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
        (WebKit::WebAutomationSession::resolveChildFrameHandle):
        (WebKit::WebAutomationSession::resolveParentFrameHandle):
        (WebKit::WebAutomationSession::computeElementLayout):
        (WebKit::WebAutomationSession::selectOptionElement):
        (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
        (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
        (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
        (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
        (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
        (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
        (WebKit::WebAutomationSession::getAllCookies):
        (WebKit::WebAutomationSession::deleteSingleCookie):
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::deleteAllCookies):
        (WebKit::WebAutomationSession::setSessionPermissions):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::performKeyboardInteractions):
        (WebKit::WebAutomationSession::takeScreenshot):
        (WebKit::WebAutomationSession::didTakeScreenshot):
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/WebAutomationSessionMacros.h:
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::inspectBrowsingContext):

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

        Don't pass NULL to the result parameter of SecTrustEvaluate()
        https://bugs.webkit.org/show_bug.cgi?id=183495
        <rdar://problem/38185688>

        Reviewed by Andy Estes.

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

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

        Allow NavigationState to intercept requests and send them to SystemPreviewController
        https://bugs.webkit.org/show_bug.cgi?id=183526
        <rdar://problem/37801140>

        Reviewed by Tim Horton.

        Implement a bit more of SystemPreviewController, such that it can be used
        from NavigationState to identify and handle content that can be previewed.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
            If we'd in a download response policy, then check if SystemPreviewController
            can show the content. We ignore the download, but pass the original URL onto
            the preview. Ultimately, we'd want to avoid the navigation
            but use the download destination URL for preview.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        (-[_WKPreviewControllerDataSource initWithURL:]):
            Move the URL to property, to help use a single datasource object for all previews.
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
        (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]):
            Add a delegate object, so we can detect when the preview is dismissed and return
            to the previous page.
        (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]):
        (WebKit::SystemPreviewController::showPreview):
            Use single instances of the QLPreviewController, its datasource and delegate.

        * UIProcess/SystemPreviewController.cpp:
            Add a helper to navigate back.
        (WebKit::SystemPreviewController::SystemPreviewController):
        (WebKit::SystemPreviewController::sendPageBack):
        * UIProcess/SystemPreviewController.h:

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

        webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
        https://bugs.webkit.org/show_bug.cgi?id=183383
        <rdar://problem/38197028>

        Reviewed by Eric Carlson.

        Follow-up patch: now that the 'fullscreenchange' event is being fired slightly earlier, the
        Fullscreen.TopContentInset tests triggers what appears to be an existing behavior: if you
        exit in the middle of an enter fullscreen animation, the exit never happens, because the
        NSWindow never starts the exit animation. The solution is to store the exit fullscreen
        request, and only act upon it when the enter animation completes.

        * UIProcess/mac/WKFullScreenWindowController.h:
        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
        (-[WKFullScreenWindowController exitFullScreen]):

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

        Unconditionalize more methods in VideoFullscreenInterface (and related classes)
        https://bugs.webkit.org/show_bug.cgi?id=183501

        Reviewed by Eric Carlson.

        No reason for these methods to be PLATFORM(MAC) only.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _videoControlsManagerDidChange]):
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
        (WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::isPlayingMediaDidChange):
        (WebKit::WebPageProxy::handleControlledElementIDResponse const):
        (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::videoControlsManagerDidChange):
        * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
        * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController videoControlsManagerDidChange]):
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):

2018-03-09  Per Arne Vollan  <pvollan@apple.com>

        Create CA layer contexts with +remoteContextWithOptions.
        https://bugs.webkit.org/show_bug.cgi?id=182747

        Reviewed by Brent Fulgham.

        CA layer contexts (CAContext) are currently created with +contextWithCGSConnection, which is
        using the main WindowServer connection to create the context. Instead, the contexts can be
        created with +remoteContextWithOptions, which does not use the main WindowServer connection.
        This is a step towards limiting the access the WebContent process has to the window server.
        To make the +remoteContextWithOptions call succeed, the sandbox has to be modified to allow
        access to CARenderServer. Also, access to the WindowServer should be denied by calling
        CGSSetDenyWindowServerConnections(true) before entering the sandbox. This is planned to do
        in a follow-up patch. The call to +remoteContextWithOptions will open up WindowServer
        connections, since the WindowServer is the system default CA render server, but these
        connections come with limited WindowServer exposure. In addition, we need to open up the
        sandbox for accessing some IOKit properties.

        * Platform/mac/LayerHostingContext.mm:
        (WebKit::LayerHostingContext::createForExternalHostingProcess):
        * Shared/mac/HangDetectionDisablerMac.mm:
        (WebKit::setClientsMayIgnoreEvents):
        * WebProcess/com.apple.WebProcess.sb.in:

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

        Remove cookie API access from WebContent Process
        https://bugs.webkit.org/show_bug.cgi?id=183519
        <rdar://problem/35368802>

        Reviewed by Alex Christensen.

        All cookie access is now handled in the Network Process. However, there are vestiges of the original logic that used CFNetwork APIs in the WebContent process.

        This patch removes CFNetwork calls from the WebProcess code paths, since they serve no purpose in modern WebKit.

        No tests because this is a code cleanup with no expected change in behavior.

        * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Moved from WebFrameNetworkingContext.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::setSharedHTTPCookieStorage): Moved from ChildProcess, since this should only be
        called in the NetworkProcess.
        * Shared/ChildProcess.h:
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::setSharedHTTPCookieStorage): Deleted.
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Remove CFNetwork code. This version of
        'ensureWebsiteDataStoreSession' is needed to maintain a dictionary on the WebProcess side so we can refer to
        the same network session in both the WebContent and Network processes.
        (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
        (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Remove calls to CFNetwork.

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

        ServiceWorkerClientFetch should send data to its resource loader once the didReceiveResponse completion handler is called
        https://bugs.webkit.org/show_bug.cgi?id=183110

        Reviewed by Chris Dumez.

        Buffering data/finish event/fail event until the response completion handler is called.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
        (WebKit::ServiceWorkerClientFetch::didReceiveData):
        (WebKit::ServiceWorkerClientFetch::didFinish):
        (WebKit::ServiceWorkerClientFetch::didFail):
        (WebKit::ServiceWorkerClientFetch::didNotHandle):
        (WebKit::ServiceWorkerClientFetch::cancel):
        (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
        * WebProcess/Storage/ServiceWorkerClientFetch.h:

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

        Add new CSS env constants for use with fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=183498

        Reviewed by Dean Jackson.

        Pass the values given to WebFullScreenManagerProxy through the process boundary and
        into WebCore.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
        (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
        * UIProcess/WebFullScreenManagerProxy.h:
        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::didExitFullScreen):
        (WebKit::WebFullScreenManager::setFullscreenInsetTop):
        (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/FullScreen/WebFullScreenManager.messages.in:

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

        Add isPictureInPictureActive messaging across WebKit process boundary
        https://bugs.webkit.org/show_bug.cgi?id=183499

        Reviewed by Eric Carlson.

        * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
        (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):

2018-03-09  Stephan Szabo  <stephan.szabo@sony.com>

        Add guard for wtf/glib include
        https://bugs.webkit.org/show_bug.cgi?id=183521

        Reviewed by Alex Christensen.

        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:

2018-03-09  Andy Estes  <aestes@apple.com>

        [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
        https://bugs.webkit.org/show_bug.cgi?id=183489
        <rdar://problem/38267517>

        WebKit calls -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...] with
        NSTemporaryDirectory() as the destination for receiving file promise drops. AppKit attempts
        to issue a sandbox extension for this directory, but for security reasons App Sandbox
        refuses to do so for NSTemporaryDirectory() itself. As a result, AppKit will call our reader
        block with a nil error and a valid file URL, but no file will actually exist at that URL.

        In order for App Sandbox to grant issuing the sandbox extension needed by AppKit, we need to
        use some other destination directory. This patch uses FileSystem::createTemporaryDirectory()
        to securely create a unique temporary directory inside NSTemporaryDirectory() for use as the
        drop destination.

        Reviewed by Wenson Hsieh.

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

2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
        https://bugs.webkit.org/show_bug.cgi?id=183510

        Reviewed by Michael Catanzaro.

        In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new
        JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal
        API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well,
        so if we change the signal parameter to WebKitDOMElement we will be able to keep using
        WebKitWebPage::will-submit-form without any changes. WPE will gain this signal and the rest of the API that uses
        DOM.

        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkit_web_page_class_init):

2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. [GTK][WPE] Bump Since tags of resource load stats API.

        The functionality hasn't been properly tested to be released in WebKitGTK+ 2.20.

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkit_website_data_manager_class_init):
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitWebsiteData.h:

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

        Unreviewed. Suppress GCC warnings in SystemPreviewController.cpp by
        using the cross-platform #include directives for header inclusion,
        instead of #import.

        * UIProcess/SystemPreviewController.cpp:

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

        Allow WebViews to disable system appearance
        https://bugs.webkit.org/show_bug.cgi?id=183418
        <rdar://problem/36975642>

        Reviewed by Tim Horton.
        
        Allow webviews to choose whether or not to follow the default system appearance.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _useSystemAppearance]):
        (-[WKWebView _setUseSystemAppearance:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        (WebKit::WebPageProxy::setUseSystemAppearance):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::useSystemAppearance const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setUseSystemAppearance):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

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

        Unreviewed, speculative attempt to fix CMake build after r229426
        https://bugs.webkit.org/show_bug.cgi?id=183382
        <rdar://problem/38191450>

        * CMakeLists.txt:

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

        [Extra zoom mode] Support resigning first responder status when focusing a form control
        https://bugs.webkit.org/show_bug.cgi?id=183477
        <rdar://problem/38225994>

        Reviewed by Tim Horton.

        Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
        status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
        controls, this prevents the user from using key pieces of functionality.

        To address this, disconnect the notion of first responder status from DOM element focus while the form control
        overlay is shown. Later, when the active input session ends, if the web content view was first responder before
        upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
        that certain UI affordances which require first responder status on the web view continue to work after
        interacting with a form control that changes the first responder.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentFocusedFormControlViewController:]):
        (-[WKContentView dismissFocusedFormControlViewController:]):

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

        Resource Load Statistics: Revert defaults read of zero values
        https://bugs.webkit.org/show_bug.cgi?id=183476

        Unreviewed revert of three small changes landed in r229427.

        * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
        (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
            Reverted back to strict check of greater than zero for defaults reads.

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

        Don't have SafariServices in minimal simulator build
        https://bugs.webkit.org/show_bug.cgi?id=183436
        <rdar://problem/38254778>

        Reviewed by Dan Bernstein.

        * config.h:

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

        Resource Load Statistics: Make debug mode always partition prevalent resources
        https://bugs.webkit.org/show_bug.cgi?id=183468
        <rdar://problem/38269437>

        Reviewed by Brent Fulgham.

        After some testing we decided that a 30 second timeout in ITP debug mode just makes
        it confusing. We should instead always partition prevalent resources in debug mode
        to make it easy to understand. The partitioned state is what developers want to test
        anyway.

        * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
        (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
            Minor change to include 0 as valid setting.
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
            Now just stores the setting of debug mode instead of changing the timeout.
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
            Now does not disable partitioning under debug mode.
        (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
            Now returns true for prevalent resources with user interaction under debug mode.            
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
            Removed duplicate debug logging statement.
        * UIProcess/WebResourceLoadStatisticsStore.h:
            Added member m_debugModeEnabled.

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

        Remove WebCookieManager and messaging from WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=183382
        <rdar://problem/38191450>

        Reviewed by Alex Christensen.

        Networking access was fully removed from the WebContent process in Bug 183192 (and related bugs). The
        UIProcess no longer needs to ask the WebContent process about networking-related things, and shouldn't
        waste everyone's time doing so.

        This bug removes some left-over WebCookieManager API stuff, and is a first step in purging the
        WebContent Process from accessing cookie data.

        * NetworkProcess/Cookies: Copied from WebProcess/Cookies.
        * NetworkProcess/Cookies/WebCookieManager.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Cookies: Removed.
        * WebProcess/Cookies/WebCookieManager.cpp: Removed.
        * WebProcess/Cookies/WebCookieManager.h: Removed.
        * WebProcess/Cookies/WebCookieManager.messages.in: Removed.
        * WebProcess/Cookies/curl: Removed.
        * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Removed.
        * WebProcess/Cookies/mac: Removed.
        * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Removed.
        * WebProcess/Cookies/soup: Removed.
        * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Removed.
        * WebProcess/InjectedBundle/InjectedBundle.cpp: Remove 'WebCookieManager.h" header.
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Ditto.
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: Ditto.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::WebProcess): Remove call to add WebCookieManager as a
        WebProcessSupplement.
        * CMakeLists.txt: Revised paths.
        * DerivedSources.make: Ditto.
        * PlatformMac.cmake: Ditto.
        * PlatformWin.cmake: Ditto.
        * SourcesGTK.txt: Ditto.
        * SourcesWPE.txt: Ditto.

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

        libwebrtc update broke internal builds
        https://bugs.webkit.org/show_bug.cgi?id=183454

        Reviewed by Eric Carlson.

        * Configurations/BaseTarget.xcconfig:

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

        PluginInfoStore::isSupportedPlugin should check for empty mime type
        https://bugs.webkit.org/show_bug.cgi?id=183457
        <rdar://problem/38159575>

        Reviewed by Chris Dumez.

        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::isSupportedPlugin):

2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
        https://bugs.webkit.org/show_bug.cgi?id=183449

        Reviewed by Mark Lam.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::frameForContext):

2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
        https://bugs.webkit.org/show_bug.cgi?id=183429

        Reviewed by Mark Lam.

        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
        (WebKit::callMethod):
        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
        (WebKit::callNPJSObject):
        (WebKit::constructWithConstructor):
        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
        (WebKit::NPJSObject::create):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::counterValue):

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

        Remove WebCore::TextureMapperAnimation as a special case in WebKit IPC
        generation. Values of this type aren't being transferred across IPC.

        Rubber-stamped by Carlos Garcia Campos.

        * Scripts/webkit/messages.py:

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

        Stop linking ApplicationServices directly
        https://bugs.webkit.org/show_bug.cgi?id=182867
        <rdar://problem/38252142>

        Reviewed by Alex Christensen.

        The frameworks that we use that live inside ApplicationServices
        have mostly moved out, so import them directly.

        * Configurations/WebKit.xcconfig:

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

        [Extra zoom mode] Specify password mode as needed when inputting text
        https://bugs.webkit.org/show_bug.cgi?id=183428
        <rdar://problem/37609386>

        Reviewed by Tim Horton.

        If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
        the text input view controller to opt in to password text input mode.

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

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

        Sort and separate FeatureDefines.xcconfig
        https://bugs.webkit.org/show_bug.cgi?id=183427

        Reviewed by Dan Bernstein.

        * Configurations/FeatureDefines.xcconfig:
        Sort and split FeatureDefines into paragraphs
        (to make it easier to sort later).

2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r218089): [GTK] webkit_web_view_get_inspector() needs to be called, otherwise inspector does not close
        https://bugs.webkit.org/show_bug.cgi?id=181126

        Reviewed by Carlos Alberto Lopez Perez.

        Fix the condition to decide whether to detach the inspector view ourselves.

        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformDetach): Remove the inspector view from its parent if we don't have a client
        or the client didn't detach it.

2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Leak checker is not working in WebKitGLib web process tests
        https://bugs.webkit.org/show_bug.cgi?id=183404

        Reviewed by Michael Catanzaro.

        Add private helper for testing to do a garbage collection when the page is closing.

        * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
        (webkitWebExtensionSetGarbageCollectOnPageDestroy):
        * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Fix annotation of
        webkit_dom_client_rect_list_item(), it should be transfer full.

2018-03-07  Youenn Fablet  <youenn@apple.com>

        Match unsupported plugins based on domains and not origin
        https://bugs.webkit.org/show_bug.cgi?id=183384

        Reviewed by Chris Dumez.

        Moved from a HashMap of plugins to a Vector of plugins since we cannot match exactly based on the origin.

        * Scripts/webkit/messages.py:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextAddSupportedPlugin):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::isSupportedPlugin):
        (WebKit::PluginInfoStore::supportedPluginNames):
        (WebKit::PluginInfoStore::addSupportedPlugin):
        * UIProcess/Plugins/PluginInfoStore.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addSupportedPlugin):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPlugins):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::getPluginInfo):
        (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
        * WebProcess/Plugins/WebPluginInfoProvider.h:

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

        REGRESSION (r229093): Media playback on Facebook and Hulu require mDNSResponder access
        https://bugs.webkit.org/show_bug.cgi?id=183421
        <rdar://problem/38191574>

        Reviewed by Dean Jackson.

        CoreMedia fails to properly play back media on Facebook and Hulu if access to the
        mDNSResponder is blocked by the sandbox. This Bug unblocks that access while we
        investigate the underlying issue.

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

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

        Try to fix build for watchOS and tvOS.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
        * UIProcess/SystemPreviewController.cpp:

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

        Add SystemPreviewController for showing system-level views of special file types
        https://bugs.webkit.org/show_bug.cgi?id=183413
        <rdar://problem/37800834>

        Reviewed by Tim Horton.

        Add a new controller class that hangs off WebPageProxy, with the goal
        of providing system-level viewing of some some file types. Specifically
        those that can't be shown by WebKit.

        This is the initial implementation which is quite simple. The controller
        can be queried about whether it supports a MIME type, then it can be
        asked to show a URL.

        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Added.
        (-[_WKPreviewControllerDataSource initWithURL:]):
        (-[_WKPreviewControllerDataSource numberOfPreviewItemsInPreviewController:]):
        (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
        (WebKit::SystemPreviewController::canPreview const):
        (WebKit::SystemPreviewController::showPreview):
        * UIProcess/SystemPreviewController.cpp: Added.
        (WebKit::SystemPreviewController::SystemPreviewController):
        (WebKit::SystemPreviewController::canPreview const):
        (WebKit::SystemPreviewController::showPreview):
        * UIProcess/SystemPreviewController.h: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues):
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::systemPreviewController):
        * WebKit.xcodeproj/project.pbxproj:

2018-03-07  Alejandro G. Castro  <alex@igalia.com>

        Make NetworkRTCResolver port agnostic
        https://bugs.webkit.org/show_bug.cgi?id=178855

        Reviewed by Youenn Fablet.

        Create a specific Cocoa class to isolate the generic code in the base class, make the base implementation port
        agnostic and dependent on DNS API in the platform directory which encapsulates the platform specific details.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp: Create an alias class name defined per platform to instantiate the resolver.
        (WebKit::NetworkRTCProvider::createResolver): Used the alias class name and receive a new IPAddress class that is not
        dependent on rtc libwebrtc library.
        * NetworkProcess/webrtc/NetworkRTCResolver.cpp: Remove the platform specific code. Use the DNS API to implement the
        platform specific code in the default start and stop methods. Add the identifier of the resolve operation to the class.
        (WebKit::NetworkRTCResolver::NetworkRTCResolver): Add the identifier in the initialization.
        (WebKit::NetworkRTCResolver::~NetworkRTCResolver): Remove the platform specific code.
        (WebKit::NetworkRTCResolver::completed): Ditto.
        (WebKit::NetworkRTCResolver::start): Add a new implementation using the DNS API.
        (WebKit::NetworkRTCResolver::stop): Ditto
        * NetworkProcess/webrtc/NetworkRTCResolver.h: Remove the platform specific code and use the DNSResolveQueue for a general
        solution to implement the platform specific code. Avoid using the IPAddress class that depends on libwertc classes to make
        it more general regarding DNS name resolution.
        (WebKit::NetworkRTCResolver::start): Make this class virtual.
        (WebKit::NetworkRTCResolver::stop): Ditto.
        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.cpp.
        Now this class overrides the start and stop methods that use DNS, cocoa implementation should use the DNS methods in the future and
        remove this class, making sure all the platform specific class is in the platform directory.
        * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.h.
        * PlatformGTK.cmake: Add NetworkRTCResolver compilation for GTK.
        * WebKit.xcodeproj/project.pbxproj: Add the NetworkRTCResolverCocoa class to the compilation.

2018-03-06  Brent Fulgham  <bfulgham@apple.com>

        NetworkDataTask should enable logging for automation clients
        https://bugs.webkit.org/show_bug.cgi?id=183378
        <rdar://problem/38189556>

        Reviewed by Brian Burg.

        The NetworkDataTaskCocoa class was only logging if the SessionID object allowed logging.
        It should also be considering whether the current session is working on behalf of an
        automation client. If so, it should allow logging.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):

2018-03-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix.

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

2018-03-06  Antoine Quint  <graouts@apple.com>

        [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
        https://bugs.webkit.org/show_bug.cgi?id=183370
        <rdar://problem/38180729>

        Reviewed by Dean Jackson.

        Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
        involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
        default while we bring this feature up.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
        (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
        (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
        * WebProcess/InjectedBundle/InjectedBundle.h:

2018-03-06  Ms2ger  <Ms2ger@igalia.com>

        [GLib] Implement WebsiteDataStore::defaultServiceWorkerRegistrationDirectory().
        https://bugs.webkit.org/show_bug.cgi?id=183364

        Reviewed by Michael Catanzaro.

        * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): implement.

2018-03-06  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed. Addressing further review feedback for patch landed in r229315.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::commitSceneState): There's no need for
        explicit calls of the clear() method on both containers in the CommitScope
        objects, the destructors invoked for these objects from the CommitScope
        destructor will have the same effect.

2018-03-06  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
        https://bugs.webkit.org/show_bug.cgi?id=183340

        Reviewed by Michael Catanzaro.

        With most of the scrolling-related code in TextureMapperLayer on the
        chopping block, we can now drop the ScrollingClient inheritance and the
        commitScrollOffset() virtual method implementation. This enables
        removing the whole commitScrollOffset() call chain that ran from
        CoordinatedGraphicsScene through CoordinatedLayerTreeHost and
        CompositingCoordinator to the affected CoordinatedGraphicsLayer object.

        The CoordinatedGraphicsScene::findScrollableContentsLayerAt() method is
        also unused and can be deleted.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::setLayerState):
        (WebKit::CoordinatedGraphicsScene::createLayer):
        (WebKit::CoordinatedGraphicsScene::commitScrollOffset): Deleted.
        (WebKit::CoordinatedGraphicsScene::findScrollableContentsLayerAt): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        (WebKit::ThreadedCompositor::commitScrollOffset): Deleted.
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::commitScrollOffset): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
        (WebKit::CoordinatedLayerTreeHost::commitScrollOffset): Deleted.
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

2018-03-06  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
        https://bugs.webkit.org/show_bug.cgi?id=183360

        Reviewed by Sergio Villar Senin.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
        Pass the monotic time value, as returned by MonotonicTime::now(), to the
        TextureMapperLayer::applyAnimationsRecursively() call.

2018-03-06  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Clean up CoordinatedImageBacking
        https://bugs.webkit.org/show_bug.cgi?id=183332

        Reviewed by Carlos Garcia Campos.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
        Adjust call to CoordinatedImageBacking::getCoordinatedImageBackingID().

2018-03-06  Zan Dobersek  <zdobersek@igalia.com>

        CoordinatedGraphicsScene: properly limit data specific to state commit operation
        https://bugs.webkit.org/show_bug.cgi?id=183326

        Reviewed by Sergio Villar Senin.

        In the process of state commit in CoordinatedGraphicsScene, the released
        image backings and backing stores with pending updates are stored in
        Vector and HashSet objects, respectively. Instead of these two objects
        being member variables on the CoordinatedGraphicsScene class, keep them
        in the CommitScope structure that's limited to the operations done in
        the commitSceneState() method.

        The two member variables are dropped, and the CommitScope object is
        passed by reference to any helper method that needs to append either
        kind of object to the respective container. At the end of the state
        commit, backing stores with pending updates have those updates applied,
        and the two containers are cleared out as the CommitScope object is
        destroyed.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::setLayerState):
        (WebKit::CoordinatedGraphicsScene::prepareContentBackingStore):
        (WebKit::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
        (WebKit::CoordinatedGraphicsScene::removeTilesIfNeeded):
        (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
        (WebKit::CoordinatedGraphicsScene::syncImageBackings):
        (WebKit::CoordinatedGraphicsScene::updateImageBacking):
        (WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
        (WebKit::CoordinatedGraphicsScene::removeImageBacking):
        (WebKit::CoordinatedGraphicsScene::commitSceneState):
        (WebKit::CoordinatedGraphicsScene::purgeGLResources):
        (WebKit::CoordinatedGraphicsScene::removeReleasedImageBackingsIfNeeded): Deleted.
        (WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations): Deleted.
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Fix std::make_unique / new[] using system malloc
        https://bugs.webkit.org/show_bug.cgi?id=182975

        Reviewed by JF Bastien.

        Use Vector instead.

        * NetworkProcess/win/SystemProxyWin.cpp:
        (WindowsSystemProxy::getSystemHttpProxy):
        * Platform/IPC/unix/ConnectionUnix.cpp:
        (IPC::Connection::processMessage):
        (IPC::Connection::sendOutputMessage):
        * Platform/win/LoggingWin.cpp:
        (WebKit::logLevelString):
        * Shared/SandboxExtension.h:
        * Shared/mac/SandboxExtensionMac.mm:
        (WebKit::SandboxExtension::HandleArray::allocate):
        (WebKit::SandboxExtension::HandleArray::operator[]):
        (WebKit::SandboxExtension::HandleArray::operator[] const):
        (WebKit::SandboxExtension::HandleArray::size const):
        (WebKit::SandboxExtension::HandleArray::encode const):

2018-03-05  Andy Estes  <aestes@apple.com>

        [Mac] Teach WebCore::Pasteboard about file promise drags
        https://bugs.webkit.org/show_bug.cgi?id=183314
        <rdar://problem/38105493>

        Reviewed by Darin Adler.

        Added a FIXME comment.

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

2018-03-05  Jeff Miller  <jeffm@apple.com>

        Expose still more WKPreferences SPI to match C SPI
        https://bugs.webkit.org/show_bug.cgi?id=183045

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setAllowsInlineMediaPlayback:]):
        (-[WKPreferences _allowsInlineMediaPlayback]):
        (-[WKPreferences _setApplePayEnabled:]):
        (-[WKPreferences _applePayEnabled]):
        (-[WKPreferences _setDNSPrefetchingEnabled:]):
        (-[WKPreferences _dnsPrefetchingEnabled]):
        (-[WKPreferences _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]):
        (-[WKPreferences _inlineMediaPlaybackRequiresPlaysInlineAttribute]):
        (-[WKPreferences _setInvisibleMediaAutoplayNotPermitted:]):
        (-[WKPreferences _invisibleMediaAutoplayNotPermitted]):
        (-[WKPreferences _setLegacyEncryptedMediaAPIEnabled:]):
        (-[WKPreferences _legacyEncryptedMediaAPIEnabled]):
        (-[WKPreferences _setMainContentUserGestureOverrideEnabled:]):
        (-[WKPreferences _mainContentUserGestureOverrideEnabled]):
        (-[WKPreferences _setMediaStreamEnabled:]):
        (-[WKPreferences _mediaStreamEnabled]):
        (-[WKPreferences _setNeedsStorageAccessFromFileURLsQuirk:]):
        (-[WKPreferences _needsStorageAccessFromFileURLsQuirk]):
        (-[WKPreferences _setPDFPluginEnabled:]):
        (-[WKPreferences _pdfPluginEnabled]):
        (-[WKPreferences _setRequiresUserGestureForAudioPlayback:]):
        (-[WKPreferences _requiresUserGestureForAudioPlayback]):
        (-[WKPreferences _setRequiresUserGestureForVideoPlayback:]):
        (-[WKPreferences _requiresUserGestureForVideoPlayback]):
        (-[WKPreferences _setServiceControlsEnabled:]):
        (-[WKPreferences _serviceControlsEnabled]):
        (-[WKPreferences _setShowsToolTipOverTruncatedText:]):
        (-[WKPreferences _showsToolTipOverTruncatedText]):
        (-[WKPreferences _setTextAreasAreResizable:]):
        (-[WKPreferences _textAreasAreResizable]):
        (-[WKPreferences _setUseGiantTiles:]):
        (-[WKPreferences _useGiantTiles]):
        (-[WKPreferences _setWantsBalancedSetDefersLoadingBehavior:]):
        (-[WKPreferences _wantsBalancedSetDefersLoadingBehavior]):
        (-[WKPreferences _setWebAudioEnabled:]):
        (-[WKPreferences _webAudioEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        Automation: clicking on a disabled option element shouldn't produce an error
        https://bugs.webkit.org/show_bug.cgi?id=183284

        Reviewed by Brian Burg.

        This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.

        14.1 Element Click.
        https://w3c.github.io/webdriver/webdriver-spec.html#element-click

        Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::selectOptionElement):

2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        Automation: stale elements not detected when removed from the DOM
        https://bugs.webkit.org/show_bug.cgi?id=183278

        Reviewed by Brian Burg.

        We detect stale elements when the page is reloaded because the maps are recreated, but if an element is removed
        from the DOM for the same document we keep the nodes in the maps. We should clear stale elements before
        accessing the maps.

        Fixes: imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py::testExpectedConditionStalenessOf

        * WebProcess/Automation/WebAutomationSessionProxy.js:
        (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _clearStaleNodes()
        (let.AutomationSessionProxy.prototype.nodeForIdentifier): Ditto.
        (let.AutomationSessionProxy.prototype._clearStaleNodes): Check if cached nodes are still in document and remove them
        from the maps if they aren't.

2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
        https://bugs.webkit.org/show_bug.cgi?id=183312

        Reviewed by Mark Lam.

        Remove wtf/CurrentTime.h include pragma.

        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        * Platform/IPC/Connection.cpp:
        * Platform/unix/SharedMemoryUnix.cpp:
        * PluginProcess/WebProcessConnection.cpp:
        * Shared/ios/NativeWebTouchEventIOS.mm:
        * UIProcess/DrawingAreaProxyImpl.cpp:
        * UIProcess/ios/WKContentView.mm:
        * UIProcess/linux/MemoryPressureMonitor.cpp:
        * WebProcess/Gamepad/WebGamepad.cpp:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        * WebProcess/WebProcess.cpp:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        * WebProcess/gtk/WebProcessMainGtk.cpp:
        * WebProcess/win/WebProcessMainWin.cpp:
        * WebProcess/wpe/WebProcessMainWPE.cpp:

2018-03-02  Brian Burg  <bburg@apple.com>

        Web Automation: script evaluations via WebDriver should have a user gesture indicator
        https://bugs.webkit.org/show_bug.cgi?id=183230
        <rdar://problem/37959739>

        Reviewed by Andy Estes.

        APIs that normally require a user gesture should just work when using via WebDriver.
        To support cases where tests need to simulate user actions with JavaScript, use a
        fake user gesture, similar to how -[WKWebView evaluateJavaScript:] forces a user
        gesture when clients evaluate JavaScript in their web view.

        No new tests, this is covered by W3C tests that use the Fullscreen API.
        This API does nothing if there is no user gesture; with this patch, it just works.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):

2018-03-04  Tim Horton  <timothy_horton@apple.com>

        Make !ENABLE(DATA_DETECTION) iOS build actually succeed
        https://bugs.webkit.org/show_bug.cgi?id=183283
        <rdar://problem/38062148>

        Reviewed by Sam Weinig.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
        (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
        Guard some more code with ENABLE(DATA_DETECTION).

2018-03-04  Dan Bernstein  <mitz@apple.com>

        Building with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
        https://bugs.webkit.org/show_bug.cgi?id=183320

        Reviewed by Tim Horton.

        * Configurations/PluginService.32.xcconfig: If the Apple build tool specifies
          RC_ARCHS=x86_64, then let the service build for x86_64, but don’t install it.

2018-03-03  Brent Fulgham  <bfulgham@apple.com>

        Notify the NetworkProcess when a session is servicing an automation client
        https://bugs.webkit.org/show_bug.cgi?id=183306
        <rdar://problem/37835783>

        Reviewed by Brian Burg.

        Network loads servicing WebDriver are done through an ephemeral session. While this is great
        for protecting a developer's machine from sharing state with test runs, it has the unintended
        effect of blocking certain logging operations.

        We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions
        generated by WebDriver should participate in logging so that proper testing (with logging) can
        be done.

        This patch signals the NetworkProcess when an ephemeral session (created for automation purposes)
        is created, so that it can allow logging.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry.
        (WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added.
        (WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session
        is servicing an automation client, and returns true if it is.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created
        for an automation client.

2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
        https://bugs.webkit.org/show_bug.cgi?id=183293

        Reviewed by Alex Christensen.

        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
        (WebKit::CompositingRunLoop::scheduleUpdate):
        (WebKit::CompositingRunLoop::compositionCompleted):
        (WebKit::CompositingRunLoop::updateCompleted):
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
        (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):

2018-03-02  Don Olmstead  <don.olmstead@sony.com>

        Share common WebError implementation
        https://bugs.webkit.org/show_bug.cgi?id=183303

        Reviewed by Ryosuke Niwa.

        * Shared/WebErrors.cpp:
        (WebKit::cancelledError):
        (WebKit::fileDoesNotExistError):
        * Shared/glib/WebErrorsGlib.cpp: Removed.
        * SourcesGTK.txt:
        * SourcesWPE.txt:

2018-03-02  Youenn Fablet  <youenn@apple.com>

        LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=179248
        <rdar://problem/35377756>

        Reviewed by Chris Dumez.

        In case we go up to the initializeSize step and Caches was cleared
        between the time we stated to initialize and the time we got there,
        we need to make as if Caches was not initialized,
        thus keeping m_isInitialized to false and m_storage to nullptr.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::initializeSize):

2018-03-02  Youenn Fablet  <youenn@apple.com>

        Clients should register to StorageProcess with their service worker registration identifier
        https://bugs.webkit.org/show_bug.cgi?id=182313
        <rdar://problem/38044403>

        Reviewed by Chris Dumez.

        Relanding.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        * WebProcess/Storage/WebSWClientConnection.h:

2018-03-02  Tim Horton  <timothy_horton@apple.com>

        Make it possible to disable WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=183281
        <rdar://problem/38060815>

        Reviewed by Dan Bates.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _isBackground]):
        (-[WKWebView _isDisplayingPDF]):
        (-[WKWebView _dataForDisplayedPDF]):
        (-[WKWebView _suggestedFilenameForDisplayedPDF]):
        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
        (-[WKWebViewContentProviderRegistry init]):
        * UIProcess/ios/WKPDFView.h:
        * UIProcess/ios/WKPDFView.mm:

2018-03-02  Youenn Fablet  <youenn@apple.com>

        WebProcessProxy should handle its completion handler at destruction time
        https://bugs.webkit.org/show_bug.cgi?id=183224

        Reviewed by Brady Eidson.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::~WebProcessProxy):
        * UIProcess/WebProcessProxy.h:

2018-03-02  Brent Fulgham  <bfulgham@apple.com>

        Update WebContent process sandbox IOKit properties
        https://bugs.webkit.org/show_bug.cgi?id=183269
        <rdar://problem/37853282>

        Reviewed by Eric Carlson.

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

2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove monotonicallyIncreasingTime
        https://bugs.webkit.org/show_bug.cgi?id=182911

        Reviewed by Michael Catanzaro.

        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::toRecordInformation):
        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::ArgumentCoder<Seconds>::encode):
        (IPC::ArgumentCoder<Seconds>::decode):
        (IPC::ArgumentCoder<MonotonicTime>::encode):
        (IPC::ArgumentCoder<MonotonicTime>::decode):
        * Platform/IPC/ArgumentCoders.h:
        * Shared/Gamepad/GamepadData.cpp:
        (WebKit::GamepadData::GamepadData):
        * Shared/Gamepad/GamepadData.h:
        (WebKit::GamepadData::lastUpdateTime const):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
        (IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
        (IPC::ArgumentCoder<Seconds>::encode): Deleted.
        (IPC::ArgumentCoder<Seconds>::decode): Deleted.
        ArgumentCoders for MonotonicTime and Seconds are now used internally.
        Move them to Platform/IPC/ArgumentCoders.h.

        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::IconDatabase::iconDatabaseSyncThread):
        * UIProcess/DrawingAreaProxyImpl.cpp:
        (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
        (WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
        (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
        * UIProcess/DrawingAreaProxyImpl.h:
        * UIProcess/Gamepad/UIGamepad.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        (WebKit::RemoteLayerTreeHost::animationDidStart):
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::acceleratedAnimationDidStart):
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (mediaTimeToCurrentTime):
        (-[WKAnimationDelegate animationDidStart:]):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
        (WebKit::PlatformCALayerRemote::animationStarted):
        This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
        conversion here to fix this issue.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
        (WebKit::RemoteLayerTreeContext::animationDidStart):
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::destroyRenderingResources):

2018-03-02  Brent Fulgham  <bfulgham@apple.com>

        [iOS] whitelist missing AppleJPEG logging feature
        https://bugs.webkit.org/show_bug.cgi?id=183270
        <rdar://problem/37808612>

        Reviewed by Alex Christensen.

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

2018-03-02  Youenn Fablet  <youenn@apple.com>

        IOChannel::read and IOChannel::write can destroy the completion handler in the thread used to manipulate thread
        https://bugs.webkit.org/show_bug.cgi?id=183261

        Reviewed by Antti Koivisto.

        Moving the completion handler when being called so that it gets desttroyed in the thread it is called.

        * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
        (WebKit::NetworkCache::IOChannel::read):
        (WebKit::NetworkCache::IOChannel::write):

2018-03-02  Dan Bernstein  <mitz@apple.com>

        Safari uses WebContent.Development when loading injected bundle embedded in its app bundle
        https://bugs.webkit.org/show_bug.cgi?id=183275

        Reviewed by Tim Horton.

        * UIProcess/mac/WebProcessProxyMac.mm:
        (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return false if this is
          a platform binary. We can also return false unconditionally when building for any shipping
          major macOS release.

2018-03-01  Commit Queue  <commit-queue@webkit.org>

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

        it is breaking imported/w3c/web-platform-tests/service-workers
        /service-worker/clients-matchall-exact-controller.https.html
        (Requested by youenn on #webkit).

        Reverted changeset:

        "Clients should register to StorageProcess with their service
        worker registration identifier"
        https://bugs.webkit.org/show_bug.cgi?id=182313
        https://trac.webkit.org/changeset/229153

2018-03-01  Brent Fulgham  <bfulgham@apple.com>

        Add the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin Process
        https://bugs.webkit.org/show_bug.cgi?id=183252
        <rdar://problem/37887136>

        Reviewed by David Kilzer.

        * Configurations/PluginService.entitlements:

2018-03-01  Youenn Fablet  <youenn@apple.com>

        Clients should register to StorageProcess with their service worker registration identifier
        https://bugs.webkit.org/show_bug.cgi?id=182313

        Reviewed by Chris Dumez.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::registerServiceWorkerClient):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::registerServiceWorkerClient):
        * WebProcess/Storage/WebSWClientConnection.h:

2018-03-01  Youenn Fablet  <youenn@apple.com>

        LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=179248
        <rdar://problem/35377756>

        Reviewed by Chris Dumez.

        WebKitTestRunner is clearing caches for every test but there might still be some on-going cache activity due to a previous test.
        In that case, the activity might try to open the Caches object at the same time the files are deleted by the clearing task.
        If the new test is trying to open the same caches, it will also receive the same error, hence the console log message.

        To fix that issue, we clear the initialization pending callbacks when clearing the caches.
        This prevents the new test to receive the error since the new test should only start some cache activity after the cache clear task is done.
        Made refactoring to append the first callback into the list of pending callbacks.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::initialize):
        (WebKit::CacheStorage::Caches::initializeSize):
        (WebKit::CacheStorage::Caches::clear):
        * NetworkProcess/cache/CacheStorageEngineCaches.h:

2018-03-01  Youenn Fablet  <youenn@apple.com>

        Add API test to validate setting of service worker and cache storage directories
        https://bugs.webkit.org/show_bug.cgi?id=182543

        Reviewed by Chris Dumez.

        Add cache engine directory path to its representation dump.
        This is used in API tests to check that the path is correctly set.

        Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
        This is used in API tests to check that the path is correctly set.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::representation):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2018-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix some errors due to some mach port APIs being unavailable on watchOS
        https://bugs.webkit.org/show_bug.cgi?id=183262
        <rdar://problem/38028521>

        Reviewed by Tim Horton.

        Minor build fix; mach_port_guard and mach_port_unguard are not available on this platform.

        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::Connection::platformInvalidate):
        (IPC::Connection::platformInitialize):
        (IPC::Connection::open):

2018-03-01  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r229140.

        * WebProcess/cocoa/WebProcessCocoa.mm:

2018-03-01  Per Arne Vollan  <pvollan@apple.com>

        Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
        https://bugs.webkit.org/show_bug.cgi?id=183231
        <rdar://problem/37793457>

        Reviewed by Brent Fulgham.

        When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
        The notification about scrollbar preferences is never received by the WebContent process when there is no
        WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
        notifying the WebProcess about this by sending it a message. This message should also contain the preferred
        scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
        there is no WindowServer access.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):
        (WebKit::WebProcessPool::unregisterNotificationObservers):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::scrollerStylePreferenceChanged):

2018-03-01  Antti Koivisto  <antti@apple.com>

        Crash when updating cache entry after validation in apps that uses class A file protection
        https://bugs.webkit.org/show_bug.cgi?id=183242
        <rdar://problem/33289058>

        Reviewed by Chris Dumez.

        When validating a cache entry, we keep it alive until we get a network response. With 304 response
        we then update the headers of this existing entry. This accesses the body data of the entry which
        may be backed by a mapped file. If the app uses class A protection, user might have locked
        the device and the entry might have become inaccessible, leading to a crash.

        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::setNeedsValidation):

        In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
        This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).

2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
        https://bugs.webkit.org/show_bug.cgi?id=183091

        Reviewed by Michael Catanzaro.

        Invalidate the surface in the page map when the backing store is destroyed.

        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::willDestroySurface):
        * UIProcess/gtk/WaylandCompositor.h:

2018-02-28  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
        https://bugs.webkit.org/show_bug.cgi?id=182660
        <rdar://problem/37408183>

        Reviewed by Tim Horton and Carlos Garcia Campos.

        Add another delegate method to ask what type of dialog is being shown.
        This is used to implement §18.4 Step 5, where sending text to a dialog
        without a prompt will return several different kinds of errors.

        No new tests, covered by web platform tests once Safari side has landed.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::AutomationSessionClient):
        (WebKit::toImpl):
        (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
        If there is no current dialog to be checked, the client can return the 'None'
        type. This gets converted into a std::nullopt and causes a command error later.

2018-02-28  John Wilander  <wilander@apple.com>

        Remove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence() which causes crashes when domains are explicitly set as prevalent without the associated statistics
        https://bugs.webkit.org/show_bug.cgi?id=183233

        Unreviewed removal of an assertion that's causing layout test crashes.

        * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
        (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
            Removed ASSERT(currentPrevalence == Low).

2018-02-28  John Wilander  <wilander@apple.com>

        Add a second tier of prevalence to facilitate telemetry on very prevalent domains
        https://bugs.webkit.org/show_bug.cgi?id=183218
        <rdar://problem/37992388>

        Reviewed by Brent Fulgham.

        * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
        (WebKit::vectorLength):
            New convenience function.
        (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
            Renamed from ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics().
            Now returns a value from the enum ResourceLoadPrevalence.
        (WebKit::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold):
            Now uses the new vectorLength() convenience function.
        (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Deleted.
            Renamed to ResourceLoadStatisticsClassifier::calculateResourcePrevalence().
        * Platform/classifier/ResourceLoadStatisticsClassifier.h:
            Added enum ResourceLoadPrevalence.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
        (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
            Handling of the new boolean field isVeryPrevalentResource.
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
        (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
            Test infrastructure.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
        (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
            All of these are for handling of the two-tier classification.
            Also bumped the statisticsModelVersion to 12.
        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        Reduce use of NetworkingContext in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=183213

        Reviewed by Brady Eidson.

        * NetworkProcess/RemoteNetworkingContext.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::preconnectTo):
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::proxiesForURL):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        * WebProcess/WebPage/WebFrame.cpp:

2018-02-28  Brent Fulgham  <bfulgham@apple.com>

        Remove network access from the WebContent process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=183192
        <rdar://problem/35369115>

        Reviewed by Alex Christensen.

        Remove the 'system-network', 'allow-network-common', and 'network-client' access from the WebContent process.
        That's why we have a Network Process! 

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

2018-02-27  Tim Horton  <timothy_horton@apple.com>

        Ensure target triple is propagated correctly to DerivedSources.make
        https://bugs.webkit.org/show_bug.cgi?id=183189
        <rdar://problem/37959694>

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        * DerivedSources.make:
        Ditto the WebCore ChangeLog.

2018-02-27  Yongjun Zhang  <yongjun_zhang@apple.com>

        Make it possible to set suggestions in extra zoom mode.
        https://bugs.webkit.org/show_bug.cgi?id=183154
        <rdar://problem/35227450>

        Reviewed by Tim Horton.

        In extra zoom mode, when presenting WKFocusedFormControlViewController, make it the inputDelegate for
        WKContentView. This is needed to ensure we can capture/cache the suggestions when _WKInputSession's
        suggestions is updated. Later, when we present WKTextInputViewController, we can pass the cached
        suggestions.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView presentFocusedFormControlViewController:]): Set _focusedFormControlViewController as
            the inputDelegate for WKContentView.
        (-[WKContentView dismissFocusedFormControlViewController:]): Null the inputDelegate on dismissal.
        (-[WKContentView presentTextInputViewController:]): Pass the suggestions from WKFocusedFormControlViewController to
            WKTextInputViewController when the latter is presented.
        (-[WKContentView textInputController:didCommitText:]): Call the new delegate method textInputController:didCommitText:withSuggestion:.
        (-[WKContentView textInputController:didCommitText:withSuggestion:]): When a suggestions is selected, insert the
            suggestion which will notify the client.
        (-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Called when the suggestion is updated after the input
            view controller is presented.

2018-02-27  Tim Horton  <timothy_horton@apple.com>

        Stop using deprecated CADisplay SPI
        https://bugs.webkit.org/show_bug.cgi?id=183150
        <rdar://problem/37918297>

        Reviewed by Simon Fraser.

        * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        * WebKit.xcodeproj/project.pbxproj:
        Switch to the more modern way of getting the display name.

2018-02-27  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r229055.

        Breaks internal builds.

        Reverted changeset:

        "Stop using deprecated CADisplay SPI"
        https://bugs.webkit.org/show_bug.cgi?id=183150
        https://trac.webkit.org/changeset/229055

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

        [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
        https://bugs.webkit.org/show_bug.cgi?id=183100
        <rdar://problem/37840987>

        Reviewed by Tim Horton.

        Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic.
        Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means
        that even when "width=device-width" is used, if the contents of the page are too wide to fit within the
        viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content.

        However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and
        displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that
        is larger than the real viewport width would cause all other elements with dimensions relative to the body to be
        excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents
        of the page all fit within the viewport.

        To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we
        simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given
        minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we
        then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the
        ability to lay out content as if our view were large, but still ensure that the contents of the page fit within
        the actual view.

        * Shared/VisibleContentRectUpdateInfo.cpp:
        (WebKit::VisibleContentRectUpdateInfo::encode const):
        (WebKit::VisibleContentRectUpdateInfo::decode):
        (WebKit::operator<<):
        * Shared/VisibleContentRectUpdateInfo.h:
        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
        (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const):
        (WebKit::operator==):

        Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:

        Plumb viewSize through IPC to WebPage.

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

        Start off WKWebView flags at their initial values.

        (-[WKWebView _minimumAllowedLayoutWidth]):
        (-[WKWebView _setMinimumAllowedLayoutWidth:]):

        This provides the minimum width at which the page will lay out, such that if the view width dips below this
        value, we'll use this minimum allowed layout width instead. 0 by default.

        (-[WKWebView activeMinimumLayoutSizes:]):

        Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size
        (which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites
        to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size.

        (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]):
        (-[WKWebView _frameOrBoundsChanged]):
        (-[WKWebView _setMinimumLayoutSizeOverride:]):
        (-[WKWebView _setForceHorizontalViewportShrinkToFit:]):
        (-[WKWebView _forceHorizontalViewportShrinkToFit]):

        Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default.

        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        (-[WKWebView _endAnimatedResize]):
        (activeMinimumLayoutSize): Deleted.

        More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:.

        (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

        Pass _forceHorizontalViewportShrinkToFit into the visible content rect update.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):

        Plumb viewSize alongside the existing minimumLayoutSize.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
        (WebKit::WebPage::dynamicViewportSizeUpdate):
        (WebKit::WebPage::updateVisibleContentRects):

        Set forceHorizontalShrinkToFit on the viewport configuration here.

2018-02-27  Tim Horton  <timothy_horton@apple.com>

        Stop using deprecated CADisplay SPI
        https://bugs.webkit.org/show_bug.cgi?id=183150
        <rdar://problem/37918297>

        Reviewed by Simon Fraser.

        * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
        * WebKit.xcodeproj/project.pbxproj:
        Switch to the more modern way of getting the display name.

2018-02-26  Youenn Fablet  <youenn@apple.com>

        Caches::m_storage should be set to null in case of error at initialization time
        https://bugs.webkit.org/show_bug.cgi?id=183068

        Reviewed by Chris Dumez.

        In case of error, we need to set m_storage back to nullptr so that
        next tries to initialize it will restart from scratch.
        If we do not set it to nullptr, we end up storing the initialize
        callback in a queue and the callback will never be called.

        This is difficult to test as we need the following conditions:
        - we need to have an error case, like a disk writing error
        - we need the web app to open a cache in two different pages/frames at about the same time.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::initialize):

2018-02-26  Commit Queue  <commit-queue@webkit.org>

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

        incorrectly assumes enumeration callback happens once
        (Requested by alexchristensen on #webkit).

        Reverted changeset:

        "Use BlockPtrs and lambdas instead of new/delete to pass
        parameters to blocks in WebViewImpl::performDragOperation"
        https://bugs.webkit.org/show_bug.cgi?id=180795
        https://trac.webkit.org/changeset/226330

2018-02-26  Ryosuke Niwa  <rniwa@webkit.org>

        Release assertion in WebPage::updatePreferences
        https://bugs.webkit.org/show_bug.cgi?id=183075

        Reviewed by Youenn Fablet and Chris Dumez.

        Replaced the release assertion added in r228589 with a more graceful disabling of the feature when the entitlement is missing.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didReceiveMessage): Added an early exit with an entitlement check to disable the feature.
        (WebKit::StorageProcess::initializeWebsiteDataStore): Ditto.
        (WebKit::StorageProcess::createStorageToWebProcessConnection): Replaced the release assertion with a debug assertion.
        (WebKit::StorageProcess::swServerForSession): Removed the assertion. This code can be reached when the service worker is disabled.
        (WebKit::StorageProcess::registerSWServerConnection): Replaced the release assertion with a debug assertion.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences): Disable the feature instead of crashing when the entitlement is missing.

2018-02-26  Chris Dumez  <cdumez@apple.com>

        Regression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
        https://bugs.webkit.org/show_bug.cgi?id=183134
        <rdar://problem/36339049>

        Reviewed by Alex Christensen.

        Like other delegates functions in this file, it is possible for didReceiveChallenge to get called
        after _session has been nulled out. Other delegate functions already had early returns when
        _session is null. However, such early return was missing in didReceiveChallenge.

        This patch ends the early return to didReceiveChallenge so that we do not end up calling
        _session->downloadID(taskIdentifier) on a null _session.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

2018-02-26  Youenn Fablet  <youenn@apple.com>

        MessagePort is not always destroyed in the right thread
        https://bugs.webkit.org/show_bug.cgi?id=183053

        Reviewed by Chris Dumez.

        Update code to pass a lambda to MessagePort::existingMessagePortForIdentifier.

        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
        (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::messagesAvailableForPort):

2018-02-25  Alexey Proskuryakov  <ap@apple.com>

        Font smoothing doesn't get disabled if the preference is set before launching WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=183108

        Reviewed by Tim Horton.

        * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
        Fix the bug. While at it, also avoid the anti-pattern in setAlwaysUsesComplexTextCodePath.

2018-02-25  Philippe Normand  <pnormand@igalia.com>

        Unreviewed GTK Debug build fix after r228942.

        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::IconDatabase::iconDatabaseSyncThread):
        (WebKit::IconDatabase::syncThreadMainLoop):
        (WebKit::IconDatabase::readFromDatabase):
        (WebKit::IconDatabase::writeToDatabase):
        (WebKit::IconDatabase::cleanupSyncThread):

2018-02-25  Chris Dumez  <cdumez@apple.com>

        Service workers do not work well inside Web.app
        https://bugs.webkit.org/show_bug.cgi?id=183105
        <rdar://problem/37864140>

        Reviewed by Youenn Fablet.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::didReceiveMessage):
        We were failing to forward IPC messages to the ChildProcess class here. As a result,
        the ChildProcess::RegisterURLSchemeServiceWorkersCanHandle IPC was being ignored
        by the StorageProcess.

2018-02-24  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed WPE breakage fix.

        * WebProcess/wpe/WebProcessMainWPE.cpp: Call g_set_prgname() in WebProcess 
        to prepare the GLib state for subsequent GStreamer initialization.

2018-02-23  John Wilander  <wilander@apple.com>

        Introduce ITP debug logging as an opt-in developer feature
        https://bugs.webkit.org/show_bug.cgi?id=183065
        <rdar://problem/37803761>

        Reviewed by Brent Fulgham.

        * Platform/Logging.h:
            Added a dedicated channel for Resource Load Statistics debug logging
            since this will be part of a developer-facing feature and should not
            be mixed with general Resource Load Statistics logging.
        * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
        (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
            Now picks up the user default setting for
            ResourceLoadStatisticsDebugLoggingEnabled.
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
            Now logs for which domains it purges website data if
            ResourceLoadStatisticsDebugLoggingEnabled is set.
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
            Now logs for which domains it partitions and blocks cookies
            in third-party contexts if ResourceLoadStatisticsDebugLoggingEnabled
            is set.
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-02-23  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Correct sandbox violation during media playback
        https://bugs.webkit.org/show_bug.cgi?id=183092
        <rdar://problem/37718495>

        Reviewed by Eric Carlson.

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

2018-02-23  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [MSVC] Unknown a type definition error in WebResourceLoadStatisticsStore on wincairo webkit
        https://bugs.webkit.org/show_bug.cgi?id=182873

        Reviewed by Yusuke Suzuki.

        * UIProcess/WebResourceLoadStatisticsStore.h:

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

        [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
        https://bugs.webkit.org/show_bug.cgi?id=173655
        <rdar://problem/37706341>

        Reviewed by Philippe Normand.

        Actually pass the gst command line options to the WebProcess. The options in /proc/self/cmdline are separated by
        null characters, so we are effectively passing always the first option only, which is the program name. Then, in
        the web process we always ignore the first option and providing WebProcess unconditionally, so we were doing
        nothing.

        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Use WebCore::extractGStreamerOptionsFromCommandLine()
        * UIProcess/wpe/WebProcessPoolWPE.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
        * WebProcess/soup/WebProcessSoup.cpp:
        (WebKit::WebProcess::platformInitializeWebProcess): Move the vector.

2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove currentTime() / currentTimeMS()
        https://bugs.webkit.org/show_bug.cgi?id=183052

        Reviewed by Mark Lam.

        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        * PluginProcess/WebProcessConnection.cpp:
        * Shared/WebProcessCreationParameters.h:
        * Shared/linux/WebMemorySamplerLinux.cpp:
        (WebKit::WebMemorySampler::sampleWebKit const):
        * Shared/mac/WebMemorySampler.mac.mm:
        (WebKit::WebMemorySampler::sampleWebKit const):
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
        * UIProcess/API/glib/IconDatabase.cpp:
        (WebKit::IconDatabase::setIconDataForIconURL):
        (WebKit::IconDatabase::synchronousLoadDecisionForIconURL):
        (WebKit::IconDatabase::performURLImport):
        * UIProcess/DrawingAreaProxyImpl.cpp:
        * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
        (WebKit::expirationTimeFromNow):
        (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
        (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
        (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable):
        (WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime):
        (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
        (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
        * UIProcess/Plugins/PlugInAutoStartProvider.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processDidFinishLaunching):
        (WebKit::WebProcessPool::startMemorySampler):
        (WebKit::WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
        * UIProcess/WebProcessPool.h:
        * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
        (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame):
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
        (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::m_webSQLiteDatabaseTracker):
        (WebKit::WebProcess::isPlugInAutoStartOriginHash):
        (WebKit::WebProcess::plugInDidStartFromOrigin):
        (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
        (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
        (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
        (WebKit::WebProcess::plugInDidReceiveUserInteraction):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        * WebProcess/wpe/WebProcessMainWPE.cpp:

2018-02-22  Matt Baker  <mattbaker@apple.com>

        Web Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
        https://bugs.webkit.org/show_bug.cgi?id=183056
        <rdar://problem/37799067>

        Reviewed by Joseph Pecoraro.

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

2018-02-22  Youenn Fablet  <youenn@apple.com>

        Caches::initialize should call all pending initialization callbacks in case of error
        https://bugs.webkit.org/show_bug.cgi?id=183062

        Reviewed by Chris Dumez.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::initialize):
        (WebKit::CacheStorage::Caches::initializeSize):

2018-02-22  Youenn Fablet  <youenn@apple.com>

        CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
        https://bugs.webkit.org/show_bug.cgi?id=183055

        Reviewed by Chris Dumez.

        Add a completion handler to Storage::store.
        Use it instead in Caches::writeRecord.
        This ensures that the Cache add/put promise will be called once all write operations have been done.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::writeRecord):
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
        (WebKit::NetworkCache::Storage::finishWriteOperation):
        (WebKit::NetworkCache::Storage::store):
        * NetworkProcess/cache/NetworkCacheStorage.h:
        (WebKit::NetworkCache::Storage::store):

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

        Add an entitlement check for service worker on iOS
        https://bugs.webkit.org/show_bug.cgi?id=182865

        Reviewed by Dan Bernstein.

        Addressed Dan's comment by using xpc_connection_copy_entitlement_value instead of obtaining the audit token first.

        * Shared/mac/SandboxUtilities.h:
        * Shared/mac/SandboxUtilities.mm:
        (WebKit::connectedProcessHasEntitlement):
        * StorageProcess/ios/StorageProcessIOS.mm:
        (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):

2018-02-22  Youenn Fablet  <youenn@apple.com>

        Fetch event release assert should take into account the fetch mode
        https://bugs.webkit.org/show_bug.cgi?id=183047

        Reviewed by Chris Dumez.

        In case of navigation tasks, we should use the request URL and not the origin of the loading client.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::isValidFetch):
        (WebKit::WebSWContextManagerConnection::startFetch):

2018-02-22  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore forwarding header paths
        https://bugs.webkit.org/show_bug.cgi?id=182969

        Reviewed by Konstantin Tokarev.

        * WebProcess/WebPage/win/WebPageWin.cpp:
        * WebProcess/win/WebProcessWin.cpp:

2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove sleep(double) and sleepMS(double) interfaces
        https://bugs.webkit.org/show_bug.cgi?id=183038

        Reviewed by Mark Lam.

        * PluginProcess/WebProcessConnection.cpp:
        (WebKit::WebProcessConnection::createPluginAsynchronously):
        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::pollIntervalForUsedMemoryPercentage):
        (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
        * WebProcess/wpe/WebProcessMainWPE.cpp:

2018-02-22  Youenn Fablet  <youenn@apple.com>

        Add release logging for CacheStorage::Engine disk related functions
        https://bugs.webkit.org/show_bug.cgi?id=183042

        Reviewed by Chris Dumez.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::writeFile):
        (WebKit::CacheStorage::Engine::readFile):

2018-02-22  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r228902.

        This broke internal builds.

        Reverted changeset:

        "[Cocoa] Web Automation: provide a way to ask clients the type
        of a JavaScript dialog"
        https://bugs.webkit.org/show_bug.cgi?id=182660
        https://trac.webkit.org/changeset/228902

2018-02-22  Youenn Fablet  <youenn@apple.com>

        Add release asserts for service worker fetch and postMessage events
        https://bugs.webkit.org/show_bug.cgi?id=183025
        rdar://problem/37765052

        Reviewed by Daniel Bates.

        Add assertion to protect interception of a fetch load by a service worker with
        a different origin from the page.

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

2018-02-22  Ms2ger  <Ms2ger@igalia.com>

        [GTK][WPE] Fix some build errors in service workers code
        https://bugs.webkit.org/show_bug.cgi?id=182966

        Reviewed by Žan Doberšek.

        * CMakeLists.txt: add missing files.
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: add missing includes.
        * UIProcess/ServiceWorkerProcessProxy.cpp: use #include rather than #import in C++; add missing ifdef.
        * UIProcess/ServiceWorkerProcessProxy.h: add missing ifdef.
        * WebProcess/Storage/WebSWClientConnection.cpp: add missing includes.
        * WebProcess/Storage/WebSWContextManagerConnection.cpp: add missing includes.
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
          call the function that exists outside cocoa.

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

        The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
        https://bugs.webkit.org/show_bug.cgi?id=182855

        Reviewed by Brent Fulgham.

        On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
        with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
        screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
        process whenever there is a change in the display properties, and have the WebContent process cache these
        display properties. This message should also be sent to a newly started WebContent process.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::displayReconfigurationCallBack):
        (WebKit::registerDisplayConfigurationCallback):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::warmInitialProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setScreenProperties):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-02-21  Christopher Reid  <chris.reid@sony.com>

        [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
        https://bugs.webkit.org/show_bug.cgi?id=182751

        Reviewed by Youenn Fablet.

        Adding a cookiePersistentStorageFile parameter to Curl's NetworkProcessCreationParameters.
        This parameter is based on Soup's cookiePersistentStoragePath.
        This parameter is not used yet, it is added to prepare for WinCairo WebKit support.

        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        * NetworkProcess/NetworkProcessCreationParameters.h:
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        * WebProcess/Cookies/WebCookieManager.h:
        * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp:

2018-02-21  Brian Burg  <bburg@apple.com>

        [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
        https://bugs.webkit.org/show_bug.cgi?id=182660
        <rdar://problem/37408183>

        Reviewed by Tim Horton and Carlos Garcia Campos.

        Add another delegate method to ask what type of dialog is being shown.
        This is used to implement §18.4 Step 5, where sending text to a dialog
        without a prompt will return several different kinds of errors.

        No new tests, covered by web platform tests once Safari side has landed.

        * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
        * UIProcess/Cocoa/AutomationSessionClient.h:
        * UIProcess/Cocoa/AutomationSessionClient.mm:
        (WebKit::AutomationSessionClient::AutomationSessionClient):
        (WebKit::toImpl):
        (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
        If there is no current dialog to be checked, the client can return the 'None'
        type. This gets converted into a std::nullopt and causes a command error later.

2018-02-21  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Fix compile errors of WebProcess and NetworkProcess due to no implementation for windows
        https://bugs.webkit.org/show_bug.cgi?id=182870

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
        (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
        * WebProcess/WebPage/WebInspector.cpp:
        (WebKit::WebInspector::openFrontendConnection):
        * WebProcess/WebPage/WebInspectorUI.cpp:
        (WebKit::WebInspectorUI::establishConnection):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2018-02-21  Don Olmstead  <don.olmstead@sony.com>

        [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
        https://bugs.webkit.org/show_bug.cgi?id=182883

        Reviewed by Per Arne Vollan.

        * config.h:

2018-02-21  Brian Burg  <bburg@apple.com>

        Web Automation: failed provisional loads cause "Navigate To" command to hang
        https://bugs.webkit.org/show_bug.cgi?id=183007
        <rdar://problem/37751819>

        Reviewed by Andy Estes.

        This hang was revealed by WPT test current_url.py::get_current_url_file_protocol. Now the
        test simply fails because Safari chooses a policy of 'Ignore' for externally-opened files.
        I filed an upstream issue with the test here: https://github.com/w3c/webdriver/issues/1232

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
        Notify the session that the load failed in the frame, just like we do
        for non-provisional failed loads and successful loads.

2018-02-20  Nan Wang  <n_wang@apple.com>

        AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
        https://bugs.webkit.org/show_bug.cgi?id=182752
        <rdar://problem/37518233>

        Reviewed by Ryosuke Niwa.

        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::assistiveTechnologyMakeFirstResponder):
        * WebProcess/WebCoreSupport/WebChromeClient.h:

2018-02-14  Brian Burg  <bburg@apple.com>

        Web Automation: combine session commands to resize and move top-level browsing contexts
        https://bugs.webkit.org/show_bug.cgi?id=182749
        <rdar://problem/37515170>

        Reviewed by Andy Estes.

        Since moving and resizing the window are both accomplished by setting the window frame,
        and the W3C WebDriver specification has a Get/Set Window Rect command, it's time to
        deduplicate these two methods which basically do the same thing.

        Adopt modern JSON::Value getters that return std::optional<float>. I have been trying
        to move the protocol over to this style wholesale, but it is probably easier to do
        this conversion in smaller pieces. And so, I have started to do so.

        This change is covered by existing WebDriver tests.

        * UIProcess/Automation/Automation.json: Add new command.
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Added.
        (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
        (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
        * UIProcess/Automation/WebAutomationSession.h:

2018-02-20  Brian Burg  <bburg@apple.com>

        ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
        https://bugs.webkit.org/show_bug.cgi?id=182991
        <rdar://problem/37620578>

        Reviewed by Timothy Hatcher.

        Sometimes when running more than one session end-to-end with the same browser instance,
        UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
        registered. This is hard to reproduce, but upon code inspection, the receiver management code
        is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
        In some cases the client could retain two sessions and cause the first one to never remove itself
        as the message receiver.

        Instead of unregistering the session as a message receiver underneath the session's destructor,
        do this whenever a new session supplants an old session since there is only one active session at a time.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::~WebAutomationSession):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setAutomationSession):

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

        Introduce HAVE(IOSURFACE_ACCELERATOR)
        https://bugs.webkit.org/show_bug.cgi?id=182955
        <rdar://problem/37699510>

        Reviewed by Sam Weinig.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        * Shared/cg/ShareableBitmapCG.cpp:
        * UIProcess/API/Cocoa/WKWebView.mm:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
        * UIProcess/mac/ViewSnapshotStore.h:
        * UIProcess/mac/ViewSnapshotStore.mm:

2018-02-20  Chris Dumez  <cdumez@apple.com>

        Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
        https://bugs.webkit.org/show_bug.cgi?id=182720
        <rdar://problem/37515204>

        Reviewed by Alex Christensen.

        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didReceiveResponse):
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
        * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
        (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):

2018-02-20  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r228829.

        This caused a consistent failure in the API test
        WebKit.InteractionDeadlockAfterCrash on iOS Simulator

        Reverted changeset:

        "Switch to UIWKTextInteractionAssistant for non-editable text"
        https://bugs.webkit.org/show_bug.cgi?id=182834
        https://trac.webkit.org/changeset/228829

2018-02-20  Megan Gardner  <megan_gardner@apple.com>

        Switch to UIWKTextInteractionAssistant for non-editable text
        https://bugs.webkit.org/show_bug.cgi?id=182834
        
        Reviewed by Wenson Hsieh and Tim Horton.
        
        Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported. 
        Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a  
        textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView useSelectionAssistantWithGranularity:]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

2018-02-20  John Wilander  <wilander@apple.com>

        Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
        https://bugs.webkit.org/show_bug.cgi?id=182719
        <rdar://problem/37517370>

        Reviewed by Brent Fulgham.

        This will allow the page notification, statistics pruning, and persistence write
        to be done at the right time and hopefully stabilize the layout tests including:
        http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
            Now takes a callback parameter.
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
        * UIProcess/WebResourceLoadStatisticsStore.h:
            Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
            in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().

2018-02-20  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Drop target GraphicsContext usage in Cairo operations
        https://bugs.webkit.org/show_bug.cgi?id=182964

        Reviewed by Carlos Garcia Campos.

        The GraphicsContext parameters in various Cairo operations are not used
        anymore, so they can be removed. Callsites are updated to reflect this.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::paint):
        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        (WebKit::convertCairoSurfaceToShareableBitmap):

2018-02-20  Philippe Normand  <pnormand@igalia.com>

        [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
        https://bugs.webkit.org/show_bug.cgi?id=173655

        Reviewed by Xabier Rodriguez-Calvar.

        The FIXME in GStreamerUtilities.cpp asks to pass the command line
        parameters to the GStreamer initialization function.

        Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
        the GStreamer options written by console.
        * WebProcess/soup/WebProcessSoup.cpp:
        (WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
        the vector which contains the options.

2018-02-20  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [Win] Fix MSVC's treating __attribute__((warn_unused_result))
        https://bugs.webkit.org/show_bug.cgi?id=182479

        Reviewed by Darin Adler.

        Since MSVC doesn't understand "__attribute__", "_Check_return_" is used instead.
        If clang and VisualStudio 2017 are used, a macro with "__attriute__" will be chosen.

        * UIProcess/API/cpp/WKRetainPtr.h:

2018-02-19  Brady Eidson  <beidson@apple.com>

        Add WebProcessPool option for process swapping on navigation.
        https://bugs.webkit.org/show_bug.cgi?id=182945

        Reviewed by Alex Christensen.

        Just the most basic groundwork for testing a new WK2 feature.

        * UIProcess/API/APIProcessPoolConfiguration.h:

        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationProcessSwapsOnNavigation):
        (WKContextConfigurationSetProcessSwapsOnNavigation):
        * UIProcess/API/C/WKContextConfigurationRef.h:

        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
        (-[_WKProcessPoolConfiguration processSwapsOnNavigation]):

2018-02-19  Daniel Bates  <dabates@apple.com>

        Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
        https://bugs.webkit.org/show_bug.cgi?id=182905
        <rdar://problem/37676775>

        Reviewed by Alex Christensen.

        Return nullptr when querying for the scheme handler of the null string.

        Before a navigation is performed WebKit checks if the destination URL is associated with an app
        unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
        If the URL is not associated with an app then WebKit may fall back to checking if the embedding
        client registered a scheme handler for it. Currently we assume that the scheme is a non-null
        string when checking the scheme handler registry. However the scheme can be a null string if
        it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
        for a scheme handler. Instead check that the scheme is a non-null string before checking to see
        if it is in the scheme handler registry.

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

2018-02-19  Eric Carlson  <eric.carlson@apple.com>

        [Extra zoom mode] Don't allow PiP media playback
        https://bugs.webkit.org/show_bug.cgi?id=182930
        <rdar://problem/37676259>

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
        all media types.

2018-02-19  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r228696.

        The API test added with this change is timing out on macOS.

        Reverted changeset:

        "Null pointer dereference in
        WebPageProxy::urlSchemeHandlerForScheme()"
        https://bugs.webkit.org/show_bug.cgi?id=182905
        https://trac.webkit.org/changeset/228696

2018-02-19  Daniel Bates  <dabates@apple.com>

        Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
        https://bugs.webkit.org/show_bug.cgi?id=182905

        Reviewed by Alex Christensen.

        Return nullptr when querying for the scheme handler of the null string.

        Before a navigation is performed WebKit checks if the destination URL is associated with an app
        unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
        If the URL is not associated with an app then WebKit may fall back to checking if the embedding
        client registered a scheme handler for it. Currently we assume that the scheme is a non-null
        string when checking the scheme handler registry. However the scheme can be a null string if
        it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
        for a scheme handler. Instead check that the scheme is a non-null string before checking to see
        if it is in the scheme handler registry.

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

2018-02-19  Ms2ger  <Ms2ger@igalia.com>

        Explicitly qualify some method calls on this in lamdas in Service Worker code.
        https://bugs.webkit.org/show_bug.cgi?id=182875

        Reviewed by Chris Dumez.

        This is necessary for the code to build with GCC 5. Other code already
        appears to have been adapted similarly.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):

2018-02-18  Reza Abbasian  <rabbasian@apple.com>

        Set the appropriate AutoFill context for suggested passwords.
        https://bugs.webkit.org/show_bug.cgi?id=182718
        <rdar://problem/36326863>

        Reviewed by Wenson Hsieh and Tim Horton.

        Before starting the input session, call the new delegate to query if AutoFill password suggestion assistance
        is required for the focused element.

        * UIProcess/API/Cocoa/_WKFormInputSession.h:
        * UIProcess/API/Cocoa/_WKInputDelegate.h:
        Introduce a new delegate to be called  before starting an input session to query if AutoFill password suggestion
        assistance is required for the focused element.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFormInputSession initWithContentView:focusedElementInfo:requiresStrongPasswordAssistance:]):
        (-[WKFormInputSession requiresStrongPasswordAssistance]):
        (-[WKContentView cleanupInteraction]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        Call the delegate to find out if AutoFill suggested password assistance is required.
        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView _autofillContext]): If the first responder is a password element and requires
        assistance for AutoFill suggested password, set the appropriate AutoFill context.
        (-[WKFormInputSession initWithContentView:focusedElementInfo:]): Deleted.

2018-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Form control values are stale after dismissing and representing input view controllers
        https://bugs.webkit.org/show_bug.cgi?id=182877
        <rdar://problem/37604395>

        Reviewed by Tim Horton.

        Currently, when presenting an input view controller for a focused element, we populate the initial form control
        value using the WKContentView's assisted node information when it was last focused. However, if the user edits
        the value of a form control, dismisses to the form control view controller (while the element is still focused)
        and then begins editing the field again, the initial text will be the previous value of the input, since the
        AssistedNodeInformation isn't up to date.

        To fix this, we introduce a mechanism to update WKContentView's AssistedNodeInformation for the current assisted
        node. This overwrites _assistedNodeInformation with new information computed from the web process, as long as
        the assisted node before and after the request is made in the UI process has not changed. We accomplish this by
        adding an identifier to AssistedNodeInformation, which is monotonically incremented when an element is focused
        in the web process. The UI process may then use this identifier to determine whether AssistedNodeInformations
        are describing the same focused element.

        One interesting consideration here is that a normal AssistedNodeInformation update (propagated when focusing an
        element) may be deferred in the UI process until the next layer tree commit. In the absence of the assisted node
        identifier check, one could imagine a scenario in which the assisted node information in the UI process gets
        "updated" from a new value to an old value:

        1. The web process focuses an element and sends AssistedNodeInformation `A`.
        2. WKContentView calls -updateCurrentAssistedNodeInformation.
        3. The web process sends AssistedNodeInformation `B`.
        4. `A` is received in the UI process, but deferred.
        5. The UI process receives `B` and sets _assistedNodeInformation to `B`.
        6. The UI process calls -_startAssistingNode: and sets _assistedNodeInformation to `A`.

        This would mean that the _assistedNodeInformation is set to an earlier value, `A`, after being set to a later
        value, `B`. However, because the AssistedNodeInformation identifier in step (2) refers to the assisted node
        prior to step (1), the assisted node identifier in (5) would not match this identifier, and we would simply bail
        instead of overwriting assisted node information.

        We use this AssistedNodeInformation update mechanism after inserting text via input view controllers, and also
        after reentering edit mode from the focused form control view controller. This fixes two issues where changing
        the size of the focused element after editing it results in the focused form overlay highlighting a stale frame,
        and also when setting the initial text when reentering edit mode for a form control that is already focused.

        * Shared/AssistedNodeInformation.cpp:
        (WebKit::AssistedNodeInformation::encode const):
        (WebKit::AssistedNodeInformation::decode):
        * Shared/AssistedNodeInformation.h:

        Add a new monotonically increasing identifier (per WebPage) which associates a AssistedNodeInformation with a
        focused element. In the event that the web process crashes and relaunches (thus resetting this identifier),
        AssistedNodeInformation state in the UI process is now also reset (see -cleanupInteraction), so we won't end up
        confusing AssistedNodeInformations computed by different WebPages between a web process crash.

        * UIProcess/WebPageProxy.h:

        A bit of related refactoring here to remove an unnecessary bool flag that indicates whether we have a deferred
        assisted node information. Instead, just use the presence of m_deferredNodeAssistanceArguments.

        * UIProcess/WebPageProxy.messages.in:

        Add a AssistedNodeInformationCallback IPC message.

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

        Clear out the previous AssistedNodeInformation. See above for details.

        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView updateCurrentAssistedNodeInformation:]):

        Tries to update AssistedNodeInformation for the current assisted node, invoking the completion callback when
        finished. This may result in the assisted node information not being updated due to the current assisted node
        changing in the time between the start of the request and the information being received in the UI process.

        (-[WKContentView presentViewControllerForCurrentAssistedNode]):

        Refactored from -presentViewControllerForAssistedNode:, such that it no longer takes an AssistedNodeInformation
        as an argument, but rather just uses WKContentView's current _assistedNodeInformation. This was just being
        called with _assistedNodeInformation from all call sites anyways.

        (-[WKContentView textInputController:didCommitText:]):

        Request an AssistedNodeInformation update after setting the value of a form control; if the assisted node hasn't
        changed, update the focused form control overlay. This is needed to handle cases where the focused element's
        frame may have changed after inserting text (e.g. due to line wrapping), and the focused form control overlay
        needs to be updated to reflect this change.

        (-[WKContentView focusedFormControlControllerDidBeginEditing:]):

        Request an AssistedNodeInformation update before reentering edit mode; if the assisted node hasn't changed since
        the start of the request, present the appropriate input view controller.

        (-[WKContentView presentViewControllerForAssistedNode:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::assistedNodeInformationCallback):
        (WebKit::WebPageProxy::requestAssistedNodeInformation):
        (WebKit::WebPageProxy::didCommitLayerTree):
        (WebKit::WebPageProxy::startAssistingNode):
        (WebKit::WebPageProxy::stopAssistingNode):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::elementDidFocus):

        Increment the assisted node identifier.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestAssistedNodeInformation):

        Compute and return an AssistedNodeInformation.

        (WebKit::WebPage::getAssistedNodeInformation):

2018-02-16  Dean Jackson  <dino@apple.com>

        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
        https://bugs.webkit.org/show_bug.cgi?id=182894

        Reviewed by Tim Horton.

        Rename OPENGL_ES_2 to OPENGL_ES.

        * CMakeLists.txt:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::paint):
        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::initializeEGL):

2018-02-16  Ryosuke Niwa  <rniwa@webkit.org>

        Add an entitlement check for service worker on iOS
        https://bugs.webkit.org/show_bug.cgi?id=182865
        <rdar://problem/37505903>

        Reviewed by Brady Eidson.

        Added an entitlement check to enable service workers on iOS.

        * Shared/mac/SandboxUtilities.h:
        * Shared/mac/SandboxUtilities.mm:
        (WebKit::connectedProcessHasEntitlement): Added.
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::createStorageToWebProcessConnection): Enforce the entitlement check by crashing
        when this code is executed without the parent process having the service worker entitlement. This should
        never happen unless someone is trying to bypass the entitlement check in UI Process since we ordinarily
        disable service worker gracefully in WKWebView _initializeWithConfiguration.
        (WebKit::StorageProcess::swServerForSession): Ditto.
        (WebKit::StorageProcess::registerSWServerConnection): Ditto.
        * StorageProcess/StorageProcess.h:
        (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
        * StorageProcess/ios/StorageProcessIOS.mm:
        (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]): Disable the service workers when the entitlement is
        missing from the current process. The entitlement is enforced by WebContent and Storage process.
        This check avoids crashing WebContent process and gracefully disabling the feature.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences): Enforce the entitlement check.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.

2018-02-16  Youenn Fablet  <youenn@apple.com>

        Allow specifying which plug-ins are supported
        https://bugs.webkit.org/show_bug.cgi?id=182748

        Reviewed by Chris Dumez.

        Add a C and ObjC API to set which plug-ins are specified.
        Plug-ins may be allowed by origin of the main page or for all origins.

        If the API to set a supported plug-in is called, WebKit enters a mode
        where it will block any plug-in that is not on the list.

        The list of supported plug-ins is stored in UIProcess and sent to WebProcess.
        This allows to compute the list of visible plug-ins according supported plugins.

        PluginInfoStore is storing the list of supported plugins and can
        answer whether a plug-in creation request is to be made unsupported or not.
        It also creates the structure sent to WebProcess for computing plugin visibility.

        Updated ArgumentCoders to accept modern HashSet decoders.

        * Platform/IPC/ArgumentCoders.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextAddSupportedPlugin):
        (WKContextClearSupportedPlugins):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::isSupportedPlugin):
        (WebKit::PluginInfoStore::SupportedPlugins::isSupported):
        (WebKit::PluginInfoStore::SupportedPlugin::isSupported):
        (WebKit::PluginInfoStore::supportedPluginNames):
        (WebKit::PluginInfoStore::addSupportedPlugin):
        * UIProcess/Plugins/PluginInfoStore.h:
        (WebKit::PluginInfoStore::clearSupportedPlugins):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findPlugin):
        (WebKit::WebPageProxy::unavailablePluginButtonClicked):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::addSupportedPlugin):
        (WebKit::WebProcessPool::clearSupportedPlugins):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getPlugins):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::getPluginInfo):
        (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
        (WebKit::WebPluginInfoProvider::populatePluginCache):
        * WebProcess/Plugins/WebPluginInfoProvider.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::createPlugin):
        (WebKit::WebPage::canPluginHandleResponse):

2018-02-16  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
        https://bugs.webkit.org/show_bug.cgi?id=182771
        <rdar://problem/36459988>

        Reviewed by Brent Fulgham.

        This patch utilizes LocalAuthentication Framework to determine if biometrics
        are enrolled on a device, which is the user verifying platform authenticator.
        To do so, it links the framework to WebKit.

        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
        (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
        (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
        * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
        (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
        (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
        (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
        * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:

2018-02-16  Per Arne Vollan  <pvollan@apple.com>

        Implement stopping of run loop in the WebContent process when using NSRunLoop.
        https://bugs.webkit.org/show_bug.cgi?id=182499
        <rdar://problem/37247424>

        Reviewed by Brent Fulgham.

        Add the method ChildProcess::stopNSRunLoop to end the WebContent process by executing a block
        with 'exit(0)' on the main run loop. 

        * Shared/ChildProcess.h:
        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::stopNSRunLoop):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::stopRunLoop):

2018-02-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCario] Add NetworkSessionCurl
        https://bugs.webkit.org/show_bug.cgi?id=182680

        Reviewed by Konstantin Tokarev.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::create):
        * PlatformWin.cmake:

2018-02-16  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
        https://bugs.webkit.org/show_bug.cgi?id=182054
        <rdar://problem/36871207>

        Reviewed by Brady Eidson.

        Pipe postMessage messages to and from service workers via the UIProcess instead of going
        directly to the StorageProcess. This is temporarily needed to avoid races due to the
        MessagePort registry currently living in the UIProcess and postMessage messages potentially
        sending MessagePort objects.

        This change is covered by tests on the bots that currently flakily crash in debug.

        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::postMessageToServiceWorker):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::postMessageToServiceWorkerClient):
        (WebKit::WebProcessPool::postMessageToServiceWorker):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessPool.messages.in:
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::postMessageToServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):

2018-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
        https://bugs.webkit.org/show_bug.cgi?id=182847
        <rdar://problem/35143111>

        Reviewed by Tim Horton.

        Add support for presenting date pickers when focusing a date input.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView dismissAllInputViewControllers]):

        Pull logic to dismiss input view controllers into a single helper.

        (-[WKContentView presentDatePickerViewController:]):
        (-[WKContentView dismissDatePickerViewController:]):
        (-[WKContentView presentViewControllerForAssistedNode:]):
        (-[WKContentView textInputController:didCommitText:]):
        (-[WKContentView _wheelChangedWithEvent:]):

        Delegate wheel events to the date picker.

        * UIProcess/ios/forms/WKDatePickerViewController.h: Added.
        * UIProcess/ios/forms/WKDatePickerViewController.mm: Added.

        Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.

        * WebKit.xcodeproj/project.pbxproj:

2018-02-15  Youenn Fablet  <youenn@apple.com>

        Resources loaded from service workers are not downloadable
        https://bugs.webkit.org/show_bug.cgi?id=182848

        Reviewed by Chris Dumez.

        Downloads are not supporting resources loaded through service worker.
        As a temporary solution, we will let network process handle it.
        Note that this would not work if the URL can only be loaded through service worker.
        Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to
        text/html as we do not support mime sniffing yet from service worker responses.
        This might interfere with automatic downloads from navigation.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):

2018-02-15  Megan Gardner  <megan_gardner@apple.com>

        Support scrolling for non-editable web-selection and start autoscroll when near screen edges
        https://bugs.webkit.org/show_bug.cgi?id=182815

        Add support for autoscrolling during a selection. This also takes into account the edges of the screen
        and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds
        of the WebView.

        Reviewed by Tim Horton.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView startAutoscroll:]):
        (-[WKContentView resignFirstResponderForWebView]):
        (-[WKContentView useSelectionAssistantWithGranularity:]):
        (-[WKContentView selectedTextRange]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::startAutoscrollAtPosition):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::startAutoscrollAtPosition):
        (WebKit::WebPage::cancelAutoscroll):

2018-02-15  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
        https://bugs.webkit.org/show_bug.cgi?id=182812
        <rdar://problem/37511406>

        Reviewed by Brent Fulgham.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
            Now does the following:
            - Logs when there is a model version mismatch.
            - Does not ingest statistics if the version on disk is newer than the supported one.
            - Does ingest statistics if the version on disk is older than the supported one.
            - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().

2018-02-15  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
        https://bugs.webkit.org/show_bug.cgi?id=181946
        <rdar://problem/37258262>

        Reviewed by Chris Dumez.

        Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
        a message exchange channel between UIProcess and WebProcess.

        * DerivedSources.make:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
        (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues):
        (WebKit::WebPageProxy::reattachToWebProcess):
        (WebKit::WebPageProxy::resetState):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
        (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
        (WebKit::WebCredentialsMessenger::makeCredential):
        (WebKit::WebCredentialsMessenger::getAssertion):
        (WebKit::WebCredentialsMessenger::makeCredentialReply):
        (WebKit::WebCredentialsMessenger::getAssertionReply):
        * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::m_cpuLimit): Deleted.
        * WebProcess/WebPage/WebPage.h:

2018-02-15  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Unify build of platform-specific files in WebKit layer
        https://bugs.webkit.org/show_bug.cgi?id=182696

        Reviewed by Žan Doberšek.

        This is easy, because all needed changes were made in the previously-landed patch.

        * CMakeLists.txt:
        * PlatformWPE.cmake:

2018-02-15  Don Olmstead  <don.olmstead@sony.com>

        WebCore headers should not be included relatively within dependent projects
        https://bugs.webkit.org/show_bug.cgi?id=182805

        Reviewed by Chris Dumez.

        * NetworkProcess/capture/NetworkCaptureManager.cpp:
        * NetworkProcess/webrtc/NetworkRTCMonitor.h:
        * Shared/gtk/WebEventFactory.cpp:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:

2018-02-15  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r228495.

        This caused mulitple perf tests to fail consistently.

        Reverted changeset:

        "Resource Load Statistics: Make sure
        WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
        ingest older plist versions and not reset the database"
        https://bugs.webkit.org/show_bug.cgi?id=182812
        https://trac.webkit.org/changeset/228495

2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>

        Default definition of InjectedBundle::PlatformBundle should not be Windows-specific.
        https://bugs.webkit.org/show_bug.cgi?id=182810

        Reviewed by Michael Catanzaro.

        This branch was added in r228455, but should not be limited to OS(WINDOWS).

        * WebProcess/InjectedBundle/InjectedBundle.h:

2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>

        Default implementations of nativeEvent() should be platform-agnostic.
        https://bugs.webkit.org/show_bug.cgi?id=182806

        Reviewed by Darin Adler.

        * Shared/NativeWebKeyboardEvent.h:
        * Shared/NativeWebMouseEvent.h:
        * Shared/NativeWebWheelEvent.h:

2018-02-14  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
        https://bugs.webkit.org/show_bug.cgi?id=182812
        <rdar://problem/37511406>

        Reviewed by Brent Fulgham.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
            Now does the following:
            - Logs when there is a model version mismatch.
            - Does not ingest statistics if the version on disk is newer than the supported one.
            - Does ingest statistics if the version on disk is older than the supported one.
            - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().

2018-02-14  Daniel Bates  <dabates@apple.com>

        Disallow cross-origin subresources from asking for credentials
        https://bugs.webkit.org/show_bug.cgi?id=182579
        <rdar://problem/36162271>

        Reviewed by Andy Estes.

        Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
        WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.

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

2018-02-14  John Wilander  <wilander@apple.com>

        Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
        https://bugs.webkit.org/show_bug.cgi?id=182797
        <rdar://problem/37540594>

        Reviewed by Tim Horton.

        This capture was added in r228455 and causes a build failure when
        run with -Wunused-lambda-capture. Xcode also warns about it.

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

2018-02-14  Ryosuke Niwa  <rniwa@webkit.org>

        EventDispatcher::wheelEvent uses a wrong enum values in switch
        https://bugs.webkit.org/show_bug.cgi?id=182796

        Reviewed by Chris Dumez.

        EventDispatcher::wheelEvent is using PlatformWheelEventPhaseBegan and PlatformWheelEventPhaseEnded
        but the enum type of wheelEvent.phase() is WebWheelEvent::Phase.

        The enum values are indentical for both so there is no behavioral change.

        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):

2018-02-14  Maureen Daum  <mdaum@apple.com>

        Add C SPI for support of Website Data Store in Website Policies
        https://bugs.webkit.org/show_bug.cgi?id=182698
        <rdar://problem/37412008>

        Reviewed by Andy Estes.

        Expand the API added for _WKWebsitePolicies.websiteDataStore in r225989 and r226325
        to be available in the C API. In the ObjC API, we handle setting the website data
        store in NavigationState::NavigationClient::decidePolicyForNavigationAction. There
        we throw an exception if setting the website data store isn't supported, and then
        change the website data store. The equivalent place to do this work in the C API is
        in WKFramePolicyListenerUseWithPolicies. However, instead of throwing exceptions,
        release asserts are used.

        * UIProcess/API/C/WKFramePolicyListener.cpp:
        (WKFramePolicyListenerUseWithPolicies):
        If the website policies data contains a website data store, do the same checks that
        are done in NavigationState::NavigationClient::decidePolicyForNavigationAction. Namely,
        that it is a valid website data store and it is a policy decision for a main frame navigation.
        If these checks are met, change the website data store.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageUpdateWebsitePolicies):
        * UIProcess/API/C/WKWebsitePolicies.cpp:
        (WKWebsitePoliciesGetDataStore):
        (WKWebsitePoliciesSetDataStore):
        * UIProcess/API/C/WKWebsitePolicies.h:
        * UIProcess/WebFrameListenerProxy.cpp:
        (WebKit::WebFrameListenerProxy::changeWebsiteDataStore):
        (WebKit::WebFrameListenerProxy::isMainFrame):
        Expose whether the frame proxy is for a main frame, which is required to verify that
        website policies only specify a website data store for main frame policy decisions.
        * UIProcess/WebFrameListenerProxy.h:
        * UIProcess/WebFramePolicyListenerProxy.cpp:
        * UIProcess/WebFrameProxy.cpp:
        (WebKit::WebFrameProxy::changeWebsiteDataStore):
        * UIProcess/WebFrameProxy.h:

2018-02-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r228444.

        Introduced API and Layout test failures.

        Reverted changeset:

        "[WebAuthN] Revisit the whole async model of task dispatching,
        timeout and aborting"
        https://bugs.webkit.org/show_bug.cgi?id=181946
        https://trac.webkit.org/changeset/228444

2018-02-13  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
        https://bugs.webkit.org/show_bug.cgi?id=182679

        Reviewed by Michael Catanzaro.

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        (WebKit::NetworkCache::BlobStorage::add):
        * NetworkProcess/cache/NetworkCacheData.cpp:
        (WebKit::NetworkCache::Data::mapToFile const):
        (WebKit::NetworkCache::mapFile):
        (WebKit::NetworkCache::adoptAndMapFile):
        (WebKit::NetworkCache::readOrMakeSalt):
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::directoryEntryType):
        (WebKit::NetworkCache::traverseDirectory):
        (WebKit::NetworkCache::fileTimes):
        (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::traverse):
        * NetworkProcess/win/SystemProxyWin.h:
        * Platform/IPC/Attachment.h:
        * Platform/Module.h:
        * Platform/SharedMemory.h:
        * PluginProcess/WebProcessConnection.cpp:
        * Shared/API/c/WKBase.h:
        * Shared/ChildProcess.cpp:
        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/ProcessAssertion.h:
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/WebProcess.cpp:

2018-02-13  Commit Queue  <commit-queue@webkit.org>

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

        Regressed CMake build stability (Requested by dolmstead on
        #webkit).

        Reverted changeset:

        "[CMake] Make WebCore headers copies"
        https://bugs.webkit.org/show_bug.cgi?id=182512
        https://trac.webkit.org/changeset/228431

2018-02-13  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
        https://bugs.webkit.org/show_bug.cgi?id=181946
        <rdar://problem/37258262>

        Reviewed by Chris Dumez.

        Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
        a message exchange channel between UIProcess and WebProcess.

        * DerivedSources.make:
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
        (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
        (WebKit::WebCredentialsMessengerProxy::makeCredential):
        (WebKit::WebCredentialsMessengerProxy::getAssertion):
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues):
        (WebKit::WebPageProxy::reattachToWebProcess):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
        (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
        (WebKit::WebCredentialsMessenger::makeCredential):
        (WebKit::WebCredentialsMessenger::getAssertion):
        (WebKit::WebCredentialsMessenger::makeCredentialReply):
        (WebKit::WebCredentialsMessenger::getAssertionReply):
        * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
        * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_credentialsMessenger):
        (WebKit::m_cpuLimit): Deleted.
        * WebProcess/WebPage/WebPage.h:

2018-02-13  Youenn Fablet  <youenn@apple.com>

        Add support for configuring WebsiteDatastore service worker and cache storage path
        https://bugs.webkit.org/show_bug.cgi?id=182674

        Reviewed by Chris Dumez.

        Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore
        service worker registration and cache storage directory path.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _initWithConfiguration:]):
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
        (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
        (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
        (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):

2018-02-13  Brian Burg  <bburg@apple.com>

        Web Automation: don't return an error if resizing/moving a window has no effect
        https://bugs.webkit.org/show_bug.cgi?id=182742

        Reviewed by Tim Horton.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
        (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
        Unify the behavior for all ports. Don't raise an error if the command was
        idempotent (by mistake or not). It should not be an error to re-maximize a window.

2018-02-13  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Make WebCore headers copies
        https://bugs.webkit.org/show_bug.cgi?id=182512

        Reviewed by Keith Miller.

        * CMakeLists.txt:
        * NetworkProcess/capture/NetworkCaptureManager.cpp:
        * NetworkProcess/webrtc/NetworkRTCMonitor.h:
        * PlatformWPE.cmake:
        * Scripts/generate-forwarding-headers.pl:
        * Shared/gtk/WebEventFactory.cpp:
        * UIProcess/API/gtk/PageClientImpl.cpp:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        * WebProcess/WebPage/wpe/WebPageWPE.cpp:

2018-02-13  Brent Fulgham  <bfulgham@apple.com>

        [iOS] whitelist iokit-get-properties
        https://bugs.webkit.org/show_bug.cgi?id=182722
        <rdar://problem/30929165>

        Reviewed by Eric Carlson.

        Update the iOS sandbox to block access to IOKit properties that are not needed for
        legitimate WebContent process use. This brings the iOS sandbox in line with the
        work done under macOS.

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

2018-02-12  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
        https://bugs.webkit.org/show_bug.cgi?id=182664
        <rdar://problem/37372572>

        Reviewed by Brent Fulgham.

        * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
        (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
            Unique top frame redirects now counts toward classification as prevalent.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
        (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
        (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
        (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
            Test infrastructure.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
            Bumped the statistics model to 11 because of the added fields.
        (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
            This function back traces redirect chains to classify domains
            that have redirected to a newly classified prevalent resource.
        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
            Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
        (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
            New convenience function to make sure we always call
            WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
            and capture redirect chains backward.
        (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
            Test infrastructure.
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-02-12  Antti Koivisto  <antti@apple.com>

        Update NetworkCache::Storage::lastStableVersion after r226349
        https://bugs.webkit.org/show_bug.cgi?id=182723
        <rdar://problem/37469554>
        
        Reviewed by Ryosuke Niwa.

        * NetworkProcess/cache/NetworkCacheStorage.h:

        Allow deleting version 11 caches.

2018-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Add support for <input type='time'> using time picker UI
        https://bugs.webkit.org/show_bug.cgi?id=182683
        <rdar://problem/35143162>

        Reviewed by Tim Horton.

        Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView presentTimePickerViewController:]):
        (-[WKContentView dismissTimePickerViewController:]):

        Add helpers to dismiss and present the time picker view controller.

        (-[WKContentView presentViewControllerForAssistedNode:]):

        When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
        input view controller as a fallback when the other input view controllers (number pads, select menus and time
        pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
        currently unsupported.

        (-[WKContentView textInputController:didCommitText:]):
        (-[WKContentView textInputControllerDidRequestDismissal:]):

        Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.

        (-[WKContentView actionNameForFocusedFormControlController:]):

        Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
        currently doesn't work for these form controls because it relies on implicit form submission; this should be
        fixed by future changes, after which we should revert this adjustment.

        (-[WKContentView _wheelChangedWithEvent:]):

        Delegate wheel events to the time picker if needed.

        (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.

        Renamed to -textInputControllerDidRequestDismissal:.

        * UIProcess/ios/forms/WKTimePickerViewController.h: Added.
        * UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-02-11  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Unify builds for platform-specific files in WebKit layer
        https://bugs.webkit.org/show_bug.cgi?id=182450

        Reviewed by Carlos Garcia Campos.

        Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
        API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
        conflicts in headers, which appears difficult to fix, are also exempted.

        * CMakeLists.txt:
        * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
        * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
        * PlatformGTK.cmake:
        * PluginProcess/unix/PluginControllerProxyUnix.cpp:
        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
        * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
        * Shared/Plugins/unix/PluginSearchPath.cpp:
        * Shared/cairo/ShareableBitmapCairo.cpp:
        * Shared/glib/WebContextMenuItemGlib.cpp:
        * Shared/glib/WebErrorsGlib.cpp:
        * Shared/gtk/ArgumentCodersGtk.cpp:
        * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
        * Shared/gtk/ProcessExecutablePathGtk.cpp:
        * Shared/gtk/WebErrorsGtk.cpp:
        * Shared/gtk/WebEventFactory.cpp:
        * Shared/linux/WebMemorySamplerLinux.cpp:
        * Shared/soup/WebCoreArgumentCodersSoup.cpp:
        * Shared/soup/WebErrorsSoup.cpp:
        * SourcesGTK.txt: Added.
        * UIProcess/AcceleratedDrawingAreaProxy.cpp:
        * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        * UIProcess/BackingStore.cpp:
        * UIProcess/DrawingAreaProxyImpl.cpp:
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
        * UIProcess/WebStorage/StorageManager.cpp:
        * UIProcess/cairo/BackingStoreCairo.cpp:
        * UIProcess/gtk/AcceleratedBackingStore.cpp:
        * UIProcess/gtk/DragAndDropHandler.cpp:
        * UIProcess/gtk/GestureController.cpp:
        * UIProcess/gtk/HardwareAccelerationManager.cpp:
        * UIProcess/gtk/InputMethodFilter.cpp:
        * UIProcess/gtk/TextCheckerGtk.cpp:
        * UIProcess/gtk/WaylandCompositor.cpp:
        * UIProcess/gtk/WebColorPickerGtk.cpp:
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
        (webkit_dom_attr_dom_event_target_init):
        (webkit_dom_attr_set_property):
        (webkit_dom_attr_get_property):
        (webkit_dom_attr_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
        (webkit_dom_cdata_section_dom_event_target_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
        (webkit_dom_css_rule_set_property):
        (webkit_dom_css_rule_get_property):
        (webkit_dom_css_rule_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
        (webkit_dom_css_rule_list_get_property):
        (webkit_dom_css_rule_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
        (webkit_dom_css_style_declaration_set_property):
        (webkit_dom_css_style_declaration_get_property):
        (webkit_dom_css_style_declaration_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
        (webkit_dom_css_style_sheet_get_property):
        (webkit_dom_css_style_sheet_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
        (webkit_dom_css_value_set_property):
        (webkit_dom_css_value_get_property):
        (webkit_dom_css_value_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
        (webkit_dom_character_data_dom_event_target_init):
        (webkit_dom_character_data_set_property):
        (webkit_dom_character_data_get_property):
        (webkit_dom_character_data_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
        (webkit_dom_client_rect_get_property):
        (webkit_dom_client_rect_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
        (webkit_dom_client_rect_list_get_property):
        (webkit_dom_client_rect_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
        (webkit_dom_comment_dom_event_target_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
        (webkit_dom_dom_selection_get_property):
        (webkit_dom_dom_selection_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
        (webkit_dom_dom_token_list_set_property):
        (webkit_dom_dom_token_list_get_property):
        (webkit_dom_dom_token_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
        (webkit_dom_dom_window_dom_event_target_init):
        (webkit_dom_dom_window_set_property):
        (webkit_dom_dom_window_get_property):
        (webkit_dom_dom_window_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
        (webkit_dom_document_dom_event_target_init):
        (webkit_dom_document_set_property):
        (webkit_dom_document_get_property):
        (webkit_dom_document_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
        (webkit_dom_document_fragment_dom_event_target_init):
        (webkit_dom_document_fragment_get_property):
        (webkit_dom_document_fragment_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
        (webkit_dom_document_type_dom_event_target_init):
        (webkit_dom_document_type_get_property):
        (webkit_dom_document_type_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
        (webkit_dom_element_dom_event_target_init):
        (webkit_dom_element_set_property):
        (webkit_dom_element_get_property):
        (webkit_dom_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
        (webkit_dom_event_set_property):
        (webkit_dom_event_get_property):
        (webkit_dom_event_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
        (webkit_dom_file_get_property):
        (webkit_dom_file_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
        (webkit_dom_file_list_get_property):
        (webkit_dom_file_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
        (webkit_dom_html_anchor_element_dom_event_target_init):
        (webkit_dom_html_anchor_element_set_property):
        (webkit_dom_html_anchor_element_get_property):
        (webkit_dom_html_anchor_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
        (webkit_dom_html_applet_element_dom_event_target_init):
        (webkit_dom_html_applet_element_set_property):
        (webkit_dom_html_applet_element_get_property):
        (webkit_dom_html_applet_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
        (webkit_dom_html_area_element_dom_event_target_init):
        (webkit_dom_html_area_element_set_property):
        (webkit_dom_html_area_element_get_property):
        (webkit_dom_html_area_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
        (webkit_dom_html_br_element_dom_event_target_init):
        (webkit_dom_html_br_element_set_property):
        (webkit_dom_html_br_element_get_property):
        (webkit_dom_html_br_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
        (webkit_dom_html_base_element_dom_event_target_init):
        (webkit_dom_html_base_element_set_property):
        (webkit_dom_html_base_element_get_property):
        (webkit_dom_html_base_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
        (webkit_dom_html_body_element_dom_event_target_init):
        (webkit_dom_html_body_element_set_property):
        (webkit_dom_html_body_element_get_property):
        (webkit_dom_html_body_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
        (webkit_dom_html_button_element_dom_event_target_init):
        (webkit_dom_html_button_element_set_property):
        (webkit_dom_html_button_element_get_property):
        (webkit_dom_html_button_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
        (webkit_dom_html_canvas_element_dom_event_target_init):
        (webkit_dom_html_canvas_element_set_property):
        (webkit_dom_html_canvas_element_get_property):
        (webkit_dom_html_canvas_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
        (webkit_dom_html_collection_get_property):
        (webkit_dom_html_collection_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
        (webkit_dom_html_d_list_element_dom_event_target_init):
        (webkit_dom_html_d_list_element_set_property):
        (webkit_dom_html_d_list_element_get_property):
        (webkit_dom_html_d_list_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
        (webkit_dom_html_directory_element_dom_event_target_init):
        (webkit_dom_html_directory_element_set_property):
        (webkit_dom_html_directory_element_get_property):
        (webkit_dom_html_directory_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
        (webkit_dom_html_div_element_dom_event_target_init):
        (webkit_dom_html_div_element_set_property):
        (webkit_dom_html_div_element_get_property):
        (webkit_dom_html_div_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
        (webkit_dom_html_document_dom_event_target_init):
        (webkit_dom_html_document_set_property):
        (webkit_dom_html_document_get_property):
        (webkit_dom_html_document_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
        (webkit_dom_html_element_dom_event_target_init):
        (webkit_dom_html_element_set_property):
        (webkit_dom_html_element_get_property):
        (webkit_dom_html_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
        (webkit_dom_html_embed_element_dom_event_target_init):
        (webkit_dom_html_embed_element_set_property):
        (webkit_dom_html_embed_element_get_property):
        (webkit_dom_html_embed_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
        (webkit_dom_html_field_set_element_dom_event_target_init):
        (webkit_dom_html_field_set_element_get_property):
        (webkit_dom_html_field_set_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
        (webkit_dom_html_font_element_dom_event_target_init):
        (webkit_dom_html_font_element_set_property):
        (webkit_dom_html_font_element_get_property):
        (webkit_dom_html_font_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
        (webkit_dom_html_form_element_dom_event_target_init):
        (webkit_dom_html_form_element_set_property):
        (webkit_dom_html_form_element_get_property):
        (webkit_dom_html_form_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
        (webkit_dom_html_frame_element_dom_event_target_init):
        (webkit_dom_html_frame_element_set_property):
        (webkit_dom_html_frame_element_get_property):
        (webkit_dom_html_frame_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
        (webkit_dom_html_frame_set_element_dom_event_target_init):
        (webkit_dom_html_frame_set_element_set_property):
        (webkit_dom_html_frame_set_element_get_property):
        (webkit_dom_html_frame_set_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
        (webkit_dom_html_hr_element_dom_event_target_init):
        (webkit_dom_html_hr_element_set_property):
        (webkit_dom_html_hr_element_get_property):
        (webkit_dom_html_hr_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
        (webkit_dom_html_head_element_dom_event_target_init):
        (webkit_dom_html_head_element_set_property):
        (webkit_dom_html_head_element_get_property):
        (webkit_dom_html_head_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
        (webkit_dom_html_heading_element_dom_event_target_init):
        (webkit_dom_html_heading_element_set_property):
        (webkit_dom_html_heading_element_get_property):
        (webkit_dom_html_heading_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
        (webkit_dom_html_html_element_dom_event_target_init):
        (webkit_dom_html_html_element_set_property):
        (webkit_dom_html_html_element_get_property):
        (webkit_dom_html_html_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
        (webkit_dom_html_iframe_element_dom_event_target_init):
        (webkit_dom_html_iframe_element_set_property):
        (webkit_dom_html_iframe_element_get_property):
        (webkit_dom_html_iframe_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
        (webkit_dom_html_image_element_dom_event_target_init):
        (webkit_dom_html_image_element_set_property):
        (webkit_dom_html_image_element_get_property):
        (webkit_dom_html_image_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
        (webkit_dom_html_input_element_dom_event_target_init):
        (webkit_dom_html_input_element_set_property):
        (webkit_dom_html_input_element_get_property):
        (webkit_dom_html_input_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
        (webkit_dom_html_li_element_dom_event_target_init):
        (webkit_dom_html_li_element_set_property):
        (webkit_dom_html_li_element_get_property):
        (webkit_dom_html_li_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
        (webkit_dom_html_label_element_dom_event_target_init):
        (webkit_dom_html_label_element_set_property):
        (webkit_dom_html_label_element_get_property):
        (webkit_dom_html_label_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
        (webkit_dom_html_legend_element_dom_event_target_init):
        (webkit_dom_html_legend_element_set_property):
        (webkit_dom_html_legend_element_get_property):
        (webkit_dom_html_legend_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
        (webkit_dom_html_link_element_dom_event_target_init):
        (webkit_dom_html_link_element_set_property):
        (webkit_dom_html_link_element_get_property):
        (webkit_dom_html_link_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
        (webkit_dom_html_map_element_dom_event_target_init):
        (webkit_dom_html_map_element_set_property):
        (webkit_dom_html_map_element_get_property):
        (webkit_dom_html_map_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
        (webkit_dom_html_marquee_element_dom_event_target_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
        (webkit_dom_html_menu_element_dom_event_target_init):
        (webkit_dom_html_menu_element_set_property):
        (webkit_dom_html_menu_element_get_property):
        (webkit_dom_html_menu_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
        (webkit_dom_html_meta_element_dom_event_target_init):
        (webkit_dom_html_meta_element_set_property):
        (webkit_dom_html_meta_element_get_property):
        (webkit_dom_html_meta_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
        (webkit_dom_html_mod_element_dom_event_target_init):
        (webkit_dom_html_mod_element_set_property):
        (webkit_dom_html_mod_element_get_property):
        (webkit_dom_html_mod_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
        (webkit_dom_html_o_list_element_dom_event_target_init):
        (webkit_dom_html_o_list_element_set_property):
        (webkit_dom_html_o_list_element_get_property):
        (webkit_dom_html_o_list_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
        (webkit_dom_html_object_element_dom_event_target_init):
        (webkit_dom_html_object_element_set_property):
        (webkit_dom_html_object_element_get_property):
        (webkit_dom_html_object_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
        (webkit_dom_html_opt_group_element_dom_event_target_init):
        (webkit_dom_html_opt_group_element_set_property):
        (webkit_dom_html_opt_group_element_get_property):
        (webkit_dom_html_opt_group_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
        (webkit_dom_html_option_element_dom_event_target_init):
        (webkit_dom_html_option_element_set_property):
        (webkit_dom_html_option_element_get_property):
        (webkit_dom_html_option_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
        (webkit_dom_html_options_collection_set_property):
        (webkit_dom_html_options_collection_get_property):
        (webkit_dom_html_options_collection_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
        (webkit_dom_html_paragraph_element_dom_event_target_init):
        (webkit_dom_html_paragraph_element_set_property):
        (webkit_dom_html_paragraph_element_get_property):
        (webkit_dom_html_paragraph_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
        (webkit_dom_html_param_element_dom_event_target_init):
        (webkit_dom_html_param_element_set_property):
        (webkit_dom_html_param_element_get_property):
        (webkit_dom_html_param_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
        (webkit_dom_html_pre_element_dom_event_target_init):
        (webkit_dom_html_pre_element_set_property):
        (webkit_dom_html_pre_element_get_property):
        (webkit_dom_html_pre_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
        (webkit_dom_html_quote_element_dom_event_target_init):
        (webkit_dom_html_quote_element_set_property):
        (webkit_dom_html_quote_element_get_property):
        (webkit_dom_html_quote_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
        (webkit_dom_html_script_element_dom_event_target_init):
        (webkit_dom_html_script_element_set_property):
        (webkit_dom_html_script_element_get_property):
        (webkit_dom_html_script_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
        (webkit_dom_html_select_element_dom_event_target_init):
        (webkit_dom_html_select_element_set_property):
        (webkit_dom_html_select_element_get_property):
        (webkit_dom_html_select_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
        (webkit_dom_html_style_element_dom_event_target_init):
        (webkit_dom_html_style_element_set_property):
        (webkit_dom_html_style_element_get_property):
        (webkit_dom_html_style_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
        (webkit_dom_html_table_caption_element_dom_event_target_init):
        (webkit_dom_html_table_caption_element_set_property):
        (webkit_dom_html_table_caption_element_get_property):
        (webkit_dom_html_table_caption_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
        (webkit_dom_html_table_cell_element_dom_event_target_init):
        (webkit_dom_html_table_cell_element_set_property):
        (webkit_dom_html_table_cell_element_get_property):
        (webkit_dom_html_table_cell_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
        (webkit_dom_html_table_col_element_dom_event_target_init):
        (webkit_dom_html_table_col_element_set_property):
        (webkit_dom_html_table_col_element_get_property):
        (webkit_dom_html_table_col_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
        (webkit_dom_html_table_element_dom_event_target_init):
        (webkit_dom_html_table_element_set_property):
        (webkit_dom_html_table_element_get_property):
        (webkit_dom_html_table_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
        (webkit_dom_html_table_row_element_dom_event_target_init):
        (webkit_dom_html_table_row_element_set_property):
        (webkit_dom_html_table_row_element_get_property):
        (webkit_dom_html_table_row_element_class_init):
        (webkit_dom_html_table_row_element_insert_cell):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
        (webkit_dom_html_table_section_element_dom_event_target_init):
        (webkit_dom_html_table_section_element_set_property):
        (webkit_dom_html_table_section_element_get_property):
        (webkit_dom_html_table_section_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
        (webkit_dom_html_text_area_element_dom_event_target_init):
        (webkit_dom_html_text_area_element_set_property):
        (webkit_dom_html_text_area_element_get_property):
        (webkit_dom_html_text_area_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
        (webkit_dom_html_title_element_dom_event_target_init):
        (webkit_dom_html_title_element_set_property):
        (webkit_dom_html_title_element_get_property):
        (webkit_dom_html_title_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
        (webkit_dom_html_u_list_element_dom_event_target_init):
        (webkit_dom_html_u_list_element_set_property):
        (webkit_dom_html_u_list_element_get_property):
        (webkit_dom_html_u_list_element_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
        (webkit_dom_keyboard_event_get_property):
        (webkit_dom_keyboard_event_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
        (webkit_dom_media_list_set_property):
        (webkit_dom_media_list_get_property):
        (webkit_dom_media_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
        (webkit_dom_mouse_event_get_property):
        (webkit_dom_mouse_event_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
        (webkit_dom_named_node_map_get_property):
        (webkit_dom_named_node_map_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
        (webkit_dom_node_dom_event_target_init):
        (webkit_dom_node_set_property):
        (webkit_dom_node_get_property):
        (webkit_dom_node_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
        (webkit_dom_node_iterator_get_property):
        (webkit_dom_node_iterator_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
        (webkit_dom_node_list_get_property):
        (webkit_dom_node_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp:
        (webkitDOMObjectSetProperty):
        (webkit_dom_object_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
        (webkit_dom_processing_instruction_dom_event_target_init):
        (webkit_dom_processing_instruction_get_property):
        (webkit_dom_processing_instruction_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
        (webkit_dom_range_get_property):
        (webkit_dom_range_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
        (webkit_dom_style_sheet_set_property):
        (webkit_dom_style_sheet_get_property):
        (webkit_dom_style_sheet_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
        (webkit_dom_style_sheet_list_get_property):
        (webkit_dom_style_sheet_list_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
        (webkit_dom_text_dom_event_target_init):
        (webkit_dom_text_get_property):
        (webkit_dom_text_class_init):
        (webkit_dom_event_target_init): Deleted.
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
        (webkit_dom_tree_walker_get_property):
        (webkit_dom_tree_walker_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
        (webkit_dom_ui_event_get_property):
        (webkit_dom_ui_event_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
        (webkit_dom_wheel_event_get_property):
        (webkit_dom_wheel_event_class_init):
        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
        (webkit_dom_xpath_result_get_property):
        (webkit_dom_xpath_result_class_init):
        * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
        * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
        * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
        * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
        * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp:
        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp:
        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
        * WebProcess/WebPage/AcceleratedSurface.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
        * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
        * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
        * WebProcess/gtk/WaylandCompositorDisplay.cpp:
        * WebProcess/gtk/WebProcessMainGtk.cpp:

2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: addCookie command should prepend a dot to domain if missing
        https://bugs.webkit.org/show_bug.cgi?id=182328
        <rdar://problem/37116398>

        Reviewed by Michael Catanzaro.

        RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

        Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):

2018-02-11  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Add WKBaseWin.h
        https://bugs.webkit.org/show_bug.cgi?id=182681

        Reviewed by Yusuke Suzuki.

        * PlatformWin.cmake:
        * Shared/API/c/win/WKBaseWin.h: Added.

2018-02-09  Ross Kirsling  <ross.kirsling@sony.com>

        Remove invalidated WebPage::handleEditingKeyboardEvent default implementation after r228260.
        https://bugs.webkit.org/show_bug.cgi?id=182663

        Reviewed by Chris Dumez.

        This would need to be updated to turn `keyEvent` into `underlyingPlatformEvent`;
        instead, we can remove it, as it's only for Windows, which doesn't yet support WK2.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::handleEditingKeyboardEvent): Deleted.

2018-02-09  Nan Wang  <n_wang@apple.com>

        AX: Accessibility is not notified when a web process cancels the suspension
        https://bugs.webkit.org/show_bug.cgi?id=182659

        Reviewed by Ryosuke Niwa.

        We were notifying Accessibility with the web process suspended information in actualPrepareToSuspend
        and processDidResume. However, the suspension can be canceled during the prepare call. So that we
        should also post a notification in cancelPrepareToSuspend.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::cancelPrepareToSuspend):

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

        Sandbox violating attempting to read log formatting preference file
        https://bugs.webkit.org/show_bug.cgi?id=182648
        <rdar://problem/36629495>

        Reviewed by Eric Carlson.

        Various frameworks attempt to read logging format information from /usr/local/lib/log. The sandbox is blocking
        this, generating log spam and preventing some logging features from working properly. We should allow read
        access to this path.

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

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

        There should be a way to disable [OverrideBuiltins] behavior in a given DOMWrapperWorld
        https://bugs.webkit.org/show_bug.cgi?id=182524
        <rdar://problem/9057327>

        Reviewed by Ryosuke Niwa.

        Add C API on WKBundleScriptWorld and Cocoa API on WKWebProcessPlugInScriptWorld to
        disable the [OverrideBuiltins] behavior on a given script world.

        The [OverrideBuiltins] behavior [1] is legacy behavior that is needed for Web compatibility
        but allowing the client to disable this behavior in a given world makes development easier
        and running injected script on uncontrolled content a lot more reliable.

        [1] https://heycam.github.io/webidl/#OverrideBuiltins

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
        (-[WKWebProcessPlugInScriptWorld disableOverrideBuiltinsBehavior]):
        * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
        (WKBundleScriptWorldDisableOverrideBuiltinsBehavior):
        * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h:
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
        (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior):
        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:

2018-02-08  Ross Kirsling  <ross.kirsling@sony.com>

        Remove WebProcessPool::platformInitialize stub.
        https://bugs.webkit.org/show_bug.cgi?id=182621

        Reviewed by Alex Christensen.

        The #if here could be simplified to PLATFORM(WIN), but Windows too will need a proper implementation
        as part of WK2 support, so this stub shouldn't need to exist at all.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::platformInitialize): Deleted.

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

        TestController should not exercise cocoa-specific resource load statistics APIs
        https://bugs.webkit.org/show_bug.cgi?id=182355

        Reviewed by Alex Christensen.

        Remove the Cocoa testing SPI, since it's redundant with the C API. Also, add a couple
        missing cookie partitioning callbacks to the C API.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsPrevalentResource:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetHadUserInteraction:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetIsGrandfathered:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubframeUnderTopFrameOrigin:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUnderTopFrameOrigin:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetSubresourceUniqueRedirectTo:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveUserInteraction:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetTimeToLiveCookiePartitionFree:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetMinimumTimeBetweenDataRecordsRemoval:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetGrandfatheringTime:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenDataRecordsWereScanned:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldClassifyResourcesBeforeDataRecordsRemoval:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetNotifyPagesWhenTelemetryWasCaptured:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

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

        Remove JavaScriptCore/ForwardingHeaders directory
        https://bugs.webkit.org/show_bug.cgi?id=182594

        Reviewed by Mark Lam.

        * PlatformGTK.cmake:

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

        Make WebKit public headers modules-safe
        https://bugs.webkit.org/show_bug.cgi?id=182611
        <rdar://problem/37160164>

        Reviewed by Dan Bernstein.

        * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
        * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
        Import headers without which these WebKit headers can not be used alone.

        * WebKit.xcodeproj/project.pbxproj:
        Make WKWindowFeaturesPrivate a private header like it was supposed to be.

2018-02-08  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r228262.

        This broke an internal build alongside r228261.

        Reverted changeset:

        "WebDriver: addCookie command should prepend a dot to domain
        if missing"
        https://bugs.webkit.org/show_bug.cgi?id=182328
        https://trac.webkit.org/changeset/228262

2018-02-08  Miguel Gomez  <magomez@igalia.com>

        [GTK] WaylandCompositor misusing eglGetProcAddress
        https://bugs.webkit.org/show_bug.cgi?id=182490

        Reviewed by Michael Catanzaro.

        Check that the appropriate extensions are available before calling eglGetProcAddress, as even
        getting a non null value from it, the functionality can be disabled at runtime.

        * UIProcess/gtk/WaylandCompositor.cpp:
        (WebKit::WaylandCompositor::initializeEGL):

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

        Add scrolling node types to distinguish main frames and subframes.
        https://bugs.webkit.org/show_bug.cgi?id=182533

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of
        FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
        (WebKit::encodeNodeAndDescendants):
        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
        (WebKit::dump):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto.
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the
        constructor of the frame scrolling node.
        (WebKit::RemoteScrollingTree::createScrollingTreeNode):
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of
        FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to
        determine whether the node is a main frame or subframe, use the node type instead of checking
        whether the node as a parent.
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):

2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: addCookie command should prepend a dot to domain if missing
        https://bugs.webkit.org/show_bug.cgi?id=182328
        <rdar://problem/37116398>

        Reviewed by Michael Catanzaro.

        RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

        Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):

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

        Event improvements
        https://bugs.webkit.org/show_bug.cgi?id=179591

        Reviewed by Chris Dumez.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
        (webkit_dom_wheel_event_init_wheel_event): Updated to call initWebKitWheelEvent.

        * WebProcess/Plugins/PluginView.cpp: Removed include of ScriptValue.h.

        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
        (WebKit::WebEditorClient::executePendingEditorCommands):
        Updated for name change from keyEvent to underlyingPlatformEvent.
        (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.
        * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
        (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
        (WebKit::WebEditorClient::handleInputMethodKeydown): Ditto.

        * WebProcess/WebPage/WebPage.cpp: Removed include of ScriptValue.h.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleEditingKeyboardEvent): Updated for name change from
        keyEvent to underlyingPlatformEvent.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::executeKeypressCommandsInternal): Ditto.
        (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.

2018-02-07  Antti Koivisto  <antti@apple.com> and Youenn Fablet  <youenn@apple.com>

        REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
        https://bugs.webkit.org/show_bug.cgi?id=182532
        <rdar://problem/36414017>

        Reviewed by Chris Dumez.

        No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
        We were calling a function that was WTFMoved away just a few lines above.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

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

        Evernote device management web view sometimes displays at the wrong scale
        https://bugs.webkit.org/show_bug.cgi?id=182590
        <rdar://problem/36633687>

        Reviewed by Simon Fraser.

        Evernote implements the WKWebView's scroll view's delegate method
        viewForZoomingInScrollView: and returns nil. This results in
        WKScrollView's zoomScale always returning 1, no matter what the
        WKContentView's actual scale is. This will result in us never updating
        the WKContentView's scale to 1. When loading a page that has a few
        scale changes during load but ends up at scale 1, we get stuck at whatever
        intermediate scale immediately preceded settling on 1.

        Fix this by not forwarding viewForZoomingInScrollView: to the external
        WKScrollView delegate; we are in charge of the contents of the scroll
        view (including which view scrollView's zoomScale should track), and
        overriding viewForZoomingInScrollView: is only ever going to lead to
        a broken WebKit.

        * UIProcess/ios/WKScrollView.mm:
        (shouldForwardScrollViewDelegateMethodToExternalDelegate):
        (-[WKScrollViewDelegateForwarder forwardInvocation:]):
        (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):

2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Delegate scrolling from the content view to input view controllers
        https://bugs.webkit.org/show_bug.cgi?id=182534
        <rdar://problem/37276625>

        Reviewed by Tim Horton.

        Override -_wheelChangedWithEvent: on the content view, and give extra zoomed input view controllers a chance to
        handle the event.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _wheelChangedWithEvent:]):

2018-02-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Implement multiple and single select menus
        https://bugs.webkit.org/show_bug.cgi?id=182525
        <rdar://problem/35143016>

        Reviewed by Tim Horton.

        Add support for presenting picker views when focusing single or multiple select elements. See changes below for
        additional detail.

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

        Move logic for presenting view controllers when focusing elements out of _startAssistingKeyboard, and into
        _startAssistingNode:(...). This is because _startAssistingKeyboard is only invoked for certain types of focused
        element types; importantly, this set excludes select elements. Putting the call to present the focused view
        controller there also didn't make much since, considering that these new view controllers are not tied to
        keyboards in any way.

        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _stopAssistingNode]):

        Dismiss any select menu that is being presented.

        (-[WKContentView presentSelectMenuViewController:]):
        (-[WKContentView dismissSelectMenuViewController:]):

        Introduce idempotent helpers for presenting and dismissing the select menu view controller.

        (-[WKContentView presentViewControllerForAssistedNode:]):
        (-[WKContentView selectMenu:didSelectItemAtIndex:]):

        For single select menus. Called when the user selects a row.

        (-[WKContentView didCancelSelectionInSelectMenu:]):
        (-[WKContentView numberOfItemsInSelectMenu:]):
        (-[WKContentView selectMenu:displayTextForItemAtIndex:]):

        Indicates the text value to show at a given index.

        (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):

        For multiple select menus, invoked when an item is checked. The `checked` parameter indicates whether or not the
        item is now checked.

        (-[WKContentView selectMenuSupportsMultipleSelection:]):

        Indicates whether this select menu is single-item-only, or allows multiple items to be selected (checked).

        (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]):

        For multiple select menus. Determines whether an option at the given index is checked.

        (-[WKContentView startingIndexForSelectMenu:]):

        Determines the index to instantly scroll to when presenting the select menu.

        * UIProcess/ios/forms/WKSelectMenuViewController.h: Added.
        * UIProcess/ios/forms/WKSelectMenuViewController.mm: Added.

        Add new harness files for WKSelectMenuViewController's header and implementation (see WebKitAdditions).

        * WebKit.xcodeproj/project.pbxproj:

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

        Improve NetworkResourceLoader logging to capture redirect cases
        https://bugs.webkit.org/show_bug.cgi?id=182573
        <rdar://problem/37316714>

        Reviewed by Chris Dumez.

        Add logging for cookie partitioning or blocking during redirects.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

2018-02-07  John Wilander  <wilander@apple.com>

        Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode
        https://bugs.webkit.org/show_bug.cgi?id=182559
        <rdar://problem/36990337>

        Reviewed by Andy Estes.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::isThirdPartyRequest):
            New convenience function. Checks whether the resource shares
            partition with the first party.
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            Now strips the referrer to just the origin for:
            1. All third party requests in private mode.
            2. Third party requests to domains that ITP blocks cookies for.
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
            Now strips the referrer in redirects to just the origin for:
            1. All third party requests in private mode.
            2. Third party requests to domains that ITP blocks cookies for.

2018-02-07  Daniel Bates  <dabates@apple.com>

        Log error when authentication challenge is blocked due to an insecure request
        https://bugs.webkit.org/show_bug.cgi?id=182358

        Reviewed by Andy Estes.

        Have network process notify the web process when it blocks an authentication challenge.

        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::completeAuthenticationChallenge):
        * NetworkProcess/NetworkLoadClient.h:
        (WebKit::NetworkLoadClient::didBlockAuthenticationChallenge):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge):
        * NetworkProcess/NetworkResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.cpp:
        (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.messages.in:

2018-02-07  Chris Dumez  <cdumez@apple.com>

        IndexedDB in service workers is using a memory backed store
        https://bugs.webkit.org/show_bug.cgi?id=182574
        <rdar://problem/37316205>

        Reviewed by Youenn Fablet.

        Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
        PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
        which uses an InProcessIDBServer and a memory-backed store for IndexedDB.

        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::start):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-02-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Typo in a translatable string
        https://bugs.webkit.org/show_bug.cgi?id=182570

        Unreviewed. Fix a typo.

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkit_website_data_manager_class_init):

2018-02-06  Don Olmstead  <don.olmstead@sony.com>

        Remove WebCore/ForwardingHeaders directory
        https://bugs.webkit.org/show_bug.cgi?id=182347

        Reviewed by Keith Miller.

        * Platform/mac/StringUtilities.mm:
        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        * Shared/WebKit2Initialize.cpp:
        * Shared/linux/WebMemorySamplerLinux.cpp:
        * Shared/mac/WebMemorySampler.mac.mm:
        * UIProcess/WebProcessPool.cpp:
        * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
        * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h:
        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
        * WebProcess/Plugins/PluginProcessConnection.cpp:
        * WebProcess/Plugins/PluginView.cpp:
        * WebProcess/WebPage/WebInspector.h:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/cocoa/WebProcessCocoa.mm:

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

        Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html is a flaky failure on macOS and iOS
        https://bugs.webkit.org/show_bug.cgi?id=181392
        <rdar://problem/36384136>

        Reviewed by Youenn Fablet.

        All tasks from the StorageProcess to the WebContent process to update registrations
        and service workers state are posted to the runloop. However, the fetch callbacks
        do not do so. This means that fetch results might come in out of order with regards
        to the registration / service worker state updates. The test was flaky because an
        intercepted load would sometimes finish before the task to update the service worker
        state to "activated" was processed by the runloop. We address the issue by having
        the ServiceWorkerClientFetch callbacks schedule tasks to the runloop too.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
        (WebKit::ServiceWorkerClientFetch::didReceiveData):
        (WebKit::ServiceWorkerClientFetch::didFinish):
        (WebKit::ServiceWorkerClientFetch::didFail):
        (WebKit::ServiceWorkerClientFetch::didNotHandle):

2018-02-06  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Correct sandbox violation triggered by Chase.com
        https://bugs.webkit.org/show_bug.cgi?id=182519
        <rdar://problem/37121757>

        Reviewed by Eric Carlson.

        Hitting a sandbox violation when attempting to check status of IOAV*En/Decode support.

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

2018-02-06  Jeff Miller  <jeffm@apple.com>

        Add WKNavigationDelegate SPI to tell the client when an insecure plug-in is blocked
        https://bugs.webkit.org/show_bug.cgi?id=182540

        Reviewed by Alex Christensen.

        * UIProcess/API/APILoaderClient.h:
        (API::LoaderClient::didBlockInsecurePluginVersion):
        Changed to take a dictionary reference.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::didBlockInsecurePluginVersion):
        Added.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageLoaderClient):
        Changed didBlockInsecurePluginVersion() to take a dictionary reference.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        Added -_webView:didBlockInsecurePluginVersionWithInfo:.

        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        Initialize webViewDidBlockInsecurePluginVersionWithInfo.

        (WebKit::NavigationState::NavigationClient::didBlockInsecurePluginVersion):
        Added.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didBlockInsecurePluginVersion):
        Remove check for PLATFORM(COCOA) (we don't check for this in didFailToInitializePlugin() where we
        also use createPluginInformationDictionary()) and ENABLE(NETSCAPE_PLUGIN_API) (we're already inside
        an #if ENABLE(NETSCAPE_PLUGIN_API block) and use auto for pluginInformation. Attempt to use the
        navigation client before the loader client.

2018-02-06  Youenn Fablet  <youenn@apple.com>

        HasServiceWorkerRegistration bit should be sent when creating a new page
        https://bugs.webkit.org/show_bug.cgi?id=182410

        Reviewed by Chris Dumez.

        Move the bit computation at page creation time.
        This allows computing the bit based on the web site data store and not only on the pool configuration.
        WebPage uses that bit to activate service worker registration matching for the whole process.

        In case there is a service worker process proxy created, the bit is set to true by default.

        Bit is computed by checking for database file presence.
        This information is cached in a map for efficiency reasons and cleared when a service worker process proxy is created.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::initializeWebPage):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_cpuLimit):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix format specifiers added in r228116
        https://bugs.webkit.org/show_bug.cgi?id=182456
        <rdar://problem/37181006>

        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::remove):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
        (WebKit::CacheStorageEngineConnection::putRecords):
        (WebKit::CacheStorageEngineConnection::reference):
        (WebKit::CacheStorageEngineConnection::dereference):

2018-02-05  Chris Dumez  <cdumez@apple.com>

        Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
        https://bugs.webkit.org/show_bug.cgi?id=182494
        <rdar://problem/37147632>

        Reviewed by Ryosuke Niwa.

        Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
        GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
        will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
        updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
        Connection::sendMessage(). This should mean the same thing since this code runs in
        WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
        without constructing a RunLoop.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::sendMessage):

2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>

        Release assertion in inlineVideoFrame
        https://bugs.webkit.org/show_bug.cgi?id=182513
        <rdar://problem/37159363>

        Reviewed by Zalan Bujtas.

        Fixed the bug. Don't try to update the layout when there is no live render tree or active DOM objects
        had been stopped: i.e. during a document destruction.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::inlineVideoFrame):

2018-02-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Refine WebKitLegacy and WebKit build for wincairo
        https://bugs.webkit.org/show_bug.cgi?id=182478

        Reviewed by Alex Christensen.

        Fixed a typo of forwarding header path for InjectedBundle and copying header
        method, which should use FLATTENED.

        * PlatformWin.cmake: Fix a typo of a forwarding header path for InjectedBundle and use FLATTENED.

2018-02-05  Youenn Fablet  <youenn@apple.com>

        WebsiteDataStore::resolveDirectoriesIfNecessary() should not overwrite its resolved serviceWorkerRegistrationDirectory  if already set
        https://bugs.webkit.org/show_bug.cgi?id=182514

        Reviewed by Chris Dumez.

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

2018-02-05  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Storage process is using the wrong sandbox profile filename
        https://bugs.webkit.org/show_bug.cgi?id=182500
        <rdar://problem/37232614>

        Reviewed by David Kilzer.

        The iOS entitlements file was still referencing the old Databases sandbox profile, even though the
        process has been renamed 'Storage'.

        * Configurations/Databases-iOS.entitlements:

2018-02-05  Ryosuke Niwa  <rniwa@webkit.org>

        Add DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
        https://bugs.webkit.org/show_bug.cgi?id=182458

        Reviewed by Chris Dumez.

        Added DoNotProcessIncomingMessagesWhenWaitingForSyncReply to GetPlugins and RootViewToScreen
        which are found to get sent from WebContent process while ScriptDisallowedScope is present
        by a work-in-progress patch on webkit.org/b/182449.

        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::populatePluginCache):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::rootViewToScreen):

2018-02-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r227964 and r228087.
        https://bugs.webkit.org/show_bug.cgi?id=182508

        These introduced an API test  failure with
        URLTest.HostIsIPAddress alongside commit r228086 (Requested by
        mlewis13 on #webkit).

        Reverted changesets:

        "[SOUP] Ensure domain is valid when converting a WebCore
        Cookie to Soup"
        https://bugs.webkit.org/show_bug.cgi?id=182328
        https://trac.webkit.org/changeset/227964

        "WebDriver: addCookie command should prepend a dot to domain
        if missing"
        https://bugs.webkit.org/show_bug.cgi?id=182328
        https://trac.webkit.org/changeset/228087

2018-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Implement number pad UI when editing `tel` and `number` inputs
        https://bugs.webkit.org/show_bug.cgi?id=182472
        <rdar://problem/35143057>

        Reviewed by Tim Horton.

        Allows the user to edit numeric input types using a number pad. See below comments for more detail.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startAssistingKeyboard]):
        (-[WKContentView _stopAssistingNode]):

        Dismiss the number pad, if it is present.

        (-[WKContentView dismissNumberPadViewController:]):
        (-[WKContentView presentNumberPadViewController:]):

        Add new helpers for showing and hiding the number pad view controller.

        (-[WKContentView presentViewControllerForAssistedNode:]):
        (-[WKContentView textInputController:didRequestDismissalWithAction:]):

        Dismiss the number pad, if it is present.

        (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
        (-[WKContentView shouldPresentTextInputViewController:]): Deleted.

        Remove -shouldPresentTextInputViewController and replace it with -presentViewControllerForAssistedNode:, which
        presents the appropriate view controller given "assisted" node information.

        * UIProcess/ios/forms/WKNumberPadView.h: Added.
        * UIProcess/ios/forms/WKNumberPadView.mm: Added.
        * UIProcess/ios/forms/WKNumberPadViewController.h: Added.
        * UIProcess/ios/forms/WKNumberPadViewController.mm: Added.

        Add "WebKitAdditions harness" files for the new number pad view and view controller classes.

        * WebKit.xcodeproj/project.pbxproj:

2018-02-05  Youenn Fablet  <youenn@apple.com>

        Add logging to CacheStorageEngineConnection
        https://bugs.webkit.org/show_bug.cgi?id=182456

        Reviewed by Chris Dumez.

        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::remove):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::retrieveRecords):
        (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
        (WebKit::CacheStorageEngineConnection::putRecords):
        (WebKit::CacheStorageEngineConnection::reference):
        (WebKit::CacheStorageEngineConnection::dereference):
        * Platform/Logging.h:

2018-02-05  Daniel Bates  <dabates@apple.com>

        REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
        https://bugs.webkit.org/show_bug.cgi?id=182491
        <rdar://problem/36533447>

        Reviewed by Brent Fulgham.

        Exempt Nike from the XHR header restrictions in r222795.

        Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
        However Nike also depends on such functionality.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (shouldAllowSettingAnyXHRHeaderFromFileURLs):

2018-02-02  Brent Fulgham  <bfulgham@apple.com>

        Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
        https://bugs.webkit.org/show_bug.cgi?id=182455
        <rdar://problem/36626601>

        Reviewed by Chris Dumez.

        Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
        manipulation. Place the generally useful logic in a static method that can be invoked
        from other places in the NetworkProcess.

        Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
        we can perform logging there as well.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
        (when enabled).
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
        (WebKit::escapeForJSON): Made a static function so it could be shared between multiple
        methods.
        (WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
        (WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
        (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
        * NetworkProcess/NetworkResourceLoader.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
        to track partitioning and blocking behavior.

2018-02-05  John Wilander  <wilander@apple.com>

        Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
        https://bugs.webkit.org/show_bug.cgi?id=181601
        <rdar://problem/36475837>

        Reviewed by Alex Christensen.

        http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
        was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
        it's possible to check access even if a frame doesn't respond timely to
        postMessage after detach and attach.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::getAllStorageAccessEntries):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
        (WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-02-05  Daniel Bates  <dabates@apple.com>

        Disallow evaluating JavaScript from NPP_Destroy() in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=181889
        <rdar://problem/36674701>

        Reviewed by Brent Fulgham.

        Make the behavior of WebKit match the behavior of WebKitLegacy on Mac.

        * Shared/Plugins/NPObjectMessageReceiver.cpp:
        (WebKit::NPObjectMessageReceiver::hasMethod):
        (WebKit::NPObjectMessageReceiver::invoke):
        (WebKit::NPObjectMessageReceiver::invokeDefault):
        (WebKit::NPObjectMessageReceiver::hasProperty):
        (WebKit::NPObjectMessageReceiver::getProperty):
        (WebKit::NPObjectMessageReceiver::setProperty):
        (WebKit::NPObjectMessageReceiver::removeProperty):
        (WebKit::NPObjectMessageReceiver::enumerate):
        (WebKit::NPObjectMessageReceiver::construct):
        Bail out if the plugin is executing NPP_Destroy().

        * WebProcess/Plugins/Plugin.cpp:
        (WebKit::Plugin::destroyPlugin):
        * WebProcess/Plugins/Plugin.h:
        (WebKit::Plugin::isBeingDestroyed const):
        Move bookkeeping of whether the plugin is being destroyed from PluginView
        to here. This makes it straightforward for NPObjectMessageReceiver to query
        this information.

        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::~PluginView):
        (WebKit::PluginView::destroyPluginAndReset):
        (WebKit::PluginView::recreateAndInitialize):
        (WebKit::PluginView::protectPluginFromDestruction):
        (WebKit::PluginView::unprotectPluginFromDestruction):
        Move bookkeeping of whether the plugin is being destroyed from here
        to Plugin.

        * WebProcess/Plugins/PluginView.h:
        (WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it
        is being destroyed, if we have one.

2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: addCookie command should prepend a dot to domain if missing
        https://bugs.webkit.org/show_bug.cgi?id=182328
        <rdar://problem/37116398>

        Reviewed by Michael Catanzaro.

        RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

        Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::addSingleCookie):

2018-02-03  Tim Horton  <timothy_horton@apple.com>

        UI process sometimes crashes under -[WKContentView _lookupForWebView:]
        https://bugs.webkit.org/show_bug.cgi?id=182460
        <rdar://problem/33260602>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _lookupForWebView:]):
        If you have a range selection, but no rects for the selection, retrieving
        the 0th element of selectionRects will crash the UI process. To fix, in
        this case, use the rect for the starting caret instead.

        It doesn't seem like the presentationRect is actually currently used for
        the Lookup service, so the only impact is that we shouldn't crash anymore.

2018-02-02  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove remaining dead !USE(NETWORK_SESSION) code
        https://bugs.webkit.org/show_bug.cgi?id=182451

        Reviewed by Alex Christensen.

        DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION
        became mandatory.

        * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed.
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:
        * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed.

2018-02-02  Youenn Fablet  <youenn@apple.com>

        CacheStorage should check for origin file presence when computing the origin of a folder
        https://bugs.webkit.org/show_bug.cgi?id=182454

        Reviewed by Chris Dumez.

        In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename.
        We should be checking the origin filename anyway since we will be reading it afterwards.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):

2018-02-02  Youenn Fablet  <youenn@apple.com>

        Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
        https://bugs.webkit.org/show_bug.cgi?id=182403
        <rdar://problem/36673358>

        Reviewed by Alex Christensen.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores.

2018-02-02  Youenn Fablet  <youenn@apple.com>

        Clearing all service worker registrations should wait for importing service worker registration to finish
        https://bugs.webkit.org/show_bug.cgi?id=182407

        Reviewed by Chris Dumez.

        Updating API to take a completion handler.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:

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

        [Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"
        https://bugs.webkit.org/show_bug.cgi?id=182081

        Reviewed by Yusuke Suzuki.

        The template friend class, which belongs to a different namespace,
        can't access private member if its friend declaration is specified
        without the namespace and with class keyword.

        Replaced "friend class NeverDestroyed<Foo>" with "friend NeverDestroyed<Foo>".

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/capture/NetworkCaptureManager.h:
        * PluginProcess/PluginProcess.h:
        * Shared/CallbackID.h:
        * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
        * StorageProcess/StorageProcess.h:
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/gtk/PluginInfoCache.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
        * UIProcess/gtk/HardwareAccelerationManager.h:
        * UIProcess/gtk/WaylandCompositor.h:
        * UIProcess/linux/MemoryPressureMonitor.h:
        * UIProcess/mac/ServicesController.h:
        * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
        * WebProcess/Plugins/WebPluginInfoProvider.h:
        * WebProcess/WebCoreSupport/WebPasteboardOverrides.h:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2018-02-02  Youenn Fablet  <youenn@apple.com>

        Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
        https://bugs.webkit.org/show_bug.cgi?id=182403

        Reviewed by Alex Christensen.

        WebsiteDataStore is the place to set configuration information such as service worker registration path.
        This patch updates WebKit code accordingly.
        By default, the service worker registration path is in a Caches subfolder, similarly to cache API path.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::createWithLegacyOptions):
        (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
        (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/C/WKContextConfigurationRef.cpp:
        (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted.
        (WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted.
        * UIProcess/API/C/WKContextConfigurationRef.h:
        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
        (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
        (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
        (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
        * UIProcess/gtk/WebProcessPoolGtk.cpp:
        * UIProcess/gtk/WebProcessPoolWPE.cpp:

2018-02-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra Zoom Mode] Implement support for indirect mainframe scrolling
        https://bugs.webkit.org/show_bug.cgi?id=182421
        <rdar://problem/35142694>

        Reviewed by Tim Horton.

        Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
        zooming. See below for more details.

        * UIProcess/API/Cocoa/WKWebView.mm:

        Remove a now-unneeded WebKitAdditions import.

        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView initWithFrame:]):

        Add imports for -Before and -After versions of WKScrollViewAdditions.

        (-[WKScrollView addGestureRecognizer:]):

        Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
        I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
        recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
        -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.

2018-02-01  Tim Horton  <timothy_horton@apple.com>

        WebKit fails to build (_startAssistingNode has conflicting parameters)
        https://bugs.webkit.org/show_bug.cgi?id=182417
        <rdar://problem/36965318>

        Reviewed by Dan Bernstein.

        * UIProcess/ios/WKContentViewInteraction.h:
        Use Big BOOL like in the implementation.

2018-02-01  Brent Fulgham  <bfulgham@apple.com>

        Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies
        https://bugs.webkit.org/show_bug.cgi?id=182408
        <rdar://problem/36918028>

        Reviewed by Chris Dumez.

        Update the logging method to report blocked origins, rather than logging them as non-partitioned
        loads that have no cookies or other content.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation const):

2018-02-01  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const
        <https://webkit.org/b/182409>
        <rdar://problem/35495094>

        Reviewed by Alex Christensen.

        * UIProcess/WebBackForwardList.cpp:
        (WebKit::WebBackForwardList::goToItem): Fix typo so the for loop
        actually checks each value in m_entries.

2018-02-01  Youenn Fablet  <youenn@apple.com>

        Delay service worker process creation until actually needed by SWServer
        https://bugs.webkit.org/show_bug.cgi?id=182301

        Reviewed by Chris Dumez.

        Do not create a service worker process at creation of the first SWServerConnection.
        Wait for a WebProcess message that needs it:
        - postMessage message
        - fetchEvent message
        - job scheduling.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):
        (WebKit::WebSWServerConnection::scheduleJobInServer):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/StorageToWebProcessConnection.cpp:
        (WebKit::StorageToWebProcessConnection::establishSWServerConnection):

2018-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Extra zoom mode] Implement basic support for interacting with text form controls
        https://bugs.webkit.org/show_bug.cgi?id=182401
        <rdar://problem/35143035>

        Reviewed by Tim Horton.

        Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below
        for more details.

        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (-[WKWebViewConfiguration init]):
        (-[WKWebViewConfiguration encodeWithCoder:]):
        (-[WKWebViewConfiguration initWithCoder:]):
        (-[WKWebViewConfiguration copyWithZone:]):
        (-[WKWebViewConfiguration _textInteractionGesturesEnabled]):
        (-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]):
        (-[WKWebViewConfiguration _longPressActionsEnabled]):
        (-[WKWebViewConfiguration _setLongPressActionsEnabled:]):

        Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`.
        The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for
        IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share
        sheet, etc.) are enabled. These are disabled by default only in extra zoom mode.

        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setTextAsync):

        Add a way to set the text value of a currently edited text form control. This will either set the text value of
        an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and
        inserting the given text.

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::focusNextAssistedNode):

        Add a default argument for the completion callback.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setupInteraction]):
        (-[WKContentView _displayFormNodeInputView]):
        (-[WKContentView _actionForLongPressFromPositionInformation:]):
        (-[WKContentView hasSelectablePositionAtPoint:]):
        (-[WKContentView pointIsNearMarkedText:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
        (-[WKContentView insertionPointColor]):

        Respect the web view configuration flags above by bailing early from text interaction and long press action
        sheet methods.

        (-[WKContentView _startAssistingKeyboard]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

        Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to
        decide whether or not we want to present the text input view controller right away, or just reload the focused
        form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're
        only changing focus to another form control.

        (-[WKContentView _stopAssistingNode]):
        (-[WKContentView presentFocusedFormControlViewController:]):
        (-[WKContentView dismissFocusedFormControlViewController:]):
        (-[WKContentView shouldPresentTextInputViewController:]):
        (-[WKContentView presentTextInputViewController:]):
        (-[WKContentView dismissTextInputViewController:]):

        Introduce helpers for managing presentation of the focused form control overlay and text input view controller.
        All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content
        view's view controller for fullscreen presentation.

        (-[WKContentView textInputController:didCommitText:]):
        (-[WKContentView textInputController:didRequestDismissalWithAction:]):
        (-[WKContentView focusedFormControlControllerDidSubmit:]):
        (-[WKContentView focusedFormControlControllerDidCancel:]):
        (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
        (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]):
        (-[WKContentView actionNameForFocusedFormControlController:]):
        (-[WKContentView focusedFormControlControllerDidRequestNextNode:]):
        (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]):
        (-[WKContentView hasNextNodeForFocusedFormControlController:]):
        (-[WKContentView hasPreviousNodeForFocusedFormControlController:]):

        Implement delegate methods for the focused form control and text input view controllers. This mainly involves
        straightforward plumbing of pieces of AssistedNodeInformation on the content view.

        (-[WKContentView pointIsInAssistedNode:]): Deleted.

        Remove a method that was still implemented only for binary compatibility with iOS 10.

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

2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Shift + mouse scroll should scroll horizontally
        https://bugs.webkit.org/show_bug.cgi?id=181629

        Reviewed by Michael Catanzaro.

        Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseScrollEvent):

2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash
        https://bugs.webkit.org/show_bug.cgi?id=182350

        Reviewed by Carlos Alberto Lopez Perez.

        Ensure events synthesized from touch gestures have a valid window, screen and device.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        * UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient.

2018-01-31  Simon Fraser  <simon.fraser@apple.com>

        Use different debug red colors for different contexts
        https://bugs.webkit.org/show_bug.cgi?id=182362

        Reviewed by Tim Horton.
        
        Pure red is used elsehwere in the system as a debug color indicator, so use different
        shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
        so they are identifiable.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::drawInContext):

2018-01-31  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Make JavaScriptCore headers copies
        https://bugs.webkit.org/show_bug.cgi?id=182303

        Reviewed by Alex Christensen.

        * CMakeLists.txt:
        * Scripts/generate-forwarding-headers.pl:

2018-01-31  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, rolling out r227942.

        r227875 should not have been rolled out.

        Reverted changeset:

        "Unreviewed, rolling out r227875."
        https://bugs.webkit.org/show_bug.cgi?id=182357
        https://trac.webkit.org/changeset/227942

2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>

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

        Missing cross-platform TestController implementation

        Reverted changeset:

        "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
        https://bugs.webkit.org/show_bug.cgi?id=181958
        https://trac.webkit.org/changeset/227875

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
        (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
        (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-01-31  Brent Fulgham  <bfulgham@apple.com>

        Follow-up to r227939.
        https://bugs.webkit.org/show_bug.cgi?id=182354
        <rdar://problem/37046844>

        Make sure the correct sandbox is used on iOS as well.

        * StorageProcess/ios/StorageProcessIOS.mm:
        (WebKit::StorageProcess::initializeSandbox):

2018-01-31  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
        https://bugs.webkit.org/show_bug.cgi?id=182354
        <rdar://problem/37046844>

        Reviewed by Ryosuke Niwa.

        The Database process was renamed to Storage, but it's sandbox was not updated.

        * Configurations/WebKit.xcconfig: Update for sandbox rename.
        * DerivedSources.make: Ditto.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
        * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed.
        * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in.
        * WebKit.xcodeproj/project.pbxproj: Update for sandbox rename.

2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
        https://bugs.webkit.org/show_bug.cgi?id=182222

        Reviewed by Alex Christensen.

        Add callbacks to notify when resource load statistics deletion is complete.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:

2018-01-31  Tim Horton  <timothy_horton@apple.com>

        Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
        https://bugs.webkit.org/show_bug.cgi?id=182349
        <rdar://problem/27822258>

        Reviewed by Simon Fraser.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
        m_drawingArea can be null during process launch and relaunch.

        Cocoa ports don't use the result of setBackingStoreIsDiscardable(),
        but they do run this code to keep it up to date.

2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
        https://bugs.webkit.org/show_bug.cgi?id=182308

        Reviewed by Carlos Garcia Campos.

        * PlatformGTK.cmake:

2018-01-31  Youenn Fablet  <youenn@apple.com>

        Remove StorageToWebProcessConnection::removeSWServerConnection
        https://bugs.webkit.org/show_bug.cgi?id=182305

        Reviewed by Chris Dumez.

        * StorageProcess/StorageToWebProcessConnection.cpp:
        (WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted.
        * StorageProcess/StorageToWebProcessConnection.h:
        * StorageProcess/StorageToWebProcessConnection.messages.in:

2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
        https://bugs.webkit.org/show_bug.cgi?id=182224

        Reviewed by Michael Catanzaro.

        Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and
        implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure
        events are handled consistently.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth
        const GdkEvents.
        (WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or
        WebPageProxy::setPageZoomFactor() otherwise.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts.
        (webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events.
        (webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent.
        (webkitWebViewBaseButtonReleaseEvent): Ditto.
        (webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events.
        (webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent.
        (webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent.
        (webkitWebViewBaseCrossingNotifyEvent): Ditto.
        (webkitWebViewBaseGestureController): Pass the widget and client to GestureController.
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::GestureController): Receives a widget and client now.
        (WebKit::GestureController::handleEvent): Remove the const.
        (WebKit::GestureController::Gesture::Gesture): Initialize client.
        (WebKit::GestureController::Gesture::handleEvent): Remove the const.
        (WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy.
        (WebKit::GestureController::DragGesture::handleDrag): Ditto.
        (WebKit::GestureController::DragGesture::handleTap): Ditto.
        (WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event().
        (WebKit::GestureController::DragGesture::update): Ditto.
        (WebKit::GestureController::DragGesture::end): Ditto.
        (WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now.
        (WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy.
        (WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event().
        (WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now.
        (WebKit::GestureController::ZoomGesture::begin): Start the zoom.
        (WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy.
        (WebKit::GestureController::ZoomGesture::handleZoom): Ditto.
        (WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now.
        (WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView.
        (WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event().
        (WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now.
        (WebKit::GestureController::Gesture::simulateMouseClick): Deleted.
        (WebKit::createScrollEvent): Deleted.
        * UIProcess/gtk/GestureController.h:

2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        Web Automation: cookies returned by automation should have expiry time in seconds
        https://bugs.webkit.org/show_bug.cgi?id=182293

        Reviewed by Brian Burg.

        When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but
        when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to
        seconds for consistency, so that the WebDriver always handles seconds.

        Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::buildObjectForCookie): Convert expiry to seconds.

2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>

        Unreviewed iOS build fix.

        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2018-01-30  John Wilander  <wilander@apple.com>

        Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()
        https://bugs.webkit.org/show_bug.cgi?id=181958
        https://bugs.webkit.org/show_bug.cgi?id=182072
        <rdar://problem/36801804>
        <rdar://problem/36845795>

        Reviewed by Brent Fulgham.

        Because of the asynchronous nature of XPC and cookies,
        we need callbacks in these TestRunner functions so that
        the layout tests can wait for state changes to finish
        before checking test conditions.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
        (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
        (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
        (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
        (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
        (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r227550): Resource timing API is disabled on macOS
        https://bugs.webkit.org/show_bug.cgi?id=182318

        Reviewed by Chris Dumez.

        Resource timing API should be enabled by default all versions of macOS we support now.

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

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

        WKWebView layout is sometimes wrong after rotation on iPhone X
        https://bugs.webkit.org/show_bug.cgi?id=182304
        <rdar://problem/34158671>

        Reviewed by Simon Fraser.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _computedContentInset]):
        (-[WKWebView _scrollViewSystemContentInset]):
        (activeMinimumLayoutSize):
        It turns out that it is not always safe to look at the safe area insets of
        children from inside layoutSubviews, even after the call to super.

        Instead, make use of the fact that WKScrollView and WKWebView have identical
        coordinate spaces, and map WKWebView's safe area insets into the WKScrollView.
        It's safe to use the scroll view's affected-edges and contentScrollInset,
        because those aren't updated at the same outside-of-layout time that
        safe area insets are.

        We could alternatively move all calls to activeMinimumLayoutSize outside
        of layoutSubviews, but that seems like a larger and riskier change.

        All attempts to write a test have failed; this depends heavily on use of
        autolayout and the mechanism by which the system updates system-owned
        safe area insets during device rotation.

2018-01-30  Don Olmstead  <don.olmstead@sony.com>

        JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
        https://bugs.webkit.org/show_bug.cgi?id=182312

        Reviewed by Michael Catanzaro.

        * config.h:

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

        Add telemetry to track storage access API adoption
        https://bugs.webkit.org/show_bug.cgi?id=182197
        <rdar://problem/35803309>

        Reviewed by Chris Dumez.

        Part 2: Add telemetry for the Storage Access API case

        This change increments a counter when an origin is loaded in a first part context because
        it was granted Storage Access API permissions.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
        loads that happened with the Storage Access API enabled.
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
        loads using the new API.

2018-01-30  Megan Gardner  <megan_gardner@apple.com>

        Make preserve and restore focus more likely to be symmetrical
        https://bugs.webkit.org/show_bug.cgi?id=182264
        <rdar://problem/36948473>
        
        Reviewed by Tim Horton.

        Keep a stack of if we actually increment the focusState, so that
        changes to the web content do not result in asymmetric decrements to the focus state. 
        To work around problems associated with <rdar://problem/37000122>.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _restoreFocusWithToken:]):
        (-[WKContentView _preserveFocusWithToken:destructively:]):

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

        Add telemetry to track storage access API adoption
        https://bugs.webkit.org/show_bug.cgi?id=182197
        <rdar://problem/35803309>

        Reviewed by Chris Dumez.
        
        This patch also handled aggregating the counts in the UIProcess, which has access to
        the right data.

        The original patch assumed the WebContent process kept track of user interaction. This is
        only tracked in the UIProcess, so we can get rid of some of the logging code adding in
        r227755.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
        needed to track the statistics.
        (WebKit::WebProcessCreationParameters::decode): Ditto.
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
        the WebContent process, which does not keep track of user interaction.
        (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
        the statistics.
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

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

        Make sure we never create a WebSWClientConnection with an invalid sessionID
        https://bugs.webkit.org/show_bug.cgi?id=182276
        <rdar://problem/36582633>

        Reviewed by Alex Christensen.

        Make sure we never create a WebSWClientConnection with an invalid sessionID as this
        could corrupt our hash tables.

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::swServerForSession):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
        (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):

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

        [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
        https://bugs.webkit.org/show_bug.cgi?id=177202

        Reviewed by Alex Christensen.

        * PlatformWin.cmake:

2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
        https://bugs.webkit.org/show_bug.cgi?id=180350

        Reviewed by Carlos Alberto Lopez Perez.

        undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
        case to return an empty string. We currently handle this case for execute script commands, but not in all other
        cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
        because in that case we wouldn't need to handle it as a special case.

        15.2 Executing Script
        https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone

        Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent

        * WebProcess/Automation/WebAutomationSessionProxy.js:
        (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.

2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>

        Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
        https://bugs.webkit.org/show_bug.cgi?id=182273

        Reviewed by Chris Dumez.

        The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
        the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
        it's not safe to execute arbitrary code.

        Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):

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

        Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=182268
        <rdar://problem/37003784>

        Reviewed by Tim Horton and Dan Bernstein.

        Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
        usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
        unlocalized resources directory. If the AdditionalResources directory does not exist in the build
        directory, we fall back to searching the SDK.

        * WebKit.xcodeproj/project.pbxproj:

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

        ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
        https://bugs.webkit.org/show_bug.cgi?id=182134

        Reviewed by Chris Dumez.

        As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
        This is also consistent with SubresourceLoader::didReceiveResponse.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):

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

        Cache API should make sure to resolve caches.open promises in the same order as called
        https://bugs.webkit.org/show_bug.cgi?id=182193
        <rdar://problem/36930363>

        Reviewed by Chris Dumez.

        Covered by added test.
        Whenever opening/removing a cache requires writing to disk, wait to finish the task
        until any disk writing task is done.
        Applying this strategy when clearing data so that we also clear data that is pending to be written.
        For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
        WebCore uses that information to return true/false as promise resolution value.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::retrieveCaches):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clear):
        (WebKit::CacheStorage::Caches::open):
        (WebKit::CacheStorage::Caches::remove):
        (WebKit::CacheStorage::Caches::writeCachesToDisk):
        (WebKit::CacheStorage::Caches::cacheInfos):
        (WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
        * NetworkProcess/cache/CacheStorageEngineCaches.h:
        (WebKit::CacheStorage::Caches::createWeakPtr):

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

        Clean up API after bugs 178240 and 176474
        https://bugs.webkit.org/show_bug.cgi?id=182259

        Reviewed by Dan Bernstein.

        NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
        and it's necessary if we get really big numbers as options.  Changing them won't cause binary
        incompatibility unless someone does signed integer comparison with currently invalid values.

        Added availability macros I forgot to add earlier.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Add a compile-time feature flag
        https://bugs.webkit.org/show_bug.cgi?id=182211
        <rdar://problem/36936365>

        Reviewed by Brent Fulgham.

        * Configurations/FeatureDefines.xcconfig:

2018-01-29  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Introduce debug mode as experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=182199
        <rdar://problem/36930364>

        Reviewed by Alex Christensen.

        The only changes to default behavior are:
        - Increased resolution on timestamps which is needed to be able to set shorter
          timeouts in debug mode.
        - Only update partitioning and blocking table when needed. This is an optimization
          which pays off in less XPC with shorter timeouts.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/APIWebsiteDataStore.cpp:
        (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
        (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
        * UIProcess/API/APIWebsiteDataStore.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
        (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-01-29  Andy Estes  <aestes@apple.com>

        [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
        https://bugs.webkit.org/show_bug.cgi?id=182252
        <rdar://problem/21555881>

        Reviewed by Tim Horton.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::dispatchTouchEvent):
        (WebKit::WebPage::updatePotentialTapSecurityOrigin):

        Record the target frame origin of touch events that are potential taps, are
        TouchStart events, are targeted in frames that have touch event listeners, and are not
        handled by those listeners.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::potentialTapAtPosition):
        (WebKit::WebPage::commitPotentialTap):
        (WebKit::WebPage::cancelPotentialTapInFrame):

        Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it.

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

        Make policy checks more robust against null pointer dereferencing
        https://bugs.webkit.org/show_bug.cgi?id=182263
        <rdar://problem/34895714>

        Reviewed by Tim Horton.

        We're still dereferencing null.  Check everything.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

2018-01-29  Brent Fulgham  <bfulgham@apple.com>

        Add telemetry to track storage access API adoption
        https://bugs.webkit.org/show_bug.cgi?id=182197
        <rdar://problem/35803309>

        Reviewed by Chris Dumez.

        Part 1: Add telemetry for the user interaction case
        
        This patch adds telemetry to track how frequently third-party cookies are
        used in a first party context due to user interaction. This will help
        understand cases where the new Storage Access API can help, and to help
        us understand if we have considered relevant use cases in its design.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
        (WebKit::submitTopList): Update for new data types.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
        passed from the UIProcess.

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

        Fix crash when during canAuthenticateAgainstProtectionSpace
        https://bugs.webkit.org/show_bug.cgi?id=182260
        <rdar://problem/34911343>

        Reviewed by Chris Dumez.

        If we have a valid network load with no challenge completion handler and we are
        telling it to continue with the challenge handling, something has gone wrong.
        Maybe we've just recovered from a crashed network process.  If this happens, do nothing.

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

2018-01-29  Zach Li  <zacharyli323@gmail.com>

        Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
        https://bugs.webkit.org/show_bug.cgi?id=182251
        rdar://problem/36964995

        Reviewed by Alex Christensen.

        * Configurations/WebKit.xcconfig:
        Only link against SafariSafeBrowsing framework in 64-bit architecture.

        * Platform/spi/Cocoa/SafeBrowsingSPI.h:
        Guard the Safe Browsing code with WK_API_ENABLED.

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

        Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC
        https://bugs.webkit.org/show_bug.cgi?id=182256
        <rdar://problem/36689233>

        Reviewed by Simon Fraser.

        Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as
        this can lead to crashes such as the one in <rdar://problem/36689233>.

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::WebSWClientConnection):

2018-01-29  Jan-Michael Brummer  <jan.brummer@tabos.org>

        [GTK] Zooming gesture incorrectly uses scale instead of zoom 
        https://bugs.webkit.org/show_bug.cgi?id=182174

        Reviewed by Michael Catanzaro.

        Switch zooming gesture to use zoom instead of scale function.

        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::ZoomGesture::begin):
        (WebKit::GestureController::ZoomGesture::handleZoom):

2018-01-29  Brady Eidson  <beidson@apple.com>

        Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
        https://bugs.webkit.org/show_bug.cgi?id=182229

        Reviewed by Chris Dumez.

        * UIProcess/UIMessagePortChannelProvider.cpp:
        (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_configurationPreferenceValues): The UI process does not need to override the 
          global singleton provider. It can remain the default ProviderImpl to allow WK1 views 
          to work fine, too.

2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
        https://bugs.webkit.org/show_bug.cgi?id=182237

        Reviewed by Carlos Alberto Lopez Perez.

        We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::willShowJavaScriptDialog):

2018-01-29  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
        https://bugs.webkit.org/show_bug.cgi?id=182238

        Reviewed by Carlos Garcia Campos.

        Use GraphicsContextImplCairo::createFactory() helpers throughout the
        Cairo-specific GraphicsContext constructors in the WebKit layer.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        * UIProcess/cairo/BackingStoreCairo.cpp:
        (WebKit::BackingStore::incorporateUpdate):
        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
        (WebKit::WebPrintOperationGtk::renderPage):

2018-01-29  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Remove the GraphicsContext(cairo_t*) constructor
        https://bugs.webkit.org/show_bug.cgi?id=182234

        Reviewed by Carlos Garcia Campos.

        Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
        instead provide a factory function that returns a fresh
        GraphicsContextImplCairo object, passing that cairo_t object to its
        constructor.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::createGraphicsContext):
        * UIProcess/cairo/BackingStoreCairo.cpp:
        (WebKit::BackingStore::incorporateUpdate):
        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
        (WebKit::WebPrintOperationGtk::renderPage):

2018-01-26  Megan Gardner  <megan_gardner@apple.com>

        Don't retain focus for input peripheral views
        https://bugs.webkit.org/show_bug.cgi?id=182204

        Reviewed by Tim Horton.

        Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
        the current architecture. This should probably be fixed in UIKit, as there is no reason for
        focus to be retained on these views anyways, as they don't have keyboard input, but this
        guards against over-aggressive retain requests.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _restoreFocusWithToken:]):
        (-[WKContentView _preserveFocusWithToken:destructively:]):

2018-01-26  Chris Dumez  <cdumez@apple.com>

        Make sure service worker code does not launch a StorageProcess unnecessarily
        https://bugs.webkit.org/show_bug.cgi?id=182192
        <rdar://problem/36927427>

        Reviewed by Geoffrey Garen.

        When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not
        force the creation of a WebProcess connection to the StorageProcess. If there is
        no WebProcess, just return false right away.

        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
        * WebProcess/WebProcess.h:

2018-01-26  Alex Christensen  <achristensen@webkit.org>

        Allow cellular access for default-created ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=182179
        <rdar://problem/36572023>

        Reviewed by Andy Estes.

        This makes it so when we recover from a NetworkProcess crash (see r227590) on iOS, we will
        be able to continue browsing using cell data.

        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setPrivateBrowsingEnabled):

2018-01-26  Alex Christensen  <achristensen@webkit.org>

        Clean up more networking code
        https://bugs.webkit.org/show_bug.cgi?id=182161

        Reviewed by Anders Carlsson.

        Two cleanups:
        1. The WebProcess doesn't need to initialize NetworkSessions.
        2. WebFrameNetworkingContext doesn't need to have the NetworkingContext functions to support ResourceHandles in WebKit any more.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/RemoteNetworkingContext.h:
        (): Deleted.
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
        (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
        (WebKit::RemoteNetworkingContext::isValid const): Deleted.
        (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
        (WebKit::RemoteNetworkingContext::isValid const): Deleted.
        (WebKit::RemoteNetworkingContext::localFileContentSniffingEnabled const): Deleted.
        (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
        (WebKit::RemoteNetworkingContext::sourceApplicationAuditData const): Deleted.
        (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier const): Deleted.
        (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
        * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
        (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
        (WebKit::RemoteNetworkingContext::isValid const): Deleted.
        (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::clearCachedCredentials):

2018-01-26  Jan-Michael Brummer  <jan.brummer@tabos.org>

        [GTK] Support using long-tap gesture to open context menu
        https://bugs.webkit.org/show_bug.cgi?id=140747

        Reviewed by Carlos Garcia Campos.

        Add long press gesture which simulates a secondary mouse press to open context menu.

        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::GestureController):
        (WebKit::GestureController::handleEvent):
        (WebKit::GestureController::isProcessingGestures const):
        (WebKit::GestureController::Gesture::simulateMousePress):
        (WebKit::GestureController::DragGesture::handleTap):
        (WebKit::GestureController::LongPressGesture::longPressed):
        (WebKit::GestureController::LongPressGesture::pressed):
        (WebKit::GestureController::LongPressGesture::LongPressGesture):
        * UIProcess/gtk/GestureController.h:
        (WebKit::GestureController::reset):

2018-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. REGRESSION(r227647): window.open() is broken in GTK and WPE after r227647.

        In r227647, API::UIClient::createNewPage() was changed to use CompletionHandler instead of Function. All
        implementations were updated expect the GLib one, and we didn't notice it because the method doesn't have the
        final/override mark.

        * UIProcess/API/glib/WebKitUIClient.cpp:
        (UIClient::createNewPage):

2018-01-25  Sergio Villar Senin  <svillar@igalia.com>

        [WebVR] Make WebVR available by default for developer builds
        https://bugs.webkit.org/show_bug.cgi?id=182101

        Reviewed by Michael Catanzaro.

        Moved WebVR setting to the experimental features section and make it
        available by default for developer builds for GTK and WPE.

        * Shared/WebPreferences.yaml:

2018-01-25  Alex Christensen  <achristensen@webkit.org>

        REGRESSION (r221899): Web Content process hangs when webpage tries to make a new window if the WKWebView doesn’t have a UI delegate
        https://bugs.webkit.org/show_bug.cgi?id=182152

        Reviewed by Joseph Pecoraro.

        Call the completion handler of the default API::UIClient::createNewPage.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::createNewPage):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageUIClient):
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::createNewPage):

2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] [WK2] Introduce new views and view controllers to support extra-zoomed text form controls
        https://bugs.webkit.org/show_bug.cgi?id=182000
        <rdar://problem/35143035>

        Reviewed by Tim Horton.

        Add new files to support text form control editing while extra-zoomed.

        * UIProcess/ios/forms/WKFocusedFormControlView.h: Added.
        * UIProcess/ios/forms/WKFocusedFormControlView.mm: Added.
        * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Added.
        * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Added.
        * UIProcess/ios/forms/WKTextFormControlViewController.h: Added.
        * UIProcess/ios/forms/WKTextFormControlViewController.mm: Added.
        * UIProcess/ios/forms/WKTextInputViewController.h: Added.
        * UIProcess/ios/forms/WKTextInputViewController.mm: Added.
        * UIProcess/ios/forms/WKTextSuggestionButton.h: Added.
        * UIProcess/ios/forms/WKTextSuggestionButton.mm: Added.
        * WebKit.xcodeproj/project.pbxproj:

2018-01-25  Chris Dumez  <cdumez@apple.com>

        Clients.get(id) should only returns clients in the service worker's origin
        https://bugs.webkit.org/show_bug.cgi?id=182149
        <rdar://problem/36882310>

        Reviewed by Youenn Fablet.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):

2018-01-25  Youenn Fablet  <youenn@apple.com>

        WebPluginInfoProvider should handle null host queries
        https://bugs.webkit.org/show_bug.cgi?id=182112

        Reviewed by Chris Dumez.

        Return early if host is null.

        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::populatePluginCache):

2018-01-25  Simon Fraser  <simon.fraser@apple.com>

        ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero)) in WebViewImpl::setFrameAndScrollBy()
        https://bugs.webkit.org/show_bug.cgi?id=182082
        rdar://problem/13971838

        Reviewed by Tim Horton.

        Safari could call WebViewImpl::setFrameAndScrollBy() multiple times with different scroll offsets,
        triggering this assertion.

        Rename to m_resizeScrollOffset to m_scrollOffsetAdjustment to reduce confusion with actual scroll offsets.
        This parameter has no effect on macOS, but is used by the -[WKWebView setFrame:andScrollBy:] so at some point
        needs to be hooked up to allow synchronous view resize and scroll adjustment (e.g. for the Find bar animation).
        
        Remove DrawingAreaProxy's m_layerPosition which was unused, and remove the parameters from the UpdateGeometry message.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _frameOrBoundsChanged]):
        (-[WKWebView _beginAnimatedResizeWithUpdates:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setFrameAndScrollBy):
        (WebKit::WebViewImpl::setDrawingAreaSize):
        * UIProcess/DrawingAreaProxy.cpp:
        (WebKit::DrawingAreaProxy::setSize):
        * UIProcess/DrawingAreaProxy.h:
        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
        (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
        (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::updateGeometry):
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
        (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):

2018-01-25  Keith Rollin  <krollin@apple.com>

        Add logging to facilitate binding of WebContent and Network processes to UI process
        https://bugs.webkit.org/show_bug.cgi?id=182066

        Reviewed by Brent Fulgham.

        When examining sysdiagnose logs and tracing events from one process to
        another, it would be helpful to know which WebKit processes were
        related to each other. When Safari, Mail, Messages, etc. are all
        running at the same time, it may otherwise be difficult to know if a
        particular Network process, for example was associated with Safari or
        some other application. Add some logging to the creation of WebContent
        and Network processes to identify their "presenting process" (parent
        application).

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        * Platform/Logging.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-01-25  Youenn Fablet  <youenn@apple.com>

        DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
        https://bugs.webkit.org/show_bug.cgi?id=182115

        Reviewed by Alex Christensen.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):

2018-01-25  Alex Christensen  <achristensen@webkit.org>

        Fix crash when preconnecting while closing private browsing
        https://bugs.webkit.org/show_bug.cgi?id=182114
        <rdar://problem/35637284>

        Reviewed by Joseph Pecoraro.

        * NetworkProcess/PreconnectTask.cpp:
        There is a race condition when destroying a session while a page is initiating a preconnect.
        If this happens, fail gracefully instead of trying to preconnect with a null session.

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

        [Mac] Enable library validation for Networking & Storage XPC services
        https://bugs.webkit.org/show_bug.cgi?id=173424
        <rdar://problem/32386565>

        Reviewed by Joseph Pecoraro.

        * Configurations/BaseXPCService.xcconfig: Moved the definitions of
          WK_LIBRARY_VALIDATION_ENABLED and WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS from
          WebContentService.xcconfig to here and made them Mac-only at this level.
        * Configurations/NetworkService.xcconfig: Also set OTHER_CODE_SIGN_FLAGS to
          WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS.
        * Configurations/StorageService.xcconfig: Ditto.
        * Configurations/WebContentService.xcconfig: Moved definitions from here to
          BaseXPCService.xcconfig.

2018-01-25  David Hyatt  <hyatt@apple.com>

        Enable lines clamp support for Apple Mail by default
        https://bugs.webkit.org/show_bug.cgi?id=182113

        Reviewed by Dean Jackson.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::appleMailLinesClampEnabled):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_cpuLimit):

2018-01-25  Sergio Villar Senin  <svillar@igalia.com>

        [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
        https://bugs.webkit.org/show_bug.cgi?id=182102

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:

2018-01-25  Sergio Villar Senin  <svillar@igalia.com>

        [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
        https://bugs.webkit.org/show_bug.cgi?id=182102

        Reviewed by Carlos Garcia Campos.

        This new public API was not supposed to be included in the patch
        that added OpenVR to the tree and to the build.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty):
        (webKitSettingsGetProperty):
        (webkit_settings_class_init):
        (webkit_settings_get_enable_webvr): Deleted.
        (webkit_settings_set_enable_webvr): Deleted.
        * UIProcess/API/gtk/WebKitSettings.h:
        * UIProcess/API/wpe/WebKitSettings.h:

2018-01-25  Claudio Saavedra  <csaavedra@igalia.com>

        [GTK] Fix build with touch events disabled

        Unreviewed build fix.

        Explicitly include gtk.h in files that were indirectly getting it
        only when touch events were enabled.
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        * UIProcess/gtk/WaylandCompositor.h:

2018-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
        https://bugs.webkit.org/show_bug.cgi?id=182096

        Reviewed by Carlos Alberto Lopez Perez.

        It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
        and the map is modified inside the loop. We need to use copyToVector to copy the keys.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
        (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
        (WebKit::WebAutomationSession::willShowJavaScriptDialog):

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

        Gracefully recover from NetworkProcess crashes in private browsing
        https://bugs.webkit.org/show_bug.cgi?id=182073
        <rdar://problem/36572023>

        Reviewed by Geoff Garen.

        If we're using a non-persistent WKWebsiteDataStore and the NetworkProcess crashes and we try to do a load,
        then the WebProcess restarts the NetworkProcess but doesn't recreate the ephemeral session in the NetworkProcess.
        When this happens, we've already lost the browsing state in memory in the NetworkProcess, but we don't want to hang.
        If this is the problem, then just recreate the ephemeral session and continue loading.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * Shared/WebsiteDataStoreParameters.cpp:
        (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
        (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
        * Shared/WebsiteDataStoreParameters.h:
        (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):

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

        Enable library validation on the Web Content service
        Part 1 of https://bugs.webkit.org/show_bug.cgi?id=172365
        <rdar://problem/26470661>

        Reviewed by David Kilzer.

        This makes the Web Content process signed with the Library Validation flag in production
        builds. Because doing so would prevent engineering builds of Apple apps that use an
        injected bundle from working, this also adds a Development version of the service, which
        does not enforce Library Validation. The UI process chooses to use the Development service
        iff it would need to load an injected bundle that is not part of the OS.

        * Configurations/DebugRelease.xcconfig: Disable Library Validation in engineering builds.

        * Configurations/WebContentService.Development.xcconfig: Added. Like the normal service, but
          only installed when WebKit is installed in the OS, and uses a Development variant.

        * Configurations/WebContentService.xcconfig: For the Development variant, append
          ".Development" to the product name, which is also the service identifier. Enable Library
          Validation for the Normal variant of the service when WK_LIBRARY_VALIDATION_ENABLED allows
          it.

        * UIProcess/Launcher/ProcessLauncher.h: Add nonValidInjectedCodeAllowed member to
          LaunchOptions, false by default.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::serviceName): Use the Development variant if nonValidInjectedCodeAllowed is true.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::getLaunchOptions): Initialize nonValidInjectedCodeAllowed using
           the new shouldAllowNonValidInjectedCode().
        (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Generic implementation
          that returns false.
        * UIProcess/WebProcessProxy.h: Declared shouldAllowNonValidInjectedCode.
        * UIProcess/mac/WebProcessProxyMac.mm:
        (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return true if this is
          system WebKit with a non-system injected bundle.

        * WebKit.xcodeproj/project.pbxproj: Added new service target.

2018-01-24  Chris Dumez  <cdumez@apple.com>

        Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
        https://bugs.webkit.org/show_bug.cgi?id=182021
        <rdar://problem/21629943>

        Reviewed by Ryosuke Niwa.

        Add a new DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption that the caller can
        set when calling sendSync(). This indicates that the sendSync() should return only when we receive
        the response to our sync IPC message, and that we should not process ANY incoming IPC in the meantime.

        This patch also starts using this flag in 3 places where we know processing incoming IPC is an issue
        and is causing crashes.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::sendSyncMessage):
        When DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, make sure
        we set the ShouldDispatchMessageWhenWaitingForSyncReply flag on the encoder. If we did not set this
        flag then it could cause deadlocks when the destination process is also waiting on a synchronous
        IPC from us. Normally, this flag already gets set for sync messages because sendSyncMessage() calls
        sendMessage() with DispatchMessageEvenWhenWaitingForSyncReply SyncOption. However, sendMessage()
        ignores the DispatchMessageEvenWhenWaitingForSyncReply flag if the
        m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag is set on the
        connection. Note that this flag is set on the connection from the WebProcess to the UIProcess at
        the moment, which is why we saw deadlocks on the previous iteration of this patch.

        (IPC::Connection::waitForSyncReply):
        If DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, do not
        process incoming IPC messages while waiting for our sync IPC reply.

        * Platform/IPC/Connection.h:
        Add new SendSyncOption.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        Testing infrastructure.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        Use new flag.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        Testing infrastructure.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
        Use new flag.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
        Testing infrastructure.

        (WebKit::WebProcess::ensureNetworkProcessConnection):
        Use new flag.

        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        Testing infrastructure.

2018-01-24  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Remove duplicate preference update for WebAuthentication value
        https://bugs.webkit.org/show_bug.cgi?id=182058

        Reviewed by Brian Burg.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        An identical update already happens in generated code.

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

        Remove WebProcess access to QTKit
        https://bugs.webkit.org/show_bug.cgi?id=182035

        Reviewed by Alexey Proskuryakov.

        * WebProcess/com.apple.WebProcess.sb.in:
        This isn't needed any more.  We only have a little bit of code that uses QTKit which we should remove,
        and it's only used for fullscreen controls in WebKitLegacy.  Let's tighten up the sandbox!

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

        Remove pre-Sierra-OS-specific code in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=182024

        Reviewed by Tim Horton.

        * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
        * Shared/Cocoa/DataDetectionResult.mm:
        (WebKit::DataDetectionResult::encode const):
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<WebCore::Payment>::encode):
        (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
        (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
        (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
        * Shared/WebPreferencesDefaultValues.h:
        * Shared/cg/ShareableBitmapCG.cpp:
        (WebKit::wantsExtendedRange):
        * Shared/ios/InteractionInformationAtPosition.mm:
        (WebKit::InteractionInformationAtPosition::encode const):
        * Shared/mac/CodeSigning.mm:
        (WebKit::codeSigningIdentifier):
        (WebKit::codeSigningIdentifierForCurrentProcess):
        * Shared/mac/ColorSpaceData.mm:
        (WebKit::ColorSpaceData::encode const):
        * Shared/mac/PasteboardTypes.mm:
        (WebKit::PasteboardTypes::forURL):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
        (IPC::ArgumentCoder<Credential>::encodePlatformData):
        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
        * Shared/mac/WebHitTestResultData.mm:
        (WebKit::WebHitTestResultData::platformEncode const):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setObject:forBundleParameter:]):
        (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _handleAcceptedCandidate:]):
        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::handleAcceptedCandidate):
        (WebKit::WebViewImpl::performDragOperation):
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
        * WebProcess/com.apple.WebProcess.sb.in:

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

        Stop using AuthenticationClient in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=182016

        Reviewed by Brady Eidson.

        It was necessary to support ResourceHandle use in WebKit, but now we're using NetworkSession everywhere in WebKit.

        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
        (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
        (WebKit::AuthenticationManager::cancelSingleChallenge):
        (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
        (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):

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

        Remove WebProcess authentication code
        https://bugs.webkit.org/show_bug.cgi?id=182020

        Reviewed by Brady Eidson.

        * Shared/Authentication/AuthenticationManager.cpp:
        * Shared/Authentication/AuthenticationManager.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
        * WebProcess/WebProcess.cpp:
        (WebKit::m_webSQLiteDatabaseTracker):

2018-01-24  Jan-Michael Brummer  <jan.brummer@tabos.org>

        [GTK] Page crash after swipe gesture running GNOME3 under wayland
        https://bugs.webkit.org/show_bug.cgi?id=181996

        Reviewed by Michael Catanzaro.

        Add missing GDK_TOUCH_CANCEL support which fixes page crashes due to cancelled gestures.
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebTouchEvent):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::doneWithTouchEvent):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (touchPointStateForEvents):
        (webkitWebViewBaseGetTouchPointsForEvent):
        (webkitWebViewBaseTouchEvent):
        * UIProcess/gtk/GestureController.cpp:
        (WebKit::GestureController::handleEvent):

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

        Remove unused QTKit preference
        https://bugs.webkit.org/show_bug.cgi?id=181968

        Reviewed by Alexey Proskuryakov.

        * Shared/API/c/WKDeprecatedFunctions.cpp:
        (WKPreferencesSetQTKitEnabled):
        (WKPreferencesGetQTKitEnabled):
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetQTKitEnabled): Deleted.
        (WKPreferencesGetQTKitEnabled): Deleted.
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setQTKitEnabled:]): Deleted.
        (-[WKPreferences _qtKitEnabled]): Deleted.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-01-24  Youenn Fablet  <youenn@apple.com>

        Fetch response should copy its url from the request if null
        https://bugs.webkit.org/show_bug.cgi?id=182048

        Reviewed by Chris Dumez.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):

2018-01-24  Sergio Villar Senin  <svillar@igalia.com>

        Unreviewed build fix after r227518. I forgot to add the function declarations to the WPE
        header.

        * UIProcess/API/wpe/WebKitSettings.h: Added webkit_settings_get/set_enable_webvr.

2018-01-24  Youenn Fablet  <youenn@apple.com>

        Add Cache Storage engine assertion following on bug 181887
        https://bugs.webkit.org/show_bug.cgi?id=181925

        Reviewed by Alex Christensen.

        In a normal environment, the folderPath should be the same as the path computed from the ClientOrigin.
        Add assertion to verify this.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):

2018-01-24  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
        https://bugs.webkit.org/show_bug.cgi?id=182031

        Reviewed by Carlos Garcia Campos.

        No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
        GDK_EVENT_PROPAGATE, to improve readability.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseKeyPressEvent):
        (webkitWebViewBaseKeyReleaseEvent):
        (webkitWebViewBaseButtonPressEvent):
        (webkitWebViewBaseButtonReleaseEvent):
        (webkitWebViewBaseScrollEvent):
        (webkitWebViewBaseMotionNotifyEvent):
        (webkitWebViewBaseCrossingNotifyEvent):
        (webkitWebViewBaseTouchEvent):

2018-01-23  Eric Carlson  <eric.carlson@apple.com>

        Resign NowPlaying status when no media element is eligible
        https://bugs.webkit.org/show_bug.cgi?id=181914
        <rdar://problem/35294116>

        Reviewed by Jer Noble.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
        status.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.

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

        Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
        https://bugs.webkit.org/show_bug.cgi?id=181961

        Reviewed by Michael Catanzaro.

        * NetworkProcess/Downloads/Download.h:
        * NetworkProcess/NetworkLoad.cpp:
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkResourceLoadParameters.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        * WebProcess/WebProcess.cpp:

2018-01-23  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rollout r227216 as it seems to be causing deadlocks
        https://bugs.webkit.org/show_bug.cgi?id=182013

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::waitForSyncReply):
        * Platform/IPC/Connection.h:
        (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): Deleted.
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::NetworkProcessConnection):
        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
        (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
        * WebProcess/WebConnectionToUIProcess.cpp:
        (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::undo):
        (WebKit::WebEditorClient::redo):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): Deleted.
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

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

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

        broke build (Requested by alexchristensen on #webkit).

        Reverted changeset:

        "Remove unused QTKit preference"
        https://bugs.webkit.org/show_bug.cgi?id=181968
        https://trac.webkit.org/changeset/227437

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

        Remove compile guard around beacon API
        https://bugs.webkit.org/show_bug.cgi?id=182002

        Reviewed by Sam Weinig.

        It's enabled everywhere now.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetBeaconAPIEnabled):
        (WKPreferencesGetBeaconAPIEnabled):
        * config.h:

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

        Remove unused QTKit preference
        https://bugs.webkit.org/show_bug.cgi?id=181968

        Reviewed by Alexey Proskuryakov.

        * Shared/API/c/WKDeprecatedFunctions.cpp:
        (WKPreferencesSetQTKitEnabled):
        (WKPreferencesGetQTKitEnabled):
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetQTKitEnabled): Deleted.
        (WKPreferencesGetQTKitEnabled): Deleted.
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setQTKitEnabled:]): Deleted.
        (-[WKPreferences _qtKitEnabled]): Deleted.
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2018-01-23  Brent Fulgham  <bfulgham@apple.com>

        [macOS] WebProcess needs TCC entitlements for media capture
        https://bugs.webkit.org/show_bug.cgi?id=181995
        <rdar://problem/36674649>

        Reviewed by Eric Carlson.

        * Configurations/WebContent-OSX.entitlements: Add delegated services needed to support media
        capture features.

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

        [Cocoa] Disable header postprocessing when building for macOS High Sierra
        https://bugs.webkit.org/show_bug.cgi?id=181972

        Reviewed by Anders Carlsson.

        * Configurations/WebKit.xcconfig: Adopt macOSTargetConditionals.xcconfig helpers and disable postprocessing
          when building for macOS 10.13.

2018-01-23  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Window resizing is broken after detaching to separate window
        https://bugs.webkit.org/show_bug.cgi?id=181992
        <rdar://problem/36714840>

        Reviewed by Brian Burg.

        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformDetach):
        Restore the inspector view's autoresizingMask to the initial value
        that works with a detached window. This gets changed when the view
        gets attached to bottom/side, so we need to revert it on detaching.

2018-01-23  Brady Eidson  <beidson@apple.com>

        Allow passing MessagePorts across processes (e.g. ServiceWorkers).
        https://bugs.webkit.org/show_bug.cgi?id=181178

        Reviewed by Andy Estes.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::postMessageToServiceWorker):
        (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:

        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::postMessageToServiceWorkerClient):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
        (WebKit::WebProcessProxy::postMessageToRemote):

        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::postMessageToServiceWorker):
        (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWClientConnection.messages.in:

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
        (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
        * WebProcess/Storage/WebSWContextManagerConnection.h:
        * WebProcess/Storage/WebSWContextManagerConnection.messages.in:

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

        Unreviewed, rolling out r227279 and r227373.
        https://bugs.webkit.org/show_bug.cgi?id=181988

        The LayoutTest crash fix introduced an API test failure.
        (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "Resign NowPlaying status when no media element is eligible"
        https://bugs.webkit.org/show_bug.cgi?id=181914
        https://trac.webkit.org/changeset/227279

        "Resign NowPlaying status when no media element is eligible"
        https://bugs.webkit.org/show_bug.cgi?id=181914
        https://trac.webkit.org/changeset/227373

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

        REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish()
        https://bugs.webkit.org/show_bug.cgi?id=181956
        <rdar://problem/36755492>

        Reviewed by Chris Dumez.

        Covered by test no longer crashing in Debug builds.
        Reset m_redirectionStatus to None when starting an SW fetch.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::start):
        (WebKit::ServiceWorkerClientFetch::didFinish):

2018-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] TestWebKitFindController asserts
        https://bugs.webkit.org/show_bug.cgi?id=181472

        Reviewed by Carlos Garcia Campos.

        Let's fix this in two independent ways.

        First, use a GRefPtr to hold ownership of the WebKitWebViewBackend. This way, we don't need
        to change the order in which WebKitWebView destroys its priv struct members from what is
        used in WebKitGTK+, which can lead to odd bugs.

        Additionally, just for good measure, stop resetting the find client when disposing
        WebKitFindController. This is unnecessary because it will never be destroyed before the
        WebKitWebView.

        * UIProcess/API/glib/WebKitFindController.cpp:
        (webkit_find_controller_class_init):
        (webkitFindControllerDispose): Deleted.
        * UIProcess/API/glib/WebKitWebView.cpp:
        (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
        (webkitWebViewSetProperty):
        (webkitWebViewGetProperty):
        (webkitWebViewCreatePage):
        (webkit_web_view_get_backend):
        * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
        (webkitWebViewBackendCreateDefault):
        (WTF::refGPtr):
        (WTF::derefGPtr):
        * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:

2018-01-22  Jon Lee  <jonlee@apple.com>

        Update title label size
        https://bugs.webkit.org/show_bug.cgi?id=181962
        rdar://problem/36754744

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
        (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
        createSubviews.
        (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
        Refer to a const CGFloat for the font size.

2018-01-22  Megan Gardner  <megan_gardner@apple.com>

        Temporarily restore block selection code conditionally
        https://bugs.webkit.org/show_bug.cgi?id=181895
        <rdar://problem/36567325>

        Reviewed by Tim Horton.

        We need to restore this code temporarily to avoid a crash.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):

2018-01-22  Zach Li  <zacharyli323@gmail.com>

        We should not try to link against the Safe Browsing framework on watchOS and tvOS.
        https://bugs.webkit.org/show_bug.cgi?id=181965.

        Reviewed by Tim Horton.

        * Configurations/WebKit.xcconfig:

2018-01-22  Alex Christensen  <achristensen@webkit.org>

        Remove pre-NetworkSession loading code
        https://bugs.webkit.org/show_bug.cgi?id=181944

        Reviewed by Tim Horton.

        We were keeping it around for El Capitan.

        * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
        (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
        * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
        (WebKit::LegacyCustomProtocolManager::initialize):
        * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
        * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed.
        * NetworkProcess/Downloads/BlobDownloadClient.h: Removed.
        * NetworkProcess/Downloads/Download.cpp:
        (WebKit::Download::~Download):
        (WebKit::Download::cancel):
        (WebKit::Download::didReceiveChallenge):
        (WebKit::Download::didFinish):
        (WebKit::Download::isAlwaysOnLoggingAllowed const):
        (WebKit::Download::start): Deleted.
        (WebKit::Download::startWithHandle): Deleted.
        (WebKit::Download::didStart): Deleted.
        (WebKit::Download::willSendRedirectedRequest): Deleted.
        (WebKit::Download::didReceiveAuthenticationChallenge): Deleted.
        (WebKit::Download::didReceiveResponse): Deleted.
        (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted.
        (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
        (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted.
        (WebKit::Download::didDecideDownloadDestination): Deleted.
        (WebKit::Download::continueDidReceiveResponse): Deleted.
        * NetworkProcess/Downloads/Download.h:
        (WebKit::Download::setBlobFileReferences): Deleted.
        (WebKit::Download::request const): Deleted.
        * NetworkProcess/Downloads/DownloadManager.cpp:
        (WebKit::DownloadManager::startDownload):
        (WebKit::DownloadManager::willDecidePendingDownloadDestination):
        (WebKit::DownloadManager::convertNetworkLoadToDownload):
        (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
        (WebKit::DownloadManager::resumeDownload):
        (WebKit::DownloadManager::cancelDownload):
        * NetworkProcess/Downloads/DownloadManager.h:
        (WebKit::DownloadManager::startDownload):
        * NetworkProcess/Downloads/PendingDownload.cpp:
        * NetworkProcess/Downloads/PendingDownload.h:
        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
        * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
        * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed.
        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
        * NetworkProcess/NetworkCORSPreflightChecker.h:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        * NetworkProcess/NetworkDataTask.cpp:
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        * NetworkProcess/NetworkDataTaskBlob.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::~NetworkLoad):
        (WebKit::NetworkLoad::setDefersLoading):
        (WebKit::NetworkLoad::cancel):
        (WebKit::NetworkLoad::continueWillSendRequest):
        (WebKit::NetworkLoad::continueDidReceiveResponse):
        (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const):
        (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted.
        (WebKit::NetworkLoad::didReceiveBuffer): Deleted.
        (WebKit::NetworkLoad::didFinishLoading): Deleted.
        (WebKit::NetworkLoad::didFail): Deleted.
        (WebKit::NetworkLoad::willSendRequestAsync): Deleted.
        (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted.
        (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted.
        (WebKit::NetworkLoad::receivedCancellation): Deleted.
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkLoadParameters.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeNetworkProcess):
        (WebKit::NetworkProcess::clearCachedCredentials):
        (WebKit::NetworkProcess::findPendingDownloadLocation):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/NetworkSession.cpp:
        * NetworkProcess/NetworkSession.h:
        * NetworkProcess/PingLoad.cpp:
        * NetworkProcess/PingLoad.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        * NetworkProcess/mac/NetworkLoadMac.mm: Removed.
        * NetworkProcess/mac/RemoteNetworkingContext.mm:
        (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
        * Shared/Authentication/AuthenticationManager.cpp:
        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
        (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
        (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
        (WebKit::AuthenticationManager::cancelSingleChallenge):
        (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
        (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
        * Shared/Authentication/AuthenticationManager.h:
        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed.
        * Shared/SessionTracker.cpp:
        (WebKit::SessionTracker::setSession):
        (WebKit::SessionTracker::destroySession):
        * Shared/SessionTracker.h:
        * Shared/mac/CookieStorageShim.h: Removed.
        * Shared/mac/CookieStorageShim.mm: Removed.
        * UIProcess/API/APIDownloadClient.h:
        (API::DownloadClient::didReceiveData):
        (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetDownloadClient):
        * UIProcess/Cocoa/DownloadClient.h:
        * UIProcess/Cocoa/DownloadClient.mm:
        (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
        * UIProcess/Downloads/DownloadProxy.cpp:
        (WebKit::DownloadProxy::willSendRequest):
        (WebKit::DownloadProxy::didReceiveResponse):
        (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted.
        (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted.
        * UIProcess/Downloads/DownloadProxy.h:
        * UIProcess/Downloads/DownloadProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::clearCachedCredentials):
        * config.h:

2018-01-22  Youenn Fablet  <youenn@apple.com>

        SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
        https://bugs.webkit.org/show_bug.cgi?id=181942
        <rdar://problem/35132091>

        Reviewed by Chris Dumez.

        Add ServiceWorkerRegistrations and DOMCache as persistent data to be cleared according ITP decisions.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):

2018-01-22  Chris Dumez  <cdumez@apple.com>

        Add release logging to help debug issues related to service workers
        https://bugs.webkit.org/show_bug.cgi?id=181935
        <rdar://problem/36735900>

        Reviewed by Brady Eidson.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        (WebKit::WebSWServerConnection::didFinishFetch):
        (WebKit::WebSWServerConnection::didFailFetch):
        (WebKit::WebSWServerConnection::didNotHandleFetch):

2018-01-22  Brent Fulgham  <bfulgham@apple.com>

        [iOS] REGRESSION (r225763): Allow access to power logging features
        https://bugs.webkit.org/show_bug.cgi?id=181938
        <rdar://problem/36442803>

        Reviewed by Eric Carlson.

        I denied access to the powerlog facility in r225763, not realizing that it
        gets activated in certain logging scenarios. This patch reverts this change.

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

2018-01-22  Brent Fulgham  <bfulgham@apple.com>

        [macOS, iOS] Allow accss to AVFoundation preference
        https://bugs.webkit.org/show_bug.cgi?id=181937
        <rdar://problem/33137029>

        Reviewed by Eric Carlson.

        Grant access to the 'com.apple.avfoundation.frecents' preference.

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

2018-01-22  Brady Eidson  <beidson@apple.com>

        In WebKit2, make the MessagePortChannelRegistry live in the UI process.
        https://bugs.webkit.org/show_bug.cgi?id=181922

        Reviewed by Andy Estes.

        With all of the work that went into making MessagePorts be fully asynchronous
        and to be process-aware, formally moving them out-of-process is just a matter
        of adding WebKit IPC layers.
        
        The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch
        adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for
        each side of the process divide.
        
        * UIProcess/UIMessagePortChannelProvider.cpp: Added.
        (WebKit::UIMessagePortChannelProvider::singleton):
        (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
        (WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider):
        (WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel):
        (WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
        (WebKit::UIMessagePortChannelProvider::messagePortDisentangled):
        (WebKit::UIMessagePortChannelProvider::messagePortClosed):
        (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
        (WebKit::UIMessagePortChannelProvider::postMessageToRemote):
        (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
        (WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity):
        * UIProcess/UIMessagePortChannelProvider.h: Added.
        (WebKit::UIMessagePortChannelProvider::registry):

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

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::processForIdentifier):
        (WebKit::m_userMediaCaptureManagerProxy):
        (WebKit::WebProcessProxy::~WebProcessProxy):
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::createNewMessagePortChannel):
        (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
        (WebKit::WebProcessProxy::messagePortDisentangled):
        (WebKit::WebProcessProxy::messagePortClosed):
        (WebKit::WebProcessProxy::takeAllMessagesForPort):
        (WebKit::WebProcessProxy::didDeliverMessagePortMessages):
        (WebKit::WebProcessProxy::postMessageToRemote):
        (WebKit::WebProcessProxy::checkRemotePortForActivity):
        (WebKit::WebProcessProxy::checkProcessLocalPortForActivity):
        (WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:

        * WebKit.xcodeproj/project.pbxproj:

        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added.
        (WebKit::WebMessagePortChannelProvider::singleton):
        (WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider):
        (WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider):
        (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
        (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
        (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
        (WebKit::WebMessagePortChannelProvider::messagePortClosed):
        (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
        (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
        (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
        (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
        (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
        (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeProcess):
        (WebKit::WebProcess::didTakeAllMessagesForPort):
        (WebKit::WebProcess::checkProcessLocalPortForActivity):
        (WebKit::WebProcess::didCheckRemotePortForActivity):
        (WebKit::WebProcess::messagesAvailableForPort):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-01-22  Youenn Fablet  <youenn@apple.com>

        Bump default cache storage quota to 50MB
        https://bugs.webkit.org/show_bug.cgi?id=181924

        Reviewed by Chris Dumez.

        Existing web sites use more than 20 MB.

        * UIProcess/WebsiteData/WebsiteDataStore.h:

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

        Unreviewed build fix after r227292. Fixing a bad copy-paste that broke
        the GTK+ debug builds.

        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        (WebKit::convertCairoSurfaceToShareableBitmap):

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

        [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
        https://bugs.webkit.org/show_bug.cgi?id=181930

        Reviewed by Carlos Garcia Campos.

        Call sites of the PlatformContextCairo::drawSurfaceToContext() method
        are adjusted to now call Cairo::drawSurface() and properly pass the
        PlatformContextCairo object to the function.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::paint):
        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        (WebKit::convertCairoSurfaceToShareableBitmap):

2018-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix compile warning.

        Use #include instead of #import in cross-platform code.

        * Shared/WebPreferencesDefaultValues.cpp:

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

        Turning off custom pasteboard data doesn't actually turn it off in WK2
        https://bugs.webkit.org/show_bug.cgi?id=181920
        <rdar://problem/36686429>

        Reviewed by Wenson Hsieh.

        Moved the code to decide when to enable custom pasteboard data from WebCore
        since we never enable this feature in WebKit1.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (defaultCustomPasteboardDataEnabled): Added.
        * Shared/WebPreferencesDefaultValues.h:

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

        Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
        https://bugs.webkit.org/show_bug.cgi?id=181918

        Reviewed by Tim Horton.

        Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).

        * Configurations/FeatureDefines.xcconfig:

2018-01-21  Eric Carlson  <eric.carlson@apple.com>

        Resign NowPlaying status when no media element is eligible
        https://bugs.webkit.org/show_bug.cgi?id=181914
        <rdar://problem/35294116>

        Reviewed by Jer Noble.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
        status.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.

2018-01-20  Andy Estes  <aestes@apple.com>

        [Apple Pay] Stop eagerly loading PassKit.framework
        https://bugs.webkit.org/show_bug.cgi?id=181911
        <rdar://problem/36555369>

        Reviewed by Tim Horton.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:

        Removed availablePaymentNetworks from WebPageCreationParameters.

        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetApplePayEnabled):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):

        Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().

        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:

        Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
        networks.

        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):

        Returned false if PassKitLibrary() fails.

        (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
        (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):

        Called completionHandler with false if PassKitLibrary() fails.

        (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
        (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):

        Renamed availablePaymentNetworks to platformAvailablePaymentNetworks

        (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.

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

        Called completionHandler with false if PassKitLibrary() fails.

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

        Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().

        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
        (WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
        * WebProcess/ApplePay/WebPaymentCoordinator.h:

        Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
        starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
        message the first time it's accessed.

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

        Stopped setting PageConfiguration::availablePaymentNetworks.

2018-01-20  Jer Noble  <jer.noble@apple.com>

        Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
        https://bugs.webkit.org/show_bug.cgi?id=181840
        <rdar://problem/36186214>

        Reviewed by Simon Fraser.

        Updating layout while the document is suspended or stopped is unsafe.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::inlineVideoFrame):

2018-01-20  Chris Dumez  <cdumez@apple.com>

        DOMCache data sometimes not properly removed when clearing data for a given origin
        https://bugs.webkit.org/show_bug.cgi?id=181887
        <rdar://problem/36671239>

        Reviewed by Youenn Fablet.

        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        This code was iterating through folders on disk, then reading the folder's origin
        from the origin file on disk. Then, if the origin would match the one we want to
        delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
        I don't know how but on my machine, I was ended up in a state where the path
        generated by cachesRootPath(*folderOrigin) differed from the actual folder path
        we read the origin from (Likely a different salt?). To make the code more robust,
        I updated the code to delete "folderPath", which is the path we read the origin
        from.

2018-01-19  Zach Li  <zacharyli323@gmail.com>

        Expose Safe Browsing SPI
        https://bugs.webkit.org/show_bug.cgi?id=181804
        <rdar://problem/36626946>

        Reviewed by Dan Bernstein.

        If client is using Apple internal SDK, then we can just import the header; if not,
        then we declare necessary symbols that client will need.

        * Configurations/WebKit.xcconfig:
        Only link against SafariSafeBrowsing framework on macOS High Sierra
        and iOS 11 and above. Weak link against SafariSafeBrowsing framework
        because it is not present on the Base system.

        * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.

        * WebKit.xcodeproj/project.pbxproj:
        Added SafeBrowsingSPI.h.

        * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
        Added.

2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix, removed unused lambda capture.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

2018-01-19  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
        https://bugs.webkit.org/show_bug.cgi?id=181890
        <rdar://problem/36674772>

        Unreviewed API test fix.

        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

2018-01-19  Youenn Fablet  <youenn@apple.com>

        Do not go to the storage process when registering a service worker client if there is no service worker registered
        https://bugs.webkit.org/show_bug.cgi?id=181740
        <rdar://problem/36650400>

        Reviewed by Chris Dumez.

        UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
        Add private API to set the number of web processes for testing purposes.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _setMaximumNumberOfProcesses:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::registerServiceWorkerClients):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-01-19  Dean Jackson  <dino@apple.com>

        REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
        https://bugs.webkit.org/show_bug.cgi?id=181817
        <rdar://problem/35274055>

        Reviewed by Simon Fraser.

        Add a linked-on-or-after check to set passive touch listeners on document in WebCore.

        * CMakeLists.txt:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
        (defaultPassiveTouchListenersAsDefaultOnDocument):
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/Cocoa/VersionChecks.h:
        * WebKit.xcodeproj/project.pbxproj:

2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>

        [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
        https://bugs.webkit.org/show_bug.cgi?id=181868

        Reviewed by Dan Bernstein.

        * Shared/API/Cocoa/_WKNSWindowExtras.h:

2018-01-19  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
        https://bugs.webkit.org/show_bug.cgi?id=181870
        <rdar://problem/36666750>

        Unreviewed build fix.

        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r227211.

        Breaks iOS Simulator tests.

        Reverted changeset:

        "Expose Safe Browsing SPI"
        https://bugs.webkit.org/show_bug.cgi?id=181804
        https://trac.webkit.org/changeset/227211

2018-01-19  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
        https://bugs.webkit.org/show_bug.cgi?id=181822
        https://bugs.webkit.org/show_bug.cgi?id=175263
        https://bugs.webkit.org/show_bug.cgi?id=178536
        https://bugs.webkit.org/show_bug.cgi?id=181223
        https://bugs.webkit.org/show_bug.cgi?id=181482
        <rdar://problem/33491222>
        <rdar://problem/33805293>
        <rdar://problem/36332683>
        <rdar://problem/36549026>

        Reviewed by Alex Christensen.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
            Calls the new API with no-op completion handler.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
            New API with completion handler.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
            Calls the new API with no-op completion handler.
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
            New API with completion handler.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2018-01-19  Daniel Bates  <dabates@apple.com>

        REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
        https://bugs.webkit.org/show_bug.cgi?id=181863
        <rdar://problem/36662452>

        Reviewed by Chris Dumez.

        More fix ups following r223149. When notifying all pages of a process state change we need to
        take care to ref all the pages before iterating over them and notifying them of the change.
        Notifying a page of such a state change may ultimately delegate to the embedding client. And
        the embedding client can do anything, including deallocating one or more pages.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didBecomeUnresponsive):
        (WebKit::WebProcessProxy::didBecomeResponsive):
        (WebKit::WebProcessProxy::willChangeIsResponsive):
        (WebKit::WebProcessProxy::didChangeIsResponsive):
        (WebKit::WebProcessProxy::requestTermination):

2018-01-19  Chris Dumez  <cdumez@apple.com>

        The WebContent process should not process incoming IPC while waiting for a sync IPC reply
        https://bugs.webkit.org/show_bug.cgi?id=181560

        Reviewed by Ryosuke Niwa.

        The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
        This is causing hard-to-debug crashes because developers often assume the state does not
        change during a sendSync() call.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::waitForSyncReply):
        * Platform/IPC/Connection.h:
        (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebProcess/Network/NetworkProcessConnection.cpp:
        (WebKit::NetworkProcessConnection::NetworkProcessConnection):
        * WebProcess/Storage/WebToStorageProcessConnection.cpp:
        (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
        * WebProcess/WebConnectionToUIProcess.cpp:
        (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::undo):
        (WebKit::WebEditorClient::redo):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-01-19  Keith Miller  <keith_miller@apple.com>

        HaveInternalSDK includes should be "#include?"
        https://bugs.webkit.org/show_bug.cgi?id=179670

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:

2018-01-19  Daniel Bates  <dabates@apple.com>

        Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::willDetachRenderer):
        (WebKit::PDFPlugin::willDetatchRenderer): Deleted.
        * WebProcess/Plugins/Plugin.h:
        (WebKit::Plugin::willDetachRenderer):
        (WebKit::Plugin::willDetatchRenderer): Deleted.
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::PluginView::willDetachRenderer):
        (WebKit::PluginView::willDetatchRenderer): Deleted.
        * WebProcess/Plugins/PluginView.h:

2018-01-19  Zach Li  <zacharyli323@gmail.com>

        Expose Safe Browsing SPI
        https://bugs.webkit.org/show_bug.cgi?id=181804
        <rdar://problem/36626946>

        Reviewed by Alex Christensen.

        If client is using Apple internal SDK, then we can just import the header; if not,
        then we declare necessary symbols that client will need.

        * Configurations/WebKit.xcconfig:
        Only link against SafariSafeBrowsing framework on macOS High Sierra
        and iOS 11 and above. Weak link against SafariSafeBrowsing framework
        because it is not present on the Base system.

        * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.

        * WebKit.xcodeproj/project.pbxproj:
        Added SafeBrowsingSPI.h.

        * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
        Added.

2018-01-18  Chris Dumez  <cdumez@apple.com>

        We should be able to terminate service workers that are unresponsive
        https://bugs.webkit.org/show_bug.cgi?id=181563
        <rdar://problem/35280031>

        Reviewed by Alex Christensen.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::terminateWorker):
        Use a 10 second timeout for forcefully exiting the service worker process when
        the service worker in question fails to terminate.

        (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
        Use a 100ms timeout for forcefully exiting the service worker process when
        the service worker in question fails to terminate. This method is only called
        from the layout tests, which is why we use a very short timeout.

2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.

        * UIProcess/ios/WKPDFPageNumberIndicator.mm:
        (-[WKPDFPageNumberIndicator _makeRoundedCorners]):

2018-01-18  Youenn Fablet  <youenn@apple.com>

        Do not go to the storage process when loading a main resource if there is no service worker registered
        https://bugs.webkit.org/show_bug.cgi?id=181395

        Reviewed by Chris Dumez.

        Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
        If there is none, the web process will then start to load HTTP resources from the network.
        The connection to the storage process is then executed when receiving the first bytes of the main resource.
        This connection is needed as other web processes may create service workers at any given time.
        If there is one registered service worker, the web process will wait for its connection to the storage process to be active.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/ServiceWorkerProcessProxy.cpp:
        (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
        * UIProcess/ServiceWorkerProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
        * WebProcess/Storage/WebServiceWorkerProvider.h:
        * WebProcess/Storage/WebToStorageProcessConnection.h:
        (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-01-18  Chris Dumez  <cdumez@apple.com>

        Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
        https://bugs.webkit.org/show_bug.cgi?id=181771
        <rdar://problem/36566237>

        Reviewed by Brady Eidson.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didClose):
        Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
        and ref the pages.

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

        [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
        https://bugs.webkit.org/show_bug.cgi?id=181803

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig: Updated.
        * Configurations/DebugRelease.xcconfig: Ditto.
        * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
        * Configurations/Version.xcconfig: Updated.
        * Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
          useful for defining settings that depend on the target macOS version.

2018-01-18  Chris Dumez  <cdumez@apple.com>

        Service Workers restored from persistent storage have 'redundant' state
        https://bugs.webkit.org/show_bug.cgi?id=181749
        <rdar://problem/36556486>

        Reviewed by Youenn Fablet.

        Allow service workers to intercept custom protocol loads as this is useful for
        API testing.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):
        (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
        * WebProcess/Network/WebLoaderStrategy.h:

2018-01-18  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
        https://bugs.webkit.org/show_bug.cgi?id=181797
        <rdar://problem/36546412>

        Reviewed by Eric Carlson.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
        'com.apple.lookup.shared' to support DataDetectors.

2018-01-17  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Block cookies for prevalent resources without user interaction
        https://bugs.webkit.org/show_bug.cgi?id=177394
        <rdar://problem/34613960>

        Reviewed by Alex Christensen.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
            Now has m_hasBeenSetToUseStatelessCookieStorage to handle
            cookie blocking.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
            Returns singleton empty, deny-all cookie storage for cookie blocking.
            The ugly pragma instructions for clang are because the NSString
            parameter for _initWithIdentifier was not marked nullable pre-Sierra.
        (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
            Instead of just decision making, this now applies the policy.
        (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
            New method.
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            Now blocks cookies for domains where cookies will be purged anyway.
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
            Now blocks cookies for domains where cookies will be purged anyway.
        (WebKit::shouldChangePartition): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
            Now downgrades for blocked cookies instead of partitioned cookies.
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
            Now downgrades for blocked cookies instead of partitioned cookies.


2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>

        [Curl] Use ResourceRequest::encodeWithPlatformData()
        https://bugs.webkit.org/show_bug.cgi?id=181768

        Reviewed by Alex Christensen.

        * Shared/curl/WebCoreArgumentCodersCurl.cpp:
        (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):

2018-01-17  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r227076.

        This breaks internal builds

        Reverted changeset:

        "Resource Load Statistics: Block cookies for prevalent
        resources without user interaction"
        https://bugs.webkit.org/show_bug.cgi?id=177394
        https://trac.webkit.org/changeset/227076

2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        WEBKIT_FRAMEWORK should not modify file-global include directories
        https://bugs.webkit.org/show_bug.cgi?id=181656

        Reviewed by Konstantin Tokarev.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:

2018-01-17  Youenn Fablet  <youenn@apple.com>

        Put fetch request keepAlive behind a runtime flag
        https://bugs.webkit.org/show_bug.cgi?id=181592

        Reviewed by Chris Dumez.

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

2018-01-17  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Block cookies for prevalent resources without user interaction
        https://bugs.webkit.org/show_bug.cgi?id=177394
        <rdar://problem/34613960>

        Reviewed by Alex Christensen.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
            Now has m_hasBeenSetToUseStatelessCookieStorage to handle
            cookie blocking.
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
            Returns singleton empty, deny-all cookie storage for cookie blocking.
        (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
            Instead of just decision making, this now applies the policy.
        (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
            New method.
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            Now blocks cookies for domains where cookies will be purged anyway.
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
            Now blocks cookies for domains where cookies will be purged anyway.
        (WebKit::shouldChangePartition): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
            Now downgrades for blocked cookies instead of partitioned cookies.
        (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
            Now downgrades for blocked cookies instead of partitioned cookies.

2018-01-17  Daniel Bates  <dabates@apple.com>

        REGRESSION (r222795): Cardiogram never signs in
        https://bugs.webkit.org/show_bug.cgi?id=181693
        <rdar://problem/36286293>

        Reviewed by Ryosuke Niwa.

        Exempt Cardiogram from the XHR header restrictions in r222795.

        Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
        However Cardiogram also depends on such functionality.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (shouldAllowSettingAnyXHRHeaderFromFileURLs):
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/Cocoa/VersionChecks.h:

2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
        https://bugs.webkit.org/show_bug.cgi?id=181637
        <rdar://problem/36508471>

        Reviewed by Tim Horton.

        Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
        represent an archive resource, given the resource's data and MIME type.

        * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
        (API::InjectedBundle::EditorClient::replacementURLForResource):
        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:

        Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.

        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
        * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
        (WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
        * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::replacementURLForResource):
        * WebProcess/WebCoreSupport/WebEditorClient.h:

2018-01-17  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
        https://bugs.webkit.org/show_bug.cgi?id=181725

        Reviewed by Carlos Garcia Campos.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::paint):
        Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.

2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.

        * gtk/NEWS: Add release notes for 2.19.6.

2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
        https://bugs.webkit.org/show_bug.cgi?id=179914

        Reviewed by Žan Doberšek.

        Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.

        * webkitglib-symbols.map:

2018-01-17  Youenn Fablet  <youenn@apple.com>

        Clear Caches volatile storage as a memory optimization.
        https://bugs.webkit.org/show_bug.cgi?id=181643

        Reviewed by Chris Dumez.

        clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
        Clearing m_volatileStorage allows releasing some memory.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clearMemoryRepresentation):

2018-01-17  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Use one-time ShadowBlur objects when performing shadowing
        https://bugs.webkit.org/show_bug.cgi?id=181720

        Reviewed by Carlos Garcia Campos.

        * Shared/cairo/ShareableBitmapCairo.cpp:
        (WebKit::ShareableBitmap::paint):
        Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.

2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake] Remove WebCoreDerivedSources library target
        https://bugs.webkit.org/show_bug.cgi?id=181664

        Reviewed by Carlos Garcia Campos.

        * CMakeLists.txt: Do not link WebCoreDerivedSources.
        * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
        * PlatformWin.cmake: Ditto.

2018-01-16  Alex Christensen  <achristensen@webkit.org>

        Merge sync and async code paths for getting context menus
        https://bugs.webkit.org/show_bug.cgi?id=181423

        Reviewed by Joseph Pecoraro.

        What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
        This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
        There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
        case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!

        * UIProcess/API/APIContextMenuClient.h:
        (API::ContextMenuClient::getContextMenuFromProposedMenu):
        (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageContextMenuClient):
        * UIProcess/API/glib/WebKitContextMenuClient.cpp:
        * UIProcess/WebContextMenuProxy.h:
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::show):
        (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
        * UIProcess/gtk/WebContextMenuProxyGtk.h:
        * UIProcess/mac/WebContextMenuProxyMac.h:
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyMac::showContextMenu):
        * UIProcess/wpe/WebContextMenuProxyWPE.h:

2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>

        Don't link WebKit target directly to JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=181688

        Reviewed by Alex Christensen.

        It's safer if we only link to the next lower-layered lib in the stack, so let's just link
        directly to WebCore instead.

        And WPE doesn't need to specify it twice.

        * CMakeLists.txt:
        * PlatformMac.cmake:
        * PlatformWPE.cmake:

2018-01-16  Eric Carlson  <eric.carlson@apple.com>

        AVSampleBufferDisplayLayer should be flushed when application activates
        https://bugs.webkit.org/show_bug.cgi?id=181623
        <rdar://problem/36487738>

        Reviewed by Darin Adler.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::applicationWillResignActive): Call page.
        (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
        (WebKit::WebPage::applicationWillEnterForeground): Call page.
        (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.

2018-01-16  Zach Li  <zachli@apple.com>

        Add pop-up policy support in website policies.
        https://bugs.webkit.org/show_bug.cgi?id=181544.
        rdar://problem/30521400.

        Reviewed by Alex Christensen.

        * Shared/WebsitePoliciesData.cpp: Encode and decode
        pop-up policy.
        (WebKit::WebsitePoliciesData::encode const):
        (WebKit::WebsitePoliciesData::decode):
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        Apply the pop-up policy from website policies to the
        document loader.

        * Shared/WebsitePoliciesData.h:

        * Shared/WebsitePopUpPolicy.h:
        Added for declaring enum WebsitePopUpPolicy.

        * UIProcess/API/APIWforebsitePolicies.cpp:
        Include pop-up policy in website policies.
        (API::WebsitePolicies::WebsitePolicies):
        (API::WebsitePolicies::data):
        * UIProcess/API/APIWebsitePolicies.h:

        * UIProcess/API/C/WKWebsitePolicies.cpp:
        Added C API to get and set pop-up policy on
        website policies.
        (WKWebsitePoliciesGetPopUpPolicy):
        (WKWebsitePoliciesSetPopUpPolicy):
        * UIProcess/API/C/WKWebsitePolicies.h:

        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
        Added Obj-C API to get and set pop-up policy
        on website policies.
        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
        (-[_WKWebsitePolicies setPopUpPolicy:]):
        (-[_WKWebsitePolicies popUpPolicy]):

        * WebKit.xcodeproj/project.pbxproj:
        Added WebsitePopUpPolicy.h.

2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake][Mac] Fix the build errors
        https://bugs.webkit.org/show_bug.cgi?id=181665

        Reviewed by Alex Christensen.

        * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile.
        * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile.
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER).

2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
        https://bugs.webkit.org/show_bug.cgi?id=181638
        <rdar://problem/36508702>

        Reviewed by Dan Bernstein.

        Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment
        elements are inserted into the document.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didInsertAttachment:withSource:]):
        (-[WKWebView _didInsertAttachment:]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/Cocoa/PageClientImplCocoa.h:
        * UIProcess/Cocoa/PageClientImplCocoa.mm:
        (WebKit::PageClientImplCocoa::didInsertAttachment):
        * UIProcess/PageClient.h:
        (WebKit::PageClient::didInsertAttachment):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didInsertAttachment):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::didInsertAttachment):
        * WebProcess/WebCoreSupport/WebEditorClient.h:

2018-01-15  Youenn Fablet  <youenn@apple.com>

        ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord
        https://bugs.webkit.org/show_bug.cgi?id=181401
        <rdar://problem/36379022>

        Reviewed by Darin Adler.

        m_isInitialized is true but m_storage is set to nullptr when calling writeRecord.
        The only case seems to be if:
        - We are doing persistent storage
        - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value.
        - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false.
        We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches.
        clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time.
        Nullifying m_storage is a memory consumption optimization.

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clearMemoryRepresentation):

2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, speculative build fix after r226899.

        Add an empty implementation for PageClient::startDrag.

        * UIProcess/PageClient.h:
        (WebKit::PageClient::startDrag):

2018-01-12  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Remove unneeded accessibility-related sandbox rules
        https://bugs.webkit.org/show_bug.cgi?id=181619
        <rdar://problem/36485356>

        Reviewed by Eric Carlson.

        Remove a number of sandbox exceptions that were in place for accessibility support. These are
        not needed in the WebContent process, since Safari (not WebKit) handles the accessibility
        interactions.

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

2018-01-12  Keith Rollin  <krollin@apple.com>

        Logged JSON should escape "'s and \'s in strings.
        https://bugs.webkit.org/show_bug.cgi?id=181608

        Reviewed by Brent Fulgham.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation const):

2018-01-12  Megan Gardner  <megan_gardner@apple.com>

        Unreviewed, fixing error in UIKitSPI.h.

        * Platform/spi/ios/UIKitSPI.h:
        
2018-01-12  Megan Gardner  <megan_gardner@apple.com>

        Implement MultiDocument protocol for restoring focus to a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=181510

        Reviewed by Dan Bernstein.

        Support the UIKit protocol for restoring focus to a what previously had focus.
        WebKit already knows what node was previously being focused by the DOM, we merely
        need to be asked to turn the focus on again.
        Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _restoreFocusWithToken:]):
        (-[WKContentView _preserveFocusWithToken:destructively:]):

2018-01-12  Youenn Fablet  <youenn@apple.com>

        WebProcess should pass the registration identifier and not the worker identifier for fetch events
        https://bugs.webkit.org/show_bug.cgi?id=181591

        Reviewed by Chris Dumez.

        Use service worker registration identifier to compute the active service worker identifier responsible to handle the fetch event.

        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::startFetch):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::start):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::startFetch):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
        (WebKit::shouldHandleFetch):

2018-01-12  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r226826.

        Breaks internal builds.

        Reverted changeset:

        "Implement MultiDocument protocol for restoring focus to a
        WKWebView"
        https://bugs.webkit.org/show_bug.cgi?id=181510
        https://trac.webkit.org/changeset/226826

2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Unify macOS and iOS codepaths in the UI process when starting a drag
        https://bugs.webkit.org/show_bug.cgi?id=181574

        Reviewed by Tim Horton.

        Rearrange some macOS drag start logic in the UI process so that it uses the same codepaths in WebPageProxy as
        iOS. Namely, startDrag should just forward the DragItem and drag image handle along to the appropriate views on
        each platform (WKContentView and WebViewImpl).

        There should be no change in behavior.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:

        Both macOS and iOS now funnel through this method.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::startDrag):
        (WebKit::WebViewImpl::dragImageForView): Deleted.

        Rename dragImageForView to startDrag. Move the call to didStartDrag() here, and call dragCancelled() in the
        case where we bailed from starting the drag (due to failing to create a drag image).

        * UIProcess/PageClient.h:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::setDragImage): Deleted.

        Rename setDragImage to startDrag.

        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::startDrag):
        (WebKit::PageClientImpl::setDragImage): Deleted.
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::startDrag): Deleted.

2018-01-12  Antoine Quint  <graouts@apple.com>

        Add support for the frames() timing function
        https://bugs.webkit.org/show_bug.cgi?id=181585
        <rdar://problem/36463317>

        Reviewed by Dean.

        Add the ability to endode and decode the frames() timing function.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<FramesTimingFunction>::encode):
        (IPC::ArgumentCoder<FramesTimingFunction>::decode):
        * Shared/WebCoreArgumentCoders.h:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (WebKit::PlatformCAAnimationRemote::Properties::encode const):
        (WebKit::PlatformCAAnimationRemote::Properties::decode):

2018-01-11  Keith Miller  <keith_miller@apple.com>

        Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
        https://bugs.webkit.org/show_bug.cgi?id=181573

        Reviewed by Simon Fraser.

        * Configurations/FeatureDefines.xcconfig:

2018-01-11  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r219530): ResourceLoadStatisticsPersistentStorage should be read-only in ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=181136
        <rdar://problem/36116604>

        Reviewed by Chris Dumez.

        Some uses of WebKit involve running a UIProcess as an ephemeral session for the life of the process. In this
        case, we do not initialize the data path for the set of load statistics triggering an assertion.

        We actually intended ephemeral sessions to consume the existing resource load data (presumably captured during
        non-ephemeral browsing). This would be a read-only mode, where it would not add new entries to the load
        statistics, but would take advantage of existing observations. Currently that does not happen (for this type
        of WebKit embed), which forces each run as an ephemeral session to build up in-memory browsing data until it has
        enough observations to begin modifying loads.

        We need to set the ResourceLoadStatisticsPersistentStorage object to a "read only" mode in this case, so
        that it read (but does not write) from this database.

        Tested by ephemeral website data TestWebKitAPI tests.

        * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
        (WebKit::ResourceLoadStatisticsPersistentStorage::create): Added to allow creation of the right style of
        Persistent Storage.
        (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): Initialize the
        new data member.
        (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired): RELEASE_ASSERT that we never run
        this method when in "read only" mode.
        (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): Ditto.
        (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): Return early if asked to
        schedule a write operation for a "read only" persistent store.
        (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): RELEASE_ASSERT if we
        ever shut down in "read only" mode with an active write timer.
        * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Pass a flag indicating whether the
        storage session is ephemeral or not.
        * UIProcess/WebResourceLoadStatisticsStore.h:

2018-01-11  Keith Rollin  <krollin@apple.com>

        Add optional logging of ITP-related user interaction information
        https://bugs.webkit.org/show_bug.cgi?id=181556

        Reviewed by Brent Fulgham.

        In order to support the tracking of the efficacy of Intelligent
        Tracking Protection, add some logging indicating when the user
        interacts with a page in a way that affects cookie partitioning. This
        logging is off by default, and is enabled with `defaults write -g
        WebKitLogCookieInformation -bool true`.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-01-11  Megan Gardner  <megan_gardner@apple.com>

        Implement MultiDocument protocol for restoring focus to a WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=181510

        Reviewed by Dan Bernstein.

        Support the UIKit protocol for restoring focus to a what previously had focus.
        WebKit already has a method to silently remove and replace focus, without telling the
        web process about the unfocus and refocusing, so we're just using that.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _restoreFocusWithToken:]):
        (-[WKContentView _preserveFocusWithToken:destructively:]):


2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Don't load inline data when requesting info for an attachment element backed by a file path
        https://bugs.webkit.org/show_bug.cgi?id=181550

        Reviewed by Tim Horton

        See WebCore/ChangeLog for more information.

        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachmentInfo initWithInfo:]):
        (-[_WKAttachmentInfo fileLoadingError]):
        (-[_WKAttachment requestInfo:]):

2018-01-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r226789 and r226794.
        https://bugs.webkit.org/show_bug.cgi?id=181564

        broke API tests (Requested by alexchristensen on #webkit).

        Reverted changesets:

        "Merge sync and async code paths for getting context menus"
        https://bugs.webkit.org/show_bug.cgi?id=181423
        https://trac.webkit.org/changeset/226789

        "Revert changes accidentally committed with r226789."
        https://bugs.webkit.org/show_bug.cgi?id=181423
        https://trac.webkit.org/changeset/226794

2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
        https://bugs.webkit.org/show_bug.cgi?id=181497

        Reviewed by Tim Horton.

        Refactor drag and drop support for promised blob data, so that blob info is shipped across to the client layer
        via DragItem in the DragClient::startDrag codepath, rather than via a separate prepareToDragPromisedBlob client
        codepath that stages promised blob info.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::prepareToDragPromisedBlob): Deleted.
        * UIProcess/PageClient.h:
        (WebKit::PageClient::prepareToDragPromisedBlob): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::prepareToDragPromisedBlob): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startDrag:item:]):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        (WebKit::WebDragClient::prepareToDragPromisedBlob): Deleted.
        * WebProcess/WebCoreSupport/WebDragClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::prepareToDragPromisedBlob): Deleted.
        * WebProcess/WebPage/WebPage.h:

2018-01-09  Per Arne Vollan  <pvollan@apple.com>

        VoiceOver does not work when the WebContent process is using NSRunLoop.
        https://bugs.webkit.org/show_bug.cgi?id=181331
        <rdar://problem/36408004>

        Reviewed by Brent Fulgham.

        When the WebContent process is using NSRunLoop instead of the NSApplication run loop,
        accessibility must be initialized for VoiceOver to work. This patch also switches to
        using NSRunLoop in the WebContent process.

        * Configurations/WebContentService.xcconfig:
        * Platform/IPC/mac/ConnectionMac.mm:
        (IPC::AccessibilityProcessSuspendedNotification): Remove unneccessary workaround.
        * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Switch to NSRunLoop.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeProcess): Initialize accessibility.

2018-01-11  Don Olmstead  <don.olmstead@sony.com>

        WebContextMenuListenerProxy.cpp not including config on first line
        https://bugs.webkit.org/show_bug.cgi?id=181552

        Reviewed by Alex Christensen.

        * UIProcess/WebContextMenuListenerProxy.cpp:

2018-01-11  Youenn Fablet  <youenn@apple.com>

        Redirected iframe loading with Request.redirect=follow should fail
        https://bugs.webkit.org/show_bug.cgi?id=181491

        Reviewed by Alex Christensen.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::validateResponse):

2018-01-11  Youenn Fablet  <youenn@apple.com>

        Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
        https://bugs.webkit.org/show_bug.cgi?id=181480

        Reviewed by Eric Carlson.

        Renaming preference to WebRTCLegacyAPIEnabled for simplification and removing it from experimental feature.
        Set it to off by default.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebRTCLegacyAPIEnabled):
        (WKPreferencesGetWebRTCLegacyAPIEnabled):
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _webRTCLegacyAPIEnabled]):
        (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2018-01-11  Alex Christensen  <achristensen@webkit.org>

        Merge sync and async code paths for getting context menus
        https://bugs.webkit.org/show_bug.cgi?id=181423

        Reviewed by Joseph Pecoraro.

        What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
        This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
        There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
        case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!

        * UIProcess/API/APIContextMenuClient.h:
        (API::ContextMenuClient::getContextMenuFromProposedMenu):
        (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageContextMenuClient):
        * UIProcess/API/glib/WebKitContextMenuClient.cpp:
        * UIProcess/WebContextMenuProxy.h:
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::show):
        (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
        * UIProcess/gtk/WebContextMenuProxyGtk.h:
        * UIProcess/mac/WebContextMenuProxyMac.h:
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyMac::showContextMenu):
        * UIProcess/wpe/WebContextMenuProxyWPE.h:

2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>

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

        Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.

        Implement support for registering and beginning a drag with promised blob info. See below for more detail.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKDragSessionContext addTemporaryDirectory:]):
        (-[WKDragSessionContext cleanUpTemporaryDirectories]):

        Introduce WKDragSessionContext, which represents the localContext of a UIDragSession initiated in WebKit. The
        blob promise dragging codepath uses this to register temporary directories when saving blob data to a location
        on disk; when all data transfers are finished, or if the drag interaction is being reset, we then use
        -cleanUpTemporaryDirectories to remove each temporary directory.

        (existingLocalDragSessionContext):
        (ensureLocalDragSessionContext):

        Helper methods to set the UIDragSession's localContext to a WKDragSessionContext and query for any existing
        context.

        (-[WKContentView cleanupInteraction]):

        Before the content view's UIDragInteraction goes away, clean up any temporary directories added to the
        UIDragSession.

        (-[WKContentView _prepareToDragPromisedBlob:]):

        When dragging with a promised blob, register a new item provider on the pasteboard representing the blob data,
        along with any additional metadata associated with the blob. For the promise callback, call out to the network
        process to write the blob data to a temporary path; when done, call the NSItemProvider's completion handler with
        the temporary blob data location.

        (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
        (-[WKContentView dragInteraction:sessionDidTransferItems:]):

        Use this delegate hook as an opportunity to remove any temporary directories created when promised blob data is
        requested upon drop. Since we know the drag session that has finished transferring data, we simply ask its local
        context (a WKDragSessionContext) to remove any temporary filepaths it has created.

2018-01-10  Jeff Miller  <jeffm@apple.com>

        -[WKWebView _web_gestureEventWasNotHandledByWebCore:] should call -_gestureEventWasNotHandledByWebCore:
        https://bugs.webkit.org/show_bug.cgi?id=181498

        Reviewed by Alex Christensen.

        WKView's API contract allows clients to override -_gestureEventWasNotHandledByWebCore:, and -[WKView
        _web_gestureEventWasNotHandledByWebCore:] calls -_gestureEventWasNotHandledByWebCore: instead of
        invoking WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly() directly. WKWebView should do
        the same thing.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]):
        Call -_gestureEventWasNotHandledByWebCore:, which will call gestureEventWasNotHandledByWebCoreFromViewOnly().

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

        REGRESSION(r222507): Composition highlight doesn't render when using IME
        https://bugs.webkit.org/show_bug.cgi?id=181485
        <rdar://problem/35896516>

        Reviewed by Ryosuke Niwa.

        Add plumbing for a `suppressUnderline` argument when setting marked text.

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSetComposition):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setCompositionForTesting):
        * WebProcess/WebPage/WebPage.h:

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

        REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
        https://bugs.webkit.org/show_bug.cgi?id=181269
        <rdar://problem/35110344>

        Reviewed by Simon Fraser.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _processDidExit]):
        (-[WKWebView _didCommitLayerTree:]):
        When swiping to a page that set history.scrollRestoration = "manual",
        we will never restore the scroll position. We will still restore
        "state", but won't have a location. Currently, the code assumes that
        it should wait to remove the swipe snapshot until the scroll position
        is restored. Instead, wait until the "state" is restored, whether
        or not that includes a scroll position/center point restoration.

        Do this by making _firstTransactionIDAfterPageRestore an optional,
        and reset it after it fires, so that we only run the restoration code
        in _didCommitLayerTree for the first commit after state restoration,
        not all subsequent commits. Then, tell ViewGestureController that
        the scroll position has been restored even if the page opted out.

        The reason that this is specific to pushState is that normal,
        non-same-document loads bail from waiting for the scroll position
        restoration in VGC::didReachMainFrameLoadTerminalState() (see the long
        comment there for an explanation).

        (-[WKWebView _beginBackSwipeForTesting]):
        (-[WKWebView _completeBackSwipeForTesting]):
        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Cocoa/ViewGestureController.h:
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (-[WKSwipeTransitionController transitionForDirection:]):
        (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
        (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
        (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
        Add a mechanism to forcefully test swipe back. Instead of simulating
        events like on Mac, we just talk to the UIKit internals and force
        the interaction to start, pause, and then complete when we want.

2018-01-10  Brent Fulgham  <bfulgham@apple.com>

        Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
        https://bugs.webkit.org/show_bug.cgi?id=181452
        <rdar://problem/36416912>
        
        Reviewed by Chris Dumez.

        We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
        the WebsiteDataStore for processing.

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

2018-01-09  John Wilander  <wilander@apple.com>

        Storage Access API: Turn feature on by default in WebPreferences.yaml
        https://bugs.webkit.org/show_bug.cgi?id=181458

        Reviewed by Brent Fulgham.

        * Shared/WebPreferences.yaml:

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

        WKOpenPanelParameters SPI should return autoreleased objects
        https://bugs.webkit.org/show_bug.cgi?id=181457
        <rdar://problem/35884960>

        Reviewed by Tim Horton.

        In r226607 I made a mistake by returning an object that has been released.
        I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.

        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _acceptedMIMETypes]):
        (-[WKOpenPanelParameters _acceptedFileExtensions]):

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

        Removed some empty directories that were left behind

        * WebProcess/Cookies/cf: Removed.
        * WebProcess/ios: Removed.

2018-01-09  Paul Knight  <pknight@apple.com>

        Don't record dynamic spelling corrections while in an ephemeral browsing session
        https://bugs.webkit.org/show_bug.cgi?id=181417
        <rdar://problem/33309104>

        Dynamic spelling correction responses are kept on disk. Avoid recording
        these responses when in an ephemeral session.

        Reviewed by Tim Horton and Wenson Hsieh.

        * UIProcess/mac/CorrectionPanel.h:
        * UIProcess/mac/CorrectionPanel.mm:
        (WebKit::CorrectionPanel::recordAutocorrectionResponse):
            Add a WebViewImpl parameter so we can query the current session.
            Return early before recording the response if the session is
            ephemeral.
        (WebKit::CorrectionPanel::handleAcceptedReplacement):
            Update a caller to include the new parameter.
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::recordAutocorrectionResponse):
            Ditto.

2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.5 release.

        * gtk/NEWS: Add release notes for 2.19.5.

2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Missing symbols exported in 2.19.4
        https://bugs.webkit.org/show_bug.cgi?id=181433

        Reviewed by Michael Catanzaro.

        Add missing WEBKIT_API to webkit_dom_dom_window_webkit_message_handlers_post_message().

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
        * webkitglib-symbols.map: Remove webkit_media_player_debug from local.

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

        SWClientConnection should not keep references to service worker jobs
        https://bugs.webkit.org/show_bug.cgi?id=181381

        Reviewed by Chris Dumez.

        Updated IPC handling based on WebCore refactoring.

        * Scripts/webkit/messages.py:
        (forward_declarations_and_headers):
        (headers_for_type):
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::rejectJobInClient):
        (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
        (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
        (WebKit::WebSWServerConnection::startScriptFetchInClient):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * WebProcess/Storage/WebSWClientConnection.messages.in:

2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.4 release.

        * gtk/NEWS: Add release notes for 2.19.4.

2018-01-09  Ali Juma  <ajuma@chromium.org>

        Implement VisualViewport API events
        https://bugs.webkit.org/show_bug.cgi?id=179386

        Reviewed by Frédéric Wang.

        Change the default value of the VisualViewportAPI experimental feature flag to
        DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. This patch completes the implementation
        of this feature as specified by https://wicg.github.io/visual-viewport/, so this
        feature is now ready for wider testing.

        * Shared/WebPreferences.yaml:

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

        Add WKNavigationDelegate SPI exposing WebProcess crash reason
        https://bugs.webkit.org/show_bug.cgi?id=181410
        <rdar://problem/36167199>

        Reviewed by Wenson Hsieh.

        We exposed it in the C SPI.

        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::toWKProcessTerminationReason):
        (WebKit::NavigationState::NavigationClient::processDidTerminate):

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

        Make ObjC SPI equivalent to WKPageNavigationClient.decidePolicyForPluginLoad
        https://bugs.webkit.org/show_bug.cgi?id=181413
        <rdar://problem/36169005>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/APINavigationClient.h:
        (API::NavigationClient::decidePolicyForPluginLoad):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageNavigationClient):
        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
        * UIProcess/Cocoa/NavigationState.h:
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::setNavigationDelegate):
        (WebKit::toPluginModuleLoadPolicy):
        (WebKit::toWKPluginModuleLoadPolicy):
        (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findPlugin):

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

        iOS build fix attempt after r226602.

        * UIProcess/API/C/WKContextMenuListener.cpp:
        (WKContextMenuListenerUseContextMenuItems):

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

        Add SPI for WKOpenPanelParameters._acceptedMIMETypes and _acceptedFileExtensions
        https://bugs.webkit.org/show_bug.cgi?id=181408
        <rdar://problem/35884960>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _acceptedMIMETypes]):
        (-[WKOpenPanelParameters _acceptedFileExtensions]):
        * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
        * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h: Added.
        * WebKit.xcodeproj/project.pbxproj:

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

        Unreviewed, rolling out r226532 and r226540.
        https://bugs.webkit.org/show_bug.cgi?id=181422

        jessie says basic browsing does not seem to work (Requested by
        alexchristensen on #webkit).

        Reverted changesets:

        "Add CSP support to service workers"
        https://bugs.webkit.org/show_bug.cgi?id=181385
        https://trac.webkit.org/changeset/226532

        "SWClientConnection should not keep references to service
        worker jobs"
        https://bugs.webkit.org/show_bug.cgi?id=181381
        https://trac.webkit.org/changeset/226540

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

        [Attachment Support] Expose file name and content type of WKAttachment
        https://bugs.webkit.org/show_bug.cgi?id=181390
        <rdar://problem/36336837>

        Reviewed by Tim Horton.

        Add support for -[_WKAttachment requestInfo:], which fetches a snapshot of the attachment's state. This API is
        meant to be a replacement for -requestData: that provides additional metadata about the attachment.

        * Scripts/webkit/messages.py:
        (headers_for_type):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<AttachmentInfo>::encode):
        (IPC::ArgumentCoder<AttachmentInfo>::decode):
        * Shared/WebCoreArgumentCoders.h:

        Add IPC support for AttachmentInfo. Note that instead of using (encode|decode)SharedBuffer, we send and receive
        data references to the shared buffer.

        * UIProcess/API/APIAttachment.cpp:
        (API::Attachment::requestInfo):
        (API::Attachment::requestData): Deleted.
        * UIProcess/API/APIAttachment.h:

        Change requestData to requestInfo.

        * UIProcess/API/Cocoa/_WKAttachment.h:
        * UIProcess/API/Cocoa/_WKAttachment.mm:
        (-[_WKAttachmentInfo initWithInfo:]):
        (-[_WKAttachmentInfo data]):
        (-[_WKAttachmentInfo name]):
        (-[_WKAttachmentInfo filePath]):
        (-[_WKAttachmentInfo contentType]):
        (-[_WKAttachment requestInfo:]):
        (-[_WKAttachment requestData:]):

        Implement -requestInfo: by calling into APIAttachment, and reimplement -requestData: in terms of -requestInfo:.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::attachmentInfoCallback):
        (WebKit::WebPageProxy::requestAttachmentInfo):
        (WebKit::WebPageProxy::sharedBufferCallback): Deleted.
        (WebKit::WebPageProxy::requestAttachmentData): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:

        Rename the SharedBufferCallback IPC message to AttachmentInfoCallback, and make it conditional on
        ATTACHMENT_ELEMENT. Rename requestAttachmentData to requestAttachmentInfo.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::requestAttachmentInfo):
        (WebKit::WebPage::invokeSharedBufferCallback): Deleted.
        (WebKit::WebPage::requestAttachmentData): Deleted.

        Rename requestAttachmentData to requestAttachmentInfo and adopt HTMLAttachmentElement::requestInfo.

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

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

        Pass around Vector<Ref<WebContextMenuItem>> instead of WKArrayRef or Vector<WebContextMenuItemData>
        https://bugs.webkit.org/show_bug.cgi?id=181419

        Reviewed by Tim Horton.

        Passing a WKArrayRef to an API object is messy and was preventing me from moving things around and making ObjC SPI.
        No change in behavior.  Just using different layering abstractions for the same data.

        * UIProcess/API/C/WKContextMenuListener.cpp:
        (WKContextMenuListenerUseContextMenuItems):
        * UIProcess/WebContextMenuListenerProxy.cpp:
        (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
        * UIProcess/WebContextMenuListenerProxy.h:
        * UIProcess/WebContextMenuProxy.h:
        * UIProcess/mac/WebContextMenuProxyMac.h:
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyMac::showContextMenu):

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

        Storage Access API: Remove access for all frames under a page when the page is closed
        https://bugs.webkit.org/show_bug.cgi?id=181398
        <rdar://problem/36357879>

        Reviewed by Alex Christensen.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close):

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

        SWClientConnection should not keep references to service worker jobs
        https://bugs.webkit.org/show_bug.cgi?id=181381

        Reviewed by Chris Dumez.

        Updated IPC handling based on WebCore refactoring.

        * Scripts/webkit/messages.py:
        (forward_declarations_and_headers):
        (headers_for_type):
        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
        (WebKit::WebSWServerConnection::rejectJobInClient):
        (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
        (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
        (WebKit::WebSWServerConnection::startScriptFetchInClient):
        * StorageProcess/ServiceWorker/WebSWServerConnection.h:
        * WebProcess/Storage/WebSWClientConnection.messages.in:

2018-01-08  Joseph Pecoraro  <pecoraro@apple.com>

        [Cocoa] Web Inspector: Provide a way for clients to check if an NSWindow is a Web Inspector window
        https://bugs.webkit.org/show_bug.cgi?id=181361
        <rdar://problem/36332865>

        Reviewed by Darin Adler.

        * WebKit.xcodeproj/project.pbxproj:
        New files.

        * Shared/API/Cocoa/_WKNSWindowExtras.h: Added.
        * Shared/API/Cocoa/_WKNSWindowExtras.mm: Added.
        (-[NSWindow _web_isWebInspectorWindow]):
        Method to determing if a window is being used for Web Inspector content.

        * UIProcess/mac/WKInspectorWindow.h: Added.
        * UIProcess/mac/WKInspectorWindow.mm: Added.
        Named subclass so we can use isKindOfClass.

        * UIProcess/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::createFrontendWindow):
        Use the named subclass.

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

        Build fix for WKPDFView
        https://bugs.webkit.org/show_bug.cgi?id=181399
        <rdar://problem/36311915>

        Reviewed by Simon Fraser.

        * UIProcess/ios/WKPDFView.mm:
        Disable deprecation warnings in this whole file.

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

        Caches::writeCachesToDisk should assert that it is initialized
        https://bugs.webkit.org/show_bug.cgi?id=181383

        Reviewed by Alex Christensen.

        Add assertion to ensure caches is initialized

        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::writeCachesToDisk):

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

        WebProcessPool::terminateServiceWorkerProcess should protect itself in debug builds
        https://bugs.webkit.org/show_bug.cgi?id=181384

        Reviewed by Chris Dumez.

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

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

        Unreviewed build fix after r226211.

        * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Use WK_IOS_TBA for iOS.

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

        navigator.onLine does not work inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=181079
        <rdar://problem/36178606>

        Reviewed by Darin Adler.

        Added support for a callback called for each service worker proxy creation.
        Callback is used by WTR to inject a self.internals object used for testing.

        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleSetServiceWorkerProxyCreationCallback):
        * WebProcess/InjectedBundle/API/c/WKBundle.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback):
        * WebProcess/InjectedBundle/InjectedBundle.h:

2018-01-07  David Kilzer  <ddkilzer@apple.com>

        Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects
        <https://webkit.org/b/181256>
        <rdar://problem/36281730>

        Reviewed by Darin Adler.

        * Configurations/Base.xcconfig:
        (WARNING_CFLAGS): Add -Wcast-qual.
        * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
        (WTF::Persistence::encodeCertificateChain): Include
        TypeCastsCF.h from WTF, and use
        checked_cf_cast<SecCertificateRef>() to fix warning.
        * Platform/cocoa/WKCrashReporter.mm:
        (WebKit::setCrashReportApplicationSpecificInformation):
        - Move `oldMessage` check above nullptr check to fix a leak when
          passing in nullptr after previously setting the crash string.
        - Change C-style cast to const_cast<char*>() to fix warning.
        * PluginProcess/mac/PluginProcessShim.mm:
        (WebKit::shim_shmat): Change C-style cast to
        const_cast<void*>() to fix warning.
        * Shared/Authentication/mac/AuthenticationManager.mac.mm:
        (WebKit::leafCertificate): Include TypeCastsCF.h from
        WTF, and use checked_cf_cast<SecCertificateRef>() to fix
        warning.
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::encode): Use static_cast<>(const_cast<void*>() to
        fix warnings since the CFTypeID has already been
        checked.
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::decodeNSError): Use an `auto` variable to hold the
        CFMutableDictionaryRef, then WTFMove() to assign it back to
        `userInfo`.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::takeWindowSnapshot): Include TypeCastsCF.h from
        WTF, and use checked_cf_cast<CGImageRef>() to fix
        warning.

2018-01-07  Konstantin Tokarev  <annulen@yandex.ru>

        [cmake] Unset CMAKE_REQUIRED_LIBRARIES after check_function_exists test
        https://bugs.webkit.org/show_bug.cgi?id=181371

        Reviewed by Michael Catanzaro.

        This variable is used by check_function_exists internally, its value
        should be never used for anything else.

        * CMakeLists.txt:

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

        REGRESSION (r226218): iOS-only assets are installed on macOS
        https://bugs.webkit.org/show_bug.cgi?id=181362

        Reviewed by Anders Carlsson.

        * Configurations/WebKit.xcconfig: Exclude everything under Resources/ios when not targeting
          iOS.

        * Resources/ios: Added.
        * Resources/ios/iOS.xcassets: Moved from Source/WebKit/WebKit.xcassets.
        * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Set the
          svn:mime-type property.
        * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Ditto.

        * Resources/mac: Added.
        * Resources/mac/mediaIcon.pdf: Moved here…
        * Resources/mediaIcon.pdf: …from here.

        * WebKit.xcassets: Moved under Resources/ios.

        * WebKit.xcodeproj/project.pbxproj: Created an ios group under the Resources group, and
          cleaned up the mac group. Removed the Recovered References group.

2018-01-05  John Wilander  <wilander@apple.com>

        Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
        https://bugs.webkit.org/show_bug.cgi?id=181357
        <rdar://problem/36331031>

        Reviewed by Alex Christensen.

        This change does the following:
        - Changes function and message names to reflect how this feature
          was eventually implemented, i.e. access per frame.
        - Makes it explicit that the UI process is only involved in
          granting storage access and not removing storage access.
          The latter is done directly by the web process.
        - Simplifies the network process' entry map since only needs to
          be able to give access to one domain in one frame at a time.
          Access goes away on frame navigation so there can only be one
          domain at a time per frame. Also, the map now uses pageIDs as
          main keys to prepare for efficient access removal for all
          frames under a page.
        - Fixes a bug in so that a cross-origin iframe with the same
          partition as the top frame correctly is handled as already
          having access.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::hasStorageAccessForFrame):
        (WebKit::NetworkProcess::grantStorageAccessForFrame):
        (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted.
        (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
        (WebKit::NetworkProcessProxy::grantStorageAccessForFrame):
        (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted.
        (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
        (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler):
        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
        (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted.
        (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::detachedFromParent2):
        (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):

2018-01-05  Youenn Fablet  <youenn@apple.com>

        Implement Cache API partitioning based on ClientOrigin
        https://bugs.webkit.org/show_bug.cgi?id=181240

        Reviewed by Alex Christensen.

        open and retrieveCaches now take a ClientOrigin instead of a String.
        Updated cache filesystem path computation to take both client origin and top origin.

        When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
        Caches are added to the web site data of their client origin with their corresponding cache size.
        Caches are added to the web site data of their top origin with a size equal to 0.

        Updated memory representation dumping used for test to include both top and client origins.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::cachesRootPath):
        (WebKit::CacheStorage::Engine::open):
        (WebKit::CacheStorage::Engine::remove):
        (WebKit::CacheStorage::Engine::retrieveCaches):
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::removeCaches):
        (WebKit::CacheStorage::Engine::fetchEntries):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
        (WebKit::CacheStorage::Engine::representation):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::Cache):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
        (WebKit::CacheStorage::Caches::Caches):
        (WebKit::CacheStorage::Caches::storeOrigin):
        (WebKit::CacheStorage::Caches::readOrigin):
        (WebKit::CacheStorage::Caches::open):
        * NetworkProcess/cache/CacheStorageEngineCaches.h:
        (WebKit::CacheStorage::Caches::create):
        (WebKit::CacheStorage::Caches::origin const):
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::doOpen):
        (WebKit::WebCacheStorageConnection::doRetrieveCaches):
        (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
        * WebProcess/Cache/WebCacheStorageConnection.h:

2018-01-05  Megan Gardner  <megan_gardner@apple.com>

        Show Keyboard when re-launching WKWebView with a previously focused element
        https://bugs.webkit.org/show_bug.cgi?id=181353

        Reviewed by Tim Horton.

        When relaunching an app with a WKWebView, restore the keyboard if there was a previously
        focused element that was being assisted. The element was already being tracked, we just
        needed to not bail on showing the keyboard for instances where it was a state change that
        caused the element to be refocused.

        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::startAssistingNode):
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::startAutoscrollAtPosition):
        (WebKit::WebPageProxy::startAssistingNode):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setActivityState):
        (WebKit::WebPage::elementDidFocus):
        * WebProcess/WebPage/WebPage.h:

2018-01-05  Alex Christensen  <achristensen@webkit.org>

        Restrict navigation-time WKWebsiteDataStore swapping to main frame navigations
        https://bugs.webkit.org/show_bug.cgi?id=181217

        Reviewed by Tim Horton.

        If we swap during an iframe navigation, then we get a page in a strange state.
        The intent of the main frame navigation WKWebsiteDataStore swap is that
        that is a time when we can change storages without a page in an inconsistent state.

        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

2018-01-05  Alex Christensen  <achristensen@webkit.org>

        Add WKBundleFrameCreateFrameHandle
        https://bugs.webkit.org/show_bug.cgi?id=181232
        <rdar://problem/35926696>

        Reviewed by Tim Horton.

        InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
        Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
        in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
        of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
        We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the 
        existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundleFrameCreateFrameHandle):
        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:

2018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Add a way to write blob data to a file URL from the UI process
        https://bugs.webkit.org/show_bug.cgi?id=181236

        Reviewed by Brady Eidson.

        Add support for writing a blob to a designated file path. In WebKit, this is mainly plumbing writeBlobToFilePath
        through WebPageProxy to the network process.

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

        Call out to the BlobRegistryImpl to write blobs to the file path. Additionally grant sandbox extensions for any
        file-backed blob parts corresponding to the given blob URL.

        (WebKit::NetworkBlobRegistry::filesInBlob):

        Introduce a version of filesInBlob that doesn't check against the NetworkConnectionToWebProcess. This is used
        when the UI process is the driver for writing a blob.

        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::writeBlobToFilePath):

        Temporarily grant sandbox access to the given file path.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
        (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
        (IPC::ArgumentCoder<PromisedBlobData>::encode): Deleted.
        (IPC::ArgumentCoder<PromisedBlobData>::decode): Deleted.

        Remove PromisedBlobData (see WebCore/ChangeLog for more information).

        * Shared/WebCoreArgumentCoders.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didClose):

        If the network process is terminated, flush any pending callbacks in m_writeBlobToFilePathCallbackMap, passing
        in a failure result (success := false) and clearing the callback map.

        (WebKit::NetworkProcessProxy::writeBlobToFilePath):
        (WebKit::NetworkProcessProxy::didWriteBlobToFilePath):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::writeBlobToFilePath):
        * UIProcess/WebPageProxy.h:

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

        Add injected bundle equivalents of DOMHTMLDocument (DOMHTMLDocumentExtensions)
        https://bugs.webkit.org/show_bug.cgi?id=181345

        Reviewed by Tim Horton.

        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Declared new methods.
        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
        (-[WKDOMDocument createDocumentFragmentWithMarkupString:baseURL:]): Added. Calls WebCore’s
          createFragmentFromMarkup.
        (-[WKDOMDocument createDocumentFragmentWithText:]): Added. Calls WebCore’s
          createFragmentFromText.

2018-01-05  Don Olmstead  <don.olmstead@sony.com>

        [Curl] Add implementation stubs for Network Cache
        https://bugs.webkit.org/show_bug.cgi?id=181343

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Added.
        (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
        (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
        * NetworkProcess/cache/NetworkCacheDataCurl.cpp: Added.
        (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):
        * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: Added.
        (WebKit::NetworkCache::IOChannel::IOChannel):
        (WebKit::NetworkCache::IOChannel::~IOChannel):
        (WebKit::NetworkCache::IOChannel::open):
        (WebKit::NetworkCache::IOChannel::read):
        (WebKit::NetworkCache::IOChannel::write):
        * PlatformWin.cmake:

2018-01-05  Don Olmstead  <don.olmstead@sony.com>

        [Curl] Update method declarations in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=181342

        Reviewed by Alex Christensen.

        * NetworkProcess/Downloads/curl/DownloadCurl.cpp:
        (WebKit::Download::resume):
        * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
        (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
        (WebKit::RemoteNetworkingContext::blockedError const): Deleted.

2018-01-05  Don Olmstead  <don.olmstead@sony.com>

        WebFullScreenManager should compile when ENABLE(VIDEO) is off
        https://bugs.webkit.org/show_bug.cgi?id=181338

        Reviewed by Alex Christensen.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::didEnterFullScreen):
        (WebKit::WebFullScreenManager::willExitFullScreen):
        * WebProcess/FullScreen/WebFullScreenManager.h:

2018-01-05  Andy Estes  <aestes@apple.com>

        [Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
        https://bugs.webkit.org/show_bug.cgi?id=181335
        <rdar://problem/36311296>

        Reviewed by Brady Eidson.

        When Safari is running in the macOS Base System, PassKit.framework is not available.
        If we fail to dlopen PassKit, we should disable Apple Pay.

        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetApplePayEnabled):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _initializeWithConfiguration:]):
        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
        (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments):

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

        Fixed the build following AppKit API deprecations in a recent SDKs

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController enterFullScreen:]): Suppressed deprecation warnings.
        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
        (-[WKFullScreenWindowController exitFullScreen]): Ditto.
        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
        (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto.
        (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto.
        (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView _setAutodisplay:]): Ditto.

2018-01-05  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r226401.

        This caused timeouts on multiple platforms.

        Reverted changeset:

        "Implement Cache API partitioning based on ClientOrigin"
        https://bugs.webkit.org/show_bug.cgi?id=181240
        https://trac.webkit.org/changeset/226401

2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>

        ServiceWorkers: Enable UserTiming / ResourceTiming
        https://bugs.webkit.org/show_bug.cgi?id=181297
        <rdar://problem/36307306>

        Reviewed by Youenn Fablet.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
        Enable Resource Timing / User Timing for the ServiceWorker process.

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

        Unreviewed GTK+ build fix.

        * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp:
        (webkit_user_media_permission_is_for_audio_device):
        Call UserMediaPermissionRequestProxy::requiresAudioCapture().
        (webkit_user_media_permission_is_for_video_device):
        Call UserMediaPermissionRequestProxy::requiresVideoCapture().

2018-01-04  Don Olmstead  <don.olmstead@sony.com>

        [Curl] Fix compilation error in WebFrameNetworkingContext
        https://bugs.webkit.org/show_bug.cgi?id=181312

        Reviewed by Alex Christensen.

        * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):

2018-01-04  Tim Horton  <timothy_horton@apple.com>

        WKWebView loses minimum layout size overrides that happen while the process is terminated
        https://bugs.webkit.org/show_bug.cgi?id=181306
        <rdar://problem/34398288>

        Reviewed by Dan Bernstein.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _didRelaunchProcess]): Deleted.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didRelaunchProcess):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
        (WebKit::WebPageProxy::setForceAlwaysUserScalable):
        (WebKit::WebPageProxy::setMaximumUnobscuredSize):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage):
        Pass the current viewport minimum layout size and maximum unobscured size
        in the WebPageCreationParameters instead of re-sending them in _didRelaunchProcess.

        The previous approach was problematic when _dispatchSetMinimumLayoutSize:
        was changed to not re-send identical updates, because if the client calls 
        _overrideLayoutParametersWithMinimumLayoutSize before the Web Content process
        is re-launched (after terminating), we would cache the size, attempt to send it,
        fail silently (because the process is not launched), and then in _didRelaunchProcess
        we would choose not to re-send (after the process is successfully relaunched)
        because we think we already sent the new value.

        Add isValid() checks to our message sends. Ideally send() would assert
        if the process is not alive to avoid problems like this, but it doesn't (yet).

        Get rid of WKWebView's _didRelaunchProcess, because it does nothing now.

2018-01-04  Stephan Szabo  <stephan.szabo@sony.com>

        NetworkProcess cache files use functions from unistd.h without explicitly including it
        https://bugs.webkit.org/show_bug.cgi?id=181261

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
        * NetworkProcess/cache/NetworkCacheData.cpp:

2018-01-04  Keith Rollin  <krollin@apple.com>

        Add commas
        https://bugs.webkit.org/show_bug.cgi?id=181295
        <rdar://problem/35802295>

        Reviewed by Brent Fulgham.

        Fix a problem introduced in r226226 where the emitted JSON didn't
        include some required commas.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::logCookieInformation const):

2018-01-04  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Add Mock screen capture source
        https://bugs.webkit.org/show_bug.cgi?id=181291
        <rdar://problem/36298164>

        Reviewed by Dean Jackson.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<MediaConstraints>::decode):
        (IPC::ArgumentCoder<CaptureDevice>::encode): Deleted, moved to CaptureDevice.h
        (IPC::ArgumentCoder<CaptureDevice>::decode): Ditto.
        * Shared/WebCoreArgumentCoders.h:

        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _WKCaptureDeviceDisplay.
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::requestUserMediaAuthorizationForDevices): Deal with display capture.
        (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.

        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): requiresAudio -> requiresAudioCapture.
        (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Never reuse
        a previously granted display capture request.

        * UIProcess/UserMediaPermissionRequestProxy.cpp:
        (WebKit::UserMediaPermissionRequestProxy::allow): Search the eligible devices instead of asking
        the source center to find devices.
        * UIProcess/UserMediaPermissionRequestProxy.h:
        (WebKit::UserMediaPermissionRequestProxy::requiresAudioCapture const): Renamed.
        (WebKit::UserMediaPermissionRequestProxy::requiresVideoCapture const): Ditto.
        (WebKit::UserMediaPermissionRequestProxy::requiresDisplayCapture const): New.
        (WebKit::UserMediaPermissionRequestProxy::requiresAudio const): Deleted.
        (WebKit::UserMediaPermissionRequestProxy::requiresVideo const): Deleted.

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

        FetchResponse should set its internal response text encoding name
        https://bugs.webkit.org/show_bug.cgi?id=181284

        Reviewed by Alex Christensen.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Set default encoding to UTF-8.

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

        Implement Cache API partitioning based on ClientOrigin
        https://bugs.webkit.org/show_bug.cgi?id=181240

        Reviewed by Alex Christensen.

        open and retrieveCaches now take a ClientOrigin instead of a String.
        Updated cache filesystem path computation to take both client origin and top origin.

        When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
        Caches are added to the web site data of their client origin with their corresponding cache size.
        Caches are added to the web site data of their top origin with a size equal to 0.

        Updated memory representation dumping used for test to include both top and client origins.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::cachesRootPath):
        (WebKit::CacheStorage::Engine::open):
        (WebKit::CacheStorage::Engine::remove):
        (WebKit::CacheStorage::Engine::retrieveCaches):
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::removeCaches):
        (WebKit::CacheStorage::Engine::fetchEntries):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
        (WebKit::CacheStorage::Engine::representation):
        * NetworkProcess/cache/CacheStorageEngine.h:
        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
        (WebKit::CacheStorage::Cache::Cache):
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
        (WebKit::CacheStorage::Caches::Caches):
        (WebKit::CacheStorage::Caches::storeOrigin):
        (WebKit::CacheStorage::Caches::readOrigin):
        (WebKit::CacheStorage::Caches::open):
        * NetworkProcess/cache/CacheStorageEngineCaches.h:
        (WebKit::CacheStorage::Caches::create):
        (WebKit::CacheStorage::Caches::origin const):
        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
        (WebKit::CacheStorageEngineConnection::open):
        (WebKit::CacheStorageEngineConnection::caches):
        (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
        * NetworkProcess/cache/CacheStorageEngineConnection.h:
        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
        * WebProcess/Cache/WebCacheStorageConnection.cpp:
        (WebKit::WebCacheStorageConnection::doOpen):
        (WebKit::WebCacheStorageConnection::doRetrieveCaches):
        (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
        * WebProcess/Cache/WebCacheStorageConnection.h:

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

        Service Worker should expose redirect mode for navigation loads as manual
        https://bugs.webkit.org/show_bug.cgi?id=181067

        Reviewed by Alex Christensen.

        * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
        (WebKit::ServiceWorkerClientFetch::didReceiveResponse):

2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Create attachment elements when dropping files on iOS
        https://bugs.webkit.org/show_bug.cgi?id=181192
        <rdar://problem/36280945>

        Reviewed by Tim Horton.

        Make some minor adjustments for changes to the pasteboard in WebCore. See WebCore/ChangeLog for more detail.
        Teaches WebPasteboardProxy et. al. to plumb PasteboardItemInfo from the UI process to the web process via the
        new `InformationForItemAtIndex` codepath.

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

2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>

        Replace hard-coded paths in shebangs with #!/usr/bin/env
        https://bugs.webkit.org/show_bug.cgi?id=181040

        Reviewed by Alex Christensen.

        * Scripts/generate-forwarding-headers.pl:

2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Add plumbing for starting a drag with promised blob data
        https://bugs.webkit.org/show_bug.cgi?id=181201

        Reviewed by Tim Horton.

        Add boilerplate plumbing for PrepareToDragPromisedBlob, which delivers blob promises to the UI process when
        dragging, respectively.

        * Scripts/webkit/messages.py:
        (headers_for_type):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeTypesAndData):
        (IPC::decodeTypesAndData):
        (IPC::ArgumentCoder<PasteboardWebContent>::encode):
        (IPC::ArgumentCoder<PasteboardWebContent>::decode):
        (IPC::ArgumentCoder<PasteboardImage>::encode):
        (IPC::ArgumentCoder<PasteboardImage>::decode):
        (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
        (IPC::ArgumentCoder<PromisedBlobInfo>::decode):

        Add IPC support PromisedBlobInfo's additionalTypes and additionalData.

        (IPC::encodeClientTypesAndData): Deleted.
        (IPC::decodeClientTypesAndData): Deleted.

        Rename these helper functions and move them to the top of the file.

        * UIProcess/Cocoa/WebViewImpl.h:
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::prepareToDragPromisedBlob):
        * UIProcess/PageClient.h:
        (WebKit::PageClient::prepareToDragPromisedBlob):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::prepareToDragPromisedBlob):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::prepareToDragPromisedBlob):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _prepareToDragPromisedBlob:]):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::prepareToDragPromisedBlob):
        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        (WebKit::WebDragClient::prepareToDragPromisedBlob):
        * WebProcess/WebCoreSupport/WebDragClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::prepareToDragPromisedBlob):
        * WebProcess/WebPage/WebPage.h:

2018-01-03  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r212929): WKSnapshotConfiguration may leak an NSNumber when deallocated
        <https://webkit.org/b/181274>

        Reviewed by Joseph Pecoraro.

        * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
        (-[WKSnapshotConfiguration dealloc]): Implement method and
        release _snapshotWidth.

2018-01-03  John Wilander  <wilander@apple.com>

        Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
        https://bugs.webkit.org/show_bug.cgi?id=181270
        <rdar://problem/36289544>

        Reviewed by Alex Christensen.

        This change refactors how the web process tells the network process
        to remove storage access. Previously, this was done over the UI process
        just like requests for storage access. But since no further reasoning
        is needed, the message should go straight from the web process to the
        network process for performance reasons and to minimize the risk of a
        race.

        As a consequence, the XPC code for storage access removal in the UI
        process is deleted.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::removeStorageAccess):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::removeStorageAccess): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::removeStorageAccess): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::requestStorageAccess):
        (WebKit::WebPageProxy::removeStorageAccess): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::requestStorageAccess):
        (WebKit::WebsiteDataStore::removeStorageAccess): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::detachedFromParent2):
        (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):

2018-01-03  David Kilzer  <ddkilzer@apple.com>

        com.apple.WebKit.Networking crash in com.apple.Foundation: -[__NSOperationInternal _start:]
        <https://webkit.org/b/181272>
        <rdar://problem/35657310>

        Reviewed by Alex Christensen.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (downgradeRequest): Remove unnecessary -autorelease.

2018-01-03  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Constant frame dropping during Flash video playback
        https://bugs.webkit.org/show_bug.cgi?id=181249
        <rdar://problem/34843448>

        Reviewed by Eric Carlson.

        Review of logs during jerky flash video playback shows a few IOKit properties are being blocked by the sandbox,
        which prevents some high-efficiency codecs from being used. Add 'AppleGVAKeyDoesNotExist', 'IODVDBundleName', and
        'IOGVA*Encode' to the whitelist.

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

2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Add web process API to detect when form is submitted via JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=173915

        Reviewed by Carlos Garcia Campos.

        Epiphany relies on the DOM submit event to detect when a form has been submitted. However,
        for historical reasons, the submit event is not emitted when a form is submitted by
        JavaScript. It is therefore not currently possible for a web browser to reliably detect form
        submission and not possible to implement a robust password storage feature. In order to
        avoid this problem, this patch adds a new WebKitWebPage signal, will-submit-form, that
        browsers can use in preference to a DOM event listener.

        Unfortunately, this signal is not available for WPE because it depends on the DOM API.

        There are two submission events, WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT and
        WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
        occurs earlier than WEBKIT_FORM_SUBMISSION_WILL_COMPLETE and can be used to retrieve form
        values before websites receive the DOM submit event. This is useful as some websites like
        to delete form values right before a submit would normally happen in order to attempt to
        defeat browser password managers. There are two tricks to note: JavaScript can cancel form
        submission immediately after this event occurs (by returning false in an onsubmit handler),
        and, for historical reasons, this event will not occur at all when form submission is
        triggered by JavaScript. WEBKIT_FORM_SUBMISSION_WILL_COMPLETE occurs next, and is more
        straightforward: it is always emitted when a form is about to be submitted, when it is too
        late to cancel.

        The recommended way to reliably retrieve password form values would be to watch for both
        events, use the form value detected in WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
        if that event is emitted, and use the value detected later in
        WEBKIT_FORM_SUBMISSION_WILL_COMPLETE otherwise.

        Since one of the signal arguments is an enum, we now have to run glib-mkenums for the web
        process API. And that has resulted in this patch also adding GType goo for
        WebKitConsoleMessageLevel and WebKitConsoleMessageSource that was previously missing. Any
        applications that for some unlikely reason want to use these enums in properties or signals
        will be happy.

        * PlatformGTK.cmake:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkit_web_page_class_init):
        * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
        * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.cpp.template: Added.
        * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.h.template: Added.

2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Really fix plugin process after r226327.

        * PluginProcess/unix/PluginProcessMainUnix.cpp:

2018-01-02  Brent Fulgham  <bfulgham@apple.com>

        [macOS, iOS] Adopt new secure coding APIs in WebKit
        https://bugs.webkit.org/show_bug.cgi?id=181085
        <rdar://problem/34837397>

        Reviewed by Tim Horton.

        Update WebKit code to use NSSecureCoding when the underlying operating system supports it. Use new
        wrapper functions so the same code can be built on all supported OS releases, while enabling
        seure coding when possible.

        Note that NSView-based classes cannot be migrated at present due to AppKit not supporting NSSecureCoding
        in its class hierarchy.

        Tested by exising TestWebKitAPI tests for Coding and data transfer.

        * Platform/ios/AccessibilityIOS.mm:
        (WebKit::newAccessibilityRemoteToken): Encode using NSSecureCoding.
        * UIProcess/API/Cocoa/WKPreferences.h:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (+[WKPreferences supportsSecureCoding]): Added to enable NSSecureCoding.
        * UIProcess/API/Cocoa/WKProcessPool.h:
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (+[WKProcessPool supportsSecureCoding]): Ditto.
        * UIProcess/API/Cocoa/WKUserContentController.h:
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        (+[WKUserContentController supportsSecureCoding]): Ditto.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView initWithCoder:]): Use coding initialization that supports secure coding if
        it is available in the supplied class.
        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
        (+[WKWebViewConfiguration supportsSecureCoding]): Added to enable NSSecureCoding.
        (-[WKWebViewConfiguration initWithCoder:]): Use secure coding when possible.
        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (+[WKWebsiteDataStore supportsSecureCoding]): Added to enable NSSecureCoding.
        * UIProcess/API/Cocoa/_WKApplicationManifest.h:
        * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
        (+[_WKApplicationManifest supportsSecureCoding]): Added to enable NSSecureCoding.
        (-[_WKApplicationManifest initWithCoder:]): Use secure coding when possible.

2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove std::chrono completely
        https://bugs.webkit.org/show_bug.cgi?id=181186

        Reviewed by Alex Christensen.

        Use MonotonicTime, WallTime, and Seconds instead.
        Changes are mechanical ones.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteWebsiteData):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
        (WebKit::CacheStorage::Caches::clear):
        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::responseHasExpired):
        (WebKit::NetworkCache::responseNeedsRevalidation):
        (WebKit::NetworkCache::makeStoreDecision):
        (WebKit::NetworkCache::Cache::clear):
        (WebKit::NetworkCache::Cache::storeData):
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheEntry.cpp:
        (WebKit::NetworkCache::Entry::Entry):
        (WebKit::NetworkCache::Entry::asJSON const):
        * NetworkProcess/cache/NetworkCacheEntry.h:
        (WebKit::NetworkCache::Entry::timeStamp const):
        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
        (WebKit::NetworkCache::fileTimes):
        (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
        * NetworkProcess/cache/NetworkCacheFileSystem.h:
        * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
        (WebKit::NetworkCache::IOChannel::IOChannel):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::responseNeedsRevalidation):
        (WebKit::NetworkCache::canRevalidate):
        * NetworkProcess/cache/NetworkCacheStorage.cpp:
        (WebKit::NetworkCache::Storage::readRecord):
        (WebKit::NetworkCache::Storage::clear):
        (WebKit::NetworkCache::computeRecordWorth):
        * NetworkProcess/cache/NetworkCacheStorage.h:
        Bump the cache version. We now change the data in persistent cache.
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
        (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
        (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
        * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
        (WebKit::NetworkCache::SubresourceInfo::lastSeen const):
        (WebKit::NetworkCache::SubresourceInfo::firstSeen const):
        (WebKit::NetworkCache::SubresourcesEntry::timeStamp const):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::clearHSTSCache):
        (WebKit::clearNSURLCache):
        (WebKit::NetworkProcess::clearDiskCache):
        * NetworkProcess/curl/NetworkProcessCurl.cpp:
        (WebKit::NetworkProcess::clearDiskCache):
        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::clearCacheForAllOrigins):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::clearCacheForAllOrigins):
        (WebKit::NetworkProcess::clearDiskCache):
        * Platform/IPC/ArgumentCoders.cpp:
        (IPC::ArgumentCoder<WallTime>::encode):
        (IPC::ArgumentCoder<WallTime>::decode):
        (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode): Deleted.
        (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode): Deleted.
        * Platform/IPC/ArgumentCoders.h:
        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::deleteWebsiteData):
        * PluginProcess/PluginProcess.h:
        * PluginProcess/PluginProcess.messages.in:
        * Scripts/webkit/messages.py:
        (headers_for_type):
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
        (WebKit::RemoteLayerBackingStore::lastDisplayTime const):
        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
        (WebKit::RemoteLayerBackingStore::display):
        * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
        * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
        (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
        (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<RecentSearch>::decode):
        (IPC::ArgumentCoder<WallTime>::encode): Deleted.
        (IPC::ArgumentCoder<WallTime>::decode): Deleted.
        * Shared/WebCoreArgumentCoders.h:
        * StorageProcess/StorageProcess.cpp:
        (WebKit::StorageProcess::deleteWebsiteData):
        * StorageProcess/StorageProcess.h:
        * StorageProcess/StorageProcess.messages.in:
        * UIProcess/API/C/WKApplicationCacheManager.cpp:
        (WKApplicationCacheManagerDeleteAllEntries):
        * UIProcess/API/C/WKCookieManager.cpp:
        (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
        (WKKeyValueStorageManagerDeleteAllEntries):
        * UIProcess/API/C/WKResourceCacheManager.cpp:
        (WKResourceCacheManagerClearCacheForAllOrigins):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
        (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
        (WKWebsiteDataStoreRemoveAllFetchCaches):
        (WKWebsiteDataStoreRemoveAllIndexedDatabases):
        (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (toSystemClockTime):
        (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_clear_cache):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkit_website_data_manager_clear):
        * UIProcess/DrawingAreaProxy.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::deleteWebsiteData):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::deleteWebsiteData):
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::deleteWebsiteData):
        * UIProcess/Plugins/PluginProcessProxy.h:
        * UIProcess/Storage/StorageProcessProxy.cpp:
        (WebKit::StorageProcessProxy::deleteWebsiteData):
        * UIProcess/Storage/StorageProcessProxy.h:
        * UIProcess/WebCookieManagerProxy.cpp:
        (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
        * UIProcess/WebCookieManagerProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::deleteWebsiteData):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        * UIProcess/WebResourceLoadStatisticsStore.h:
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
        (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
        * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
        * UIProcess/WebStorage/StorageManager.cpp:
        (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
        * UIProcess/WebStorage/StorageManager.h:
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::removeData):
        (WebKit::WebsiteDataStore::removeMediaKeys):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
        * UIProcess/wpe/WebPageProxyWPE.cpp:
        (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
        * WebProcess/Cookies/WebCookieManager.cpp:
        (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
        * WebProcess/Cookies/WebCookieManager.h:
        * WebProcess/Cookies/WebCookieManager.messages.in:
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::lastModifiedDateMS):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::deleteWebsiteData):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Introduce data structures and IPC support for writing promised blobs
        https://bugs.webkit.org/show_bug.cgi?id=181189

        Reviewed by Tim Horton.

        Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail.

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

2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=181231

        Reviewed by Alex Christensen.

        Add new C API for use by WebKitTestRunner.

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
        (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:

2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>

        Add a WebAuthentication runtime feature flag
        https://bugs.webkit.org/show_bug.cgi?id=181220
        <rdar://problem/36055305>

        Reviewed by Brent Fulgham.

        Renames the CredentialManagement runtime feature flag into WebAuthentication.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKPreferences.cpp:
        (WKPreferencesSetWebAuthenticationEnabled):
        (WKPreferencesGetWebAuthenticationEnabled):
        (WKPreferencesSetCredentialManagementEnabled): Deleted.
        (WKPreferencesGetCredentialManagementEnabled): Deleted.
        * UIProcess/API/C/WKPreferencesRefPrivate.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r226327): [GTK] Plugin process is broken
        https://bugs.webkit.org/show_bug.cgi?id=181187

        Unreviewed, fix PluginProcessMainUnix after r226327.

        * PluginProcess/unix/PluginProcessMainUnix.cpp:

2018-01-02  Tim Horton  <timothy_horton@apple.com>

        Fix the build on platforms where UICurrentUserInterfaceIdiomIsPad is defined to false
        https://bugs.webkit.org/show_bug.cgi?id=181218

        Reviewed by Alex Christensen.

        * Platform/spi/ios/UIKitSPI.h:
        (currentUserInterfaceIdiomIsPad):
        * UIProcess/ios/SmartMagnificationController.mm:
        (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
        (-[WKContentView _requiresKeyboardWhenFirstResponder]):
        (-[WKContentView _displayFormNodeInputView]):
        (-[WKContentView requiresAccessoryView]):
        (-[WKContentView _updateAccessory]):
        * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
        (-[WKAirPlayRoutePicker show:fromRect:]):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
        (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
        * UIProcess/ios/forms/WKFormInputControl.mm:
        (-[WKDateTimePicker initWithView:datePickerMode:]):
        (-[WKFormInputControl initWithView:]):
        * UIProcess/ios/forms/WKFormSelectControl.mm:
        (-[WKFormSelectControl initWithView:]):
        On platforms where UICurrentUserInterfaceIdiomIsPad is defined to false,
        blocks that conditionally execute based on its value are unreachable.
        This causes the compiler to complain. Hide it away inside an inline function
        and make use of that everywhere we used to use the macro.

2018-01-02  Alex Christensen  <achristensen@webkit.org>

        Remove SVN file accidentally added in r226160
        https://bugs.webkit.org/show_bug.cgi?id=180934

        * UIProcess/WebPageProxy.cpp.orig: Removed.

2018-01-02  Alex Christensen  <achristensen@webkit.org>

        Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation
        https://bugs.webkit.org/show_bug.cgi?id=180795

        Reviewed by Brent Fulgham.

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

2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Implement the assignment of ProcessIdentifiers to child processes
        https://bugs.webkit.org/show_bug.cgi?id=181187

        Reviewed by Brady Eidson.

        * Shared/ChildProcess.cpp: Make the ProcessIdentifier mandatory.
        (WebKit::ChildProcess::initialize):
        * Shared/unix/ChildProcessMain.cpp: Initialize ChildProcessInitializationParameters with the
        ProcessIdentifier.
        (WebKit::ChildProcessMainBase::parseCommandLine):
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Copy the ProcessIdentifier from
        LaunchOptions into argv.
        (WebKit::ProcessLauncher::launchProcess):
        * WebProcess/wpe/WebProcessMainWPE.cpp: Expect the WPE socket ID later in the command line.

2018-01-02  Alex Christensen  <achristensen@webkit.org>

        Use new WebsiteDataStore passed in through decidePolicyForNavigation SPI
        https://bugs.webkit.org/show_bug.cgi?id=180897
        <rdar://problem/35535328>

        Reviewed by Brent Fulgham.

        * Shared/WebsitePoliciesData.cpp:
        (WebKit::WebsitePoliciesData::applyToDocumentLoader):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::changeWebsiteDataStore):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
        (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
        (WebKit::WebProcessPool::pageAddedToProcess): Deleted.
        (WebKit::WebProcessPool::pageRemovedFromProcess): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::addExistingWebPage):
        (WebKit::WebProcessProxy::removeWebPage):
        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
        (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):

2018-01-02  Alex Christensen  <achristensen@webkit.org>

        Only use CookieStorageShim when we aren't using NetworkSession
        https://bugs.webkit.org/show_bug.cgi?id=180766

        Reviewed by Brent Fulgham.

        * Shared/mac/CookieStorageShim.h:
        * Shared/mac/CookieStorageShim.mm:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):

2018-01-02  Alex Christensen  <achristensen@webkit.org>

        Clean up context menu code
        https://bugs.webkit.org/show_bug.cgi?id=181074

        Reviewed by Brent Fulgham.

        Use Ref instead of RefPtr where possible.
        Use move semantics instead of copying from const references when possible.
        Remove dead iOS code.  Reduce allocations.  Add stub for WPE.

        * UIProcess/API/APIContextMenuClient.h:
        (API::ContextMenuClient::getContextMenuFromProposedMenu):
        (API::ContextMenuClient::getContextMenuFromProposedMenuAsync):
        (API::ContextMenuClient::showContextMenu):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageContextMenuClient):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createContextMenuProxy):
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebContextMenuListenerProxy.cpp:
        (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
        * UIProcess/WebContextMenuProxy.cpp:
        (WebKit::WebContextMenuProxy::WebContextMenuProxy):
        * UIProcess/WebContextMenuProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showContextMenu):
        (WebKit::WebPageProxy::internalShowContextMenu): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
        * UIProcess/gtk/WebContextMenuProxyGtk.h:
        (WebKit::WebContextMenuProxyGtk::create):
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::createContextMenuProxy): Deleted.
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::createContextMenuProxy):
        * UIProcess/mac/WebContextMenuProxyMac.h:
        (WebKit::WebContextMenuProxyMac::create):
        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyMac::showContextMenu):

== Rolled over to ChangeLog-2018-01-01 ==