ChangeLog   [plain text]


2020-10-06  Alan Coon  <alancoon@apple.com>

        Cherry-pick r268030. rdar://problem/70010322

    Break reference cycle with NSURLSessionDataTask in NetworkDataTaskCocoa
    https://bugs.webkit.org/show_bug.cgi?id=217347
    <rdar://problem/69483575>
    
    Reviewed by Geoffrey Garen.
    
    * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
    (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268030 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-10-05  Sihui Liu  <sihui_liu@apple.com>

            Break reference cycle with NSURLSessionDataTask in NetworkDataTaskCocoa
            https://bugs.webkit.org/show_bug.cgi?id=217347
            <rdar://problem/69483575>

            Reviewed by Geoffrey Garen.

            * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
            (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking):

2020-10-06  Alan Coon  <alancoon@apple.com>

        Cherry-pick r268019. rdar://problem/70005083

    Change a PDF RELEASE_ASSERT to an early return.
    rdar://problem/69805240 and https://bugs.webkit.org/show_bug.cgi?id=217346
    
    Reviewed by Tim Horton.
    
    No new tests (Wish they were possible)
    
    * WebProcess/Plugins/PDF/PDFPlugin.mm:
    (WebKit::PDFPlugin::installPDFDocument): This release assert is getting hit regularly.
      Change to an early return while we continue tracking this down.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268019 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-10-05  Brady Eidson  <beidson@apple.com>

            Change a PDF RELEASE_ASSERT to an early return.
            rdar://problem/69805240 and https://bugs.webkit.org/show_bug.cgi?id=217346

            Reviewed by Tim Horton.

            No new tests (Wish they were possible)

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::installPDFDocument): This release assert is getting hit regularly.
              Change to an early return while we continue tracking this down.

2020-10-05  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267602. rdar://problem/69904386

    WebGL should use GLES in iOS apps running on Apple Silicon
    https://bugs.webkit.org/show_bug.cgi?id=216722
    <rdar://problem/68976337>
    
    Reviewed by Tim Horton and Ken Russell.
    
    Source/ThirdParty/ANGLE:
    
    Change ANGLE to dynamically load either EAGL (OpenGLES) or CGL (OpenGL) depending
    on both compile and runtime configurations.
        Intel Mac -> CGL
        Intel Mac Catalyst -> CGL
        Intel iOS Simulator -> EAGL
        iOS Device -> EAGL
        Apple Silicon Mac -> CGL
        Apple Silicon Mac Catalyst (with Mac app) -> CGL
        Apple Silicon Mac Catalyst (with iOS app) -> EAGL
    
    The trickiest bit is Apple Silicon Mac Catalyst, which depends on the
    type of the application it is attempting to run. In that case ANGLE must compile
    both the CGL and EAGL interfaces and then pick one to use after launch.
    
    * ANGLE.xcodeproj/project.pbxproj: Add new files.
    
    * Configurations/ANGLE-dynamic.xcconfig: Remove all the OpenGL* linking.
    * Configurations/ANGLE-static.xcconfig:
    
    * GLESv2.cmake: New files.
    
    * src/common/platform.h: New definitions for CPU type on Apple Systems.
    
    * src/gpu_info_util/SystemInfo.h: Split SystemInfo for Apple into two
    files, for iOS and Mac. Added a field for isiOSAppOnMac that will only
    be true when running an iOS binary on Apple Silicon.
    * src/gpu_info_util/SystemInfo_apple.mm: Added. Decides which SystemInfo
    to call.
    (angle::GetSystemInfo):
    * src/gpu_info_util/SystemInfo_ios.cpp:
    (angle::GetSystemInfo_ios):
    (angle::GetSystemInfo): Deleted.
    * src/gpu_info_util/SystemInfo_macos.mm:
    (angle::GetSystemInfo_mac):
    (angle::GetSystemInfo): Deleted.
    
    * src/libANGLE/Caps.cpp: Can no longer just check for PLATFORM_IOS. This
    might still need a runtime check.
    (gl::DetermineDepthTextureANGLESupport):
    (gl::DetermineDepthTextureOESSupport):
    
    * src/libANGLE/Display.cpp: This is the main initialization point for
    ANGLE, which decides at compile/runtime which variant of Display to
    create.
    
    * src/libANGLE/formatutils.cpp: Add the correct formats.
    (gl::BuildInternalFormatInfoMap):
    
    * src/libANGLE/renderer/gl/SoftLinking_apple.h: Added. Macros to help soft-link
    functions and ObjC classes.
    * src/libANGLE/renderer/gl/cgl/CGLFunctions.cpp: Added. Where we soft-link all
    the OpenGL/CGL API.
    * src/libANGLE/renderer/gl/cgl/CGLFunctions.h: Added.
    
    * src/libANGLE/renderer/gl/cgl/DisplayCGL.mm: Use the soft-linked methods.
    * src/libANGLE/renderer/gl/cgl/IOSurfaceSurfaceCGL.cpp:
    * src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h:
    * src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm: Rename WebSwapLayer to WebSwapLayerCGL
    otherwise it clashes with the EAGL version.
    (rx::WindowSurfaceCGL::initialize):
    (-[WebSwapLayer initWithSharedState:withContext:withFunctions:]): Deleted.
    (-[WebSwapLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
    (-[WebSwapLayer copyCGLContextForPixelFormat:]): Deleted.
    (-[WebSwapLayer canDrawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.
    (-[WebSwapLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.
    
    * src/libANGLE/renderer/gl/eagl/DeviceEAGL.cpp: Similar changes to the CGL implementation.
    * src/libANGLE/renderer/gl/eagl/DeviceEAGL.h:
    * src/libANGLE/renderer/gl/eagl/DisplayEAGL.h:
    * src/libANGLE/renderer/gl/eagl/DisplayEAGL.mm:
    (rx::DisplayEAGL::initialize):
    (rx::DisplayEAGL::terminate):
    (rx::WorkerContextEAGL::~WorkerContextEAGL):
    (rx::WorkerContextEAGL::makeCurrent):
    (rx::WorkerContextEAGL::unmakeCurrent):
    (rx::DisplayEAGL::createWorkerContext):
    * src/libANGLE/renderer/gl/eagl/EAGLFunctions.h: Added.
    * src/libANGLE/renderer/gl/eagl/EAGLFunctions.mm: Added.
    * src/libANGLE/renderer/gl/eagl/IOSurfaceSurfaceEAGL.mm:
    * src/libANGLE/renderer/gl/eagl/PbufferSurfaceEAGL.cpp:
    * src/libANGLE/renderer/gl/eagl/RendererEAGL.cpp:
    * src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.h:
    * src/libANGLE/renderer/gl/eagl/WindowSurfaceEAGL.mm:
    (-[WebSwapLayerEAGL display]):
    (rx::WindowSurfaceEAGL::initialize):
    (-[WebSwapLayer initWithSharedState:withContext:withFunctions:]): Deleted.
    (-[WebSwapLayer display]): Deleted.
    
    * src/libANGLE/renderer/gl/renderergl_utils.cpp: Runtime check.
    (rx::nativegl_gl::GenerateCaps):
    
    Source/WebCore:
    
    * Configurations/WebCore.xcconfig: Remove all OpenGL/OpenGLES linking.
    * WebCore.xcodeproj/project.pbxproj:
    
    * platform/graphics/GraphicsContextGL.h: Change the ANGLE IOSurface texture binding
    enums into functions, because they have to be calculated at run-time.
    * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: Use the new soft-linked
    functions from PAL. Also implement the IOSurface texture binding helpers that were
    previously enums.
    * platform/mac/PlatformScreenMac.mm:
    * platform/mac/WebGLBlocklist.mm:
    
    Source/WebCore/PAL:
    
    Add soft-linking content for OpenGL/OpenGLES.
    
    * PAL.xcodeproj/project.pbxproj:
    * pal/PlatformMac.cmake:
    * pal/cocoa/OpenGLSoftLinkCocoa.h: Added.
    * pal/cocoa/OpenGLSoftLinkCocoa.mm: Added.
    
    Source/WebKit:
    
    * Configurations/WebKit.xcconfig: Remove OpenGL linking.
    * UIProcess/mac/HighPerformanceGPUManager.mm: Renamed to .mm. Use the PAL soft-linked OpenGL API.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267602 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-24  Dean Jackson  <dino@apple.com>

            WebGL should use GLES in iOS apps running on Apple Silicon
            https://bugs.webkit.org/show_bug.cgi?id=216722
            <rdar://problem/68976337>

            Reviewed by Tim Horton.

            * Configurations/WebKit.xcconfig: Remove OpenGL linking.
            * UIProcess/mac/HighPerformanceGPUManager.mm: Renamed to .mm. Use the PAL soft-linked OpenGL API.

2020-10-02  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267792. rdar://problem/69904383

    REGRESSION (r265009): Web Share API can no longer be invoked if a previous invocation was dismissed using the close button
    https://bugs.webkit.org/show_bug.cgi?id=216913
    <rdar://problem/69659878>
    
    Reviewed by Darin Adler.
    
    No new tests; not able to test without UI tests that actually use UIActivityViewController.
    
    * UIProcess/Cocoa/WKShareSheet.mm:
    (-[WKShareSheet presentWithShareDataArray:inRect:]):
    -presentationControllerDidDismiss is not called if the UIActivityViewController is
    programmatically dismissed, so we need to revert to observing completion via
    UIActivityViewController's -completionWithItemsHandler.
    
    In order to avoid regressing bug 214894 by doing so, we also need to
    make sure that we're actually not presented anymore, as -completionWithItemsHandler
    can be called multiple times before the share sheet is actually dismissed.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267792 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-30  Tim Horton  <timothy_horton@apple.com>

            REGRESSION (r265009): Web Share API can no longer be invoked if a previous invocation was dismissed using the close button
            https://bugs.webkit.org/show_bug.cgi?id=216913
            <rdar://problem/69659878>

            Reviewed by Darin Adler.

            No new tests; not able to test without UI tests that actually use UIActivityViewController.

            * UIProcess/Cocoa/WKShareSheet.mm:
            (-[WKShareSheet presentWithShareDataArray:inRect:]):
            -presentationControllerDidDismiss is not called if the UIActivityViewController is
            programmatically dismissed, so we need to revert to observing completion via
            UIActivityViewController's -completionWithItemsHandler.

            In order to avoid regressing bug 214894 by doing so, we also need to
            make sure that we're actually not presented anymore, as -completionWithItemsHandler
            can be called multiple times before the share sheet is actually dismissed.

2020-10-02  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267612. rdar://problem/69904365

    Crunchyroll playback controls do not work on iPad with trackpad
    https://bugs.webkit.org/show_bug.cgi?id=217000
    <rdar://problem/66362029>
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isCrunchyroll):
    
    Source/WebKit:
    
    * UIProcess/ios/WKContentViewInteraction.mm:
    (applicationIsKnownToIgnoreMouseEvents):
    Add it to the list.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267612 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-25  Tim Horton  <timothy_horton@apple.com>

            Crunchyroll playback controls do not work on iPad with trackpad
            https://bugs.webkit.org/show_bug.cgi?id=217000
            <rdar://problem/66362029>

            Reviewed by Wenson Hsieh.

            * UIProcess/ios/WKContentViewInteraction.mm:
            (applicationIsKnownToIgnoreMouseEvents):
            Add it to the list.

2020-10-02  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266028. rdar://problem/69904377

    Move node geometry functions from Range to RenderObject
    https://bugs.webkit.org/show_bug.cgi?id=215677
    
    Reviewed by Zalan Bujtas.
    
    Source/WebCore:
    
    Moved functions that return quads and rectangles out of Range into RenderObject.
    We could find another home for them, but for now they make sense as static member
    functions there since RenderObject has the non-static member functions that they
    call on multiple nodes. Mostly did not change the design of these functions much,
    and was careful not to change behavior at all. But did change a few things:
    
    - Got rid of the functions that return a single unioned rectangle.
      Instead callers call unionRect at each call site.
    - Changed the "use selection height" boolean to a BoundingRectBehavior flag.
    
    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::boundsForRects): Call unionRect(RenderObject::absoluteTextRects) instead
    of Range::absoluteBoundingBox.
    
    * dom/DocumentMarkerController.cpp:
    (WebCore::updateRenderedRectsForMarker): Instead of passing "true", pass
    "RenderObject::BoundingRectBehavior::UseSelectionHeight".
    
    * dom/Range.cpp:
    (WebCore::Range::absoluteBoundingBox const): Deleted.
    (WebCore::Range::absoluteRectsForRangeInText const): Deleted.
    (WebCore::Range::absoluteTextRects const): Deleted.
    (WebCore::Range::getClientRects const): Call RenderObject::clientBorderAndTextRects.
    (WebCore::Range::getBoundingClientRect const): Call
    unionRect(RenderObject::clientBorderAndTextRects).
    (WebCore::Range::borderAndTextRects const): Deleted.
    (WebCore::Range::boundingRect const): Deleted.
    (WebCore::Range::absoluteBoundingRect const): Deleted.
    * dom/Range.h: Updated for above.
    
    * dom/SimpleRange.cpp:
    (WebCore::IntersectingNodeIterator::IntersectingNodeIterator): Fix bug affecting
    empty ranges by calling enforceEndInvariant.
    (WebCore::IntersectingNodeIterator::advance): Refactor to call enforceEndInvariant.
    (WebCore::IntersectingNodeIterator::advanceSkippingChildren): Ditto.
    (WebCore::IntersectingNodeIterator::enforceEndInvariant): Added.
    * dom/SimpleRange.h: Added enforceEndInvariant.
    
    * editing/FrameSelection.cpp:
    (WebCore::FrameSelection::getClippedVisibleTextRectangles const): Instead of
    passing a useSelectionHeight boolean, pass BoundingRectBehavior.
    
    * page/TextIndicator.cpp:
    (WebCore::absoluteBoundingRectForRange): Call
    unionRectIgnoringZeroRects(RenderObject::absoluteBorderAndTextRects).
    (WebCore::initializeIndicator): Call RenderObject::absoluteTextRects.
    
    * platform/graphics/GeometryUtilities.cpp:
    (WebCore::unionRectIgnoringZeroRects): Added.
    * platform/graphics/GeometryUtilities.h: Updated for above.
    
    * rendering/RenderLineBreak.h: Marked a lot of functions final.
    Added a default value for the absoluteQuads out argument.
    
    * rendering/RenderObject.cpp:
    (WebCore::RenderObject::addPDFURLRect): Tweaked code style a bit.
    (WebCore::RenderObject::absoluteTextQuads): Replaced boolean useSelectionHeight
    argument with a BoundingRectBehavior argument. Also added a downcast so the
    call to RenderLineBreak::absoluteQuads is a non-virtual function call.
    (WebCore::absoluteRectsForRangeInText): Added.
    (WebCore::RenderObject::absoluteTextRects): Replaced boolean useSelectionHeight
    argument with a BoundingRectBehavior argument.
    (WebCore::nodeBefore): Added.
    (WebCore::borderAndTextRects): Added.
    (WebCore::RenderObject::absoluteBorderAndTextRects): Added.
    (WebCore::RenderObject::clientBorderAndTextRects): Added.
    * rendering/RenderObject.h: Updated for above.
    
    Source/WebKit:
    
    * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
    (WebKit::InjectedBundleRangeHandle::boundingRectInWindowCoordinates const):
    Call unionRectIgnoringZeroRects(RenderObject::absoluteBorderAndTextRects).
    (WebKit::InjectedBundleRangeHandle::renderedImage): Call
    unionRectIgnoringZeroRects(RenderObject::absoluteBorderAndTextRects).
    
    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::WebPage::requestEvasionRectsAboveSelection): Call
    unionRect(RenderObject::absoluteTextRects).
    (WebKit::WebPage::requestDocumentEditingContext): Call
    unionRect(RenderObject::absoluteTextRects).
    
    Source/WebKitLegacy/mac:
    
    * DOM/DOM.mm:
    (-[DOMRange boundingBox]): Call unionRect(RenderObject::absoluteTextRects).
    
    Source/WebKitLegacy/win:
    
    * AccessibleTextImpl.cpp:
    (AccessibleText::scrollSubstringTo): Call
    unionRect(RenderObject::absoluteTextRects) instead of
    Range::absoluteBoundingBox.
    
    LayoutTests:
    
    * fast/dom/Range/scale-page-bounding-client-rect.html: Fix this test that accidentally
    depended on getting rects for an empty range (the contents of a div element with no
    text inside it) to instead get rects for a non-empty element (the div element, not
    just its contents). Test now works correctly, but results don't need to change.
    * fast/dom/Range/scale-page-client-rects.html: Ditto.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266028 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Move node geometry functions from Range to RenderObject
            https://bugs.webkit.org/show_bug.cgi?id=215677

            Reviewed by Zalan Bujtas.

            * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
            (WebKit::InjectedBundleRangeHandle::boundingRectInWindowCoordinates const):
            Call unionRectIgnoringZeroRects(RenderObject::absoluteBorderAndTextRects).
            (WebKit::InjectedBundleRangeHandle::renderedImage): Call
            unionRectIgnoringZeroRects(RenderObject::absoluteBorderAndTextRects).

            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::WebPage::requestEvasionRectsAboveSelection): Call
            unionRect(RenderObject::absoluteTextRects).
            (WebKit::WebPage::requestDocumentEditingContext): Call
            unionRect(RenderObject::absoluteTextRects).

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267540. rdar://problem/69593993

    CrashTracer: com.apple.WebKit.Networking in NetworkSession::firstPartyHostCNAMEDomain() code
    https://bugs.webkit.org/show_bug.cgi?id=216934
    <rdar://problem/69216768>
    
    Reviewed by Alex Christensen.
    
    Add a check for a valid key.
    
    * NetworkProcess/NetworkSession.cpp:
    (WebKit::NetworkSession::firstPartyHostCNAMEDomain):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267540 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-24  Kate Cheney  <katherine_cheney@apple.com>

            CrashTracer: com.apple.WebKit.Networking in NetworkSession::firstPartyHostCNAMEDomain() code
            https://bugs.webkit.org/show_bug.cgi?id=216934
            <rdar://problem/69216768>

            Reviewed by Alex Christensen.

            Add a check for a valid key.

            * NetworkProcess/NetworkSession.cpp:
            (WebKit::NetworkSession::firstPartyHostCNAMEDomain):

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267496. rdar://problem/69594104

    [macOS] Change name of client decoder entitlement
    https://bugs.webkit.org/show_bug.cgi?id=216670
    <rdar://problem/69101997>
    
    Reviewed by Darin Adler.
    
    The client decoder entitlement landed in <https://trac.webkit.org/changeset/266613/webkit> has changed name, and should be updated.
    
    * Scripts/process-entitlements.sh:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267496 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-23  Per Arne Vollan  <pvollan@apple.com>

            [macOS] Change name of client decoder entitlement
            https://bugs.webkit.org/show_bug.cgi?id=216670
            <rdar://problem/69101997>

            Reviewed by Darin Adler.

            The client decoder entitlement landed in <https://trac.webkit.org/changeset/266613/webkit> has changed name, and should be updated.

            * Scripts/process-entitlements.sh:

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267412. rdar://problem/69594162

    Crashtracer inside PDFPlugin::createScrollbar.
    <rdar://problem/69256031> and https://bugs.webkit.org/show_bug.cgi?id=216810
    
    Reviewed by Tim Horton.
    
    To quote Tim from r264945:
    No new tests; timing is such that I can't reproduce without inserting
    intentional delays into the main thread hops, which is further than
    I'm willing to go for a test.
    
    This is a speculative fix due to the aforementioned reproducibility issue.
    
    * WebProcess/Plugins/PDF/PDFPlugin.mm:
    (WebKit::PDFPlugin::installPDFDocument): With all the past fixes in place, its apparent
      the plug-in HAS been torn down, and it's somewhat common to bypass the other "hasBeenDestroyed"
      checks. So put an explicit check here followed by an explicit release assert.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267412 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-22  Brady Eidson  <beidson@apple.com>

            Crashtracer inside PDFPlugin::createScrollbar.
            <rdar://problem/69256031> and https://bugs.webkit.org/show_bug.cgi?id=216810

            Reviewed by Tim Horton.

            To quote Tim from r264945:
            No new tests; timing is such that I can't reproduce without inserting
            intentional delays into the main thread hops, which is further than
            I'm willing to go for a test.

            This is a speculative fix due to the aforementioned reproducibility issue.

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::installPDFDocument): With all the past fixes in place, its apparent
              the plug-in HAS been torn down, and it's somewhat common to bypass the other "hasBeenDestroyed"
              checks. So put an explicit check here followed by an explicit release assert.

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267394. rdar://problem/69593980

    paper.io ad close buttons cannot be iteracted with via trackpad on iPad
    https://bugs.webkit.org/show_bug.cgi?id=216812
    <rdar://problem/68738585>
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isPaperIO):
    
    Source/WebKit:
    
    * UIProcess/ios/WKContentViewInteraction.mm:
    (applicationIsKnownToIgnoreMouseEvents):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267394 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-21  Tim Horton  <timothy_horton@apple.com>

            paper.io ad close buttons cannot be iteracted with via trackpad on iPad
            https://bugs.webkit.org/show_bug.cgi?id=216812
            <rdar://problem/68738585>

            Reviewed by Wenson Hsieh.

            * UIProcess/ios/WKContentViewInteraction.mm:
            (applicationIsKnownToIgnoreMouseEvents):

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267305. rdar://problem/69594350

    [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data
    https://bugs.webkit.org/show_bug.cgi?id=216718
    <rdar://problem/69150358>
    
    Reviewed by Tim Horton.
    
    Source/WebKit:
    
    Test: CopyHTML.WriteRichTextSelectionToPasteboard
    
    * UIProcess/mac/WebPageProxyMac.mm:
    (WebKit::WebPageProxy::dataSelectionForPasteboard):
    
    After r265702, the `IPCHandle` received in the UI process was always being converted into a buffer of size 0,
    due to using the `size` local variable (which is no longer set as an outparam of the sync IPC message). Instead,
    use `ipcHandle.dataSize`.
    
    Tools:
    
    Add a new API test to verify that we get non-empty web archive data when using
    `-writeSelectionToPasteboard:types:` to grab selected content as rich text data.
    
    * TestWebKitAPI/Tests/WebKitCocoa/CopyHTML.mm:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-18  Wenson Hsieh  <wenson_hsieh@apple.com>

            [macOS] REGRESSION (r265702): System Services receive 0 bytes when extracting selected content as rich text data
            https://bugs.webkit.org/show_bug.cgi?id=216718
            <rdar://problem/69150358>

            Reviewed by Tim Horton.

            Test: CopyHTML.WriteRichTextSelectionToPasteboard

            * UIProcess/mac/WebPageProxyMac.mm:
            (WebKit::WebPageProxy::dataSelectionForPasteboard):

            After r265702, the `IPCHandle` received in the UI process was always being converted into a buffer of size 0,
            due to using the `size` local variable (which is no longer set as an outparam of the sync IPC message). Instead,
            use `ipcHandle.dataSize`.

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267215. rdar://problem/69594225

    Per-app accent color overrides are broken
    https://bugs.webkit.org/show_bug.cgi?id=216674
    <rdar://problem/67745464>
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore/PAL:
    
    * pal/spi/mac/NSApplicationSPI.h:
    
    Source/WebKit:
    
    No new tests; I've no idea how to write a test that would have caught this;
    any test I can imagine would have also written to _accentColor and worked fine.
    
    * UIProcess/mac/PageClientImplMac.mm:
    (WebKit::PageClientImpl::accentColor):
    AppKit changed the meaning of the IPI. Use the correct version.
    We still write to _accentColor; it is now purely an override.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Per-app accent color overrides are broken
            https://bugs.webkit.org/show_bug.cgi?id=216674
            <rdar://problem/67745464>

            Reviewed by Wenson Hsieh.

            No new tests; I've no idea how to write a test that would have caught this;
            any test I can imagine would have also written to _accentColor and worked fine.

            * UIProcess/mac/PageClientImplMac.mm:
            (WebKit::PageClientImpl::accentColor):
            AppKit changed the meaning of the IPI. Use the correct version.
            We still write to _accentColor; it is now purely an override.

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267092. rdar://problem/69594199

    REGRESSION (r267002): ASSERTION FAILED:[ iOS wk2 Debug ] !HashTranslator::equal(KeyTraits::emptyValue(), key) on compositing/ios/overflow-scroll-update-overlap.html
    https://bugs.webkit.org/show_bug.cgi?id=216520
    <rdar://problem/68894931>
    
    Reviewed by Tim Horton.
    
    Source/WebKit:
    
    Avoid hash lookups with zero nodeIDs.
    
    * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
    (WebKit::RemoteScrollingCoordinator::isRubberBandInProgress const):
    (WebKit::RemoteScrollingCoordinator::isUserScrollInProgress const):
    (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress const):
    
    LayoutTests:
    
    * platform/ios-wk2/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267092 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-15  Simon Fraser  <simon.fraser@apple.com>

            REGRESSION (r267002): ASSERTION FAILED:[ iOS wk2 Debug ] !HashTranslator::equal(KeyTraits::emptyValue(), key) on compositing/ios/overflow-scroll-update-overlap.html
            https://bugs.webkit.org/show_bug.cgi?id=216520
            <rdar://problem/68894931>

            Reviewed by Tim Horton.

            Avoid hash lookups with zero nodeIDs.

            * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
            (WebKit::RemoteScrollingCoordinator::isRubberBandInProgress const):
            (WebKit::RemoteScrollingCoordinator::isUserScrollInProgress const):
            (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress const):

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267002. rdar://problem/69594199

    Overflow:scroll rubberbanding is interrupted by post-layout scrolling
    https://bugs.webkit.org/show_bug.cgi?id=216463
    <rdar://problem/67095741>
    
    Reviewed by Darin Adler.
    
    When rubberbanding overflow:scroll RenderLayer has an overscrolled scroll offset.
    If RenderLayer::updateScrollInfoAfterLayout() happens when in this state, it can
    clamp the scroll offset, causing the rubberband to collapse which interferes with
    the user interaction. This happend on Gmail when composing a reply.
    
    Fix by tracking the rubberbanding state in the scrolling tree, and having RenderLayer
    query this state via the ScrollingCoordinator. RenderLayer::updateScrollInfoAfterLayout()
    already tested isRubberBandInProgress(). This is similar to how isUserScrollInProgress()
    and isScrollSnapInProgress() work.
    
    This patch also fixes the tracking of rubberbanding state. Previously setMainFrameIsRubberBanding()
    was just based on when the timer was started and stopped, which did not match the
    implementation of ScrollController::isRubberBandInProgress(). Now ScrollController
    correctly notifies its clients when the rubberbanding state changes by updating that
    state whenever any of the conditions consulted in isRubberBandInProgressInternal() change.
    
    Source/WebCore:
    
    I tried to make tests for this, but the timing of wheel and scroll event delivery makes
    reliable detection of interrupted rubberbands impossible in WebKitTestRunner.
    
    * page/FrameView.cpp:
    (WebCore::FrameView::isRubberBandInProgress const):
    * page/scrolling/AsyncScrollingCoordinator.cpp:
    (WebCore::AsyncScrollingCoordinator::isRubberBandInProgress const):
    * page/scrolling/AsyncScrollingCoordinator.h:
    * page/scrolling/ScrollingCoordinator.h:
    (WebCore::ScrollingCoordinator::isRubberBandInProgress const):
    * page/scrolling/ScrollingTree.cpp:
    (WebCore::ScrollingTree::isRubberBandInProgressForNode):
    (WebCore::ScrollingTree::setRubberBandingInProgressForNode):
    (WebCore::ScrollingTree::isRubberBandInProgress): Deleted.
    (WebCore::ScrollingTree::setMainFrameIsRubberBanding): Deleted.
    * page/scrolling/ScrollingTree.h:
    * page/scrolling/ScrollingTreeScrollingNode.cpp:
    (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
    * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
    (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
    (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState):
    * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
    * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
    (WebCore::ScrollingTreeOverflowScrollingNodeMac::currentScrollPositionChanged):
    * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
    * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
    (WebCore::ScrollingTreeScrollingNodeDelegateMac::currentScrollPositionChanged):
    (WebCore::ScrollingTreeScrollingNodeDelegateMac::isRubberBandInProgress const):
    (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopRubberbandSnapAnimation):
    (WebCore::ScrollingTreeScrollingNodeDelegateMac::rubberBandingStateChanged):
    * platform/ScrollAnimator.cpp:
    (WebCore::ScrollAnimator::notifyPositionChanged):
    * platform/cocoa/ScrollController.h:
    (WebCore::ScrollControllerClient::rubberBandingStateChanged):
    * platform/cocoa/ScrollController.mm:
    (WebCore::ScrollController::handleWheelEvent):
    (WebCore::ScrollController::snapRubberBandTimerFired):
    (WebCore::ScrollController::scrollPositionChanged):
    (WebCore::ScrollController::isRubberBandInProgress const):
    (WebCore::ScrollController::stopSnapRubberbandTimer):
    (WebCore::ScrollController::isRubberBandInProgressInternal const):
    (WebCore::ScrollController::updateRubberBandingState):
    (WebCore::ScrollController::updateGestureInProgressState):
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::isRubberBandInProgress const):
    (WebCore::RenderLayer::updateScrollInfoAfterLayout):
    
    Source/WebKit:
    
    * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
    * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
    (WebKit::RemoteScrollingCoordinator::isRubberBandInProgress const):
    (WebKit::RemoteScrollingCoordinator::scrollingStateInUIProcessChanged):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267002 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-13  Simon Fraser  <simon.fraser@apple.com>

            Overflow:scroll rubberbanding is interrupted by post-layout scrolling
            https://bugs.webkit.org/show_bug.cgi?id=216463
            <rdar://problem/67095741>

            Reviewed by Darin Adler.

            When rubberbanding overflow:scroll RenderLayer has an overscrolled scroll offset.
            If RenderLayer::updateScrollInfoAfterLayout() happens when in this state, it can
            clamp the scroll offset, causing the rubberband to collapse which interferes with
            the user interaction. This happend on Gmail when composing a reply.

            Fix by tracking the rubberbanding state in the scrolling tree, and having RenderLayer
            query this state via the ScrollingCoordinator. RenderLayer::updateScrollInfoAfterLayout()
            already tested isRubberBandInProgress(). This is similar to how isUserScrollInProgress()
            and isScrollSnapInProgress() work.

            This patch also fixes the tracking of rubberbanding state. Previously setMainFrameIsRubberBanding()
            was just based on when the timer was started and stopped, which did not match the
            implementation of ScrollController::isRubberBandInProgress(). Now ScrollController
            correctly notifies its clients when the rubberbanding state changes by updating that
            state whenever any of the conditions consulted in isRubberBandInProgressInternal() change.

            * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
            * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
            (WebKit::RemoteScrollingCoordinator::isRubberBandInProgress const):
            (WebKit::RemoteScrollingCoordinator::scrollingStateInUIProcessChanged):

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266611. rdar://problem/69594191

    MediaRecorder timeslice parameter causing internal error on longer videos
    https://bugs.webkit.org/show_bug.cgi?id=216076
    <rdar://problem/68209422>
    
    Reviewed by Eric Carlson.
    
    Source/WebCore:
    
    Test: http/wpt/fetch/blob-range.html
    
    * platform/network/BlobResourceHandle.cpp:
    (WebCore::BlobResourceHandle::readDataAsync):
    
    Source/WebKit:
    
    Test: http/wpt/fetch/blob-range.html
    
    * NetworkProcess/NetworkDataTaskBlob.cpp:
    (WebKit::NetworkDataTaskBlob::readData):
    readData can be re-entrant so we need to reset m_currentItemReadSize before consuming data.
    
    LayoutTests:
    
    * http/wpt/fetch/blob-range-expected.txt: Added.
    * http/wpt/fetch/blob-range.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266611 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            MediaRecorder timeslice parameter causing internal error on longer videos
            https://bugs.webkit.org/show_bug.cgi?id=216076
            <rdar://problem/68209422>

            Reviewed by Eric Carlson.

            Test: http/wpt/fetch/blob-range.html

            * NetworkProcess/NetworkDataTaskBlob.cpp:
            (WebKit::NetworkDataTaskBlob::readData):
            readData can be re-entrant so we need to reset m_currentItemReadSize before consuming data.

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r265977. rdar://problem/69594018

    Could not find module 'WebKit' for target 'armv7-apple-ios'
    <https://bugs.webkit.org/show_bug.cgi?id=215190>
    <rdar://problem/65642049>
    
    Reviewed by Brady Eidson.
    
    The config changes here got added to the wrong config file. They need to
    be for the overlay, not its tests.
    
    * SwiftOverlay/Configurations/WebKitSwiftOverlay.xcconfig:
    * SwiftOverlay/Configurations/WebKitSwiftOverlayTests.xcconfig:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-20  James Savage  <james.savage@apple.com>

            Could not find module 'WebKit' for target 'armv7-apple-ios'
            <https://bugs.webkit.org/show_bug.cgi?id=215190>
            <rdar://problem/65642049>

            Reviewed by Brady Eidson.

            The config changes here got added to the wrong config file. They need to
            be for the overlay, not its tests.

            * SwiftOverlay/Configurations/WebKitSwiftOverlay.xcconfig:
            * SwiftOverlay/Configurations/WebKitSwiftOverlayTests.xcconfig:

2020-09-27  Alan Coon  <alancoon@apple.com>

        Cherry-pick r265322. rdar://problem/69594018

    Could not find module 'WebKit' for target 'armv7-apple-ios'
    <https://bugs.webkit.org/show_bug.cgi?id=215190>
    <rdar://problem/65642049>
    
    Reviewed by Brady Eidson.
    
    * SwiftOverlay/Configurations/WebKitSwiftOverlayTests.xcconfig: Define
    SWIFT_MODULE_ONLY_ARCHS to emit other architectures.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265322 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-06  James Savage  <james.savage@apple.com>

            Could not find module 'WebKit' for target 'armv7-apple-ios'
            <https://bugs.webkit.org/show_bug.cgi?id=215190>
            <rdar://problem/65642049>

            Reviewed by Brady Eidson.

            * SwiftOverlay/Configurations/WebKitSwiftOverlayTests.xcconfig: Define
            SWIFT_MODULE_ONLY_ARCHS to emit other architectures.

2020-09-25  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266804. rdar://problem/69583164

    macCatalyst: Form controls behave strangely (like iPhone) in macOS-idiom apps
    https://bugs.webkit.org/show_bug.cgi?id=216326
    
    Reviewed by Wenson Hsieh.
    
    * Shared/UserInterfaceIdiom.h:
    * Shared/UserInterfaceIdiom.mm:
    (WebKit::userInterfaceIdiomIsPad):
    (WebKit::currentUserInterfaceIdiomIsPadOrMac):
    (WebKit::setCurrentUserInterfaceIdiomIsPadOrMac):
    (WebKit::currentUserInterfaceIdiomIsPad): Deleted.
    (WebKit::setCurrentUserInterfaceIdiomIsPad): Deleted.
    * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
    (WebKit::defaultTextAutosizingUsesIdempotentMode):
    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
    (-[WKWebViewConfiguration init]):
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    * UIProcess/ios/SmartMagnificationController.mm:
    (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
    (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
    (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
    (-[WKContentView _zoomToRevealFocusedElement]):
    (-[WKContentView requiresAccessoryView]):
    (-[WKContentView _updateAccessory]):
    (shouldShowKeyboardForElement):
    (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
    * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
    (WebKit::WebDataListSuggestionsDropdownIOS::show):
    * UIProcess/ios/WebPageProxyIOS.mm:
    (WebKit::desktopClassBrowsingSupported):
    * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
    (-[WKAirPlayRoutePicker show:fromRect:]):
    * UIProcess/ios/forms/WKFileUploadPanel.mm:
    (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
    (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
    * UIProcess/ios/forms/WKFormColorControl.mm:
    (-[WKFormColorControl initWithView:]):
    * UIProcess/ios/forms/WKFormColorPicker.mm:
    (-[WKColorPicker initWithView:inPopover:]):
    (-[WKColorPicker drawSelectionIndicatorForColorButton:]):
    * UIProcess/ios/forms/WKFormSelectControl.mm:
    (-[WKFormSelectControl initWithView:]):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    Rename currentUserInterfaceIdiomIsPad to currentUserInterfaceIdiomIsPadOrMac,
    and force it to YES on macCatalyst since internally we use it to distinguish
    between iPhone and iPad behavior, and (for our behaviors, at least) macCatalyst
    should always follow iPad.
    
    We should clean this up, and make all callers make their
    iPhone vs. iPad vs. macOS decisions more explicit.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266804 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-09  Tim Horton  <timothy_horton@apple.com>

            macCatalyst: Form controls behave strangely (like iPhone) in macOS-idiom apps
            https://bugs.webkit.org/show_bug.cgi?id=216326

            Reviewed by Wenson Hsieh.

            * Shared/UserInterfaceIdiom.h:
            * Shared/UserInterfaceIdiom.mm:
            (WebKit::userInterfaceIdiomIsPad):
            (WebKit::currentUserInterfaceIdiomIsPadOrMac):
            (WebKit::setCurrentUserInterfaceIdiomIsPadOrMac):
            (WebKit::currentUserInterfaceIdiomIsPad): Deleted.
            (WebKit::setCurrentUserInterfaceIdiomIsPad): Deleted.
            * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
            (WebKit::defaultTextAutosizingUsesIdempotentMode):
            * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
            (-[WKWebViewConfiguration init]):
            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
            (WebKit::WebProcessPool::platformInitializeWebProcess):
            * UIProcess/ios/SmartMagnificationController.mm:
            (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
            * UIProcess/ios/WKContentViewInteraction.mm:
            (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
            (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
            (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
            (-[WKContentView _zoomToRevealFocusedElement]):
            (-[WKContentView requiresAccessoryView]):
            (-[WKContentView _updateAccessory]):
            (shouldShowKeyboardForElement):
            (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
            * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
            (WebKit::WebDataListSuggestionsDropdownIOS::show):
            * UIProcess/ios/WebPageProxyIOS.mm:
            (WebKit::desktopClassBrowsingSupported):
            * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
            (-[WKAirPlayRoutePicker show:fromRect:]):
            * UIProcess/ios/forms/WKFileUploadPanel.mm:
            (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
            (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
            * UIProcess/ios/forms/WKFormColorControl.mm:
            (-[WKFormColorControl initWithView:]):
            * UIProcess/ios/forms/WKFormColorPicker.mm:
            (-[WKColorPicker initWithView:inPopover:]):
            (-[WKColorPicker drawSelectionIndicatorForColorButton:]):
            * UIProcess/ios/forms/WKFormSelectControl.mm:
            (-[WKFormSelectControl initWithView:]):
            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess):
            Rename currentUserInterfaceIdiomIsPad to currentUserInterfaceIdiomIsPadOrMac,
            and force it to YES on macCatalyst since internally we use it to distinguish
            between iPhone and iPad behavior, and (for our behaviors, at least) macCatalyst
            should always follow iPad.

            We should clean this up, and make all callers make their
            iPhone vs. iPad vs. macOS decisions more explicit.

2020-09-25  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266798. rdar://problem/69583118

    Make sure WKWebsiteDataStore operations reuse existing process pools even when all WKWebViews have closed.
    <rdar://problem/62978295> and https://bugs.webkit.org/show_bug.cgi?id=216317
    
    Reviewed by Geoffrey Garen.
    
    Source/WebKit:
    
    Covered by new API test.
    
    When WebsiteDataStores are gathering all the NetworkProcesses they might need to message, they miss some
    obvious candidates if there are no longer any related WKWebViews.
    
    Fix that by tracking which sessions a NetworkProcess knows about.
    
    * UIProcess/Network/NetworkProcessProxy.cpp:
    (WebKit::NetworkProcessProxy::addSession):
    (WebKit::NetworkProcessProxy::hasSession const):
    (WebKit::NetworkProcessProxy::removeSession):
    * UIProcess/Network/NetworkProcessProxy.h:
    
    * UIProcess/WebsiteData/WebsiteDataStore.cpp:
    (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
    
    Tools:
    
    * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
    (TestWebKitAPI::TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266798 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-09  Brady Eidson  <beidson@apple.com>

            Make sure WKWebsiteDataStore operations reuse existing process pools even when all WKWebViews have closed.
            <rdar://problem/62978295> and https://bugs.webkit.org/show_bug.cgi?id=216317

            Reviewed by Geoffrey Garen.

            Covered by new API test.

            When WebsiteDataStores are gathering all the NetworkProcesses they might need to message, they miss some
            obvious candidates if there are no longer any related WKWebViews.

            Fix that by tracking which sessions a NetworkProcess knows about.

            * UIProcess/Network/NetworkProcessProxy.cpp:
            (WebKit::NetworkProcessProxy::addSession):
            (WebKit::NetworkProcessProxy::hasSession const):
            (WebKit::NetworkProcessProxy::removeSession):
            * UIProcess/Network/NetworkProcessProxy.h:

            * UIProcess/WebsiteData/WebsiteDataStore.cpp:
            (WebKit::WebsiteDataStore::isAssociatedProcessPool const):

2020-09-18  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267208. rdar://problem/69178138

    Enable ITP in WKWebViews for apps with the full browser entitlement who are not linked to iOS 14.0
    https://bugs.webkit.org/show_bug.cgi?id=216655
    <rdar://problem/69081227>
    
    Reviewed by Brent Fulgham.
    
    Apps with the full browser entitlement who are not linked to iOS 14.0
    should have ITP enabled in WKWebViews by default.
    
    No new tests, no way currently to test apps with different iOS
    versions. Tested manually.
    
    * Shared/Cocoa/DefaultWebBrowserChecks.mm:
    (WebKit::determineITPStateInternal):
    Ignore the early return for the linked-on-or-after check if the
    app has the default browser entitlement so we still enable ITP based
    on the user's preference.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-17  Kate Cheney  <katherine_cheney@apple.com>

            Enable ITP in WKWebViews for apps with the full browser entitlement who are not linked to iOS 14.0
            https://bugs.webkit.org/show_bug.cgi?id=216655
            <rdar://problem/69081227>

            Reviewed by Brent Fulgham.

            Apps with the full browser entitlement who are not linked to iOS 14.0
            should have ITP enabled in WKWebViews by default.

            No new tests, no way currently to test apps with different iOS
            versions. Tested manually.

            * Shared/Cocoa/DefaultWebBrowserChecks.mm:
            (WebKit::determineITPStateInternal):
            Ignore the early return for the linked-on-or-after check if the
            app has the default browser entitlement so we still enable ITP based
            on the user's preference.

2020-09-17  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266802. rdar://problem/69101097

    Text copied and pasted from Mac Catalyst apps appears larger than expected
    https://bugs.webkit.org/show_bug.cgi?id=215971
    <rdar://problem/65768907>
    
    Reviewed by Tim Horton.
    
    Source/WebKit:
    
    Various pieces of platform logic in Mac Catalyst depend on the user interface idiom (i.e. Mac or iPad) of the
    app, as well as the application-wide "scale factor". In the context of this bug, NSAttributedString to RTF data
    conversion methods in `UIFoundation` consult the scale factor of `UIiOSMacIdiomManager` to determine whether to
    emit 0 (standard) or 1 (iOS) for the `\cocoatextscaling` attribute. The fact that the web process' scale factor
    may be out of sync with the UI process' scale factor leads to copied RTF data in the web process appearing
    either larger or smaller than expected, due to an incorrect `NSTextScalingType` value.
    
    To mitigate this (as well as any other issues), we add a mechanism for the UI process to forward the global
    scale factor and user interface idiom to the web process inside of the web process creation parameters, and then
    use new UIKit SPI to override the scale factor and idiom within the web process.
    
    * Scripts/process-entitlements.sh:
    
    Add a new entitlement needed to use `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`.
    
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    
    Use `_UIApplicationCatalystUserInterfaceIdiom` and `_UIApplicationCatalystScaleFactor` to grab the global user
    interface idiom and scale factor, respectively.
    
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    
    Override the idiom and scale factor in the web process with the idiom and scale factor from the UI process,
    using the new SPI `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. As this function hasn't landed
    yet, we soft link the function for now to avoid causing the web process to instantly crash on any builds without
    the fix for <rdar://problem/68524148>.
    
    Source/WTF:
    
    Add a new flag to guard the presence of `_UIApplicationCatalystUserInterfaceIdiom`,
    `_UIApplicationCatalystScaleFactor`, and `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`.
    
    * wtf/PlatformHave.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266802 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-09  Wenson Hsieh  <wenson_hsieh@apple.com>

            Text copied and pasted from Mac Catalyst apps appears larger than expected
            https://bugs.webkit.org/show_bug.cgi?id=215971
            <rdar://problem/65768907>

            Reviewed by Tim Horton.

            Various pieces of platform logic in Mac Catalyst depend on the user interface idiom (i.e. Mac or iPad) of the
            app, as well as the application-wide "scale factor". In the context of this bug, NSAttributedString to RTF data
            conversion methods in `UIFoundation` consult the scale factor of `UIiOSMacIdiomManager` to determine whether to
            emit 0 (standard) or 1 (iOS) for the `\cocoatextscaling` attribute. The fact that the web process' scale factor
            may be out of sync with the UI process' scale factor leads to copied RTF data in the web process appearing
            either larger or smaller than expected, due to an incorrect `NSTextScalingType` value.

            To mitigate this (as well as any other issues), we add a mechanism for the UI process to forward the global
            scale factor and user interface idiom to the web process inside of the web process creation parameters, and then
            use new UIKit SPI to override the scale factor and idiom within the web process.

            * Scripts/process-entitlements.sh:

            Add a new entitlement needed to use `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`.

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

            Use `_UIApplicationCatalystUserInterfaceIdiom` and `_UIApplicationCatalystScaleFactor` to grab the global user
            interface idiom and scale factor, respectively.

            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess):

            Override the idiom and scale factor in the web process with the idiom and scale factor from the UI process,
            using the new SPI `_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor`. As this function hasn't landed
            yet, we soft link the function for now to avoid causing the web process to instantly crash on any builds without
            the fix for <rdar://problem/68524148>.

2020-09-17  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266677. rdar://problem/68740521

    [MotionMark] RenderLayer::paintLayerContents spends ~5% of the time in MonotonicTime::now() in Multiply
    https://bugs.webkit.org/show_bug.cgi?id=216190
    
    Reviewed by Darin Adler.
    
    Source/WebCore:
    
    In several of MotionMark's subtests (for instance, Multiply), we spent a large amount of time underneath
    `RenderLayer::paintLayerContents` due to both the large number of layers and the need to frequently repaint
    each layer (all of which are constantly being animated). Underneath this method, a nontrivial amount of time
    (~5%) is then spent grabbing the system time via `MonotonicTime::now()`.
    
    We can avoid this extra work by instead using the timestamp of the last rendering update (before we started
    painting), which we keep track of using a new member variable on `Page`. See below for more details, as well as
    the WebKit2 ChangeLog.
    
    * page/ChromeClient.h:
    (WebCore::ChromeClient::timestampForPaintFrequencyTracking const):
    
    Add a client hook to fetch the timestamp to use when tracking painting frequency. See the WebKit2 ChangeLog for
    more details.
    
    * page/Page.cpp:
    (WebCore::Page::updateRendering):
    
    Update `m_lastRenderingUpdateTimestamp`.
    
    * page/Page.h:
    (WebCore::Page::lastRenderingUpdateTimestamp const):
    * rendering/PaintFrequencyTracker.h:
    
    Drive-by cleanup: narrow the `PaintFrequency` enum to `bool` width.
    
    (WebCore::PaintFrequencyTracker::begin):
    (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::paintLayerContents):
    
    Call out to the client layer to return a timestamp for tracking painting frequency. By default, this is simply
    the current time (`MonotonicTime::now()`), but ports (namely, WebKit2) may opt for a coarser granularity.
    
    (WebCore::RenderLayer::simulateFrequentPaint):
    * rendering/RenderLayer.h:
    
    Source/WebKit:
    
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::timestampForPaintFrequencyTracking const):
    
    In WebKit2, we can assume (with the exception of SVG pages) that we must've performed a rendering update prior
    to tracking painting frequencies. As such, we can use the page's rendering update timestamp instead of the real
    current time (`MonotonicTime::now()`).
    
    Note that in WebKit1, it is possible for any client to force a synchronous paint of the page before the page has
    performed a rendering update, which triggers assertions in `SinglePaintFrequencyTracking::end()`. As such, we
    stick with `MonotonicTime::now()` in WebKit1.
    
    * WebProcess/WebCoreSupport/WebChromeClient.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266677 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-05  Wenson Hsieh  <wenson_hsieh@apple.com>

            [MotionMark] RenderLayer::paintLayerContents spends ~5% of the time in MonotonicTime::now() in Multiply
            https://bugs.webkit.org/show_bug.cgi?id=216190

            Reviewed by Darin Adler.

            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::timestampForPaintFrequencyTracking const):

            In WebKit2, we can assume (with the exception of SVG pages) that we must've performed a rendering update prior
            to tracking painting frequencies. As such, we can use the page's rendering update timestamp instead of the real
            current time (`MonotonicTime::now()`).

            Note that in WebKit1, it is possible for any client to force a synchronous paint of the page before the page has
            performed a rendering update, which triggers assertions in `SinglePaintFrequencyTracking::end()`. As such, we
            stick with `MonotonicTime::now()` in WebKit1.

            * WebProcess/WebCoreSupport/WebChromeClient.h:

2020-09-17  Alan Coon  <alancoon@apple.com>

        Cherry-pick r267031. rdar://problem/69101165

    Web Inspector: docking buttons don't work when already docked if window is too small
    https://bugs.webkit.org/show_bug.cgi?id=216488
    <rdar://problem/68242717>
    
    Reviewed by Timothy Hatcher.
    
    Source/WebInspectorUI:
    
    * UserInterface/Base/Main.js:
    (WI.updateDockingAvailability):
    (WI.updateDockedState):
    (WI._updateDockNavigationItems):
    Always be sure to update the docking navigation items when docking becomes unavailable
    instead of just forcing Web Inspector to undock as if Web Inspector is already undocked
    then none of the docking navigation items will be updated. This makes it so that the
    docking navigation items are hidden when docking becomes unavailable while undocked.
    
    Source/WebKit:
    
    * UIProcess/Inspector/WebInspectorProxy.cpp:
    (WebKit::WebInspectorProxy::attach):
    (WebKit::WebInspectorProxy::attachAvailabilityChanged):
    If Web Inspector is already attached, it can re-attach with a different configuration.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267031 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-14  Devin Rousso  <drousso@apple.com>

            Web Inspector: docking buttons don't work when already docked if window is too small
            https://bugs.webkit.org/show_bug.cgi?id=216488
            <rdar://problem/68242717>

            Reviewed by Timothy Hatcher.

            * UIProcess/Inspector/WebInspectorProxy.cpp:
            (WebKit::WebInspectorProxy::attach):
            (WebKit::WebInspectorProxy::attachAvailabilityChanged):
            If Web Inspector is already attached, it can re-attach with a different configuration.

2020-09-17  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266745. rdar://problem/69100985

    Tighten checks when creating an audio buffer list
    https://bugs.webkit.org/show_bug.cgi?id=216237
    <rdar://problem/68271376>
    
    Reviewed by Geoffrey Garen.
    
    Source/WebCore:
    
    Add a routine to check there is no multiplication integer overflow.
    
    * platform/audio/cocoa/WebAudioBufferList.cpp:
    (WebCore::computeBufferSize):
    (WebCore::WebAudioBufferList::isSupportedDescription):
    (WebCore::WebAudioBufferList::setSampleCount):
    * platform/audio/cocoa/WebAudioBufferList.h:
    
    Source/WebKit:
    
    Add message checks to verify that no message integer overflows happen when processing audio buffer list messages.
    
    * GPUProcess/GPUConnectionToWebProcess.cpp:
    (WebKit::GPUConnectionToWebProcess::audioTrackRendererManager):
    * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
    (WebKit::RemoteAudioMediaStreamTrackRenderer::RemoteAudioMediaStreamTrackRenderer):
    (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged):
    (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable):
    * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
    * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp:
    (WebKit::RemoteAudioMediaStreamTrackRendererManager::RemoteAudioMediaStreamTrackRendererManager):
    (WebKit::RemoteAudioMediaStreamTrackRendererManager::createRenderer):
    * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h:
    * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
    (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
    (WebKit::RemoteMediaRecorder::audioSamplesAvailable):
    * GPUProcess/webrtc/RemoteMediaRecorder.h:
    * WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
    (WebKit::RemoteCaptureSampleManager::RemoteAudio::audioSamplesAvailable):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-08  Youenn Fablet  <youenn@apple.com>

            Tighten checks when creating an audio buffer list
            https://bugs.webkit.org/show_bug.cgi?id=216237
            <rdar://problem/68271376>

            Reviewed by Geoffrey Garen.

            Add message checks to verify that no message integer overflows happen when processing audio buffer list messages.

            * GPUProcess/GPUConnectionToWebProcess.cpp:
            (WebKit::GPUConnectionToWebProcess::audioTrackRendererManager):
            * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
            (WebKit::RemoteAudioMediaStreamTrackRenderer::RemoteAudioMediaStreamTrackRenderer):
            (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged):
            (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable):
            * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
            * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp:
            (WebKit::RemoteAudioMediaStreamTrackRendererManager::RemoteAudioMediaStreamTrackRendererManager):
            (WebKit::RemoteAudioMediaStreamTrackRendererManager::createRenderer):
            * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h:
            * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
            (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
            (WebKit::RemoteMediaRecorder::audioSamplesAvailable):
            * GPUProcess/webrtc/RemoteMediaRecorder.h:
            * WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
            (WebKit::RemoteCaptureSampleManager::RemoteAudio::audioSamplesAvailable):

2020-09-17  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266411. rdar://problem/68300959

    [iOS] AGX compiler service sandbox violation
    https://bugs.webkit.org/show_bug.cgi?id=216042
    <rdar://problem/68111667>
    
    Reviewed by Brent Fulgham.
    
    For a set of devices, mach-lookup sandbox violations have been observed for an AGX compiler service. For these devices,
    we currently issue an extension for one AGX compiler service, but this is not sufficient since there is a similar
    service name that needs to be added as well.
    
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::agxCompilerServices):
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266411 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-01  Per Arne Vollan  <pvollan@apple.com>

            [iOS] AGX compiler service sandbox violation
            https://bugs.webkit.org/show_bug.cgi?id=216042
            <rdar://problem/68111667>

            Reviewed by Brent Fulgham.

            For a set of devices, mach-lookup sandbox violations have been observed for an AGX compiler service. For these devices,
            we currently issue an extension for one AGX compiler service, but this is not sufficient since there is a similar
            service name that needs to be added as well.

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

2020-09-15  Russell Epstein  <repstein@apple.com>

        Cherry-pick r266121. rdar://problem/68949237

    [macOS] Update audio arbitration manager when audio transport changes
    https://bugs.webkit.org/show_bug.cgi?id=215781
    <rdar://problem/65920613>
    
    Reviewed by Jer Noble.
    
    Source/WebCore:
    
    No new tests, updated AudioRoutingArbitration API test.
    
    * platform/audio/AudioSession.cpp:
    (WebCore::AudioSession::audioOutputDeviceChanged): Add empty method.
    (WebCore::setIsPlayingToBluetoothOverride): Ditto.
    * platform/audio/AudioSession.h:
    
    * platform/audio/cocoa/MediaSessionManagerCocoa.h:
    * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
    (WebCore::MediaSessionManagerCocoa::audioOutputDeviceChanged): Call AudioSession::audioOutputDeviceChanged.
    
    * platform/audio/mac/AudioSessionMac.mm:
    (WebCore::defaultDeviceTransportIsBluetooth): New.
    (WebCore::AudioSession::audioOutputDeviceChanged): Clear m_private->playingToBluetooth
    if bluetooth transport has changed since the last arbitration update.
    (WebCore::AudioSession::setIsPlayingToBluetoothOverride): Allow override of bluetooth
    transport for testing.
    (WebCore::AudioSession::setCategory): Update routing arbitration if audio session category
    or bluetooth transport changes.
    
    * testing/Internals.cpp:
    (WebCore::Internals::setIsPlayingToBluetoothOverride):
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    
    * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
    * UIProcess/API/Cocoa/WKWebViewTesting.mm:
    (-[WKWebView _audioRoutingArbitrationUpdateTime]):
    
    * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
    (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationUpdateTime const):
    
    * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
    (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
    
    Tools:
    
    * TestWebKitAPI/Tests/WebKitCocoa/AudioRoutingArbitration.mm:
    (AudioRoutingArbitration::statusShouldBecomeEqualTo): Add message string to help
    debugging when the test fails.
    * TestWebKitAPI/Tests/WebKitLegacy/ios/video-with-audio.html:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266121 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-25  Eric Carlson  <eric.carlson@apple.com>

            [macOS] Update audio arbitration manager when audio transport changes
            https://bugs.webkit.org/show_bug.cgi?id=215781
            <rdar://problem/65920613>

            Reviewed by Jer Noble.

            * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
            * UIProcess/API/Cocoa/WKWebViewTesting.mm:
            (-[WKWebView _audioRoutingArbitrationUpdateTime]):

            * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
            (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationUpdateTime const):

            * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
            (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):

2020-09-14  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266932. rdar://problem/68881008

    Fix undeclared identifier issue due to clashes in soft link headers
    https://bugs.webkit.org/show_bug.cgi?id=216412
    
    Reviewed by Geoffrey Garen.
    
    Source/WebCore/PAL:
    
    r266898 broke builds on certain SDKs. The reason for this is that it includes
    MediaToolbox/FigPhoto.h, which transitively includes CoreMedia/CMTimePrivate.h. The latter
    header has a bunch of inline code in certain SDKs which conflicts with the
    CoreMediaSoftLink.h header. For instance, CoreMediaSoftLink.h redefines CMTimeCompare to
    softLink_CoreMedia_CMTimeCompare, which messes up the inline code in the CMTimePrivate.h
    header that references CMTimeCompare.
    
    For now, we just avoid including FigPhoto.h altogether and use a constant. We'll clean this
    up once we start weak linking rather than soft linking CoreMedia and MediaToolbox (216388).
    
    * pal/cocoa/MediaToolboxSoftLink.cpp:
    * pal/cocoa/MediaToolboxSoftLink.h:
    * pal/spi/cocoa/MediaToolboxSPI.h:
    
    Source/WebKit:
    
    Use the workaround constant kPALFigPhotoContainerFormat_JFIF instead of the enum value
    kFigPhotoContainerFormat_JFIF.
    
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-11  Ben Nham  <nham@apple.com>

            Fix undeclared identifier issue due to clashes in soft link headers
            https://bugs.webkit.org/show_bug.cgi?id=216412

            Reviewed by Geoffrey Garen.

            Use the workaround constant kPALFigPhotoContainerFormat_JFIF instead of the enum value
            kFigPhotoContainerFormat_JFIF.

            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess):

2020-09-14  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266898. rdar://problem/68881029

    Disable hardware JPEG decoding on x86 Mac
    https://bugs.webkit.org/show_bug.cgi?id=216377
    
    Reviewed by Geoff Garen.
    
    Source/WebCore/PAL:
    
    Add wrappers for a new MediaToolbox SPI that allows us to disable HW JPEG decoding.
    
    * PAL.xcodeproj/project.pbxproj:
    * pal/PlatformMac.cmake:
    * pal/cocoa/MediaToolboxSoftLink.cpp:
    * pal/cocoa/MediaToolboxSoftLink.h:
    
    Source/WebKit:
    
    In Big Sur, ImageIO uses hardware JPEG decoding automatically for certain JPEGs. This caused
    a small regression in our battery life benchmark since the one-time setup cost for the
    decoder (~20-30 ms per process) was higher than the per-decode win we got from the HW decoder.
    
    For now, we're reverting to the Catalina behavior of not using hardware JPEG on x86 Macs by
    calling a MediaToolbox SPI. (The tradeoffs for Apple Silicon are different so we use
    ImageIO's default heuristics on that architecture.) We plan to revisit this decision once we
    move to a GPUProcess world.
    
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    
    Source/WTF:
    
    Add macros to disable HW JPEG decoding on x86 Macs and indicate the presence of a new MediaToolbox SPI.
    (The latter is to prevent unnecessary dlopen/dlsym calls since we soft-link MediaToolbox.)
    
    * wtf/PlatformEnableCocoa.h:
    * wtf/PlatformHave.h:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266898 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-10  Ben Nham  <nham@apple.com>

            Disable hardware JPEG decoding on x86 Mac
            https://bugs.webkit.org/show_bug.cgi?id=216377

            Reviewed by Geoff Garen.

            In Big Sur, ImageIO uses hardware JPEG decoding automatically for certain JPEGs. This caused
            a small regression in our battery life benchmark since the one-time setup cost for the
            decoder (~20-30 ms per process) was higher than the per-decode win we got from the HW decoder.

            For now, we're reverting to the Catalina behavior of not using hardware JPEG on x86 Macs by
            calling a MediaToolbox SPI. (The tradeoffs for Apple Silicon are different so we use
            ImageIO's default heuristics on that architecture.) We plan to revisit this decision once we
            move to a GPUProcess world.

            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess):

2020-09-14  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266797. rdar://problem/68881018

    Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess
    https://bugs.webkit.org/show_bug.cgi?id=216195
    
    Reviewed by Simon Fraser.
    
    Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess, now that the
    DisplayLink has been moved to the UIProcess due to sandboxing.
    
    After a DisplayLink no longer has any clients, we keep it firing up to 20 times without
    any clients in case a new client gets added shortly after. The idea was to avoid killing
    and respawning too many threads when adding and removing clients in quick succession.
    However, now that the DisplayLink lives in the UIProcess side and sends IPC to the
    WebProcesses every time it fires, it makes a lot more sense to implement this logic in
    the UIProcess side, to avoid sending unnecessary IPC to processes that do not care about
    it.
    
    Source/WebCore:
    
    * platform/graphics/DisplayRefreshMonitor.cpp:
    (WebCore::DisplayRefreshMonitor::displayDidRefresh):
    * platform/graphics/DisplayRefreshMonitor.h:
    (WebCore::DisplayRefreshMonitor::shouldBeTerminated const):
    
    Source/WebKit:
    
    * UIProcess/mac/DisplayLink.cpp:
    (WebKit::DisplayLink::addObserver):
    (WebKit::DisplayLink::removeObserver):
    (WebKit::DisplayLink::removeObservers):
    (WebKit::DisplayLink::displayLinkCallback):
    (WebKit::DisplayLink::hasObservers const): Deleted.
    * UIProcess/mac/DisplayLink.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266797 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-09  Chris Dumez  <cdumez@apple.com>

            Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess
            https://bugs.webkit.org/show_bug.cgi?id=216195

            Reviewed by Simon Fraser.

            Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess, now that the
            DisplayLink has been moved to the UIProcess due to sandboxing.

            After a DisplayLink no longer has any clients, we keep it firing up to 20 times without
            any clients in case a new client gets added shortly after. The idea was to avoid killing
            and respawning too many threads when adding and removing clients in quick succession.
            However, now that the DisplayLink lives in the UIProcess side and sends IPC to the
            WebProcesses every time it fires, it makes a lot more sense to implement this logic in
            the UIProcess side, to avoid sending unnecessary IPC to processes that do not care about
            it.

            * UIProcess/mac/DisplayLink.cpp:
            (WebKit::DisplayLink::addObserver):
            (WebKit::DisplayLink::removeObserver):
            (WebKit::DisplayLink::removeObservers):
            (WebKit::DisplayLink::displayLinkCallback):
            (WebKit::DisplayLink::hasObservers const): Deleted.
            * UIProcess/mac/DisplayLink.h:

2020-09-11  Russell Epstein  <repstein@apple.com>

        Cherry-pick r266771. rdar://problem/68666453

    Regression(r260614) Power usage has increased due to extra thread hopping
    https://bugs.webkit.org/show_bug.cgi?id=216296
    <rdar://problem/67719299>
    
    Reviewed by Simon Fraser.
    
    Power usage has increased after r260614 due to extra thread hopping. To recover,
    we now process the DisplayWasRefreshed IPC to a background queue if there is
    scrolling going on and responsiveness is thus critical. In the common case, where
    the user is not scrolling, we keep processing the IPC on the main thread, like
    before r260614. This avoids extra thread hopping and saves power.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::ScrollingObserver::willSendWheelEvent):
    (WebKit::ScrollingObserver::ScrollingObserver):
    (WebKit::ScrollingObserver::singleton):
    (WebKit::WebPageProxy::sendWheelEvent):
    * UIProcess/mac/DisplayLink.cpp:
    (WebKit::DisplayLink::displayLinkCallback):
    * UIProcess/mac/DisplayLink.h:
    (WebKit::DisplayLink::setShouldSendIPCOnBackgroundQueue):
    * WebProcess/WebPage/EventDispatcher.cpp:
    (WebKit::EventDispatcher::notifyScrollingTreesDisplayWasRefreshed):
    (WebKit::EventDispatcher::displayWasRefreshed):
    * WebProcess/WebPage/EventDispatcher.h:
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::displayWasRefreshed):
    * WebProcess/WebProcess.h:
    * WebProcess/WebProcess.messages.in:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266771 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-08  Chris Dumez  <cdumez@apple.com>

            Regression(r260614) Power usage has increased due to extra thread hopping
            https://bugs.webkit.org/show_bug.cgi?id=216296
            <rdar://problem/67719299>

            Reviewed by Simon Fraser.

            Power usage has increased after r260614 due to extra thread hopping. To recover,
            we now process the DisplayWasRefreshed IPC to a background queue if there is
            scrolling going on and responsiveness is thus critical. In the common case, where
            the user is not scrolling, we keep processing the IPC on the main thread, like
            before r260614. This avoids extra thread hopping and saves power.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::ScrollingObserver::willSendWheelEvent):
            (WebKit::ScrollingObserver::ScrollingObserver):
            (WebKit::ScrollingObserver::singleton):
            (WebKit::WebPageProxy::sendWheelEvent):
            * UIProcess/mac/DisplayLink.cpp:
            (WebKit::DisplayLink::displayLinkCallback):
            * UIProcess/mac/DisplayLink.h:
            (WebKit::DisplayLink::setShouldSendIPCOnBackgroundQueue):
            * WebProcess/WebPage/EventDispatcher.cpp:
            (WebKit::EventDispatcher::notifyScrollingTreesDisplayWasRefreshed):
            (WebKit::EventDispatcher::displayWasRefreshed):
            * WebProcess/WebPage/EventDispatcher.h:
            * WebProcess/WebProcess.cpp:
            (WebKit::WebProcess::displayWasRefreshed):
            * WebProcess/WebProcess.h:
            * WebProcess/WebProcess.messages.in:

2020-09-11  Russell Epstein  <repstein@apple.com>

        Cherry-pick r266743. rdar://problem/68652752

    iOS: <attachment>'s QuickLook thumbnails can appear squished
    https://bugs.webkit.org/show_bug.cgi?id=216209
    <rdar://problem/67817706>
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    Test: fast/attachment/attachment-thumbnail-preserves-aspect-ratio.html
    
    * html/HTMLAttachmentElement.idl:
    * testing/Internals.cpp:
    (WebCore::Internals::attachmentThumbnailInfo):
    * testing/Internals.h:
    * testing/Internals.idl:
    Expose the attachment thumbnail size via Internals.
    
    * rendering/RenderThemeIOS.mm:
    (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
    Allow the thumbnail aspect ratio to vary, instead of assuming it is always square.
    
    Source/WebKit:
    
    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
    (WebKit::convertPlatformImageToBitmap):
    Propagate an image of the same aspect ratio that QuickLook provided,
    instead of squishing it to square.
    
    * UIProcess/QuickLookThumbnailLoader.mm:
    (-[WKQLThumbnailLoadOperation start]):
    Only request full thumbnails; we do not want the icon form, since <attachment>
    already has one without QuickLook's help; if we can't get a full thumbnail,
    we'll just leave it alone.
    
    Tools:
    
    * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
    * TestRunnerShared/UIScriptContext/UIScriptController.h:
    (WTR::UIScriptController::insertAttachmentForFilePath):
    * WebKitTestRunner/TestController.cpp:
    (WTR::TestController::currentTestURL const):
    * WebKitTestRunner/TestController.h:
    * WebKitTestRunner/cocoa/UIScriptControllerCocoa.h:
    * WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:
    (WTR::UIScriptControllerCocoa::insertAttachmentForFilePath):
    Make it possible to insert an attachment wrapping a file on disk
    via UIScriptController.
    
    LayoutTests:
    
    * fast/attachment/attachment-thumbnail-preserves-aspect-ratio-expected.txt: Added.
    * fast/attachment/attachment-thumbnail-preserves-aspect-ratio.html: Added.
    * fast/attachment/resources/400x200-circle.png: Added.
    * platform/ios/fast/attachment/attachment-thumbnail-preserves-aspect-ratio-expected.txt: Added.
    * resources/ui-helper.js:
    (window.UIHelper.insertAttachmentForFilePath):
    Add a test that dumps the thumbnail size for a 400x200 attachment.
    We only run it on iOS, because on macOS, QuickLook always returns
    an image of the size we ask for (400x400), padded with whitespace,
    so the problem does not reproduce and the test doesn't work right there.
    On iOS, the result used to be 400x400 and now is 400x200.
    
    I tried and failed to make a more useful test (a ref test, actually
    testing the presentation) because it's quite hard to match the
    native <attachment> painting.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            iOS: <attachment>'s QuickLook thumbnails can appear squished
            https://bugs.webkit.org/show_bug.cgi?id=216209
            <rdar://problem/67817706>

            Reviewed by Wenson Hsieh.

            * UIProcess/Cocoa/WebPageProxyCocoa.mm:
            (WebKit::convertPlatformImageToBitmap):
            Propagate an image of the same aspect ratio that QuickLook provided,
            instead of squishing it to square.

            * UIProcess/QuickLookThumbnailLoader.mm:
            (-[WKQLThumbnailLoadOperation start]):
            Only request full thumbnails; we do not want the icon form, since <attachment>
            already has one without QuickLook's help; if we can't get a full thumbnail,
            we'll just leave it alone.

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266750. rdar://problem/68652608

    Null check m_layerHostingContext in TiledCoreAnimationDrawingArea::sendDidFirstLayerFlushIfNeeded
    https://bugs.webkit.org/show_bug.cgi?id=216282
    <rdar://problem/64933878>
    
    Patch by Alex Christensen <achristensen@webkit.org> on 2020-09-08
    Reviewed by Tim Horton.
    
    There's no reason to dereference null here.  Let's not crash.
    
    * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
    (WebKit::TiledCoreAnimationDrawingArea::sendDidFirstLayerFlushIfNeeded):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266750 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-08  Alex Christensen  <achristensen@webkit.org>

            Null check m_layerHostingContext in TiledCoreAnimationDrawingArea::sendDidFirstLayerFlushIfNeeded
            https://bugs.webkit.org/show_bug.cgi?id=216282
            <rdar://problem/64933878>

            Reviewed by Tim Horton.

            There's no reason to dereference null here.  Let's not crash.

            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
            (WebKit::TiledCoreAnimationDrawingArea::sendDidFirstLayerFlushIfNeeded):

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266613. rdar://problem/68652692

    [macOS] Add client decoder entitlement
    https://bugs.webkit.org/show_bug.cgi?id=216175
    <rdar://problem/67532128>
    
    Reviewed by Brent Fulgham.
    
    Add client decoder entitlement in the WebContent process on macOS.
    
    * Scripts/process-entitlements.sh:
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266613 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-04  Per Arne Vollan  <pvollan@apple.com>

            [macOS] Add client decoder entitlement
            https://bugs.webkit.org/show_bug.cgi?id=216175
            <rdar://problem/67532128>

            Reviewed by Brent Fulgham.

            Add client decoder entitlement in the WebContent process on macOS.

            * Scripts/process-entitlements.sh:

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266606. rdar://problem/68652779

    WebProcessProxy::checkURLReceivedFromWebProcess() does not always need to check the back/forward list
    https://bugs.webkit.org/show_bug.cgi?id=216109
    <rdar://problem/59867349>
    
    Reviewed by Brady Eidson.
    
    We should not need to check the back/forward list when setting a
    pasteboard URL because any valid pasteboard URL will be handled
    by one of the other if-statements in
    WebProcessProxy::checkURLReceivedFromWebProcess(), therefore checking
    again is a waste of time.
    
    This also hardens the process against potential abuse by preventing
    the possibility of an invalid URL in the back/forward list being
    saved in the pasteboard property list.
    
    * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
    (WebKit::WebPasteboardProxy::setPasteboardURL):
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
    * UIProcess/WebProcessProxy.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266606 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-04  Kate Cheney  <katherine_cheney@apple.com>

            WebProcessProxy::checkURLReceivedFromWebProcess() does not always need to check the back/forward list
            https://bugs.webkit.org/show_bug.cgi?id=216109
            <rdar://problem/59867349>

            Reviewed by Brady Eidson.

            We should not need to check the back/forward list when setting a
            pasteboard URL because any valid pasteboard URL will be handled
            by one of the other if-statements in
            WebProcessProxy::checkURLReceivedFromWebProcess(), therefore checking
            again is a waste of time.

            This also hardens the process against potential abuse by preventing
            the possibility of an invalid URL in the back/forward list being
            saved in the pasteboard property list.

            * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
            (WebKit::WebPasteboardProxy::setPasteboardURL):
            * UIProcess/WebProcessProxy.cpp:
            (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
            * UIProcess/WebProcessProxy.h:

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266493. rdar://problem/68652496

    Remove custom domain from SameSite=strict jail protection
    https://bugs.webkit.org/show_bug.cgi?id=216083
    <rdar://problem/68220223>
    
    Reviewed by Alex Christensen.
    
    No new tests. This was a site-specific opt-in rule. The feature
    itself has tests.
    
    * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
    (WebKit::ResourceLoadStatisticsStore::shouldEnforceSameSiteStrictForSpecificDomain const):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266493 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-02  John Wilander  <wilander@apple.com>

            Remove custom domain from SameSite=strict jail protection
            https://bugs.webkit.org/show_bug.cgi?id=216083
            <rdar://problem/68220223>

            Reviewed by Alex Christensen.

            No new tests. This was a site-specific opt-in rule. The feature
            itself has tests.

            * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
            (WebKit::ResourceLoadStatisticsStore::shouldEnforceSameSiteStrictForSpecificDomain const):

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266485. rdar://problem/68652729

    iPad + Trackpad: JW Library highlighting and edit menus don't appear
    https://bugs.webkit.org/show_bug.cgi?id=216086
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isJWLibrary):
    
    Source/WebKit:
    
    * UIProcess/ios/WKContentViewInteraction.mm:
    (applicationIsKnownToIgnoreMouseEvents):
    Add JW Library to the list.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266485 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-02  Timothy Horton  <timothy_horton@apple.com>

            iPad + Trackpad: JW Library highlighting and edit menus don't appear
            https://bugs.webkit.org/show_bug.cgi?id=216086

            Reviewed by Wenson Hsieh.

            * UIProcess/ios/WKContentViewInteraction.mm:
            (applicationIsKnownToIgnoreMouseEvents):
            Add JW Library to the list.

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266407. rdar://problem/68652645

    Some apps linked beyond iOS 13.4 don't respect mouse events, only touch events
    https://bugs.webkit.org/show_bug.cgi?id=216021
    <rdar://problem/64830335>
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isFIFACompanion):
    (WebCore::IOSApplication::isNoggin):
    (WebCore::IOSApplication::isOKCupid):
    Add some more bundle checks.
    
    Source/WebKit:
    
    * UIProcess/Cocoa/VersionChecks.h:
    * UIProcess/ios/WKContentViewInteraction.mm:
    (applicationIsKnownToIgnoreMouseEvents):
    (-[WKContentView shouldUseMouseGestureRecognizer]):
    Remove Feedly from the list, they are no longer affected.
    Add a once-per-app-launch error-level log message to warn developers
    of the impending behavior change.
    Add three new apps with a later linked-on target.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266407 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-01  Tim Horton  <timothy_horton@apple.com>

            Some apps linked beyond iOS 13.4 don't respect mouse events, only touch events
            https://bugs.webkit.org/show_bug.cgi?id=216021
            <rdar://problem/64830335>

            Reviewed by Wenson Hsieh.

            * UIProcess/Cocoa/VersionChecks.h:
            * UIProcess/ios/WKContentViewInteraction.mm:
            (applicationIsKnownToIgnoreMouseEvents):
            (-[WKContentView shouldUseMouseGestureRecognizer]):
            Remove Feedly from the list, they are no longer affected.
            Add a once-per-app-launch error-level log message to warn developers
            of the impending behavior change.
            Add three new apps with a later linked-on target.

2020-09-10  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266314. rdar://problem/68652747

    Sites built with flambe.js don't work with trackpad on iPad
    https://bugs.webkit.org/show_bug.cgi?id=215954
    
    Reviewed by Wenson Hsieh.
    
    Source/WebKit:
    
    New API Test: iOSMouseSupport.MouseTimestampTimebase
    
    * UIProcess/ios/WKMouseGestureRecognizer.mm:
    (-[WKMouseGestureRecognizer createMouseEventWithType:]):
    Use the timestamp property on UITouch instead of GSCurrentEventTimestamp().
    This property is in the same units as mach_absolute_time/MonotonicTime.
    Previously, treating a monotonic time as wall time resulted in it getting clamped to 0,
    breaking sites that depend on it.
    
    Tools:
    
    * TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm:
    (-[WKTestingHoverEvent locationInView:]):
    (-[WKTestingTouch timestamp]):
    (TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-28  Tim Horton  <timothy_horton@apple.com>

            Sites built with flambe.js don't work with trackpad on iPad
            https://bugs.webkit.org/show_bug.cgi?id=215954

            Reviewed by Wenson Hsieh.

            New API Test: iOSMouseSupport.MouseTimestampTimebase

            * UIProcess/ios/WKMouseGestureRecognizer.mm:
            (-[WKMouseGestureRecognizer createMouseEventWithType:]):
            Use the timestamp property on UITouch instead of GSCurrentEventTimestamp().
            This property is in the same units as mach_absolute_time/MonotonicTime.
            Previously, treating a monotonic time as wall time resulted in it getting clamped to 0,
            breaking sites that depend on it.

2020-09-09  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266756. rdar://problem/68584247

    Crashtracer inside PDFPlugin::createScrollbar.
    <rdar://problem/68474062> and https://bugs.webkit.org/show_bug.cgi?id=216286
    
    Reviewed by Tim Horton.
    
    To quote Tim from r264945:
    No new tests; timing is such that I can't reproduce without inserting
    intentional delays into the main thread hops, which is further than
    I'm willing to go for a test.
    
    This is a speculative fix due to the aforementioned reproducibility issue.
    
    * WebProcess/Plugins/PDF/PDFPlugin.mm:
    (WebKit::PDFPlugin::createScrollbar): Plugin hasn't been destroyed, and there's still a PluginView,
      but the PluginView isn't in a frame. So null check that.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266756 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-09-08  Brady Eidson  <beidson@apple.com>

            Crashtracer inside PDFPlugin::createScrollbar.
            <rdar://problem/68474062> and https://bugs.webkit.org/show_bug.cgi?id=216286

            Reviewed by Tim Horton.

            To quote Tim from r264945:
            No new tests; timing is such that I can't reproduce without inserting
            intentional delays into the main thread hops, which is further than
            I'm willing to go for a test.

            This is a speculative fix due to the aforementioned reproducibility issue.

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::createScrollbar): Plugin hasn't been destroyed, and there's still a PluginView,
              but the PluginView isn't in a frame. So null check that.

2020-09-03  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266265. rdar://problem/68168939

    [iOS] provide a way to get previously inserted alternatives for the selected text
    https://bugs.webkit.org/show_bug.cgi?id=215816
    <rdar://problem/66646042>
    
    Reviewed by Darin Adler.
    
    Source/WebCore:
    
    * editing/cocoa/AlternativeTextUIController.h:
    * editing/cocoa/AlternativeTextUIController.mm:
    (WebCore::AlternativeTextUIController::alternativesForContext):
    Return the raw `NSTextAlternatives *` and let the caller create the `Vector<String>` if they
    need to so that callers that don't can use the actual `NSTextAlternatives *`.
    
    * editing/Editor.h:
    * editing/Editor.cpp:
    (WebCore::Editor::applyDictationAlternative): Added.
    (WebCore::Editor::applyDictationAlternativelternative): Deleted.
    * page/ContextMenuController.cpp:
    (WebCore::ContextMenuController::contextMenuItemSelected):
    Drive-by: fix typo.
    
    Source/WebKit:
    
    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKContentView alternativesForSelectedText]):
    
    * UIProcess/WebPageProxy.h:
    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
    (WebKit::WebPageProxy::platformDictationAlternatives): Added.
    * UIProcess/PageClient.h:
    * UIProcess/Cocoa/PageClientImplCocoa.h:
    * UIProcess/Cocoa/PageClientImplCocoa.mm:
    (WebKit::PageClientImplCocoa::dictationAlternatives):
    (WebKit::PageClientImplCocoa::platformDictationAlternatives): Added.
    Provide a way to get the raw `NSTextAlternatives *` for a given `WebCore::DictationContext`.
    
    * Shared/EditorState.h:
    * Shared/EditorState.cpp:
    (WebKit::EditorState::PostLayoutData::encode const):
    (WebKit::EditorState::PostLayoutData::decode):
    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::WebPage::getPlatformEditorState const):
    Include a `Vector<WebCore::DictationContext>` as part of the `EditorState` that contains all
    of the `WebCore::DictationContext` that exist in the currently selected range (or the range
    of the word containing the cursor if nothing is selected).
    
    * Platform/spi/ios/UIKitSPI.h:
    
    Source/WebKitLegacy/mac:
    
    * WebView/WebView.mm:
    (-[WebView _dictationAlternatives:]):
    Create a `Vector<String>` from the returned `NSTextAlternatives *` now that the member
    `WebCore::AlternativeTextUIController::alternativesForContext` returns it.
    
    Tools:
    
    * TestWebKitAPI/Tests/WebKitCocoa/InsertTextAlternatives.mm:
    (InsertTextAlternatives.Simple):
    
    * TestWebKitAPI/ios/UIKitSPI.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266265 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-27  Devin Rousso  <drousso@apple.com>

            [iOS] provide a way to get previously inserted alternatives for the selected text
            https://bugs.webkit.org/show_bug.cgi?id=215816
            <rdar://problem/66646042>

            Reviewed by Darin Adler.

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

            * UIProcess/WebPageProxy.h:
            * UIProcess/Cocoa/WebPageProxyCocoa.mm:
            (WebKit::WebPageProxy::platformDictationAlternatives): Added.
            * UIProcess/PageClient.h:
            * UIProcess/Cocoa/PageClientImplCocoa.h:
            * UIProcess/Cocoa/PageClientImplCocoa.mm:
            (WebKit::PageClientImplCocoa::dictationAlternatives):
            (WebKit::PageClientImplCocoa::platformDictationAlternatives): Added.
            Provide a way to get the raw `NSTextAlternatives *` for a given `WebCore::DictationContext`.

            * Shared/EditorState.h:
            * Shared/EditorState.cpp:
            (WebKit::EditorState::PostLayoutData::encode const):
            (WebKit::EditorState::PostLayoutData::decode):
            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::WebPage::getPlatformEditorState const):
            Include a `Vector<WebCore::DictationContext>` as part of the `EditorState` that contains all
            of the `WebCore::DictationContext` that exist in the currently selected range (or the range
            of the word containing the cursor if nothing is selected).

            * Platform/spi/ios/UIKitSPI.h:

2020-09-03  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266158. rdar://problem/67812825

    Web Share API Level 2 functions even when its experimental feature flag is disabled
    https://bugs.webkit.org/show_bug.cgi?id=215831
    <rdar://problem/67760687>
    
    Reviewed by Darin Adler.
    
    Source/WebCore:
    
    Tests: fast/web-share/canShare-with-files-feature-disabled.html
           fast/web-share/share-with-files-feature-disabled.html
    
    We had a feature flag for Web Share API Level 2, but it isn't actually
    consulted anywhere in the implementation.
    
    * page/Navigator.cpp:
    (WebCore::Navigator::canShare):
    Rewrite canShare to be a bit more readable, and also to consult the Level 2 feature flag.
    
    (WebCore::Navigator::share):
    Since canShare (per the spec) will return true if we have files and other content,
    even if files are not shareable, check the feature flag again before loading the files.
    
    Source/WebKit:
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::showShareSheet):
    If the Web Content process sends us files, but the Level 2 feature flag is disabled,
    something fishy is happening, so fire a MESSAGE_CHECK.
    
    LayoutTests:
    
    * fast/web-share/canShare-with-files-feature-disabled-expected.txt: Added.
    * fast/web-share/canShare-with-files-feature-disabled.html: Added.
    * fast/web-share/share-with-files-feature-disabled-expected.txt: Added.
    * fast/web-share/share-with-files-feature-disabled.html: Added.
    Add some tests that ensure that disabling the feature actually works.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-25  Tim Horton  <timothy_horton@apple.com>

            Web Share API Level 2 functions even when its experimental feature flag is disabled
            https://bugs.webkit.org/show_bug.cgi?id=215831
            <rdar://problem/67760687>

            Reviewed by Darin Adler.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::showShareSheet):
            If the Web Content process sends us files, but the Level 2 feature flag is disabled,
            something fishy is happening, so fire a MESSAGE_CHECK.

2020-09-03  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266151. rdar://problem/67812825

    Web Share API can share non-HTTP(S) URLs
    https://bugs.webkit.org/show_bug.cgi?id=215823
    <rdar://problem/62083130>
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    Test: fast/web-share/share-disallows-file-urls.html
    
    * page/Navigator.cpp:
    (WebCore::shareableURLForShareData):
    (WebCore::Navigator::canShare):
    (WebCore::Navigator::share):
    Factor out the code to complete and check the scheme of the URL.
    Make canShare() return NO and share() fail for non-HTTP(S) or data: URLs.
    
    Source/WebKit:
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::showShareSheet):
    Ensure that only HTTP family or data: URLs are shared.
    
    LayoutTests:
    
    * fast/web-share/share-disallows-file-urls-expected.txt: Added.
    * fast/web-share/share-disallows-file-urls.html: Added.
    * fast/web-share/share-transient-activation-expired.html:
    * fast/web-share/share-transient-activation.html:
    * fast/web-share/share.html:
    Add a test that ensures that sharing a non-HTTP-family URL fails,
    and fix the existing tests to share HTTP-family URLs.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-25  Tim Horton  <timothy_horton@apple.com>

            Web Share API can share non-HTTP(S) URLs
            https://bugs.webkit.org/show_bug.cgi?id=215823
            <rdar://problem/62083130>

            Reviewed by Wenson Hsieh.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::showShareSheet):
            Ensure that only HTTP family or data: URLs are shared.

2020-09-03  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266240. rdar://problem/67963550

    REGRESSION(r264710): Initializing the AVPlayer Obj-C class at process start up causes a regression in power-use tests
    https://bugs.webkit.org/show_bug.cgi?id=215861
    
    Reviewed by Eric Carlson.
    
    Calling +instancesRespondToSelector: will cause the underyling Obj-C class to be initialized, which in the case of
    AVPlayer does a bunch of work which shows up on power-use tests. Because the API being checked for will always exist
    in macOS 11, and that code is already protected by a HAVE(AVPLAYER_VIDEORANGEOVERRIDE) pragma, just return early
    here without running the +instancesRespondToSelector: check.
    
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::updatePageScreenProperties):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-27  Jer Noble  <jer.noble@apple.com>

            REGRESSION(r264710): Initializing the AVPlayer Obj-C class at process start up causes a regression in power-use tests
            https://bugs.webkit.org/show_bug.cgi?id=215861

            Reviewed by Eric Carlson.

            Calling +instancesRespondToSelector: will cause the underyling Obj-C class to be initialized, which in the case of
            AVPlayer does a bunch of work which shows up on power-use tests. Because the API being checked for will always exist
            in macOS 11, and that code is already protected by a HAVE(AVPLAYER_VIDEORANGEOVERRIDE) pragma, just return early
            here without running the +instancesRespondToSelector: check.

            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::updatePageScreenProperties):

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266301. rdar://problem/68177648

    [macOS] Fix iokit-get-properties sandbox violations
    https://bugs.webkit.org/show_bug.cgi?id=215925
    
    Reviewed by Brent Fulgham.
    
    Add iokit-property to WebContent sandbox that should have been a part of r266282.
    
    * WebProcess/com.apple.WebProcess.sb.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-28  Per Arne Vollan  <pvollan@apple.com>

            [macOS] Fix iokit-get-properties sandbox violations
            https://bugs.webkit.org/show_bug.cgi?id=215925

            Reviewed by Brent Fulgham.

            Add iokit-property to WebContent sandbox that should have been a part of r266282.

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

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266282. rdar://problem/68177648

    [macOS] Fix iokit-get-properties sandbox violations
    https://bugs.webkit.org/show_bug.cgi?id=215925
    
    Reviewed by Darin Adler.
    
    A few iokit properties needs to be added to the WebContent process' sandbox after observing these being in use.
    
    * WebProcess/com.apple.WebProcess.sb.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266282 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-28  Per Arne Vollan  <pvollan@apple.com>

            [macOS] Fix iokit-get-properties sandbox violations
            https://bugs.webkit.org/show_bug.cgi?id=215925

            Reviewed by Darin Adler.

            A few iokit properties needs to be added to the WebContent process' sandbox after observing these being in use.

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

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266099. rdar://problem/68176073

    CrashTracer: com.apple.WebKit.WebContent at com.apple.WebKit: WebKit::PDFPlugin::createScrollbar
    <rdar://problem/67473335> and https://bugs.webkit.org/show_bug.cgi?id=215787
    
    Reviewed by Tim Horton.
    
    To quote Tim from r264945:
    No new tests; timing is such that I can't reproduce without inserting
    intentional delays into the main thread hops, which is further than
    I'm willing to go for a test.
    
    This is a speculative fix due to the aforementioned reproducibility issue.
    
    * WebProcess/Plugins/PDF/PDFPlugin.mm:
    (WebKit::PDFPlugin::receivedNonLinearizedPDFSentinel): Check on the main thread whenever this is called,
      instead of when deciding to dispatch to the main thread.
    (WebKit::PDFPlugin::threadEntry): We can't do this check on the background thread when considering the dispatch
      to the main thread, as the flag might've changed by then. Let's *just* check it on the main thread.
    (WebKit::PDFPlugin::adoptBackgroundThreadDocument): We can't do the check on the background thread when
    (WebKit::PDFPlugin::updateScrollbars): This is where the crash itself is. All of the Obj-C code in here is
      safe to do after destroy(), up until the very end when we get into pluginView() derefencing.
      So it seems prudent to add another check here.
    (WebKit::PDFPlugin::documentDataDidFinishLoading): In addition to receivedNonLinearizedPDFSentinel and
      adoptBackgroundThreadDocument, this is the final of the (3) calls that end up calling installPDFDocument,
      so for added coverage it seems like a prudent place to add the check.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266099 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-24  Brady Eidson  <beidson@apple.com>

            CrashTracer: com.apple.WebKit.WebContent at com.apple.WebKit: WebKit::PDFPlugin::createScrollbar
            <rdar://problem/67473335> and https://bugs.webkit.org/show_bug.cgi?id=215787

            Reviewed by Tim Horton.

            To quote Tim from r264945:
            No new tests; timing is such that I can't reproduce without inserting
            intentional delays into the main thread hops, which is further than
            I'm willing to go for a test.

            This is a speculative fix due to the aforementioned reproducibility issue.

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::receivedNonLinearizedPDFSentinel): Check on the main thread whenever this is called,
              instead of when deciding to dispatch to the main thread.
            (WebKit::PDFPlugin::threadEntry): We can't do this check on the background thread when considering the dispatch
              to the main thread, as the flag might've changed by then. Let's *just* check it on the main thread.
            (WebKit::PDFPlugin::adoptBackgroundThreadDocument): We can't do the check on the background thread when
            (WebKit::PDFPlugin::updateScrollbars): This is where the crash itself is. All of the Obj-C code in here is
              safe to do after destroy(), up until the very end when we get into pluginView() derefencing.
              So it seems prudent to add another check here.
            (WebKit::PDFPlugin::documentDataDidFinishLoading): In addition to receivedNonLinearizedPDFSentinel and
              adoptBackgroundThreadDocument, this is the final of the (3) calls that end up calling installPDFDocument,
              so for added coverage it seems like a prudent place to add the check.

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266214. rdar://problem/68164557

    Resource Load Statistics data summary does not report data which is held up in the web content process.
    https://bugs.webkit.org/show_bug.cgi?id=215822
    <rdar://problem/66682044>
    
    Reviewed by Chris Dumez.
    
    Source/WebCore:
    
    Send empty lambda when calling updateCentralStatisticsStore() because
    in these cases we don't care about timing.
    
    * loader/ResourceLoadObserver.h:
    (WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
    * page/DOMWindow.cpp:
    (WebCore::DOMWindow::close):
    * testing/Internals.cpp:
    (WebCore::Internals::notifyResourceLoadObserver):
    
    Source/WebKit:
    
    No new tests, this fixes a timing bug that is flaky to reproduce, so I
    was unable to write a test case. Non-regressed behavior is confirmed
    with existing API testing.
    
    * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
    (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    Most of the time, the completion handler will be an empty function,
    but we should handle it in the network process so we fix the
    case where we wait to send the full data summary until the update has
    finished.
    
    (WebKit::WebResourceLoadStatisticsStore::aggregatedThirdPartyData):
    Delete extra space.
    
    * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
    * NetworkProcess/NetworkConnectionToWebProcess.cpp:
    (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
    * NetworkProcess/NetworkConnectionToWebProcess.h:
    * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
    * UIProcess/WebProcessPool.cpp:
    (WebKit::WebProcessPool::sendResourceLoadStatisticsDataImmediately):
    * UIProcess/WebProcessPool.h:
    * UIProcess/WebsiteData/WebsiteDataStore.cpp:
    (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
    Don't ask the network process for data until any lingering data
    in the web content process has been sent first.
    
    * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
    (WKBundleResourceLoadStatisticsNotifyObserver):
    * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
    (WebKit::WebResourceLoadObserver::WebResourceLoadObserver):
    (WebKit::WebResourceLoadObserver::~WebResourceLoadObserver):
    (WebKit::WebResourceLoadObserver::updateCentralStatisticsStore):
    * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::flushResourceLoadStatistics):
    (WebKit::WebProcess::sendResourceLoadStatisticsDataImmediately):
    * WebProcess/WebProcess.h:
    * WebProcess/WebProcess.messages.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-26  Kate Cheney  <katherine_cheney@apple.com>

            Resource Load Statistics data summary does not report data which is held up in the web content process.
            https://bugs.webkit.org/show_bug.cgi?id=215822
            <rdar://problem/66682044>

            Reviewed by Chris Dumez.

            No new tests, this fixes a timing bug that is flaky to reproduce, so I
            was unable to write a test case. Non-regressed behavior is confirmed
            with existing API testing.

            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
            (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
            Most of the time, the completion handler will be an empty function,
            but we should handle it in the network process so we fix the
            case where we wait to send the full data summary until the update has
            finished.

            (WebKit::WebResourceLoadStatisticsStore::aggregatedThirdPartyData):
            Delete extra space.

            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
            * NetworkProcess/NetworkConnectionToWebProcess.cpp:
            (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
            * NetworkProcess/NetworkConnectionToWebProcess.h:
            * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
            * UIProcess/WebProcessPool.cpp:
            (WebKit::WebProcessPool::sendResourceLoadStatisticsDataImmediately):
            * UIProcess/WebProcessPool.h:
            * UIProcess/WebsiteData/WebsiteDataStore.cpp:
            (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
            Don't ask the network process for data until any lingering data
            in the web content process has been sent first.

            * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
            (WKBundleResourceLoadStatisticsNotifyObserver):
            * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
            (WebKit::WebResourceLoadObserver::WebResourceLoadObserver):
            (WebKit::WebResourceLoadObserver::~WebResourceLoadObserver):
            (WebKit::WebResourceLoadObserver::updateCentralStatisticsStore):
            * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
            * WebProcess/WebProcess.cpp:
            (WebKit::WebProcess::flushResourceLoadStatistics):
            (WebKit::WebProcess::sendResourceLoadStatisticsDataImmediately):
            * WebProcess/WebProcess.h:
            * WebProcess/WebProcess.messages.in:

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266143. rdar://problem/68164547

    Trying to lookup when WebView is in a popover causes process to hang. Fix for Legacy WebView.
    https://bugs.webkit.org/show_bug.cgi?id=215792
    
    Reviewed by Tim Horton.
    
    Source/WebKit:
    
    Update code based on Darin's suggestion for mirror fix in legacy webkit.
    
    * UIProcess/mac/WebContextMenuProxyMac.mm:
    (WebKit::WebContextMenuProxyMac::getContextMenuFromItems):
    
    Source/WebKitLegacy/mac:
    
    Fix for https://bugs.webkit.org/show_bug.cgi?id=214773 also needed in legacy WebView.
    The Lookup framework does not populate the menus that it vends with the option to 'lookup'
    words that are selected in popovers. WebKit should follow the pattern and not put the
    item in the menu as Lookup is not able to handle this situation. Also if Lookup is disabled
    via defaults, we should not show it in the menu.
    
    * WebView/WebHTMLView.mm:
    (customMenuFromDefaultItems):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-25  Megan Gardner  <megan_gardner@apple.com>

            Trying to lookup when WebView is in a popover causes process to hang. Fix for Legacy WebView.
            https://bugs.webkit.org/show_bug.cgi?id=215792

            Reviewed by Tim Horton.

            Update code based on Darin's suggestion for mirror fix in legacy webkit.

            * UIProcess/mac/WebContextMenuProxyMac.mm:
            (WebKit::WebContextMenuProxyMac::getContextMenuFromItems):

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266134. rdar://problem/68164543

    [Mac] REGRESSION(r262322): Focusable elements are focused when exiting from video fullscreen mode.
    https://bugs.webkit.org/show_bug.cgi?id=215660
    <rdar://problem/65263150>
    
    Reviewed by Darin Adler.
    
    Source/WebKit:
    
    API Test: Fullscreen.Focus.
    
    The default behavior of NSWindow is to change its -keyViewSelectionDirection to NSSelectingNext when activating
    and changing the firstResponder. This causes WKWebView to change it's focus in response to becoming first responder.
    The cheap fix is to ensure WKWebView is already the firstResponder when the window is activated. Then NSWindow won't
    try to change the firstResponder in response to activation.
    
    * UIProcess/mac/WKFullScreenWindowController.mm:
    (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
    
    Tools:
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/mac/FullscreenFocus.mm: Added.
    (-[FullscreenFocusUIDelegate _webViewDidEnterFullscreen:]):
    (-[FullscreenFocusUIDelegate _webViewDidExitFullscreen:]):
    (TestWebKitAPI::TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266134 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-25  Jer Noble  <jer.noble@apple.com>

            [Mac] REGRESSION(r262322): Focusable elements are focused when exiting from video fullscreen mode.
            https://bugs.webkit.org/show_bug.cgi?id=215660
            <rdar://problem/65263150>

            Reviewed by Darin Adler.

            API Test: Fullscreen.Focus.

            The default behavior of NSWindow is to change its -keyViewSelectionDirection to NSSelectingNext when activating
            and changing the firstResponder. This causes WKWebView to change it's focus in response to becoming first responder.
            The cheap fix is to ensure WKWebView is already the firstResponder when the window is activated. Then NSWindow won't
            try to change the firstResponder in response to activation.

            * UIProcess/mac/WKFullScreenWindowController.mm:
            (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266268. rdar://problem/68107183

    Remove the feature flag for capped cookies set in 3rd-party CNAME cloaked HTTP responses and add ITP debug logging
    https://bugs.webkit.org/show_bug.cgi?id=215902
    <rdar://problem/66699731>
    
    Reviewed by Brent Fulgham.
    
    This change removes the feature flag, effectively turning the feature on.
    It also adds log output of cookie names that have been capped when ITP
    Debug Mode is enabled.
    
    Source/WebCore:
    
    WebCore::NetworkStorageSession now has a member flag for ITP debug logging.
    
    No new tests. This feature already has tests.
    
    * page/Settings.yaml:
    * platform/network/NetworkStorageSession.cpp:
    (WebCore::NetworkStorageSession::setResourceLoadStatisticsDebugLoggingEnabled):
    (WebCore::NetworkStorageSession::resourceLoadStatisticsDebugLoggingEnabled const):
        New function to be able to conditionalize log output in the new feature.
    * platform/network/NetworkStorageSession.h:
    
    Source/WebKit:
    
    * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
    (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
        Now sets the flag in WebCore::NetworkStorageSession through the new function
        WebCore::NetworkStorageSession::setResourceLoadStatisticsDebugLoggingEnabled().
    * NetworkProcess/NetworkProcess.cpp:
    (WebKit::NetworkProcess::resetParametersToDefaultValues):
    (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
    * NetworkProcess/NetworkSession.cpp:
    (WebKit::NetworkSession::NetworkSession):
    (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain):
    (WebKit::NetworkSession::firstPartyHostCNAMEDomain):
    * NetworkProcess/NetworkSession.h:
    (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled): Deleted.
    (WebKit::NetworkSession::cnameCloakingMitigationEnabled const): Deleted.
    * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
    (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession):
    (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking):
    * Shared/ResourceLoadStatisticsParameters.h:
    (WebKit::ResourceLoadStatisticsParameters::encode const):
    (WebKit::ResourceLoadStatisticsParameters::decode):
    * Shared/WebPreferences.yaml:
    * UIProcess/WebProcessPool.cpp:
    (WebKit::WebProcessPool::ensureNetworkProcess):
    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
    (WebKit::WebsiteDataStore::platformSetNetworkParameters):
    * UIProcess/WebsiteData/WebsiteDataStore.cpp:
    (WebKit::WebsiteDataStore::parameters):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266268 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-27  John Wilander  <wilander@apple.com>

            Remove the feature flag for capped cookies set in 3rd-party CNAME cloaked HTTP responses and add ITP debug logging
            https://bugs.webkit.org/show_bug.cgi?id=215902
            <rdar://problem/66699731>

            Reviewed by Brent Fulgham.

            This change removes the feature flag, effectively turning the feature on.
            It also adds log output of cookie names that have been capped when ITP
            Debug Mode is enabled.

            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
            (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
                Now sets the flag in WebCore::NetworkStorageSession through the new function
                WebCore::NetworkStorageSession::setResourceLoadStatisticsDebugLoggingEnabled().
            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::resetParametersToDefaultValues):
            (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
            * NetworkProcess/NetworkSession.cpp:
            (WebKit::NetworkSession::NetworkSession):
            (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain):
            (WebKit::NetworkSession::firstPartyHostCNAMEDomain):
            * NetworkProcess/NetworkSession.h:
            (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled): Deleted.
            (WebKit::NetworkSession::cnameCloakingMitigationEnabled const): Deleted.
            * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
            (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession):
            (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking):
            * Shared/ResourceLoadStatisticsParameters.h:
            (WebKit::ResourceLoadStatisticsParameters::encode const):
            (WebKit::ResourceLoadStatisticsParameters::decode):
            * Shared/WebPreferences.yaml:
            * UIProcess/WebProcessPool.cpp:
            (WebKit::WebProcessPool::ensureNetworkProcess):
            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
            (WebKit::WebsiteDataStore::platformSetNetworkParameters):
            * UIProcess/WebsiteData/WebsiteDataStore.cpp:
            (WebKit::WebsiteDataStore::parameters):

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266238. rdar://problem/68161715

    Unreviewed, add missing double quote in r266216.
    
    * WebProcess/com.apple.WebProcess.sb.in:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-27  Chris Dumez  <cdumez@apple.com>

            Unreviewed, add missing double quote in r266216.

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

2020-09-01  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266216. rdar://problem/68161715

    [macOS] Stop logging sandbox violations of com.apple.CoreDisplay.Notification
    https://bugs.webkit.org/show_bug.cgi?id=215869
    
    Reviewed by Darin Adler.
    
    On macOS, stop logging mach-lookup sandbox violations of com.apple.CoreDisplay.Notification for performance reasons.
    
    No new tests, since there is no change in behavior. The service was already being denied in the sandbox.
    
    * WebProcess/com.apple.WebProcess.sb.in:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266216 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-26  Per Arne Vollan  <pvollan@apple.com>

            [macOS] Stop logging sandbox violations of com.apple.CoreDisplay.Notification
            https://bugs.webkit.org/show_bug.cgi?id=215869

            Reviewed by Darin Adler.

            On macOS, stop logging mach-lookup sandbox violations of com.apple.CoreDisplay.Notification for performance reasons.

            No new tests, since there is no change in behavior. The service was already being denied in the sandbox.

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

2020-08-26  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266168. rdar://problem/67836301

    REGRESSION (r265908): Crash under Blob::arrayBuffer() / Blob::text() in stress GC
    https://bugs.webkit.org/show_bug.cgi?id=215832
    <rdar://problem/67741677>
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    r265908 added support for Blob::arrayBuffer() / Blob::text() which are asynchronous operations
    returning promises. The crash is due to the fact that the Blob's JS wrapper may get garbage
    collected before the promise is settled.
    
    To address the issue, this patch makes Blob an ActiveDOMObject and creates an
    ActiveDOMObject::pendingActivity whenever there is a pending promise so that the JS wrapper
    does not get garbage collected too early.
    
    Test: fast/files/blob-text-gc.html
    
    * Modules/async-clipboard/Clipboard.cpp:
    (WebCore::Clipboard::getType):
    * Modules/async-clipboard/ClipboardImageReader.h:
    (WebCore::ClipboardImageReader::ClipboardImageReader):
    * Modules/async-clipboard/ClipboardItem.cpp:
    (WebCore::ClipboardItem::blobFromString):
    * Modules/async-clipboard/ClipboardItem.h:
    * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
    (WebCore::ClipboardItemBindingsDataSource::getType):
    * Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm:
    (WebCore::ClipboardImageReader::readBuffer):
    * Modules/async-clipboard/mac/ClipboardImageReaderMac.mm:
    (WebCore::ClipboardImageReader::readBuffer):
    * Modules/entriesapi/DOMFileSystem.cpp:
    (WebCore::DOMFileSystem::getFile):
    * Modules/entriesapi/DOMFileSystem.h:
    * Modules/entriesapi/FileSystemFileEntry.cpp:
    (WebCore::FileSystemFileEntry::file):
    * Modules/entriesapi/FileSystemFileEntry.h:
    * Modules/entriesapi/FileSystemFileEntry.idl:
    * Modules/fetch/FetchBody.cpp:
    (WebCore::FetchBody::fromFormData):
    * Modules/fetch/FetchBody.h:
    * Modules/fetch/FetchBodyConsumer.cpp:
    (WebCore::blobFromData):
    (WebCore::packageFormData):
    (WebCore::resolveWithTypeAndData):
    (WebCore::FetchBodyConsumer::resolve):
    (WebCore::FetchBodyConsumer::takeAsBlob):
    * Modules/fetch/FetchBodyConsumer.h:
    * Modules/fetch/FetchBodyOwner.cpp:
    (WebCore::FetchBodyOwner::blob):
    * Modules/mediarecorder/MediaRecorder.cpp:
    (WebCore::MediaRecorder::stopRecording):
    (WebCore::MediaRecorder::requestData):
    * Modules/mediastream/RTCDataChannel.cpp:
    (WebCore::RTCDataChannel::didReceiveRawData):
    * Modules/websockets/WebSocket.cpp:
    (WebCore::WebSocket::didReceiveBinaryData):
    * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
    (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
    * bindings/js/SerializedScriptValue.cpp:
    (WebCore::CloneDeserializer::readFile):
    (WebCore::CloneDeserializer::readTerminal):
    * dom/DataTransfer.cpp:
    (WebCore::DataTransfer::updateFileList):
    (WebCore::DataTransfer::items):
    (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
    (WebCore::DataTransfer::files const):
    * dom/DataTransfer.h:
    * dom/DataTransfer.idl:
    * dom/DataTransferItemList.cpp:
    (WebCore::DataTransferItemList::DataTransferItemList):
    (WebCore::DataTransferItemList::remove):
    (WebCore::DataTransferItemList::clear):
    (WebCore::DataTransferItemList::ensureItems const):
    (WebCore::DataTransferItemList::document const):
    * dom/DataTransferItemList.h:
    * dom/DataTransferItemList.idl:
    * editing/WebCorePasteboardFileReader.cpp:
    (WebCore::WebCorePasteboardFileReader::readFilename):
    (WebCore::WebCorePasteboardFileReader::readBuffer):
    * editing/WebCorePasteboardFileReader.h:
    * editing/cocoa/WebContentReaderCocoa.mm:
    (WebCore::createFragmentForImageAttachment):
    (WebCore::replaceRichContentWithAttachments):
    (WebCore::createFragmentAndAddResources):
    (WebCore::sanitizeMarkupWithArchive):
    (WebCore::WebContentReader::readImage):
    (WebCore::attachmentForFilePath):
    (WebCore::attachmentForData):
    * editing/markup.cpp:
    (WebCore::restoreAttachmentElementsInFragment):
    * fileapi/Blob.cpp:
    (WebCore::Blob::Blob):
    (WebCore::Blob::loadBlob):
    (WebCore::Blob::activeDOMObjectName const):
    * fileapi/Blob.h:
    (WebCore::Blob::create):
    (WebCore::Blob::deserialize):
    (WebCore::Blob::slice const):
    * fileapi/Blob.idl:
    * fileapi/File.cpp:
    (WebCore::File::createWithRelativePath):
    (WebCore::File::create):
    (WebCore::File::File):
    (WebCore::File::activeDOMObjectName const):
    * fileapi/File.h:
    * fileapi/File.idl:
    * html/DOMFormData.cpp:
    (WebCore::DOMFormData::createFileEntry):
    * html/DirectoryFileListCreator.cpp:
    (WebCore::FileInformation::isolatedCopy const):
    (WebCore::appendDirectoryFiles):
    (WebCore::gatherFileInformation):
    (WebCore::toFileList):
    (WebCore::DirectoryFileListCreator::start):
    * html/DirectoryFileListCreator.h:
    * html/FileInputType.cpp:
    (WebCore::FileInputType::appendFormData const):
    (WebCore::FileInputType::filesChosen):
    * html/HTMLAttachmentElement.cpp:
    (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
    * html/HTMLCanvasElement.cpp:
    (WebCore::HTMLCanvasElement::toBlob):
    * testing/Internals.cpp:
    (WebCore::Internals::createFile):
    * testing/ServiceWorkerInternals.cpp:
    (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
    * workers/service/context/ServiceWorkerFetch.cpp:
    (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
    * xml/XMLHttpRequest.cpp:
    (WebCore::XMLHttpRequest::createResponseBlob):
    
    Source/WebKit:
    
    * WebProcess/Automation/WebAutomationSessionProxy.cpp:
    (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload):
    
    LayoutTests:
    
    Add better test coverage.
    
    * fast/files/blob-text-gc-expected.txt: Added.
    * fast/files/blob-text-gc.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266168 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2020-08-26  Chris Dumez  <cdumez@apple.com>

            REGRESSION (r265908): Crash under Blob::arrayBuffer() / Blob::text() in stress GC
            https://bugs.webkit.org/show_bug.cgi?id=215832
            <rdar://problem/67741677>

            Reviewed by Ryosuke Niwa.

            * WebProcess/Automation/WebAutomationSessionProxy.cpp:
            (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload):

2020-08-26  Alan Coon  <alancoon@apple.com>

        Cherry-pick r266087. rdar://problem/67836301

    Implement Request/Response consuming as FormData
    https://bugs.webkit.org/show_bug.cgi?id=215671
    
    Patch by Alex Christensen <achristensen@webkit.org> on 2020-08-24
    Reviewed by Darin Adler.
    
    LayoutTests/imported/w3c:
    
    * web-platform-tests/fetch/api/abort/general.any-expected.txt:
    * web-platform-tests/fetch/api/abort/general.any.worker-expected.txt:
    * web-platform-tests/fetch/api/request/request-consume-empty-expected.txt:
    This remaining failing test now fails similarly in all browsers.
    * web-platform-tests/fetch/api/request/request-consume-expected.txt:
    * web-platform-tests/fetch/api/request/request-init-002-expected.txt:
    * web-platform-tests/fetch/api/response/response-consume-empty-expected.txt:
    This remaining failing test now fails similarly in all browsers.
    * web-platform-tests/fetch/api/response/response-consume-expected.txt:
    * web-platform-tests/fetch/api/response/response-error-from-stream-expected.txt:
    This change makes the formData failures in this file look like all the other failures in this file,
    which should be fixed together in a separate patch.
    * web-platform-tests/fetch/api/response/response-init-002-expected.txt:
    * web-platform-tests/url/urlencoded-parser.any-expected.txt:
    * web-platform-tests/url/urlencoded-parser.any.worker-expected.txt:
    * web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https-expected.txt:
    
    Source/WebCore:
    
    Covered by many newly passing WPT tests, for most of which Safari was the only failing browser.
    
    * Modules/fetch/FetchBody.cpp:
    (WebCore::FetchBody::formData):
    (WebCore::FetchBody::consume):
    (WebCore::FetchBody::consumeFormData):
    * Modules/fetch/FetchBody.h:
    * Modules/fetch/FetchBodyConsumer.cpp:
    (WebCore::formDataFromData):
    (WebCore::resolveWithTypeAndData):
    (WebCore::FetchBodyConsumer::resolve):
    * Modules/fetch/FetchBodyConsumer.h:
    
    Source/WebKit:
    
    * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
    (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
    Add a fast path that allows non-blob FormData responses from service workers to not hang.
    This part is covered by this layout test:
    imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html
    
    Source/WTF:
    
    In order to be compatible with other browsers, we need a verson of String::fromUTF8 that
    uses U8_NEXT_OR_FFFD instead of U8_NEXT, but changing that across the board will break other things.
    Leave everything else as it is, use templates and constexpr to not add any branches, but add
    String::fromUTF8ReplacingInvalidSequences to allow me to make our FormData consuming compatible with other browsers.
    
    * wtf/text/WTFString.cpp:
    (WTF::fromUTF8Helper):
    (WTF::String::fromUTF8):
    (WTF::String::fromUTF8ReplacingInvalidSequences):
    * wtf/text/WTFString.h:
    * wtf/unicode/UTF8Conversion.cpp:
    (WTF::Unicode::convertUTF8ToUTF16Impl):
    (WTF::Unicode::convertUTF8ToUTF16):
    (WTF::Unicode::convertUTF8ToUTF16ReplacingInvalidSequences):
    * wtf/unicode/UTF8Conversion.h:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

            Implement Request/Response consuming as FormData
            https://bugs.webkit.org/show_bug.cgi?id=215671

            Reviewed by Darin Adler.

            * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
            (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
            Add a fast path that allows non-blob FormData responses from service workers to not hang.
            This part is covered by this layout test:
            imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html

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

        [macOS] Unable to copy text from the function browser panel in Numbers
        https://bugs.webkit.org/show_bug.cgi?id=215740
        <rdar://problem/65189303>

        Reviewed by Darin Adler.

        On some versions of Xcode, using Interface Builder to set up WKWebViews causes the WKWebView to contain two
        WKFlippedViews as subviews; one of these is created and added in the normal initialization path of the web view
        underneath WebViewImpl's constructor, and the other is created and added underneath the superclass (NSView's)
        `-initWithCoder:` implementation.

        This causes issues when hit-testing WKWebView using the `-hitTest:` method, which is expected to return the
        WKWebView itself instead of the inner WKFlippedView. The logic that tries to implement this behavior is in
        `WebViewImpl::hitTest`, which calls into WKWebView's `-hitTest:` method and returns the WKWebView if the hit-
        tested view ended up being equal to the `m_layerHostingView`. Since we end up with two layer hosting views (only
        one of which is the real `m_layerHostingView`), we fail the check and end up returning the other WKFlippedView.
        In the context of this bug, this erroneous hit-test causes AppKit to ask if the WKFlippedView can become the
        first responder upon mousedown (which it cannot), and so the window's first responder remains the same (instead
        of changing to WKWebView).

        To fix this, adjust the constructor of WebViewImpl to avoid making an extra layer hosting view in the case where
        decoding the WKWebView already initialized and placed the layer hosting view, and just use the existing one
        instead.

        Test: WKWebView.HitTestAfterInitializingFromCoder

        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKFlippedView initWithFrame:]):
        (-[WKFlippedView initWithCoder:]):
        (-[WKFlippedView _commonInitialize]):

        Override both designated initialization codepaths so that we call the `-_commonInitialize` helper, which sets
        the autoresizing mask. This was previously called immediately after creating the WKFlippedView in the
        constructor of WebViewImpl.

        (WebKit::WebViewImpl::WebViewImpl):

2020-08-21  Andy Estes  <aestes@apple.com>

        IPC::encodeSharedBuffer combines SharedBuffer data segments when copying to SharedMemory
        https://bugs.webkit.org/show_bug.cgi?id=215737
        <rdar://problem/67568099>

        Reviewed by Darin Adler.

        IPC::encodeSharedBuffer called SharedBuffer::data() when copying data into SharedMemory,
        requiring the SharedBuffer to combine its data segments. This can be avoided by using
        SharedMemory::copyBuffer() instead.

        * Platform/SharedMemory.cpp:
        (WebKit::SharedMemory::copyBuffer): Modernized to use auto and range-based for loops.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeSharedBuffer): Used SharedMemory::copyBuffer() to create a copy of the buffer in
        a new SharedMemory. Calling this function does not combine the buffer's data segments.

        * Platform/SharedMemory.h: Added a FIXME for how SharedMemory's factory functions could be
        improved.

2020-08-21  Jiten Mehta  <jmehta@apple.com>

        Use closeReason provided in didCloseWithCode delegate for the NSURLSessionWebSocket code path
        https://bugs.webkit.org/show_bug.cgi?id=215519

        Reviewed by Youenn Fablet.

        Covered by existing protocol tests with NSURLSession code path enabled.
        http/tests/websocket/tests/hybi/workers/close-code-and-reason.html

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:webSocketTask:didCloseWithCode:reason:]):

2020-08-21  Andy Estes  <aestes@apple.com>

        REGRESSION (r257667): 1.9x more CPU time in IPC::SharedBufferDataReference decoding during Netflix playback
        https://bugs.webkit.org/show_bug.cgi?id=215232
        <rdar://problem/66637920>

        Reviewed by Geoff Garen.

        Prior to r257667, an IPC message defined a IPC::SharedBufferDataReference argument to allow
        its sender to easily encode SharedBuffer data as a DataReference. SharedBufferDataReference
        cost the same to encode as a DataReference -- both copied data into the Encoder -- but did
        so by iterating over the SharedBuffer's data segments rather than combining them into a
        contiguous allocation. The message argument was received as a decoded IPC::DataReference,
        which stores a pointer into the IPC::Decoder's buffer rather than making a copy.

        In r257667, IPC::SharedBufferDataReference switched its encoder to use IPC::ArgumentCoder's
        SharedBuffer specialization, which works by allocating a SharedMemory buffer, copying
        SharedBuffer data into it, creating a SharedMemory::IPCHandle from it, and encoding the
        handle. It makes only one copy like the old encoder did, but pays the added cost of
        combining SharedBuffer data segments prior to copying by needlessly calling
        SharedBuffer::data() (this should be fixed independently).

        Since this serialization could no longer be decoded by DataReference's decoder,
        SharedBufferDataReference implemented a decoder, also in terms of ArgumentCoder's SharedBuffer
        specialization. It works by mapping a SharedMemory buffer from a decoded
        SharedMemory::IPCHandle and copying that buffer into a new SharedBuffer. This copy is a cost
        that the old decoder did not incur, but in some cases the message receiver would have made
        such a copy anyway and can instead just ref the decoded SharedBuffer. In other cases though,
        the receiver either made no copies or couldn't use the decoded SharedBuffer to avoid making
        its own copy so creating the SharedBuffer was pure added cost.

        There are additional costs from allocating, mapping, and deleting shared memory and Mach
        send rights, but they are offset by savings due to smaller Encoder and Decoder buffers. The
        additional SharedBuffer combining and copying is not offset elsewhere, and on net makes
        sending and receiving IPC::SharedBufferDataReferences use up to 2x more CPU time when
        playing a video on netflix.com in Safari.

        Resolve this slowdown by reverting the argument encoding changes made to
        IPC::SharedBufferDataReference in r257667. For compatibility with code added after r257667,
        the current IPC::SharedBufferDataReference was copied to IPC::SharedBufferCopy and retains
        the behavior of copying into a SharedBuffer when decoded. IPC::SharedBufferDataReference now
        has the pre-r257667 behavior of decoding to an IPC::DataReference. Messages added after
        r257667 whose receivers were designed to handle a SharedBuffer were changed to use
        IPC::SharedBufferCopy, and all other receivers of messages with IPC::SharedBufferDataReference
        arguments were changed to handle an IPC::DataReference.

        * GPUProcess/media/RemoteCDMInstanceProxy.cpp:
        * GPUProcess/media/RemoteCDMInstanceProxy.h:
        * GPUProcess/media/RemoteCDMInstanceProxy.messages.in:
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.cpp:
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.h:
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.messages.in:
        * GPUProcess/media/RemoteCDMProxy.cpp:
        * GPUProcess/media/RemoteCDMProxy.h:
        * GPUProcess/media/RemoteLegacyCDMSessionProxy.cpp:
        * GPUProcess/media/RemoteLegacyCDMSessionProxy.h:
        * GPUProcess/media/RemoteLegacyCDMSessionProxy.messages.in:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::platformRegisterAttachment):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::registerAttachmentIdentifierFromData):
        (WebKit::WebPageProxy::platformRegisterAttachment):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
        * WebProcess/GPU/media/RemoteCDMInstance.cpp:
        * WebProcess/GPU/media/RemoteCDMInstanceSession.cpp:
        * WebProcess/GPU/media/RemoteCDMInstanceSession.h:
        * WebProcess/GPU/media/RemoteCDMInstanceSession.messages.in:
        * WebProcess/GPU/media/RemoteLegacyCDMSession.cpp:
        * WebProcess/GPU/media/RemoteLegacyCDMSession.h:
        * WebProcess/GPU/media/RemoteLegacyCDMSession.messages.in:
        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Replaced
        IPC::SharedBufferDataReference with IPC::SharedBufferCopy.

        * NetworkProcess/NetworkResourceLoader.cpp:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in:
        * WebProcess/Network/WebResourceLoader.cpp:
        * WebProcess/Network/WebResourceLoader.h:
        * WebProcess/Network/WebResourceLoader.messages.in:
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Removed the DidReceiveSharedBuffer
        message and reverted the DidReceiveData message back to taking an
        IPC::SharedBufferDataReference.

        * Platform/IPC/Encoder.h: Made Encoder::reserve(size_t) public so
        SharedBufferCopy::encode(Encoder&) can call it.

        * Platform/IPC/HandleMessage.h: Restored the CodingType specialization that decodes
        SharedBufferDataReference arguments as DataReferences.

        * Platform/IPC/SharedBufferCopy.cpp:
        * Platform/IPC/SharedBufferCopy.h: Copied from SharedBufferDataReference.h. Implemented the
        interface and decoding behavior that SharedBufferDataReference had between r257667 and this
        change.

        * Platform/IPC/SharedBufferDataReference.cpp: 
        * Platform/IPC/SharedBufferDataReference.h: Reverted to the pre-r257667 interface and
        decoding behvior.

        * Scripts/webkit/messages.py: Removed an unneeded special case.

        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj: Added SharedBuffer{Copy,DataReference}.cpp.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::dataCallback):
        (WebKit::WebPageProxy::finishedLoadingIcon):
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h: Used `const IPC::DataReference&` in message receiver
        signatures for SharedBufferDataReference arguments.

        * UIProcess/WebURLSchemeTask.cpp:
        * WebProcess/GPU/media/RemoteAudioBusData.h:
        * WebProcess/GPU/media/RemoteCDM.cpp:
        * WebProcess/Network/WebLoaderStrategy.cpp: Removed unused includes.

2020-08-20  Peng Liu  <peng.liu6@apple.com>

        Mac Catalyst Apps require "playsinline" attribute to support playing videos in the inline mode
        https://bugs.webkit.org/show_bug.cgi?id=215724

        Reviewed by Tim Horton.

        Currently WebKit::currentUserInterfaceIdiomIsPad() returns NO on Mac Catalyst apps.
        Therefore, the behavior of Mac Catalyst apps regarding the inline media playback
        support is not consistent with iPad apps.

        This patch removes the usage of WebKit::currentUserInterfaceIdiomIsPad() to decide
        the settings of the inline media playback support on Mac Catalyst apps.

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

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

        [GTK][WPE] Debug crashes in backdrop filter tests
        https://bugs.webkit.org/show_bug.cgi?id=215209

        Reviewed by Adrian Perez de Castro.

        * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
        (WebKit::CompositingCoordinator::~CompositingCoordinator): Use invalidateCoordinator() instead of setCoordinator()
        that has been removed.
        (WebKit::CompositingCoordinator::createGraphicsLayer): Use setCoordinatorIncludingSubLayersIfNeeded() instead of
        attaching the layer directly.
        (WebKit::CompositingCoordinator::attachLayer): Do not call setCoordinator(), the caller is expected to set the
        coordinator.

2020-08-20  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Web pages are not responding correctly to changes in "Reduce motion" setting
        https://bugs.webkit.org/show_bug.cgi?id=215664

        Reviewed by Darin Adler.

        This happens because there is a race between the preference change and notification being received in the WebContent
        process. This race is usually won by the notification, which then reads the wrong preference value when being handled.
        This bug was introduced when access to the preference daemon was closed in the WebContent process, and preferences
        were updated from the UI process. This patch addresses this issue by re-posting the notification when the preference
        value is updated in the WebContent process.

        API test: WebKit.AccessibilityReduceMotion

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::reduceMotionPreferenceKey):
        (WebKit::dispatchSimulatedNotificationsForPreferenceChange):

2020-08-20  James Savage  <james.savage@apple.com>

        Could not find module 'WebKit' for target 'armv7-apple-ios'
        <https://bugs.webkit.org/show_bug.cgi?id=215190>
        <rdar://problem/65642049>

        Reviewed by Brady Eidson.

        The config changes here got added to the wrong config file. They need to
        be for the overlay, not its tests.

        * SwiftOverlay/Configurations/WebKitSwiftOverlay.xcconfig:
        * SwiftOverlay/Configurations/WebKitSwiftOverlayTests.xcconfig:

2020-08-20  Aditya Keerthi  <akeerthi@apple.com>

        Add runtime setting for editable components in date/time inputs
        https://bugs.webkit.org/show_bug.cgi?id=215705

        Reviewed by Wenson Hsieh.

        Added DateTimeInputsEditableComponentsEnabled as a runtime setting. This
        setting is enabled by default on macOS.

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

2020-08-20  Chris Dumez  <cdumez@apple.com>

        Sandbox violation when calling [NSHTTPCookieStorage sharedHTTPCookieStorage] from the WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=215701
        <rdar://problem/67069826>

        Reviewed by Geoffrey Garen.

        The sandbox does not allow calling [NSHTTPCookieStorage sharedHTTPCookieStorage] from the WebProcess.
        createPrivateStorageSession() was calling [NSHTTPCookieStorage sharedHTTPCookieStorage] to retrieve
        the cookieAcceptPolicy and createPrivateStorageSession() is used by the cookie cache in the WebProcess.
        To address the issue, we now allow the caller of createPrivateStorageSession() to provide the
        cookieAcceptPolicy and we have the cookie cache retrieve the cookieAcceptPolicy from the
        NetworkProcessConnection.

        * WebProcess/Network/NetworkProcessConnection.h:
        (WebKit::NetworkProcessConnection::cookieAcceptPolicy const):
        * WebProcess/WebPage/Cocoa/WebCookieCacheCocoa.mm:
        (WebKit::WebCookieCache::inMemoryStorageSession):

2020-08-20  Youenn Fablet  <youenn@apple.com>

        Align console log message of new WebSocket code path with the legacy code path
        https://bugs.webkit.org/show_bug.cgi?id=215695

        Reviewed by Alex Christensen.

        No observable change of behavior from the page.
        Console log messages appear in expected.txt files when NSURLSession code path is enabled.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::connect):
        (WebKit::WebSocketChannel::didReceiveMessageError):
        * WebProcess/Network/WebSocketChannel.h:

2020-08-20  Lauro Moura  <lmoura@igalia.com>

        REGRESSION(r265856) [GTK][WPE] hybi websockets tests failing
        https://bugs.webkit.org/show_bug.cgi?id=215679

        Reviewed by Carlos Garcia Campos.

        r265856 changed WebSocketChannel to expect AbnormalClosure when the
        closing handshake is not received.

        Covered by existing tests.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::didFail):

2020-08-20  Youenn Fablet  <youenn@apple.com>

        WebSocketTask::close should correctly compute reason byte size in UTF-8
        https://bugs.webkit.org/show_bug.cgi?id=215645

        Reviewed by Darin Adler.

        Covered by http/tests/websocket/tests/hybi/close.html with NSURLSession code path enabled.

        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::close):
        Instead of calling sizeInBytes, we should just get the utf8 CString and gets its size directly.

2020-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>

        IPC message can't be decoded due to uninitialized NavigationActionData member variables with the latest MSVC
        https://bugs.webkit.org/show_bug.cgi?id=215662

        Reviewed by Darin Adler.

        WinCairo WebKit2 is crashing in AuxiliaryProcess::didReceiveInvalidMessage
        if it is compiled by the latest MSVC (Visual Studio 2019 16.7) with optimizer (/O2).

        LockHistory is a bool based enum type. NavigationActionData
        doesn't initialize the member variable of it. IPC::Encoder
        converts a LockHistory value to the underlying type bool. The
        uninitialized value is converted 0 or 1 in GCC, Clang and old
        MSVC. However, the latest MSVC doesn't convert and IPC::Decoder
        detects an invalid enum value.

        * Shared/NavigationActionData.h: Added initializes for userGestureTokenIdentifier, lockHistory and lockBackForwardList.

2020-08-19  Brady Eidson  <beidson@apple.com>

        Improperly linearized PDFs show up as blank gray on Big Sur.
        rdar://problem/67117968 and https://bugs.webkit.org/show_bug.cgi?id=215683

        Reviewed by Darin Adler.

        Will add a new test once an in-house expert helps us construct an example PDF that
        we will have the legal right to commit.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::threadEntry): When PDFKit indicates a PDFDocument is *improperly* linearized
          (as opposed to not linearized at all), we failed to appopriately notify the main thread that
          it needs to start handling the PDF.
          Failure to create a PDFDocument is equivalent to receiving the "nonlinearized sentinel", so
          adding that call fixes this issue.

2020-08-19  Simon Fraser  <simon.fraser@apple.com>

        Fix possible crash when webAnimationsCSSIntegrationEnabled is false
        https://bugs.webkit.org/show_bug.cgi?id=215668
        <rdar://problem/67402003>

        Reviewed by Dean Jackson.

        When webAnimationsCSSIntegrationEnabled is false, GraphicsLayerCA::setupAnimation() doesn't
        set a timing function on the animation, causing a null de-ref when the animation is being encoded.
        Fix the encoder to handle null timing functions.

        Test: animations/legacy-encoding-timing-function.html

        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (WebKit::PlatformCAAnimationRemote::Properties::encode const):
        (WebKit::PlatformCAAnimationRemote::Properties::decode):

2020-08-19  Alex Christensen  <achristensen@webkit.org>

        Fix null pointer crashes in network process after r265835
       ​https://bugs.webkit.org/show_bug.cgi?id=215626
        <rdar://problem/67268892>

        Call the correct CompletionHandler.  completionHandler has already been moved from at this point.
        This crash was being hit in the test, but the test recovered from it.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):

2020-08-19  Kate Cheney  <katherine_cheney@apple.com>

        Third party domains are not stored in the case of back/forward navigations
        https://bugs.webkit.org/show_bug.cgi?id=215595
        <rdar://problem/66642893>

        Reviewed by Chris Dumez.

        This patch adds the ability to retrieve loaded third party domains from the page
        synchronously to be stored in the CachedPage in the case of a
        back/forward navigation. 

        It also changes the functions loadedThirdPartyDomains and
        getLoadedThirdPartyDomains to loadedSubresourceDomains and
        getLoadedSubresourceDomains respectively based on the conversation from
        https://bugs.webkit.org/show_bug.cgi?id=215595.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageLoadedSubresourceDomains):
        (WKPageClearLoadedSubresourceDomains):
        (WKPageLoadedThirdPartyDomains): Deleted.
        (WKPageClearLoadedThirdPartyDomains): Deleted.
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _loadedSubresourceDomainsFor:completionHandler:]):
        (-[WKWebsiteDataStore _clearLoadedSubresourceDomainsFor:]):
        (-[WKWebsiteDataStore _loadedThirdPartyDomainsFor:completionHandler:]): Deleted.
        (-[WKWebsiteDataStore _clearLoadedThirdPartyDomainsFor:]): Deleted.
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getLoadedSubresourceDomains):
        (WebKit::WebPageProxy::clearLoadedSubresourceDomains):
        (WebKit::WebPageProxy::loadedThirdPartyDomains): Deleted.
        (WebKit::WebPageProxy::clearLoadedThirdPartyDomains): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::loadedSubresourceDomains const):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didCommitLoad):
        (WebKit::WebPage::didLoadFromRegistrableDomain):
        (WebKit::WebPage::getLoadedSubresourceDomains):
        (WebKit::WebPage::clearLoadedSubresourceDomains):
        (WebKit::WebPage::loadedThirdPartyDomains): Deleted.
        (WebKit::WebPage::clearLoadedThirdPartyDomains): Deleted.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::loadedSubresourceDomains const):
        * WebProcess/WebPage/WebPage.messages.in:

2020-08-19  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r261407): Sharing rich links from Twitter/Netflix via Messages is unreliable
        https://bugs.webkit.org/show_bug.cgi?id=215656
        <rdar://problem/67087352>

        Reviewed by Tim Horton.

        The WKWebView._clientNavigationsRunAtForegroundPriority SPI was not working for the
        MessagesViewService because the view is unparented and PageClient::isApplicationVisible()
        would not work return accurate results when [view window] returns nil. It is very
        unfortunate to have to rely on the view or the view's window to determine application
        visibility so this patch fixes this. We now rely on UIKit's visibility endowment to
        determine if the UIProcess is visible, using RunningBoard API. I have verified that the
        visibility endowment properly gets propagated from the host application to the view
        service when the application is a view service and I have verified that this detects
        the MessagesViewService as visible for the use-case at <rdar://problem/67087352>, which
        causes the WKWebView._clientNavigationsRunAtForegroundPriority SPI to work as intended.

        Note that when the application does not have the visibility endowment, we still allow
        it to take a foreground assertion for client navigations if the process is allowed to
        run in the background for an extended period of time, according to RunningBoard. This
        allows the SPI to work for daemons (like maild) which rely on it.

        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld):
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::canTakeForegroundAssertions):
        (WebKit::PageClientImpl::isApplicationVisible): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::shouldForceForegroundPriorityForClientNavigation const):

2020-08-19  Youenn Fablet  <youenn@apple.com>

        WebSocketChannel::didClose should correctly compute whether a closing handshake was received
        https://bugs.webkit.org/show_bug.cgi?id=215644

        Reviewed by Darin Adler.

        Covered by LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html with NSURLSession code path enabled.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::didClose):
        As noted by Jiten Mehta, absence of closing handshake from the server is notified by WebSocketChannel::CloseEventCodeAbnormalClosure.
        Update check accordingly.

2020-08-18  Alex Christensen  <achristensen@webkit.org>

        WKWebViews using fastServerTrustEvaluationEnabled should only allow legacy TLS for main resource loads
        https://bugs.webkit.org/show_bug.cgi?id=215626
        <rdar://problem/67268892>

        Reviewed by Darin Adler.

        We have introduced public API webView:authenticationChallenge:shouldAllowDeprecatedTLS: in WKNavigationDelegate to allow
        applications to choose whether to allow TLS 1.0 or 1.1 connections.  We don't want to break this API or break existing third party
        apps that load pages that load third party subresources that use TLS 1.0 or 1.1.

        However, we do want Safari, which uses fastServerTrustEvaluationEnabled SPI, to silently fail subresource loads that use TLS 1.0 or 1.1.
        This matches the current behavior of Chrome and Firefox, which was not implemented in those other browsers when we decided to ask about subresources.

        Covered by an API test.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):

2020-08-18  Jer Noble  <jer.noble@apple.com>

        [Mac] Unhandled keyDown: events cause a system beep in full screen mode
        https://bugs.webkit.org/show_bug.cgi?id=215596
        <rdar://problem/65823962>

        Reviewed by Darin Adler.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController noResponderFor:]):

2020-08-18  Youenn Fablet  <youenn@apple.com>

        NetworkSocketChannel should delay sending back error message as done by NetworkSocketStream
        https://bugs.webkit.org/show_bug.cgi?id=215563

        Reviewed by Alex Christensen.

        Apply same policy as NetworkSocketStream in case of WebSocket connection error.
        Covered by http/tests/websocket/tests/hybi/closed-port-delay.html with NSURLSession WebSocket code path.

        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::NetworkSocketChannel):
        (WebKit::NetworkSocketChannel::didClose):
        (WebKit::NetworkSocketChannel::didReceiveMessageError):
        (WebKit::NetworkSocketChannel::sendDelayedError):
        * NetworkProcess/NetworkSocketChannel.h:

2020-08-17  Chris Dumez  <cdumez@apple.com>

        AudioContext.getOutputTimestamp() is missing
        https://bugs.webkit.org/show_bug.cgi?id=215591

        Reviewed by Darin Adler.

        * GPUProcess/media/RemoteAudioDestinationManager.cpp:
        * WebProcess/GPU/media/RemoteAudioBusData.h:
        (WebKit::RemoteAudioBusData::encode const):
        (WebKit::RemoteAudioBusData::decode):
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
        (WebKit::RemoteAudioDestinationProxy::renderBuffer):

2020-08-17  Per Arne Vollan  <pvollan@apple.com>

        Assert failure after r265715
        https://bugs.webkit.org/show_bug.cgi?id=215592

        Reviewed by Darin Adler.

        The change set r265715 introduced an assert failure in AuthenticationManager::initializeConnection. This
        happens because after r265715 the new XPC event handler set in AuthenticationManager::initializeConnection,
        will no longer be called on the main thread. This patch addresses this issue by dispatching this work on
        the main thread.

        No new tests, covered by existing tests.

        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
        (WebKit::AuthenticationManager::initializeConnection):

2020-08-17  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Avoid waiting for Launch Services on every load
        https://bugs.webkit.org/show_bug.cgi?id=215569

        Reviewed by Darin Adler.

        Currently, we are waiting for the Launch Services database to be present on every load in the WebContent process.
        It should be sufficient to wait only on the first load. Since we now are waiting only once per WebContent process,
        increase the maximum wait time from 1s to 5s.

        No new tests, covered by existing tests.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):

2020-08-17  Jer Noble  <jer.noble@apple.com>

        [Mac] Add Experimental Feature preference for SW VP9
        https://bugs.webkit.org/show_bug.cgi?id=215043
        <rdar://problem/66400034>

        Reviewed by Darin Adler.

        Follow up fix: during a rebase, a line deletion was dropped which causes the SW decoder to
        always be registered regardless of the new setting.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::enableVP9Decoder):
        (WebKit::WebProcess::enableVP9SWDecoder):

2020-08-17  Youenn Fablet  <youenn@apple.com>

        Remove message check in WebSocketTask::readNextMessage
        https://bugs.webkit.org/show_bug.cgi?id=215561

        Reviewed by Alex Christensen.

        This if check was added as a workaround to cases where both error and message were null.
        This is no longer the case as per running existing tests with NSURLSession WebSocket code path on BigSur.

        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::readNextMessage):

2020-08-17  Youenn Fablet  <youenn@apple.com>

        Remove Cocoa WebSocketTask::send workaround
        https://bugs.webkit.org/show_bug.cgi?id=215564

        Reviewed by Alex Christensen.

        Covered by existing tests run in Debug.

        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::sendString):
        (WebKit::WebSocketTask::sendData):

2020-08-17  David Kilzer  <ddkilzer@apple.com>

        Clean up DragApplicationFlags after switch to OptionSet<>
        <https://webkit.org/b/215349>

        Reviewed by Darin Adler.

        Change WebCore::DragApplicationFlags to an enum class.

        * UIProcess/API/gtk/DropTargetGtk3.cpp:
        (WebKit::DropTarget::drop):
        - Switch to use OptionSet<WebCore::DragApplicationFlags>.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::applicationFlagsForDrag):
        * WebProcess/WebPage/WebPage.h:
        - Update forward declaration.

2020-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Remove support for NPAPI plugins
        https://bugs.webkit.org/show_bug.cgi?id=215503

        Reviewed by Darin Adler.

        * PlatformGTK.cmake:
        * PluginProcess/unix/PluginControllerProxyUnix.cpp: Removed.
        * PluginProcess/unix/PluginProcessMainUnix.cpp: Removed.
        * PluginProcess/unix/PluginProcessUnix.cpp: Removed.
        * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Removed.
        * Shared/Plugins/unix/PluginSearchPath.cpp: Removed.
        * Shared/Plugins/unix/PluginSearchPath.h: Removed.
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitMimeInfo.cpp:
        (webkit_mime_info_ref):
        (webkit_mime_info_unref):
        (webkit_mime_info_get_mime_type):
        (webkit_mime_info_get_description):
        (webkit_mime_info_get_extensions):
        * UIProcess/API/glib/WebKitMimeInfoPrivate.h: Removed.
        * UIProcess/API/glib/WebKitPlugin.cpp:
        (webkit_plugin_get_name):
        (webkit_plugin_get_description):
        (webkit_plugin_get_path):
        (webkit_plugin_get_mime_info_list):
        * UIProcess/API/glib/WebKitPluginPrivate.h: Removed.
        * UIProcess/API/glib/WebKitSettings.cpp:
        (webKitSettingsSetProperty):
        (webKitSettingsGetProperty):
        (webkit_settings_class_init):
        (webkit_settings_get_enable_plugins):
        (webkit_settings_set_enable_plugins):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_set_additional_plugins_directory):
        (webkit_web_context_get_plugins):
        (webkit_web_context_get_plugins_finish):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewLoadFail):
        * UIProcess/API/glib/WebKitWebsiteData.cpp:
        (recordContainsSupportedDataTypes):
        (toWebKitWebsiteDataTypes):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (toWebsiteDataTypes):
        * UIProcess/API/gtk/WebKitError.h:
        * UIProcess/API/gtk/WebKitMimeInfo.h:
        * UIProcess/API/gtk/WebKitPlugin.h:
        * UIProcess/API/gtk/WebKitSettings.h:
        * UIProcess/API/gtk/WebKitWebContext.h:
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitError.h:
        * UIProcess/API/wpe/WebKitMimeInfo.h:
        * UIProcess/API/wpe/WebKitPlugin.h:
        * UIProcess/API/wpe/WebKitSettings.h:
        * UIProcess/API/wpe/WebKitWebContext.h:
        * UIProcess/API/wpe/WebKitWebsiteData.h:
        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bubblewrapSpawn):
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Removed.
        * UIProcess/Plugins/gtk/PluginInfoCache.h: Removed.
        * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: Removed.
        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Removed.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/gtk/WebPageProxyGtk.cpp:
        * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: Removed.
        * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h: Removed.
        * WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp: Removed.
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Removed.
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h: Removed.
        * WebProcess/Plugins/PluginController.h:
        * WebProcess/Plugins/PluginView.cpp:
        * WebProcess/Plugins/PluginView.h:

2020-08-17  Youenn Fablet  <youenn@apple.com>

        Set Sec-WebSocket-Protocol for WebSocket NSURLSession code path
        https://bugs.webkit.org/show_bug.cgi?id=215456
        <rdar://problem/66996369>

        Reviewed by Alex Christensen.

        Covered by existing protocol tests with NSURLSession code path enabled.
        http/tests/websocket/tests/hybi/set-protocol.html, http/tests/websocket/tests/hybi/workers/multiple-subprotocols.html
        Code change originating from Jiten Mehta.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::createWebSocketTask):
        Set Sec-WebSocket-Protocol to support WebSocket protocol negotiation.

2020-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r265725) [GTK][WPE] Several http/tests timeout/failures
        https://bugs.webkit.org/show_bug.cgi?id=215542

        Reviewed by Sergio Villar Senin.

        The problem is that ShareableResource is now using the dataSize member of IPCHandle to encode/decode the
        resource size, but SharedMemoryUnix is not encoding/decoding dataSize.

        * Platform/unix/SharedMemoryUnix.cpp:
        (WebKit::SharedMemory::IPCHandle::encode const):
        (WebKit::SharedMemory::IPCHandle::decode):

2020-08-14  Simon Fraser  <simon.fraser@apple.com>

        Scrolling sync changes in r261985 regressed CPU usage by ~2 ms/s
        https://bugs.webkit.org/show_bug.cgi?id=215529
        <rdar://problem/66866163>

        Reviewed by Geoff Garen.
        
        r261985 added two code paths that wake up the scrolling thread on every
        rendering update (triggered by displayDidRefresh()). One is a ping from
        the EventDispatcher thread, the other is a wake-and-block from the main
        thread. If the scrolling thread isn't active (no wheel events received recently),
        we can avoid both of these to reduce the number of CPU core wakeups.

        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):

2020-08-15  Tim Horton  <timothy_horton@apple.com>

        Live Web Content processes do not respect accent color if dynamically changed to "multicolor"
        https://bugs.webkit.org/show_bug.cgi?id=215523
        <rdar://problem/63941133>

        Reviewed by Wenson Hsieh.

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::setPreferenceValue):
        The NSUserDefaults syncing mechanism does not propagate defaults that are
        deleted or changed to nil.

        Allow nil, and fix up an assert that would fire for the same reason.

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

        Revert r263551
        https://bugs.webkit.org/show_bug.cgi?id=215530
        <rdar://problem/66961066>

        Reviewed by Geoffrey Garen.

        I was hoping to fix many developers' bugs, but it caused hangs and more hangs, so back to the status quo.
        https://bugs.webkit.org/show_bug.cgi?id=203547 will fix this the right way in the hopefully-not-too-distant future.

        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::setCookies):
        (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
        (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
        (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):

2020-08-14  Kate Cheney  <katherine_cheney@apple.com>

        Convert remaining SharedMemory::Handle to SharedMemory::IPCHandle
        https://bugs.webkit.org/show_bug.cgi?id=215471
        <rdar://problem/67024177>

        Reviewed by David Kilzer.

        Use the new struct for sending SharedMemory::Handle objects via IPC, so
        we can include the exact size of data (SharedMemory::Handle::size()
        rounds up to the nearest page), and verify these sizes match when decoding.

        In many cases, the size is not sent as a separate argument via IPC, so
        we can initialize the IPCHandle object with SharedMemory::Handle::size().

        We can remove the additional size parameter when it exists, because
        we are now passing IPCHandle which should include the size value.

        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
        (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged):
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
        Send SharedMemory::IPCHandle object instead of SharedMemory::Handle
        over IPC. 

        * NetworkProcess/ServiceWorker/WebSWOriginStore.cpp:
        (WebKit::WebSWOriginStore::sendStoreHandle):
        Since no additional size parameter is being sent in this function, we
        can use handle.size() as the IPCHandle::dataSize parameter.

        * Platform/SharedMemory.h:
        Remove encode/decode functions in SharedMemory::Handle.

        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::SharedMemory::Handle::encode const): Deleted.
        (WebKit::SharedMemory::Handle::decode): Deleted.
        * Platform/unix/SharedMemoryUnix.cpp:
        (WebKit::SharedMemory::IPCHandle::encode const):
        (WebKit::SharedMemory::IPCHandle::decode):
        * Platform/win/SharedMemoryWin.cpp:
        (WebKit::SharedMemory::IPCHandle::encode const):
        (WebKit::SharedMemory::IPCHandle::decode):
        (WebKit::SharedMemory::Handle::encode const): Deleted.
        (WebKit::SharedMemory::Handle::decode): Deleted.
        Remove SharedMemory::Handle encode/decode functions so we will not
        ever send a SharedMemory::Handle object over IPC accidentally in the future.

        * Shared/ShareableBitmap.cpp:
        (WebKit::ShareableBitmap::Handle::encode const):
        (WebKit::ShareableBitmap::Handle::decode):
        Keep m_size here because it is an IntSize object and is useful to
        check width/height parameters in the SharableBitmap object.

        * Shared/ShareableResource.cpp:
        (WebKit::ShareableResource::Handle::encode const):
        (WebKit::ShareableResource::Handle::decode):
        * Shared/WebCompiledContentRuleListData.cpp:
        (WebKit::WebCompiledContentRuleListData::encode const):
        (WebKit::WebCompiledContentRuleListData::decode):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::encodeSharedBuffer):
        (IPC::decodeSharedBuffer):
        * Shared/WebHitTestResultData.cpp:
        (WebKit::WebHitTestResultData::encode const):
        (WebKit::WebHitTestResultData::decode):
        More cases of converting between SharedMemory::Handle and
        SharedMemory::IPCHandle when encoding/decoding.

        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
        * UIProcess/VisitedLinkStore.cpp:
        (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
        * WebProcess/GPU/media/RemoteAudioBusData.h:
        (WebKit::RemoteAudioBusData::encode const):
        (WebKit::RemoteAudioBusData::decode):
        Since no additional size parameter is being sent in this function, we
        can use handle.size() as the IPCHandle::dataSize parameter.

        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:
        (WebKit::AudioMediaStreamTrackRenderer::storageChanged):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::storageChanged):
        * WebProcess/Storage/WebSWClientConnection.cpp:
        (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
        * WebProcess/Storage/WebSWClientConnection.h:
        * WebProcess/Storage/WebSWClientConnection.messages.in:
        * WebProcess/WebPage/VisitedLinkTableController.cpp:
        (WebKit::VisitedLinkTableController::setVisitedLinkTable):
        * WebProcess/WebPage/VisitedLinkTableController.h:
        * WebProcess/WebPage/VisitedLinkTableController.messages.in:
        * WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
        (WebKit::RemoteCaptureSampleManager::audioStorageChanged):
        * WebProcess/cocoa/RemoteCaptureSampleManager.h:
        * WebProcess/cocoa/RemoteCaptureSampleManager.messages.in:
        More cases of converting between SharedMemory::Handle and
        SharedMemory::IPCHandle when encoding/decoding.


2020-08-14  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Avoid changing XPC target queue inside XPC event handler
        https://bugs.webkit.org/show_bug.cgi?id=215460

        Reviewed by Darin Adler.

        In WebProcess::handleXPCEndpointMessages we currently change the XPC target queue for the XPC bootstrap connection while
        under the XPC event handler. This sometimes causes simulated crashes on iOS and should be avoided. According to the
        documentation in https://developer.apple.com/documentation/xpc/1448786-xpc_connection_set_target_queue?language=objc,
        there does not seem to be anything saying this is a programming error, but the simulated crash claims otherwise. This
        patch addresses this issue by changing the initial target queue for the XPC bootstrap connection from the main thread
        queue to a queue on a secondary thread. The WebKit initializer function needs to be called on the main thread, which
        is done by synchronously dispatching the call on the main thread. This patch also stops changing the event handler for
        the bootstrap connection, but instead adds the additional XPC handling to the current event handler.

        No new tests, since this is covered by existing tests. The handling of the Launch Services XPC endpoint message that
        this patch changes, is used to receive the Launch Services database from the Networking process. The Launch Services
        database is used in MIME type mapping APIs, and many tests would fail if this database was not received in the
        WebContent process.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceEventHandler):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/HandleXPCEndpointMessages.h: Added.
        * WebProcess/cocoa/HandleXPCEndpointMessages.mm: Added.
        (WebKit::handleXPCEndpointMessages):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const): Deleted.

2020-08-14  Kate Cheney  <katherine_cheney@apple.com>

        Convert SharedMemory::Handle to SharedMemory::IPCHandle WebPage image/pasteboard functions
        https://bugs.webkit.org/show_bug.cgi?id=215478
        <rdar://problem/67024582>

        Reviewed by Chris Dumez.

        Convert SharedMemory::Handle objects to SharedMemory::IPCHandle
        objects which automatically verify the size of data being sent.

        We can remove the additional size parameter being sent in many IPC
        messages along with the handle, now that both are stored in the
        IPCHandle struct.

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::setPromisedDataForImage):
        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
        No longer need size check, this is done in the IPCHandle::decode()
        function.
        (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebPasteboardProxy.cpp:
        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
        * UIProcess/WebPasteboardProxy.h:
        * UIProcess/WebPasteboardProxy.messages.in:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::saveImageToLibrary):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::dataSelectionForPasteboard):
        No longer need size check, this is done in the IPCHandle::decode()
        function.
        (WebKit::WebPageProxy::setPromisedDataForImage):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::writeItemsToPasteboard):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::bufferForType):
        (WebKit::WebPlatformStrategies::setBufferForType):
        (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
        No longer need size check, this is done in the IPCHandle::decode()
        function.
        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
        (WebKit::WebDragClient::declareAndWriteDragImage):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getDataSelectionForPasteboard):
        (WebKit::WebPage::performActionOnElement):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::getDataSelectionForPasteboard):

2020-08-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, revert r265213 and r265441
        https://bugs.webkit.org/show_bug.cgi?id=215089

        This logging is no longer needed, since the test seems to be passing reliably in internal automation now.

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

2020-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Notify the web process on drag leave
        https://bugs.webkit.org/show_bug.cgi?id=215373

        Reviewed by Adrian Perez de Castro.

        We missed this when implemented drag and drop support for GTK4.

        * UIProcess/API/gtk/DropTargetGtk4.cpp:
        (WebKit::DropTarget::leave): Call dragExited() and resetCurrentDragInformation() on WebPageProxy.

2020-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Do not accept drag operations when the matched target list is empty
        https://bugs.webkit.org/show_bug.cgi?id=215372

        Reviewed by Adrian Perez de Castro.

        Do not initialize m_selectionData if we don't have valid targets.

        * UIProcess/API/gtk/DropTargetGtk3.cpp:
        (WebKit::DropTarget::accept):
        (WebKit::DropTarget::leaveTimerFired):

2020-08-13  Brady Eidson  <beidson@apple.com>

        (WK2 only) gamepad mapping stops being reported as “standard” in new tabs.
        rdar://problem/66946505 and https://bugs.webkit.org/show_bug.cgi?id=215486

        Reviewed by Tim Horton.

        Covered by new API test.
        
        Get rid of the premature optimization that was "full gamepaddata" vs "condensed gamepaddata"
        
        In practice, the actual button and axis values are larger than the mapping and id, so
        not much IPC was being saved.

        * Shared/Gamepad/GamepadData.cpp:
        * Shared/Gamepad/GamepadData.h:

        * UIProcess/Gamepad/UIGamepad.cpp:
        (WebKit::UIGamepad::gamepadData const):
        (WebKit::UIGamepad::condensedGamepadData const): Deleted.
        (WebKit::UIGamepad::fullGamepadData const): Deleted.
        * UIProcess/Gamepad/UIGamepad.h:

        * UIProcess/Gamepad/UIGamepadProvider.cpp:
        (WebKit::UIGamepadProvider::snapshotGamepads):

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

2020-08-13  Kate Cheney  <katherine_cheney@apple.com>

        Create SharedMemory::IPCHandle object to validate the size of SharedMemory::Handle objects sent over IPC
        https://bugs.webkit.org/show_bug.cgi?id=215288
        <rdar://problem/60870795>

        Reviewed by David Kilzer.

        Part 1 of a multi-patch plan to convert all SharedMemory::Handle
        objects being sent over IPC to use SharedMemory::IPCHandle objects instead.

        * Platform/SharedMemory.h:
        (WebKit::SharedMemory::IPCHandle::IPCHandle):
        * Platform/cocoa/SharedMemoryCocoa.cpp:
        (WebKit::SharedMemory::IPCHandle::encode const):
        (WebKit::SharedMemory::IPCHandle::decode):
        Validate the size of the data sent in the IPCHandle::decode()
        function.
        * Platform/unix/SharedMemoryUnix.cpp:
        (WebKit::SharedMemory::IPCHandle::encode const):
        (WebKit::SharedMemory::IPCHandle::decode):
        * Platform/win/SharedMemoryWin.cpp:
        Implement IPCHandle encode and decode for all platforms for when we remove
        SharedMemory::Handle encode/decode functions.

2020-08-13  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed non-unified build fix.

        No new tests needed.

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::requestEnterFullScreen): Add missing WebCore:: namespace
        prefix to usage of WebCore::FullscreenManager.

2020-08-13  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r260684): Messages YouTube inline video: after Multitasking away and Back, Audio is heard but icon indicates "muted"
        https://bugs.webkit.org/show_bug.cgi?id=215453
        <rdar://problem/66136673>

        Reviewed by Tim Horton.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsDoingSnapshotSequence):
        (WebKit::WebPageProxy::setShouldFireEvents): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKApplicationStateTrackingView.mm:
        (-[WKApplicationStateTrackingView _willBeginSnapshotSequence]):
        (-[WKApplicationStateTrackingView _didCompleteSnapshotSequence]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setIsDoingSnapshotSequence):
        (WebKit::WebPage::setShouldFireEvents): Deleted.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-08-13  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed, reverting r265520.

        Invalid sandbox change

        Reverted changeset:

        "[macOS] Deny access to directory for compiled WebKit
        sandboxes"
        https://bugs.webkit.org/show_bug.cgi?id=215384
        https://trac.webkit.org/changeset/265520

2020-08-12  Keith Rollin  <krollin@apple.com>

        Remove the need for defining USE_NEW_BUILD_SYSTEM
        https://bugs.webkit.org/show_bug.cgi?id=215439

        Reviewed by Darin Adler.

        When building WebKit for XCBuild, we currently require that the
        external build system (such as the Makefile, build-webkit, etc.)
        defines the USE_NEW_BUILD_SYSTEM=YES build setting. This build setting
        controls parts of our build instructions that are sensitive to when
        XCBuild or the Legacy build system are being used. Notably, we need to
        know when to use our custom “copy and modify” scripts with copying
        certain header files (used with the Legacy build system) vs. using the
        enhanced Copy Headers build phase that’s enabled with
        APPLY_RULES_IN_COPY_HEADERS=YES (introduced with and used by XCBuild).
        The choice of which method to copy headers is used is controlled by
        USE_NEW_BUILD_SYSTEM.

        There is no built-in build setting that we can probe to help us
        determine which approach to take when copying and modifying headers,
        which is why we need to define USE_NEW_BUILD_SYSTEM ourselves. But it
        turns out that we can *detect* which build system is being used by
        taking advantage of a subtle difference between the two systems. As
        noted in:

            https://developer.apple.com/documentation/xcode-release-notes/build-system-release-notes-for-xcode-10

            “When an .xcconfig file contains multiple assignments of the same
             build setting, later assignments using $(inherited) or
             $(<setting_name>) will inherit from earlier assignments in the
             .xcconfig. The legacy build system caused every use of
             $(inherited) or $(<setting_name>) skip any other values defined
             within the .xcconfig.”

        This difference can be exploited as follows:

            WK_WHICH_BUILD_SYSTEM = not_
            WK_WHICH_BUILD_SYSTEM = $(inherited)legacy
            WK_USE_NEW_BUILD_SYSTEM = $(WK_USE_NEW_BUILD_SYSTEM_$(WK_WHICH_BUILD_SYSTEM))
            WK_USE_NEW_BUILD_SYSTEM_legacy = NO
            WK_USE_NEW_BUILD_SYSTEM_not_legacy = YES

        We can then use WK_USE_NEW_BUILD_SYSTEM where we used to use the
        externally-defined USE_NEW_BUILD_SYSTEM.

        No new tests -- no new or changed functionality.

        * Configurations/Base.xcconfig:
        * Configurations/WebKit.xcconfig:
        * WebKit.xcodeproj/project.pbxproj:

2020-08-12  Alex Christensen  <achristensen@webkit.org>

        Fail preconnect requests to deprecated TLS instead of allowing application to show warning
        https://bugs.webkit.org/show_bug.cgi?id=215424
        <rdar://problem/66784116>

        Reviewed by Geoffrey Garen.

        Preconnecting is just a suggestion, so if the content really wants to load something from the deprecated TLS server,
        we will see the warning when the load actually happens.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):

2020-08-12  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Allow additional iokit-get-property to support HEIF images
        https://bugs.webkit.org/show_bug.cgi?id=215431
        <rdar://problem/66760775>

        Reviewed by Per Arne Vollan.

        Allow the WebContent process to read the HEVCCanDecodeTileToCanvas property.

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

2020-08-12  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Fix iokit get property sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=215430
        <rdar://problem/65290967>

        Reviewed by Brent Fulgham.

        The WebContent process' sandbox on macOS needs to allow querying the iokit property "acoustic-id".

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

2020-08-12  Peng Liu  <peng.liu6@apple.com>

        Add the support to return to element fullscreen from picture-in-picture
        https://bugs.webkit.org/show_bug.cgi?id=215305

        Reviewed by Jer Noble.

        This patch replaces WKFullScreenViewControllerVideoFullscreenModelClient
        with WKFullScreenWindowControllerVideoFullscreenModelClient. We need to do
        that because the instance of WKFullScreenViewControllerVideoFullscreenModelClient
        will be destroyed after the container element exits fullscreen while the video
        element enters picture-in-picture.

        The instance of WKFullScreenWindowControllerVideoFullscreenModelClient
        will always exist when the WKFullScreenWindowController instance is alive,
        so that it can receive callbacks from the VideoFullscreenInterfaceAVKit instance
        to implement the "return to element fullscreen from picture-in-picture" feature.

        This patch supports the following transitions:
        element fullscreen -> picture-in-picture (through user gestures)
        element fullscreen -> picture-in-picture (through the PiP button)
        picture-in-picture -> element fullscreen (when the tab is visible)
        picture-in-picture -> element fullscreen (when the tab is invisible)
        picture-in-picture -> element fullscreen (when the browser is in background)
        picture-in-picture -> inline (when the browser is in foreground)
        exit picture-in-picture when the browser is in background

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenModelContext::fullscreenWillReturnToInline):
        (WebKit::VideoFullscreenModelContext::prepareToExitFullscreen):
        Notify clients to prepare for the stop of fullscreen/picture-in-picture.
        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
        Fix issues that increase the client count unnecessarily.
        (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
        Call m_page->fullscreenMayReturnToInline() earlier.
        (WebKit::VideoFullscreenManagerProxy::fullscreenMayReturnToInline):
        Ditto.
        (WebKit::VideoFullscreenManagerProxy::fullscreenWillReturnToInline):
        Notify VideoFullscreenManager to prepare for exiting picture-in-picture or video fullscreen
        and report the destination rectangle of the exit picture-in-picture or video fullscreen animations.

        * UIProcess/WebFullScreenManagerProxy.cpp:
        (WebKit::WebFullScreenManagerProxy::requestEnterFullScreen):
        * UIProcess/WebFullScreenManagerProxy.h:
        Add a function requestEnterFullScreen() so that we can request an element to enter fullscreen
        from the UI process side.

        * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
        * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
        (-[WKFullScreenViewController initWithWebView:]):
        (-[WKFullScreenViewController dealloc]):
        (-[WKFullScreenViewController videoControlsManagerDidChange]):
        (-[WKFullScreenViewController setAnimatingViewAlpha:]):
        (-[WKFullScreenViewController _cancelAction:]):
        (WKFullScreenViewControllerVideoFullscreenModelClient::setParent): Deleted.
        (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface): Deleted.
        (WKFullScreenViewControllerVideoFullscreenModelClient::interface const): Deleted.
        (-[WKFullScreenViewController willEnterPictureInPicture]): Deleted.
        (-[WKFullScreenViewController didEnterPictureInPicture]): Deleted.
        (-[WKFullScreenViewController failedToEnterPictureInPicture]): Deleted.
        Minor clean-ups and remove code related to WKFullScreenViewControllerVideoFullscreenModelClient.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h:
        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
        (WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
        (WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
        (-[WKFullScreenWindowController initWithWebView:]):
        (-[WKFullScreenWindowController dealloc]):
        (-[WKFullScreenWindowController enterFullScreen]):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController requestEnterFullScreen]):
        (-[WKFullScreenWindowController requestExitFullScreen]):
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        (-[WKFullScreenWindowController videoControlsManagerDidChange]):
        (-[WKFullScreenWindowController willEnterPictureInPicture]):
        (-[WKFullScreenWindowController didEnterPictureInPicture]):
        (-[WKFullScreenWindowController failedToEnterPictureInPicture]):
        (-[WKFullScreenWindowController prepareToExitPictureInPicture]):
        (-[WKFullScreenWindowController didExitPictureInPicture]):
        Add WKFullScreenWindowControllerVideoFullscreenModelClient and implement the support
        to "restore fullscreen from picture-in-picture".

        * WebProcess/FullScreen/WebFullScreenManager.cpp:
        (WebKit::WebFullScreenManager::enterFullScreenForElement):
        (WebKit::WebFullScreenManager::requestEnterFullScreen):
        * WebProcess/FullScreen/WebFullScreenManager.h:
        * WebProcess/FullScreen/WebFullScreenManager.messages.in:
        Add the interface requestEnterFullScreen() and the corresponding IPC message.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::prepareForVideoFullscreen):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        Add the interface to prepare for video fullscreen standby. The web process can
        use this interface to create a VideoFullscreenManager instance to avoid the
        scenario that an IPC message comes from the VideoFullscreenManagerProxy but
        the VideoFullscreenManager instance is not constructed yet.

        * WebProcess/cocoa/VideoFullscreenManager.h:
        * WebProcess/cocoa/VideoFullscreenManager.messages.in:
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::fullscreenWillReturnToInline):
        (WebKit::VideoFullscreenManager::fullscreenMayReturnToInline): Deleted.
        Rename fullscreenMayReturnToInline() to fullscreenWillReturnToInline().
        In the UI process side, fullscreenMayReturnToInline() is used by
        VideoFullscreenManagerProxy to notify applications regarding UI
        changes (e.g., switch browser tabs).

2020-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebPageProxy::registerEditCommand should be robust against invalid undo step identifiers
        https://bugs.webkit.org/show_bug.cgi?id=215412
        <rdar://problem/66296820>

        Reviewed by Tim Horton.

        Add a `MESSAGE_CHECK` to avoid ever creating a `WebEditCommandProxy` with an invalid command identifier.

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

2020-08-12  Youenn Fablet  <youenn@apple.com>

        Refresh WritableStream up to spec
        https://bugs.webkit.org/show_bug.cgi?id=215267

        Reviewed by Geoff Garen.

        * Shared/WebPreferences.yaml:
        Add a dedicated runtime flag, off by default.

2020-08-12  Youenn Fablet  <youenn@apple.com>

        Enable H264 low latency code path by default for MacOS
        https://bugs.webkit.org/show_bug.cgi?id=215371

        Reviewed by Eric Carlson.

        Covered by existing tests, in particular platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html.

        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultWebRTCH264LowLatencyEncoderEnabled):

2020-08-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r261570): [GTK] Fails to send drop event to JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=215032

        Reviewed by Darin Adler.

        Handle custom data in drag and drop operations.

        * UIProcess/API/gtk/DragSourceGtk3.cpp:
        (WebKit::DragSource::DragSource):
        (WebKit::DragSource::begin):
        * UIProcess/API/gtk/DragSourceGtk4.cpp:
        (WebKit::DragSource::begin):
        * UIProcess/API/gtk/DropTargetGtk3.cpp:
        (WebKit::DropTarget::DropTarget):
        (WebKit::DropTarget::accept):
        (WebKit::DropTarget::dataReceived):
        * UIProcess/API/gtk/DropTargetGtk4.cpp:
        (WebKit::DropTarget::DropTarget):
        (WebKit::DropTarget::accept):

2020-08-11  Jer Noble  <jer.noble@apple.com>

        [Mac] Add Experimental Feature preference for SW VP9
        https://bugs.webkit.org/show_bug.cgi?id=215043
        <rdar://problem/66400034>

        Reviewed by Beth Dakin.

        * FeatureFlags/WebKit.plist:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultVP9SWDecoderEnabledOnBattery):
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::enableVP9Decoder):
        (WebKit::WebProcess::enableVP9SWDecoder):
        * WebProcess/WebProcess.h:

2020-08-11  Brady Eidson  <beidson@apple.com>

        Add a "use stored credentials" setting to WKWebView.
        <rdar://problem/63308019> and https://bugs.webkit.org/show_bug.cgi?id=215388

        Reviewed by Geoff Garen.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:

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

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::preconnectTo):
        (WebKit::WebPageProxy::setCanUseCredentialStorage):
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::canUseCredentialStorage):

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

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

2020-08-11  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Deny access to directory for compiled WebKit sandboxes
        https://bugs.webkit.org/show_bug.cgi?id=215384

        Reviewed by Brent Fulgham.

        A WebKit process on macOS should not be allowed access to the directory containing compiled sandboxes
        after entering the sandbox itself.

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

2020-08-11  Tim Horton  <timothy_horton@apple.com>

        iOS: Scrolling and touch events sporadically stop working after navigating
        https://bugs.webkit.org/show_bug.cgi?id=215368
        <rdar://problem/65801531>

        Reviewed by Wenson Hsieh.

        Test: fast/events/touch/ios/touch-event-stall-after-navigating-with-pending-asynchronous-touch-start.html

        WebPageProxy::handlePreventableTouchEvent keeps a counter of the number
        of outstanding "preventable" touch events that it is waiting to hear
        from the Web Content process about. This counter is incremented when the
        event is dispatched to the Web Content process's EventHandler queue,
        and decremented when the reply (whether it was handled or not) comes
        back from the Web Content process. While the counter is non-zero, all
        deferrable gestures remain deferred (and when it returns to zero, the
        WKDeferringGestureRecognizer gate is lifted, and events are allowed to flow).
        This means that it is very important that every event eventually reply
        about its handling status.

        Before this change, when the Web Content process is navigating, and reaches didCommitLoad,
        it cleared all queued touch events, without replying to to the UI process.
        Thus, there is a small window of time in which an incoming touch event will
        end up in the queue, *not* get dispatched/replied, and then get dropped on
        the floor in didCommitLoad. Most events do not meet this fate, because they
        are handled promptly, and commitLoad/didCommitLoad tend to be very quick.
        However, if the Web Content process ends up spending any significant amount
        of time under commitLoad (say, in an unload handler, or in media frameworks),
        any incoming touch events during that time will get lost, and the UI process'
        count of outstanding events will end up getting stuck non-zero.

        Fix this by always pretending that the page ate any events that were outstanding
        when didCommitLoad occurs, instead of just dropping them on the floor.

        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::doneWithTouchEvent):
        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::takeQueuedTouchEventsForPage):
        (WebKit::EventDispatcher::clearQueuedTouchEventsForPage): Deleted.
        (WebKit::EventDispatcher::getQueuedTouchEventsForPage): Deleted.
        Also, rename getQueuedTouchEventsForPage to takeQueuedTouchEventsForPage,
        since it removes the queue from EventDispatcher's set.

        * WebProcess/WebPage/EventDispatcher.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::touchEventSync):
        (WebKit::WebPage::didCommitLoad):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::cancelAsynchronousTouchEvents):

2020-08-11  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] gst-full standalone library support
        https://bugs.webkit.org/show_bug.cgi?id=215262

        Reviewed by Xabier Rodriguez-Calvar.

        Disable missing-plugins handling when gst-full is in use. The plugin installer doesn't make
        much sense for this scenario.

        * PlatformWPE.cmake:
        * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
        (webkitInstallMissingMediaPluginsPermissionRequestAllow):
        (webkitInstallMissingMediaPluginsPermissionRequestDeny):
        (webkit_install_missing_media_plugins_permission_request_get_description):
        * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewRequestInstallMissingMediaPlugins):
        * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp:
        * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.h:
        * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
        (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):

2020-08-10  Chris Dumez  <cdumez@apple.com>

        AuxiliaryProcess::didReceiveInvalidMessage() for WebPage::PerformDragControllerAction IPC
        https://bugs.webkit.org/show_bug.cgi?id=215341
        <rdar://problem/59344091>

        Reviewed by Alex Christensen.

        DragApplicationFlags is an enum containing flags. It was being sent over IPC as a DragApplicationFlags
        instead of an OptionSet<DragApplicationFlags>, and thus would fail enum value validation when decoding
        when more than one flag is set.

        * Scripts/webkit/messages.py:
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<DragData>::decode):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::applicationFlagsForDrag):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::performDragControllerAction):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-08-10  David Kilzer  <ddkilzer@apple.com>

        Use RefPtr for WebKit::WebOpenPanelResultListenerProxy
        <https://webkit.org/b/215252>
        <rdar://problem/65753821>

        Reviewed by Geoffrey Garen.

        Unable to create an API test for this.

        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::runOpenPanel):
        - Use RefPtr<WebOpenPanelResultListenerProxy> when passing
          `listener` into the block.

2020-08-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add more logging to diagnose editing/selection/ios/select-all-non-editable-text-using-keyboard.html
        https://bugs.webkit.org/show_bug.cgi?id=215089
        <rdar://problem/66282806>

        Reviewed by Tim Horton.

        Remove some unnecessary declarations that were only used for debug logging in WebKitTestRunner, and add some
        more logging to check whether the web view is even getting a call to select all from UIKit.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView selectAllForWebView:]):

2020-08-10  Sihui Liu  <sihui_liu@apple.com>

        Always suspend IDB work when network process is prepared to suspend
        https://bugs.webkit.org/show_bug.cgi?id=215239
        <rdar://problem/65690450>

        Reviewed by Geoffrey Garen.

        We do not suspend IDB work in the network process when there is an ongoing transaction because the network 
        process is going to ask the UI process to hold a background process assertion for it. However, it is possible 
        that the request from the network process does not reach the UI process in time: RunningBoard may already decide
        to suspend the network process after app is backgrounded and UI process drops the foreground assertion for the 
        network process. 

        In this case, IDB in the network process would continue its transaction and the network process will be killed 
        when it becomes suspened for holding database file locks. A network process crash can lead to a worse result 
        than suspending IDB work, which aborts ongoing transactions, because it will destroy all database connections 
        and transaction. Therefore, let's just suspend IDB work when the network process receives prepareToSuspend 
        message.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::suspend):
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::prepareToSuspend):

2020-08-10  Per Arne Vollan  <pvollan@apple.com>

        Add required entitlement for Catalyst
        https://bugs.webkit.org/show_bug.cgi?id=215244

        Reviewed by Darin Adler.

        The entitlement 'com.apple.private.webkit.use-xpc-endpoint' should be added to the WebContent process on Catalyst as well,
        since it is needed on all Apple platforms. This entitlement is needed to support direct XPC communication between WebKit
        processes, which is used to send the Launch Services database to the WebContent process from the Networking process. Also,
        add some more logging related to this, to detect if it takes a long time for the WebContent process to receive the database.

        * Scripts/process-entitlements.sh:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):

2020-08-09  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [macOS] Drag/drop an image of a unsupported format to an file input element should convert it to a supported format
        https://bugs.webkit.org/show_bug.cgi?id=212482
        <rdar://problem/63731672>

        Reviewed by Darin Adler.

        Move ImageUtilities.h and ImageUtilitiesCG.cpp from WebKit to WebCore.
        Use the image transcoding functions and shared WorkQueue from WebCore.

        * Platform/ImageUtilities.h: Removed.
        * Platform/cg: Removed.
        * SourcesCocoa.txt:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithImageTranscoding):
        (WebKit::m_transcodingQueue): Deleted.
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2020-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [ iOS wk2 ] editing/pasteboard/paste-without-nesting.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=215218
        <rdar://problem/66628493>

        Reviewed by Darin Adler.

        This test writes to the system pasteboard using `document.execCommand("Copy")`, and then immediately reads from
        the system pasteboard by triggering `document.execCommand("Paste")`. On rare occasions, this fails on iOS, where
        IPC messages for writing content to the pasteboard (e.g. `WebPasteboardProxy::WriteWebContentToPasteboard`) are
        asynchronous, but the IPC message to get the pasteboard change count before pasting (`GetPasteboardChangeCount`)
        is synchronous. This means that `Connection` may end up dispatching the sync `GetPasteboardChangeCount` IPC
        message before dispatching `WriteWebContentToPasteboard`, which causes the pasteboard read to fail, because the
        contents on the pasteboard have changed after starting to read from the pasteboard.

        Note that this is not a problem on macOS since all pasteboard writing IPC is synchronous. Instead of turning all
        of the async iOS pasteboard writing messages synchronous as well, we can fix this by adding a mechanism in
        `WebProcess` to keep track of outgoing async pasteboard write messages; then, before attempting to grab the
        change count when we start reading, wait for any of these pending async writes to finish before we continue.

        In a future patch, we could actually adopt this same mechanism in `SetPasteboardTypes` and neighboring IPC
        messages to turn these all asynchronous.

        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
        (WebKit::WebPasteboardProxy::writeURLToPasteboard):
        (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
        (WebKit::WebPasteboardProxy::writeImageToPasteboard):
        (WebKit::WebPasteboardProxy::writeStringToPasteboard):

        Call `didWriteToPasteboardAsynchronously` after we finish writing to the pasteboard asynchronously.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::changeCount):

        Before accessing changeCount, wait until any asynchronous calls to write to the system pasteboard have finished.

        (WebKit::WebPlatformStrategies::writeToPasteboard):

        Right before we send an async message to the UI process to write to the system pasteboard, notify `WebProcess`
        so that it can keep track of pending clipboard writes.

        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::willWriteToPasteboardAsynchronously):
        (WebKit::WebProcess::didWriteToPasteboardAsynchronously):
        (WebKit::WebProcess::waitForPendingPasteboardWritesToFinish):

        Wait for a maximum of 1 second for any outgoing pasteboard writing messages to return to the web process.

2020-08-07  Chris Dumez  <cdumez@apple.com>

        baseLatency attribute is missing on AudioContext interface
        https://bugs.webkit.org/show_bug.cgi?id=215277

        Reviewed by Eric Carlson.

        * GPUProcess/media/RemoteAudioDestinationManager.cpp:
        (WebKit::RemoteAudioDestination::framesPerBuffer const):
        (WebKit::RemoteAudioDestinationManager::createAudioDestination):
        * GPUProcess/media/RemoteAudioDestinationManager.h:
        * GPUProcess/media/RemoteAudioDestinationManager.messages.in:
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.cpp:
        (WebKit::RemoteAudioDestinationProxy::RemoteAudioDestinationProxy):
        * WebProcess/GPU/media/RemoteAudioDestinationProxy.h:

2020-08-07  John Wilander  <wilander@apple.com>

        Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses
        https://bugs.webkit.org/show_bug.cgi?id=215201
        <rdar://problem/57454633>

        Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen.

        This experimental feature is off by default.

        CNAME cloaking means a host resolves to a a different domain, potentially a
        third-party domain, as part of DNS resolution.

        This patch makes WebKit::NetworkDataTaskCocoa capture any CNAME cloaking for
        the first party host and stores it in a table in the WebKit::NetworkSession.
        It then checks first party subresource loads to see if they resolve to a
        different domain and if so, compare that domain to both the first party
        domain and its CNAME cloaking domain, if there is one. If there's a
        mismatch, it's deemed a case of third-party CNAME cloaking and any cookies
        set in the response of the cloaked subresource load will have their expiry
        capped to 7 days.

        The cases for capping expiry look like this (and are backed by test cases):

        First-party host  | First-party subdomain      | Capped expiry
        ------------------|----------------------------|--------------
        No CNAME cloaking | No CNAME cloaking          | No
        No CNAME cloaking | First-party CNAME cloaking | No
        No CNAME cloaking | Third-party CNAME cloaking | Yes
        CNAME cloaking    | No CNAME cloaking          | No
        CNAME cloaking    | Matching CNAME cloaking    | No
        CNAME cloaking    | First-party CNAME cloaking | No
        CNAME cloaking    | Third-party CNAME cloaking | Yes

        This patch makes use of two new CFNetwork SPIs on NSURLSessionTask:
        - _cookieTransformCallback
        - _resolvedCNAMEChain

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::resetParametersToDefaultValues):
            This reset now covers the new CNAME cloaking member variables.
        (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
            This function now also enables the CNAME cloaking code.
        (WebKit::NetworkProcess::setFirstPartyHostCNAMEDomainForTesting):
        (WebKit::NetworkProcess::setThirdPartyCNAMEDomainForTesting):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
            New IPC to forward test configuration.
        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::NetworkSession):
            Now picks up the flag for this feature.
        (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain):
            This is called from NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession()
            when there is CNAME cloaking for the first party host. This is done to make it
            possible to not cap the expiry of cookies if subsequent subresource loads have
            CNAME cloaking that matches the first-party host's CNAME cloaking. This happens
            when whole websites are hosted on edge networks.
            This function is also used by the test infrastructure to mock the DNS resolution
            for a first-party host.
        (WebKit::NetworkSession::firstPartyHostCNAMEDomain):
            This returns any captured CNAME cloaking for a host, if there is one.
        (WebKit::NetworkSession::resetCNAMEDomainData):
        * NetworkProcess/NetworkSession.h:
        (WebKit::NetworkSession::setCNAMECloakingMitigationEnabled):
        (WebKit::NetworkSession::cnameCloakingMitigationEnabled const):
        (WebKit::NetworkSession::setThirdPartyCNAMEDomainForTesting):
            This test functions allows us to mock the DNS resolution for a subresource.
        (WebKit::NetworkSession::thirdPartyCNAMEDomainForTesting const):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::hasCNAMEAndCookieTransformSPI):
        (WebKit::lastCNAMEDomain):
        (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession):
            This is called by NetworkDataTaskCocoa::didReceiveResponse() to capture any
            CNAME cloaking for the first-party host.
        (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking):
            This is called in the NetworkDataTaskCocoa constructor and in
            NetworkDataTaskCocoa::willPerformHTTPRedirection() and sets the new
            _cookieTransformCallback SPI property on the task which will check the
            response for any third-party CNAME cloaking and cap the expiry of incoming
            cookies accordingly.
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
            This now calls
            NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking().
        (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
            This now calls
            NetworkDataTaskCocoa::updateFirstPartyInfoForTaskAndSession().
        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
            This now calls
            NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking().
        * Shared/ResourceLoadStatisticsParameters.h:
            Now holds a WebCore::CNAMECloakingMitigationEnabled flag.
        (WebKit::ResourceLoadStatisticsParameters::encode const):
        (WebKit::ResourceLoadStatisticsParameters::decode):
        * Shared/WebPreferences.yaml:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting):
            Used to mock CNAME resolution data.
        (WKWebsiteDataStoreSetResourceLoadStatisticsThirdPartyCNAMEDomainForTesting):
            Used to mock CNAME resolution data.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setFirstPartyHostCNAMEDomainForTesting):
        (WebKit::NetworkProcessProxy::setThirdPartyCNAMEDomainForTesting):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
            Now handles the WebCore::CNAMECloakingMitigationEnabled flag.
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
            Now handles the WebCore::CNAMECloakingMitigationEnabled flag.
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyHostCNAMEDomainForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsThirdPartyCNAMEDomainForTesting):
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove UIScriptController.removeAllDynamicDictionaries()
        https://bugs.webkit.org/show_bug.cgi?id=215207

        Reviewed by Sam Weinig.

        See Tools/ChangeLog for more detail.

        * Platform/spi/ios/UIKitSPI.h:

2020-08-06  Kenneth Russell  <kbr@chromium.org>

        Implement createImageBitmap(ImageData)
        https://bugs.webkit.org/show_bug.cgi?id=183438

        Reviewed by Dean Jackson.

        Add "AlphaPremultiplication destFormat" argument to putImageData,
        to handle creation of non-premultiplied ImageBitmaps from
        ImageData.

        * GPUProcess/graphics/RemoteImageBufferProxy.h:
        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
        (WebKit::ImageBufferShareableBitmapBackend::putImageData):
        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:
        * WebProcess/GPU/graphics/RemoteImageBuffer.h:
        (WebKit::RemoteImageBuffer::putImageData):

2020-08-06  David Kilzer  <ddkilzer@apple.com>

        WTF::makeString() should handle enum values
        <https://webkit.org/b/214906>

        Reviewed by Sam Weinig.

        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::Connection::sendMessage):
        * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
        (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
        - Update to take advantage of enum support in WTF::makeString().

2020-08-06  Jer Noble  <jer.noble@apple.com>

        [Mac,WK2] REGRESSION(r262322): ScreenTime overlay is hidden in fullscreen mode
        https://bugs.webkit.org/show_bug.cgi?id=215222
        <rdar://problem/65871844>

        Reviewed by Eric Carlson.

        During a refactor, a call to -[NSWindow setAutodisplay:YES] was dropped (in addition to a call to
        NSEnableScreenUpdates(), but that has a 1s timeout so its effects aren't persistent). This meant
        all NSViews added to that window need -display called on them explicitly in order to paint, and
        so subviews like the ScreenTime overlay is never drawn.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):

2020-08-06  Truitt Savell  <tsavell@apple.com>

        Unreviewed, reverting r265328.

        Broke 17 MediaRecorder tests.

        Reverted changeset:

        "Add support for MediaRecorder bitrate options"
        https://bugs.webkit.org/show_bug.cgi?id=214973
        https://trac.webkit.org/changeset/265328

2020-08-06  Youenn Fablet  <youenn@apple.com>

        Add support for MediaRecorder bitrate options
        https://bugs.webkit.org/show_bug.cgi?id=214973

        Reviewed by Eric Carlson.

        Serialize options when creating remote media recorder.

        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::create):
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        (WebKit::RemoteMediaRecorderManager::createRecorder):
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::startRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
        * WebProcess/GPU/webrtc/MediaRecorderProvider.h:

2020-08-06  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Wrong argument order for clone syscall seccomp filter on s390x
        https://bugs.webkit.org/show_bug.cgi?id=215212

        Reviewed by Michael Catanzaro.

        Patch based on this Flatpak pull request:
        https://github.com/flatpak/flatpak/pull/3777

        No new tests needed.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::setupSeccomp): Add preprocessor guard to choose the correct
        clone() system call argument on S390.

2020-08-06  James Savage  <james.savage@apple.com>

        Could not find module 'WebKit' for target 'armv7-apple-ios'
        <https://bugs.webkit.org/show_bug.cgi?id=215190>
        <rdar://problem/65642049>

        Reviewed by Brady Eidson.

        * SwiftOverlay/Configurations/WebKitSwiftOverlayTests.xcconfig: Define
        SWIFT_MODULE_ONLY_ARCHS to emit other architectures.

2020-08-05  Tim Horton  <timothy_horton@apple.com>

        Remove all references to non-existent 10.16
        https://bugs.webkit.org/show_bug.cgi?id=215202

        Reviewed by Wenson Hsieh.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/Version.xcconfig:
        * Configurations/WebKitTargetConditionals.xcconfig:
        * Scripts/process-entitlements.sh:
        * WebProcess/com.apple.WebProcess.sb.in:

2020-08-05  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Sandbox extension token not cleared from memory
        https://bugs.webkit.org/show_bug.cgi?id=215136

        Reviewed by Geoffrey Garen.

        As a security mitigation, an invalidated sandbox extension should have its token cleared from memory.

        No new tests, covered by existing tests.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::SandboxExtensionImpl::m_length):
        (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):

2020-08-05  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Remove obsolete sandbox extension after r264178
        https://bugs.webkit.org/show_bug.cgi?id=215154

        Reviewed by Brent Fulgham.

        After r264178, the code related to issuing an extension to com.apple.lsd.mapdb is obsolete, and should be removed.

        No new tests, covered by existing tests.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * 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):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-08-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Keyboard shortcuts and arrow key scrolling stop working after navigating via swipe gesture
        https://bugs.webkit.org/show_bug.cgi?id=215137
        <rdar://problem/65082979>

        Reviewed by Tim Horton.

        The process of starting a navigation swipe gesture causes the first responder (in this case, WKContentView) to
        resign. Subsequently, nothing makes the content view first responder again once the navigation gesture ends,
        even if the gesture is cancelled and we don't end up navigating. This results in several symptoms, two of which
        are that keyboard shortcuts stop working, and pressing arrow keys does not scroll the web view after ending the
        swipe gesture.

        To mitigate this, add a mechanism to have the web view remember that our content view was first responder before
        calling `-startInteractiveTransition:`; after ending the interactive transition (i.e. swipe gesture), we then
        restore the web view's content view as first responder if it is not already first responder (and it is also
        parented, which is not the case when swiping back to close a newly opened tab in Safari).

        Test:   NavigationSwipeTests.RestoreFirstResponderAfterNavigationSwipe
                NavigationSwipeTests.DoNotBecomeFirstResponderAfterNavigationSwipeIfWebViewIsUnparented

        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _navigationGestureDidBegin]):
        (-[WKWebView _navigationGestureDidEnd]):

2020-08-04  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed build fix after r265263
        https://bugs.webkit.org/show_bug.cgi?id=215139
        <rdar://problem/66501746>

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-08-04  Devin Rousso  <drousso@apple.com>

        "DoubleDown Casino" respin button stops working with trackpad
        https://bugs.webkit.org/show_bug.cgi?id=215146
        <rdar://problem/64668138>

        Reviewed by Tim Horton.

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

2020-08-04  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue a temporary extension to the MobileGestalt daemon when the MobileGestalt cache is invalid
        https://bugs.webkit.org/show_bug.cgi?id=214965

        Unreviewed, address review comments.

        Add comment explaining why a set of MobileGestalt queries are performed when starting up the WebContent process on iOS.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-08-04  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Check that Accessibility is enabled when receiving the enable Accessibility notification
        https://bugs.webkit.org/show_bug.cgi?id=215112
        <rdar://problem/66498397>

        Reviewed by Youenn Fablet.

        As a security mitigation, return early when handling this notification if Accessibility is not enabled.

        API test: WebKit.AccessibilityHasNoPreferencesServiceAccessWhenPostingNotification

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::registerNotificationObservers):

2020-08-04  Brent Fulgham  <bfulgham@apple.com>

        Limit 'com.apple.webkit.microphone' use to macOS and MacCatalyst 
        https://bugs.webkit.org/show_bug.cgi?id=215139
        <rdar://problem/66501746>

        Reviewed by Eric Carlson.

        We only need the 'com.apple.webkit.microphone' Sandbox Extension at startup on
        macOS and MacCatalyst (and even on those platforms, only until <rdar://problem/29448368>
        is fixed).

        We should not issue this extension on the iOS family of targets.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-08-04  Per Arne Vollan  <pvollan@apple.com>

        [iOS Simulator] Assert under WebPage::platformDidReceiveLoadParameters
        https://bugs.webkit.org/show_bug.cgi?id=215108

        Reviewed by Youenn Fablet.

        This asserts because it appears that the WebContent and Networking process do not have the required entitlement
        com.apple.private.webkit.use-xpc-endpoint on the iOS Simulator. Add the entitlement for simulator.
 
        No new tests, covered by existing tests.

        * Resources/ios/XPCService-embedded-simulator.entitlements:

2020-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Allow -accessoryDone to blur the focused element on iPad when AutoFilling strong passwords
        https://bugs.webkit.org/show_bug.cgi?id=215105
        <rdar://problem/65143984>

        Reviewed by Tim Horton.

        `-accessoryDone` is now used to dismiss the strong password AutoFill keyboard after choosing a password on iOS,
        due to how it hides the keyboard without causing the content view to resign first responder; being stuck in a
        state where the content view is not first responder causes several issues when choosing strong passwords on iOS,
        such as keyboard shortcuts no longer working.

        On iPad, to ensure that `-accessoryDone` actually dismisses the keyboard, we need to additionally teach
        `-endEditingAndUpdateFocusAppearanceWithReason:` (when given `EndEditingReasonAccessoryDone`) to allow the
        focused element to blur when dismissing the strong password input view.

        Test: KeyboardInputTests.TestWebViewAccessoryDoneDuringStrongPasswordAssistance

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

        Refactor this logic into a local helper lambda with early returns, instead of using a single if statement.

2020-08-03  Youenn Fablet  <youenn@apple.com>

        Move user gesture propagation over promise behind a feature flag
        https://bugs.webkit.org/show_bug.cgi?id=215014

        Reviewed by Eric Carlson.

        Add a preference, on by default.

        * Shared/WebPreferences.yaml:

2020-08-03  Alex Christensen  <achristensen@webkit.org>

        Null check parentProcessConnection when creating a NetworkDataTaskCocoa
        https://bugs.webkit.org/show_bug.cgi?id=215109
        <rdar://problem/64853922>

        Reviewed by Chris Dumez.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        Null check parentProcessConnection.  Otherwise, we can dereference null and crash between disconnecting with the parent process and terminating,
        which isn't the worst time to crash because we are trying to terminate anyways.  But we may as well not crash.

2020-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove the ENABLE_DATA_INTERACTION feature flag
        https://bugs.webkit.org/show_bug.cgi?id=215091

        Reviewed by Megan Gardner.

        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/DragDropInteractionState.h:
        * UIProcess/ios/DragDropInteractionState.mm:
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView setUpInteraction]):
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:

2020-08-03  Tim Horton  <timothy_horton@apple.com>

        Fix the macCatalyst build

        * UIProcess/EndowmentStateTracker.mm:
        (WebKit::EndowmentStateTracker::stateFromEndowments):

2020-08-03  Per Arne Vollan  <pvollan@apple.com>

        Finalize the list of MobileGestalt queries needed to populate the in-memory cache in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=215095
        <rdar://problem/66034080>

        Reviewed by Geoffrey Garen.

        When the MobileGestalt cache is invalid, we issue a temporary extension to the MobileGestalt daemon for the WebContent process,
        which will populate the in-memory cache by doing a set of MobileGestalt queries before revoking the extension. This patch
        finalizes the list of MobileGestalt queries needed to populate the in-memory cache in the WebContent process on iOS before
        revoking the temporary extension to com.apple.mobilegestalt.xpc. This list was compiled by querying every possible MobileGestalt
        key after the temporary extension was revoked, and make a note of all queries that were contacting the MobileGestalt daemon to
        get the answer. The added queries in this patch should make the list complete, and ensures that all cachable values are in the
        in-memory cache before revoking the extension, since every possible MobileGestalt query was tested. This again means that users
        that have an invalid MobileGestalt cache, will have access to the exact same MobileGestalt values, as those users who have a
        valid MobileGestalt cache.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS 14] editing/selection/ios/select-all-non-editable-text-using-keyboard.html sometimes times out
        https://bugs.webkit.org/show_bug.cgi?id=215089
        <rdar://problem/66282806>

        Reviewed by Tim Horton.

        * Platform/spi/ios/UIKitSPI.h:

2020-08-03  Devin Rousso  <drousso@apple.com>

        should be able to request an editing context for a given region of a given input
        https://bugs.webkit.org/show_bug.cgi?id=215042
        <rdar://problem/65561491>

        Reviewed by Wenson Hsieh.

        Right now, it's only possible to request an editing context for either an entire input
        element or a particular rect of the page.  It should be possible to request an editing
        context for a particular rect within a given input element as well (e.g. get one paragraph
        or the currently selected text in a `<textarea>` instead of the entire thing).

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

2020-08-03  Kate Cheney  <katherine_cheney@apple.com>

        doesParentProcessHaveITPEnabled() check should match behavior in determineITPStateInternal() check
        https://bugs.webkit.org/show_bug.cgi?id=215031
        <rdar://problem/66384618>

        Reviewed by Brent Fulgham.

        Checking ITP state from a WebKit child process should have the same
        behavior as checking it from the UI process. In order to do this,
        we must pass the value of hasRequestedCrossWebsiteTrackingPermission
        to the network process to know if an application has included the
        NSCrossWebsiteTrackingUsageDescription value in their Info.plist.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::activateSessionCleanup):
        * Shared/Cocoa/DefaultWebBrowserChecks.h:
        * Shared/Cocoa/DefaultWebBrowserChecks.mm:
        (WebKit::hasRequestedCrossWebsiteTrackingPermission):
        (WebKit::doesParentProcessHaveITPEnabled):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2020-08-03  Adrian Perez de Castro  <aperez@igalia.com>

        Non-unified build fixes, early August 20202 edition
        https://bugs.webkit.org/show_bug.cgi?id=215082

        Unreviewed build fix.

        * WebProcess/WebPage/FindController.h: Add missing inclusion of WebCore/SimpleRange.h.

2020-08-02  Darin Adler  <darin@apple.com>

        Remove some member functions of Range and many calls to createLiveRange
        https://bugs.webkit.org/show_bug.cgi?id=215070

        Reviewed by Sam Weinig.

        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
        (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Use makeSimpleRange.
        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
        (API::PageOverlayClientImpl::actionContextForResultAtPoint): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
        (-[WKDOMRange textRects]): Ditto.
        * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
        (-[WKDOMTextIterator initWithRange:]): Ditto.
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::performDictionaryLookupAtLocation): Remove createLiveRange.
        (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPlatformEditorState const): Ditto.
        (WebKit::WebPage::computeAndSendEditDragSnapshot): Ditto.
        (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): Ditto.
        (WebKit::WebPage::getRectsAtSelectionOffsetWithText): Ditto.
        (WebKit::WebPage::requestAutocorrectionData): Ditto.

2020-08-01  Darin Adler  <darin@apple.com>

        Fix and further refine makefile rule for WebKit messages generated files
        https://bugs.webkit.org/show_bug.cgi?id=215064

        Reviewed by Sam Weinig.

        * DerivedSources-output.xcfilelist: Updated for a file that was omitted
        because of a typo in the makefile.
        * DerivedSources.make: Fix "addsufix" typo and reorganized things a bit.

2020-08-01  Keith Rollin  <krollin@apple.com>

        Prevent multiple invocations of generate-message-receiver.py
        https://bugs.webkit.org/show_bug.cgi?id=215054

        Reviewed by Darin Adler.

        WebKit/DerivedSources.make is written such that
        generate-message-receiver.py can be invoked N times, where N is the
        value passed to -j. This results in the N invocations of
        generate-message-receiver.py trying trying to generate the same set of
        files at the same time, possibly leading to their being corrupted. We
        have reports of generated files starting with a 4K block of NULs, and
        this contention may be causing it. Address this by using a "pattern
        rule" in the makefile, which is documented in GNU make's documentation
        as the approach to take when there is one build rule that creates
        multiple outputs, as is the case here.

        See also <https://bugs.webkit.org/show_bug.cgi?id=166814> and
        <http://trac.webkit.org/changeset/210507>.

        No new tests -- no new or changed functionality.

        * DerivedSources.make:

2020-08-01  Darin Adler  <darin@apple.com>

        Remove Range::create and many more uses of live ranges
        https://bugs.webkit.org/show_bug.cgi?id=215004

        Reviewed by Sam Weinig.

        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
        (API::PageOverlayClientImpl::actionContextForResultAtPoint): Return a
        structure that includes a SimpleRange.

        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
        (WebKit::InjectedBundleNodeHandle::visibleRange): Use makeSimpleRange.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: Use SimpleRange.
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::rangeAndOffsetRelativeToSelection): Use SimpleRange.
        (WebKit::TextCheckingControllerProxy::replaceRelativeToSelection): Ditto.
        (WebKit::TextCheckingControllerProxy::removeAnnotationRelativeToSelection): Ditto.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::characterIndexForPointAsync): Remove makeSimpleRange.
        (WebKit::WebPage::deleteSurrounding): Use makeSimpleRange.

        * WebProcess/WebPage/WebPageOverlay.cpp:
        (WebKit::WebPageOverlay::actionContextForResultAtPoint): Use return value instead of out argument.
        * WebProcess/WebPage/WebPageOverlay.h: Update for above.

        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::getPlatformEditorState const): Use makeSimpleRange.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::computeEditableRootHasContentAndPlainText): Use makeSimpleRange.
        (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): Removed unneeded null checks that
        are already done by makeSimpleRange.
        (WebKit::WebPage::getRectsAtSelectionOffsetWithText): Use makeSimpleRange.
        (WebKit::WebPage::requestDictationContext): Ditto.
        (WebKit::WebPage::autocorrectionContext): Ditto.
        (WebKit::linkIndicatorPositionInformation): Use makeRangeSelectingNodeContents.
        (WebKit::dataDetectorLinkPositionInformation): Ditto.
        (WebKit::WebPage::requestDocumentEditingContext): Use makeSimpleRange.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performImmediateActionHitTestAtLocation): Update for change to the
        actionContextForResultAtPoint return value.

2020-08-01  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r265171.
        https://bugs.webkit.org/show_bug.cgi?id=215060

        broke 2 mac api tests

        Reverted changeset:

        "[Mac] Add Experimental Feature preference for SW VP9"
        https://bugs.webkit.org/show_bug.cgi?id=215043
        https://trac.webkit.org/changeset/265171

2020-08-01  Megan Gardner  <megan_gardner@apple.com>

        Unable to select multiple lines of vertical text correctly
        https://bugs.webkit.org/show_bug.cgi?id=213671
        <rdar://problem/53753636>

        Reviewed by Darin Adler.

        In order to make for a better text selection experience, we pulled the selection position 
        down to be on the last line selectable, rather than snap the selection to a single position.
        This made for a better selection experience on small text, but we failed to take
        vertical text into account, and a user is locked into only selecting vertical text that ends below the
        other anchor point of the selection. We should have the same behavior for vertical text, but correctly 
        calculated for X instead of Y.
        This does not fix all cases, but it fixes the most glaring cases.

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

2020-07-31  Jer Noble  <jer.noble@apple.com>

        [Mac] Add Experimental Feature preference for SW VP9
        https://bugs.webkit.org/show_bug.cgi?id=215043
        <rdar://problem/66400034>

        Reviewed by Beth Dakin.

        * FeatureFlags/WebKit.plist:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultVP9SWDecoderEnabledOnBattery):
        * Shared/WebPreferencesDefaultValues.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::enableVP9Decoder):
        (WebKit::WebProcess::enableVP9SWDecoder):
        * WebProcess/WebProcess.h:

2020-07-31  Chris Dumez  <cdumez@apple.com>

        Launch time regression due to EndowmentStateTracker initialization in WebPageProxy constructor
        https://bugs.webkit.org/show_bug.cgi?id=215029
        <rdar://problem/66362333>

        Reviewed by Geoffrey Garen.

        EndowmentStateTracker was expensive and in a critical code path during MobileSafari app launch. Since
        this code is new, this was a net app launch time regression. To address the regression, the following
        changes were made:
        1. We only need the EndowmentStateTracker to monitor if the app is user-facing or not, so that we can
           suspend / resume media playback as needed. As a result, it is unnecessary to start monitoring
           user-facing state changes as soon as the WebPageProxy is constructed. Instead, we now wait until
           media plays on the page for the first time.
        2. It turns out that over 70% of CPU time in the EndowmentStateTracker constructor was spent getting
           the current endownment for the process. As a result, I updated the code to lazy populate those
           until they are requested for the first time.
        3. The remaining 30% of CPU time in the EndowmentStateTracker constructor was spent constructing the
           RBSProcessMonitor. I moved the initialization of the RBSProcessMonitor from the constructor to
           EndowmentStateTracker::addClient() so that we only construct a monitor when we actually have our
           first client.
        4. All this code was actually only useful for Catalyst app and was therefore doing work on iOS for no
           reason. I properly #ifdef'd out this code so that it now only applies to Catalyst apps.

        * UIProcess/EndowmentStateTracker.h:
        (WebKit::EndowmentStateTracker::isVisible const):
        (WebKit::EndowmentStateTracker::isUserFacing const):
        * UIProcess/EndowmentStateTracker.mm:
        (WebKit::EndowmentStateTracker::stateFromEndowments):
        (WebKit::EndowmentStateTracker::registerMonitorIfNecessary):
        (WebKit::EndowmentStateTracker::addClient):
        (WebKit::EndowmentStateTracker::ensureState const const):
        (WebKit::EndowmentStateTracker::setState):
        (WebKit::EndowmentStateTracker::EndowmentStateTracker): Deleted.
        (WebKit::EndowmentStateTracker::setIsUserFacing): Deleted.
        (WebKit::EndowmentStateTracker::setIsVisible): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_transcodingQueue):
        (WebKit::WebPageProxy::updatePlayingMediaDidChange):
        * UIProcess/WebPageProxy.h:

2020-07-31  Chris Dumez  <cdumez@apple.com>

        Drop ProcessAssertion::Client and replace with a simple invalidation handler
        https://bugs.webkit.org/show_bug.cgi?id=214976

        Reviewed by Brady Eidson.

        ProcessAssertion had a Client class with 2 functions:
        (1) one to indicate that the assertion was invalidated
        (2) one to indicate that the UI assertion is about to expire

        While ProcessAssertion is used in several places, only the ProcessThrottler
        ever sets itself as a client. The reason is that other call sites use
        assertion types that do not expire. Also, (2) only makes sense for
        ProcessAndUIAssertion, not for ProcessAssertion. Only the ProcessThrottler
        is using a ProcessAndUIAssertion.

        I think a better design is to have a simple invalidation handler on
        the ProcessAssertion, that the call site can set if they are interested
        in invalidation.

        Similarly, I added a UIAssertion expiration handler on ProcessAndUIAssertion
        so that the ProcessThrottler can know if the UIAssertion is about to expire.

        This new design also matches more closely the system process assertion API
        that ProcessAssertion / ProcessAndUIAssertion are wrapping.

        This patch also fixes a bug found by Youenn Fablet where the ProcessThrottler
        would only set its invalidation handler in didConnectToProcess(), instead of
        doing it every time a new ProcessAssertion is created in setAssertionType().
        The assertion type can change (e.g. from foreground to background) after the
        process has launched.

        * UIProcess/ProcessAssertion.h:
        (WebKit::ProcessAssertion::setInvalidationHandler):
        (WebKit::ProcessAssertion::Client::~Client): Deleted.
        (WebKit::ProcessAssertion::setClient): Deleted.
        (WebKit::ProcessAssertion::client): Deleted.
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::setAssertionType):
        (WebKit::ProcessThrottler::didConnectToProcess):
        * UIProcess/ProcessThrottler.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAssertion::processAssertionWasInvalidated):
        (WebKit::ProcessAndUIAssertion::uiAssertionWillExpireImminently):

2020-07-31  Jiewen Tan  <jiewen_tan@apple.com>

        SOAuthorizationSession::dismissViewController could crash on calling WebPageProxy::platformWindow
        https://bugs.webkit.org/show_bug.cgi?id=214816
        <rdar://problem/65681530>

        Reviewed by Youenn Fablet.

        pageClient() called in WebPageProxy::platformWindow() could be null. Therefore, platformWindow()
        needs to check m_pageClient instead.

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::platformWindow):

2020-07-31  Youenn Fablet  <youenn@apple.com>

        Update service worker if certificate info does not match when soft updating
        https://bugs.webkit.org/show_bug.cgi?id=214988

        Reviewed by Alex Christensen.

        Make sure service worker soft updater gathers certificate info.

        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
        (WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork):
        (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse):
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):

2020-07-31  Sihui Liu  <sihui_liu@appe.com>

        -[WKWebsiteDataStore _renameOrigin:] needs to support IndexedDB renames
        https://bugs.webkit.org/show_bug.cgi?id=214905
        <rdar://problem/66247978>

        Reviewed by Alex Christensen.

        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::renameOrigin):
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::renameOriginInWebsiteData):
        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _renameOrigin:to:forDataOfTypes:completionHandler:]):

2020-07-31  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed Catalyst build fix.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h: I should have added the include here.
        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:

2020-07-31  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Issue a temporary extension to the MobileGestalt daemon when the MobileGestalt cache is invalid
        https://bugs.webkit.org/show_bug.cgi?id=214965

        Reviewed by Geoffrey Garen.

        When the MobileGestalt cache is invalid, some MG queries will fail in the WebContent process, since it has no access to the daemon.
        This can be fixed by issuing a temporary extension to the daemon, and having the WebContent process query all relevant MG values
        while holding the extension. This will bring the values into the in-memory cache, which will be valid after the extension to the
        daemon has been revoked. We will still attempt to rebuild the MG cache if invalid, but since we now have a workaround for when the
        cache is invalid, we can do this on a secondary thread to avoid blocking the main thread. We also only attempt to rebuild once now,
        instead of every time a WebContent process is started. Additionally, add IOKit property read access to "platform-name", since that
        is needed by a MG query.

        No new tests, since testing this depends on having an invalid cache, which is rare, and non-trivial to enforce in the test
        environment.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitialize):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Mouse wheel events on horizontal scrollbar not correctly handled when AC mode is forced
        https://bugs.webkit.org/show_bug.cgi?id=207113

        Reviewed by Adrian Perez de Castro.

        Move the direction swap to the UI process before passing the event to the web
        process. WebHitTestResultData::isScrollbar is now an enum with values No, Verttical, Horizontal. When a wheel
        event is received in the widget we check whether we should invert the direction or not.

        * Shared/API/glib/WebKitHitTestResult.cpp:
        (webkitHitTestResultCreate):
        (webkitHitTestResultCompare):
        * Shared/WebHitTestResultData.cpp:
        (WebKit::WebHitTestResultData::WebHitTestResultData):
        * Shared/WebHitTestResultData.h:
        * UIProcess/API/APIHitTestResult.h:
        (API::HitTestResult::isScrollbar const):
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewMouseTargetChanged):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (shouldInvertDirectionForScrollEvent):
        (webkitWebViewBaseScrollEvent):
        (webkitWebViewBaseScroll):
        (webkitWebViewBaseSetMouseIsOverScrollbar):
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

2020-07-30  Alex Christensen  <achristensen@webkit.org>

        Optimize WebsiteDataStoreConfiguration::copy
        https://bugs.webkit.org/show_bug.cgi?id=215012
        <rdar://problem/64263406>

        Reviewed by Brady Eidson.

        The WebsiteDataStoreConfiguration constructor does some read/write heavy things.
        We only want to do these things if we are not just going to overwrite the strings with strings from another WebsiteDataStoreConfiguration.
        No change in behavior, just making things faster.

        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
        (WebKit::WebsiteDataStoreConfiguration::create):

2020-07-30  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed second attempt to fix Catalyst build after r265084.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:

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

        [iPadOS] Two taps are required to choose a country/region when creating an account on ea.com
        https://bugs.webkit.org/show_bug.cgi?id=214984
        <rdar://problem/66261490>

        Reviewed by Devin Rousso.

        On the desktop version of the account creation page on ea.com, tapping a custom selection menu element
        programmatically focuses a real `select` element that is positioned far outside the viewport. As a result, on
        iPad, we still attempt to show a popover for this focused select at the element location. This popover is not
        visible to the user, but on iOS 13, it still steals modal focus from the web view, which means that an
        additional tap anywhere in the window is required to dismiss the (invisible) popover before the user can choose
        one of the options in the custom in-page menu that is shown.

        Furthermore, upon choosing one of these options, the page programmatically focuses the offscreen select again.
        This causes us to re-present the offscreen popover, which requires yet another tap to dismiss on iOS 13.
        However, on iOS 14, this actually results in a crash when attempting to scroll the popover's inner UITableView
        to the selected row.

        To fix both the crash on iOS 14 and the multiple redundant taps required to dismiss the popover on iOS 13, avoid
        showing popovers altogether if the popover's presentation rect is outside the bounds of the content view, since
        we cannot reasonably expect a user to interact with such a popover anyways.

        Test: fast/forms/ios/repeatedly-focus-offscreen-select.html

        * UIProcess/ios/forms/WKFormPopover.mm:
        (-[WKRotatingPopover presentPopoverAnimated:]):

2020-07-30  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Adopt -[AVContentKeyRequest willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:]
        https://bugs.webkit.org/show_bug.cgi?id=214659
        <rdar://problem/63555006>

        Reviewed by Darin Adler.
        
        Support clients in the GPU process asking for (and receiving updates to) the current displayID.

        * GPUProcess/media/RemoteCDMInstanceSessionProxy.cpp:
        (WebKit::RemoteCDMInstanceSessionProxy::displayIDChanged):
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.h:
        * GPUProcess/media/RemoteCDMInstanceSessionProxy.messages.in:

2020-07-30  Antoine Quint  <graouts@webkit.org>

        [ iOS ] webanimations/accelerated-animation-with-easing.html is still flaky
        https://bugs.webkit.org/show_bug.cgi?id=214327
        <rdar://problem/65569237>

        Reviewed by Dean Jackson.

        When we fixed bug 213495 in r263506, we started calling PlatformCAAnimation::setTimingFunction()
        to set the animation-wide timing function of CSS Animations and JS-originated animations alike.
        However, we neglected to update PlatformCAAnimationRemote, used on iOS, to be able to handle
        both animation-wide timing functions as well as keyframe-specific timing functions. This patch
        adds a new "timingFunction" member to PlatformCAAnimationRemote::Properties to allow for this
        and this new member is used in setTimingFunction() and copyTimingFunctionFrom(). Finally, after
        the animation is decoded in the UI process, we call -[CAKeyframeAnimation setTimingFunction:]
        inside addAnimationToLayer() to use this animation-wide timing function.

        This fixes the test added originally in r263506 which would only work flakily, a symptom of this
        missing implementation on iOS.

        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (WebKit::encodeTimingFunction):
        (WebKit::decodeTimingFunction):
        (WebKit::PlatformCAAnimationRemote::Properties::encode const):
        (WebKit::PlatformCAAnimationRemote::Properties::decode):
        (WebKit::PlatformCAAnimationRemote::setTimingFunction):
        (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
        (WebKit::addAnimationToLayer):
        (WebKit::operator<<):

2020-07-30  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Make DecoderTest run against .mp4 files; add rate-limiting.
        https://bugs.webkit.org/show_bug.cgi?id=214807

        Reviewed by Darin Adler.

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

2020-07-30  Tim Horton  <timothy_horton@apple.com>

        Web content gets stuck in an inactive state (no cursor updates or text insertion caret) when activating a tab with a thumbnail visible
        https://bugs.webkit.org/show_bug.cgi?id=214962
        <rdar://problem/65670984>

        Reviewed by Wenson Hsieh.

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setThumbnailView):
        When WKThumbnailView is unparented, invalidate all activity state bits.
        We do this because many of the functions that compute activity state bits
        use the WKThumbnailView's window while it is parented. When it is unparented,
        and we switch back to using the WKWebView's window, we mustn't get stuck
        with activity state bits from WKThumbnailView's window.

        This was particularly problematic in the case of the WKThumbnailViews
        used for tab hover previews, because that window is not key, so we'd get
        stuck with the inactive-window state, resulting in a lack of cursor updates,
        a hidden text caret, the wrong selection color, etc.

        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::isViewWindowActive):
        While writing the API test for this, I noticed that isViewWindowActive
        returns YES if there is no key window AND WKWebView is unparented
        ([NSApp keyWindow] == activeWindow() == nil).
        This seems completely insane (how can the window be active if it doesn't
        exist?), and breaks the test, so ensure that we only say YES if we actually
        have a window.

2020-07-30  Peng Liu  <peng.liu6@apple.com>

        ASSERTION FAILED: !isInRoutingArbitrationForArbitrator(proxy) in WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator
        https://bugs.webkit.org/show_bug.cgi?id=214904

        Reviewed by Jer Noble.

        Only add an AudioSessionRoutingArbitratorProxy to the WeakHashSet (m_arbitrators)
        if the routing arbitration is completed successfully.

        * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
        (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator):

2020-07-30  Per Arne Vollan  <pvollan@apple.com>

        Remember to check entitlement before communicating over XPC
        https://bugs.webkit.org/show_bug.cgi?id=214825

        Reviewed by Brent Fulgham.

        Remember to check entitlement before communicating over XPC with another WebKit process. This needs to be done
        to make sure that it really is a WebKit process on the other end.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::m_messagePortChannelRegistry):
        * Shared/Cocoa/XPCEndpoint.mm:
        (WebKit::XPCEndpoint::XPCEndpoint):
        * Shared/Cocoa/XPCEndpointClient.mm:
        (WebKit::XPCEndpointClient::setEndpoint):
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const):

2020-07-30  Kate Cheney  <katherine_cheney@apple.com>

        REGRESSION (r264925): run-safari --debug no longer works
        https://bugs.webkit.org/show_bug.cgi?id=214947
        <rdar://problem/66297850>

        Reviewed by Darin Adler.

        Removing these APIs in WebKit caused older versions of Safari to
        break. We should add back in empty functions to make this work.

        No new tests. Manually verified this fix.

        * Shared/API/c/WKRenderLayer.cpp: Added.
        (WKRenderLayerGetTypeID):
        (WKRenderLayerGetRenderer):
        (WKRenderLayerCopyRendererName):
        (WKRenderLayerCopyElementTagName):
        (WKRenderLayerCopyElementID):
        (WKRenderLayerGetElementClassNames):
        (WKRenderLayerGetAbsoluteBounds):
        (WKRenderLayerIsClipping):
        (WKRenderLayerIsClipped):
        (WKRenderLayerIsReflection):
        (WKRenderLayerGetCompositingLayerType):
        (WKRenderLayerGetBackingStoreMemoryEstimate):
        (WKRenderLayerGetNegativeZOrderList):
        (WKRenderLayerGetNormalFlowList):
        (WKRenderLayerGetPositiveZOrderList):
        (WKRenderLayerGetFrameContentsLayer):
        * Shared/API/c/WKRenderLayer.h: Added.
        * Shared/API/c/WKRenderObject.cpp: Added.
        (WKRenderObjectGetTypeID):
        (WKRenderObjectCopyName):
        (WKRenderObjectCopyTextSnippet):
        (WKRenderObjectGetTextLength):
        (WKRenderObjectCopyElementTagName):
        (WKRenderObjectCopyElementID):
        (WKRenderObjectGetElementClassNames):
        (WKRenderObjectGetAbsolutePosition):
        (WKRenderObjectGetFrameRect):
        (WKRenderObjectGetChildren):
        * Shared/API/c/WKRenderObject.h: Added.
        * Sources.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyRenderTree):
        (WKBundlePageCopyRenderLayerTree):
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2020-07-30  Darin Adler  <darin@apple.com>

        Further reduction in the use of live ranges, particularly in headers
        https://bugs.webkit.org/show_bug.cgi?id=214793

        Reviewed by Sam Weinig.

        * Shared/API/c/mac/WKWebArchiveRef.cpp:
        (WKWebArchiveCreateFromRange): Use makeSimpleRange.

        * Shared/APIWebArchive.h: Use SimpleRange.
        * Shared/APIWebArchive.mm:
        (API::WebArchive::create): Take SimpleRange.

        * Shared/EditingRange.cpp:
        (WebKit::EditingRange::toRange): Don't call createLiveRange.
        (WebKit::EditingRange::fromRange): Take SimpleRange.
        * Shared/EditingRange.h: Updated for above.

        * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
        Take SimpleRange, String, StyleProperties instead of
        Range, StringImpl, CSSStyleDeclaration.

        * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp:
        String instead of StringImpl.

        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
        (-[WKDOMDocument createDocumentFragmentWithText:]): Use SimpleRange.
        * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
        (-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):
        Use SimpleRange and createLiveRange.

        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
        Updated for changes to bundle editor client.

        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
        (WebKit::InjectedBundleRangeHandle::create): Deleted. Moved the
        code into InjectedBundleRangeHandle::getOrCreate.
        (WebKit::createHandle): Added. Makes a handle for a SimpleRange.
        * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
        Updated for above.

        * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
        (WebKit::createHandle): Added. Makes a handle for a CSSStyleDeclaration.
        (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing):
        Updated for changes to bundle editor client.
        (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto.
        (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto.
        (WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto.
        (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto.
        (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto.
        (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto.
        (WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto.
        (WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto.
        (WebKit::InjectedBundlePageEditorClient::didChange): Ditto.
        (WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto.
        (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto.
        (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto.
        (WebKit::InjectedBundlePageEditorClient::performTwoStepDrop): Ditto.
        * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
        Updated for above.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::shouldDeleteRange): Updated to call new
        revised bundle editor client.
        (WebKit::WebEditorClient::shouldBeginEditing): Ditto.
        (WebKit::WebEditorClient::shouldEndEditing): Ditto.
        (WebKit::WebEditorClient::shouldInsertNode): Ditto.
        (WebKit::WebEditorClient::shouldInsertText): Ditto.
        (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
        (WebKit::WebEditorClient::shouldApplyStyle): Ditto.
        (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
        (WebKit::WebEditorClient::getClientPasteboardData): Ditto.
        (WebKit::WebEditorClient::performTwoStepDrop): Ditto.
        (WebKit::insertionPointFromCurrentSelection): Use SimpleRange.

        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::replaceMatches): Use SimpleRange.
        (WebKit::FindController::findString): Updated for change to
        Page::findTextMatches function.
        (WebKit::FindController::findStringMatches): Ditto.
        (WebKit::FindController::getImageForFindMatch): Use SimpleRange.
        (WebKit::FindController::selectFindMatch): Ditto.
        * WebProcess/WebPage/FindController.h: Updated for above.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getMarkedRangeAsync): Do not call createLiveRange.
        (WebKit::WebPage::getSelectedRangeAsync): Ditto.
        (WebKit::WebPage::characterIndexForPointAsync): Call makeSimpleRange.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::plainTextForContext): Changed overloads a bit to work
        better with Optional<SimpleRange> and removed the ones that explicitly
        take a Range, updating callers to compensate.
        (WebKit::plainTextForDisplay): Ditto.
        (WebKit::WebPage::getPlatformEditorState const): Use SimpleRange.
        (WebKit::WebPage::getSelectionContext): Ditto.
        (WebKit::WebPage::didConcludeEditDrag): Ditto.
        (WebKit::WebPage::handleStylusSingleTapAtPoint): Ditto.
        (WebKit::WebPage::selectWithGesture): Ditto.
        (WebKit::rangeForPointInRootViewCoordinates): Return SimpleRange.
        (WebKit::rangeAtWordBoundaryForPosition): Ditto.
        (WebKit::WebPage::updateSelectionWithTouches): Use SimpleRange.
        (WebKit::WebPage::selectWithTwoTouches): Ditto.
        (WebKit::WebPage::extendSelection): Ditto.
        (WebKit::WebPage::selectWordBackward): Ditto.
        (WebKit::WebPage::moveSelectionByOffset): Ditto.
        (WebKit::WebPage::getRectsForGranularityWithSelectionOffset): Ditto.
        (WebKit::WebPage::selectPositionAtPoint): Ditto.
        (WebKit::WebPage::selectPositionAtBoundaryWithDirection): Ditto.
        (WebKit::WebPage::moveSelectionAtBoundaryWithDirection): Ditto.
        (WebKit::WebPage::rangeForGranularityAtPoint): Ditto.
        (WebKit::WebPage::selectTextWithGranularityAtPoint): Ditto.
        (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): Ditto.
        (WebKit::WebPage::updateSelectionWithExtentPoint): Ditto.
        (WebKit::WebPage::replaceSelectedText): Ditto.
        (WebKit::WebPage::replaceDictatedText): Ditto.
        (WebKit::WebPage::requestAutocorrectionData): Ditto.
        (WebKit::WebPage::applyAutocorrectionInternal): Ditto.
        (WebKit::WebPage::autocorrectionContext): Ditto.
        (WebKit::dataDetectorLinkPositionInformation): Ditto.
        (WebKit::WebPage::updateSelectionWithDelta): Ditto.
        (WebKit::WebPage::focusTextInputContextAndPlaceCaret): Ditto.

2020-07-30  Alex Christensen  <achristensen@webkit.org>

        Remove non-inclusive terminology from WebKit variable names and test-only SPI
        https://bugs.webkit.org/show_bug.cgi?id=214941

        Reviewed by Michael Catanzaro.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::addOriginAccessAllowListEntry):
        (WebKit::NetworkConnectionToWebProcess::removeOriginAccessAllowListEntry):
        (WebKit::NetworkConnectionToWebProcess::resetOriginAccessAllowLists):
        (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry): Deleted.
        (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry): Deleted.
        (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists): Deleted.
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/glib/WebKitUserContent.cpp:
        (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
        (webkit_user_style_sheet_new):
        (webkit_user_style_sheet_new_for_world):
        (_WebKitUserScript::_WebKitUserScript):
        (webkit_user_script_new):
        (webkit_user_script_new_for_world):
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (pathIsBlocked):
        (webkit_web_context_add_path_to_sandbox):
        (pathIsBlacklisted): Deleted.
        * UIProcess/API/gtk/WebKitUserContent.h:
        * UIProcess/API/wpe/WebKitUserContent.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::setupSeccomp):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setFontAllowList):
        * UIProcess/WebProcessPool.h:
        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
        (WKBundleAddOriginAccessAllowListEntry):
        (WKBundleRemoveOriginAccessAllowListEntry):
        (WKBundleResetOriginAccessAllowLists):
        (WKBundleAddOriginAccessWhitelistEntry): Deleted.
        (WKBundleRemoveOriginAccessWhitelistEntry): Deleted.
        (WKBundleResetOriginAccessWhitelists): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::addOriginAccessAllowListEntry):
        (WebKit::InjectedBundle::removeOriginAccessAllowListEntry):
        (WebKit::InjectedBundle::resetOriginAccessAllowLists):
        (WebKit::InjectedBundle::addOriginAccessWhitelistEntry): Deleted.
        (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry): Deleted.
        (WebKit::InjectedBundle::resetOriginAccessWhitelists): Deleted.
        * WebProcess/InjectedBundle/InjectedBundle.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

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

        [GTK4] Enable API tests
        https://bugs.webkit.org/show_bug.cgi?id=214344

        Reviewed by Adrian Perez de Castro.

        Use a custom KeyEvent struct to pass to the IM filter as a fake GdkEvent to be able to test input methods with
        GTK4.

        * UIProcess/API/glib/InputMethodFilter.h:
        * UIProcess/API/gtk/InputMethodFilterGtk.cpp:
        (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const):
        (WebKit::InputMethodFilter::filterKeyEvent):
        * UIProcess/API/gtk/WebKitWebViewBaseInternal.h:
        * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
        (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):

2020-07-30  Brady Eidson  <beidson@apple.com>

        Refactor HID gamepad code to be much less fragile and much easier to hack on.
        https://bugs.webkit.org/show_bug.cgi?id=214910

        Reviewed by Darin Adler.

        * Shared/Gamepad/GamepadData.cpp:
        (WebKit::GamepadData::GamepadData):
        * Shared/Gamepad/GamepadData.h:

        * UIProcess/Gamepad/UIGamepad.h:

        * WebProcess/Gamepad/WebGamepad.cpp:
        (WebKit::WebGamepad::axisValues const):
        (WebKit::WebGamepad::buttonValues const):
        (WebKit::WebGamepad::updateValues):
        * WebProcess/Gamepad/WebGamepad.h:

2020-07-30  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r265043.
        https://bugs.webkit.org/show_bug.cgi?id=214959

        Will re-land after Safari 14 branching

        Reverted changeset:

        "Enable paint timing by default"
        https://bugs.webkit.org/show_bug.cgi?id=211736
        https://trac.webkit.org/changeset/265043

2020-07-29  Megan Gardner  <megan_gardner@apple.com>

        Highlight color does not switch after being set it system preferences.
        https://bugs.webkit.org/show_bug.cgi?id=214938
        <rdar://problem/65270586>

        Reviewed by Tim Horton.

        After the changes to the sandbox and how defaults are being transferred to the web process
        (https://trac.webkit.org/changeset/258064/webkit), the highlight color was not being updated 
        immediately. We need to send the proper notification after setting the defaults so that the 
        color cache is invalidated after it is actually set and we do not end up with a stale value.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::userHighlightColorPreferenceKey):
        (WebKit::dispatchSimulatedNotificationsForPreferenceChange):

2020-07-29  Kate Cheney  <katherine_cheney@apple.com>

        Migrate App-Bound Domains code from WebKit Additions
        https://bugs.webkit.org/show_bug.cgi?id=214889
        <rdar://problem/66075857>

        Reviewed by Brent Fulgham.

        No new tests, this is just code migration and will be tested
        by existing App-Bound Domains tests.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::activateSessionCleanup):
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        * Shared/Cocoa/DefaultWebBrowserChecks.h: Added.
        * Shared/Cocoa/DefaultWebBrowserChecks.mm: Added.
        Holds all functions related to full browser checks and
        App-Bound Domains.

        (WebKit::shouldBeTreatedAsFullBrowser):
        (WebKit::getAppBoundDomainsTesting):
        These functions allow us to treat our test runners as full browsers
        while triggering non-browser mode for testing other App-Bound Domains
        functionality.

        (WebKit::isInWebKitChildProcess):
        (WebKit::hasRequestedCrossWebsiteTrackingPermission):
        (WebKit::determineITPStateInternal):
        (WebKit::determineITPState):
        (WebKit::doesAppHaveITPEnabled):
        (WebKit::doesParentProcessHaveITPEnabled):
        (WebKit::hasProhibitedUsageStrings):
        (WebKit::isParentProcessAFullWebBrowser):
        (WebKit::isFullWebBrowser):
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::filterAppBoundCookies):
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::PageConfiguration):
        (): Deleted.
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::WebProcessPool):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::createNewWebProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::addTestDomains const):
        (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebKit.xcodeproj/project.pbxproj:

2020-07-29  Jer Noble  <jer.noble@apple.com>

        REGRESSION(r264476): Calling systemHasAC() regresses launch time performance
        https://bugs.webkit.org/show_bug.cgi?id=214907
        <rdar://problem/66191430>

        Reviewed by Eric Carlson.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-07-29  Darin Adler  <darin@apple.com>

        Improve range idioms and other changes to prepare the way for more reduction in live range use
        https://bugs.webkit.org/show_bug.cgi?id=214882

        Reviewed by Sam Weinig.

        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
        (WKBundleNodeHandleGetRenderRect): Emptied out this unused function and added
        ASSERT_NOT_REACHED. Later, we can delete this once we deal with any link-time
        dependencies. I believe Safari may link with this but never calls it.
        (WKBundleNodeHandleCopyVisibleRange): Ditto.
        (WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Ditto.
        (WKBundleNodeHandleGetHTMLInputElementAutoFilled): Ditto.
        (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled): Ditto.
        (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable): Ditto.
        (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonBounds): Ditto.
        (WKBundleNodeHandleCopyHTMLTableCellElementCellAbove): Ditto.
        (WKBundleNodeHandleCopyHTMLFrameElementContentFrame): Ditto.
        (WKBundleNodeHandleGetHTMLInputElementAutofilled): Ditto.
        (WKBundleNodeHandleSetHTMLInputElementAutofilled): Ditto.
        (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled): Ditto.

        * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.mm:
        (WebKit::TextCheckingControllerProxy::annotatedSubstringBetweenPositions):
        Simplify with makeSimpleRange.

        * WebProcess/WebPage/glib/WebPageGLib.cpp: Added include of "Range.h",
        may not be needed right now, but highly likely to be needed after
        future live range work.
        * WebProcess/WebPage/ios/WebPageIOS.mm: Ditto.
        (WebKit::WebPage::selectWithGesture): Simplify with makeSimpleRange.
        (WebKit::WebPage::requestDocumentEditingContext): Ditto.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
        Use auto for range to prepare for possible change of type from live
        range to SimpleRange.

2020-07-29  Noam Rosenthal  <noam@webkit.org>

        Enable paint timing by default
        https://bugs.webkit.org/show_bug.cgi?id=211736

        Reviewed by Simon Fraser.

        * Shared/WebPreferences.yaml:
                PaintTimingEnabled default to true.

2020-07-29  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.29.2 release

        * wpe/NEWS: Add release notes for 2.29.2.

2020-07-29  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r265018.
        https://bugs.webkit.org/show_bug.cgi?id=214917

        Broke various ios-wk2 tests.

        Reverted changeset:

        "Migrate App-Bound Domains code from WebKit Additions"
        https://bugs.webkit.org/show_bug.cgi?id=214889
        https://trac.webkit.org/changeset/265018

2020-07-29  Youenn Fablet  <youenn@apple.com>

        TestWebKitAPI.WebKit.QuotaDelegate flaky times out
        https://bugs.webkit.org/show_bug.cgi?id=214842

        Reviewed by Geoffrey Garen.

        Add some release logging.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::requestStorageSpace):

2020-07-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.29.4 release

        * gtk/NEWS: Add release notes for 2.29.4.

2020-07-28  Kate Cheney  <katherine_cheney@apple.com>

        Migrate App-Bound Domains code from WebKit Additions
        https://bugs.webkit.org/show_bug.cgi?id=214889
        <rdar://problem/66075857>

        Reviewed by Brent Fulgham.

        No new tests, this is just code migration and will be tested
        by existing App-Bound Domains tests.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::activateSessionCleanup):
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
        * Shared/Cocoa/DefaultWebBrowserChecks.h: Added.
        * Shared/Cocoa/DefaultWebBrowserChecks.mm: Added.
        Holds all functions related to full browser checks and
        App-Bound Domains.

        (WebKit::shouldBeTreatedAsFullBrowser):
        (WebKit::getAppBoundDomainsTesting):
        These functions allow us to treat our test runners as full browsers
        while triggering non-browser mode for testing other App-Bound Domains
        functionality.

        (WebKit::isInWebKitChildProcess):
        (WebKit::hasRequestedCrossWebsiteTrackingPermission):
        (WebKit::determineITPStateInternal):
        (WebKit::determineITPState):
        (WebKit::doesAppHaveITPEnabled):
        (WebKit::doesParentProcessHaveITPEnabled):
        (WebKit::hasProhibitedUsageStrings):
        (WebKit::isParentProcessAFullWebBrowser):
        (WebKit::isFullWebBrowser):
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::filterAppBoundCookies):
        * UIProcess/API/APIPageConfiguration.cpp:
        (API::PageConfiguration::PageConfiguration):
        (): Deleted.
        * UIProcess/WebPageProxy.cpp:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::WebProcessPool):
        (WebKit::WebProcessPool::ensureNetworkProcess):
        (WebKit::WebProcessPool::createNewWebProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::addTestDomains const):
        (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebKit.xcodeproj/project.pbxproj:

2020-07-28  Tim Horton  <timothy_horton@apple.com>

        Web Share API Level 2: Can only perform one share action per share sheet invocation
        https://bugs.webkit.org/show_bug.cgi?id=214894

        Reviewed by Wenson Hsieh.

        No new tests; our WKShareSheet testing mechanism intentionally bypasses
        actually presenting the share sheet, which is the only way to test this.

        WKShareSheet assumes that UIActivityViewController's completionWithItemsHandler
        is only called once, when the share sheet is dismissed, and uses it to 
        clean up the temporary file written to disk, and send the success state
        to the API.

        However, it is actually called per share action, of which an arbitrary number
        can be performed per UIActivityViewController invocation.

        Defer cleanup until the share sheet is actually dismissed (which we observe
        using UIAdaptivePresentationControllerDelegate's -presentationControllerDidDismiss: callback),
        and respond to the Web Share API with success if *any* attempted share action
        succeeded.

        * UIProcess/Cocoa/WKShareSheet.mm:
        (-[WKShareSheet presentWithParameters:inRect:completionHandler:]):
        (-[WKShareSheet presentWithShareDataArray:inRect:]):
        (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
        (-[WKShareSheet sharingService:didFailToShareItems:error:]):
        (-[WKShareSheet sharingService:didShareItems:]):
        (-[WKShareSheet presentationControllerDidDismiss:]):
        (-[WKShareSheet dismiss]):
        Fold dispatchDidDismiss and _didCompleteWithSuccess into -dismiss,
        so we only have one "dismiss if needed and also do the requisite cleanup"
        path. -dismiss should only be called when it is no longer possible to do
        additional sharing actions for the current share sheet invocation.

        (-[WKShareSheet _didCompleteWithSuccess:]): Deleted.
        (-[WKShareSheet dispatchDidDismiss]): Deleted.

2020-07-28  Timothy Hatcher  <timothy@apple.com>

        Web Inspector: Don't allow docking to a hidden web view
        https://bugs.webkit.org/show_bug.cgi?id=214886

        Reviewed by Devin Rousso.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::attach): Call platformCanAttach() since it can do a live check.
        (WebKit::WebInspectorProxy::detach): Return early if already attached, otherwise asserts later.
        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformCanAttach): Return flase when the web view is hidden.

2020-07-28  Alex Christensen  <achristensen@webkit.org>

        Add null checks in ResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=214786
        <rdar://problem/61106685>

        Reviewed by Youenn Fablet.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::getResourceBytesAtPosition):

2020-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Support for backdrop-filter
        https://bugs.webkit.org/show_bug.cgi?id=169988

        Reviewed by Adrian Perez de Castro.

        Set the backdrop layer if changed when updating the scene state.

        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
        (WebKit::CoordinatedGraphicsScene::updateSceneState):

2020-07-28  Youenn Fablet  <youenn@apple.com>

        Disable low latency code path for H264 constrained baseline
        https://bugs.webkit.org/show_bug.cgi?id=214830

        Reviewed by Eric Carlson.

        Enable low latency code path on iOS.
        Manually tested.

        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultWebRTCH264LowLatencyEncoderEnabled):
        * Shared/WebPreferencesDefaultValues.h:

2020-07-27  Kate Cheney  <katherine_cheney@apple.com>

        Handle full browser apps that try to use prohibited Info.plist strings
        https://bugs.webkit.org/show_bug.cgi?id=214852
        <rdar://problem/66023860>

        Reviewed by Brent Fulgham.

        Full-web browsing applications which also use prohibited Info.plist
        strings should be restricted from using certain powerful APIs like
        JavaScript injection. These apps will have the equivalent privileges
        of an app that opts into App-Bound Domains with an empty
        WKAppBoundDomains key.

        No new tests. Writing a test for this would require being able to
        change TestWebKitAPI's Info.plist between tests, which we do not
        support. I manually tested this by adding a prohibited
        string to the TestWebKitAPI Info.plist then verified that restricted APIs, 
        like JS injection, were blocked.

        * UIProcess/WebPageProxy.cpp:
        (isFullWebBrowser):
        (hasProhibitedUsageStrings):
        (WebKit::WebPageProxy::loadData):
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
        We do not need to set m_isNavigatingToAppBoundDomain in the case where
        a full web browser does not use prohibited strings. In this case, we
        want m_isNavigatingToAppBoundDomain to stay as WTF::nullopt so no API
        restriction is enabled.

2020-07-27  David Kilzer  <ddkilzer@apple.com>

        WebKit::setCrashReportApplicationSpecificInformation() should also log to WTFLogAlways()
        <https://webkit.org/b/214756>
        <rdar://problem/66085705>

        Reviewed by Darin Adler.

        This also makes the following changes:
        - Renames setCrashReportApplicationSpecificInformation() to
          logAndSetCrashLogMessage().
        - Replaces _WKSetCrashReportApplicationSpecificInformation()
          with WebKit::logAndSetCrashLogMessage().
        - Calls WTF::setCrashLogMessage() in DumpRenderTree and
          WebKitTestRunner to avoid new WTFLogAlways() calls, which
          broke internal tests and caused the first patch to be rolled
          out.
        - Changes WebKit::logAndSetCrashLogMessage() to take a
          const char* argument instead of CFStringRef.

        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::Connection::sendMessage):
        (IPC::readFromMachPort):
        - Update call to logAndSetCrashLogMessage() to pass const char*
          value.

        * Platform/cocoa/WKCrashReporter.h:
        (WebKit::logAndSetCrashLogMessage):
        - Rename from setCrashReportApplicationSpecificInformation().
        - Update function signature to use `const char*`.
        * Platform/cocoa/WKCrashReporter.mm:
        (WebKit::logAndSetCrashLogMessage):
        - Rename from setCrashReportApplicationSpecificInformation().
        - Update function signature to use `const char*`.
        - Call WTFLogAlways() in addition to setting the Application
          Specific Information.

        * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
        (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
        - Update call to logAndSetCrashLogMessage() to pass const char*
          value.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        - Update call to logAndSetCrashLogMessage() instead of both
          WTFLogAlways() and
          _WKSetCrashReportApplicationSpecificInformation().

        * WebKit.xcodeproj/project.pbxproj:
        - Remove WebProcessCocoa.h from the project.
        * WebProcess/cocoa/WebProcessCocoa.h: Remove.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::_WKSetCrashReportApplicationSpecificInformation): Delete.

2020-07-27  Tim Horton  <timothy_horton@apple.com>

        Occasional crashes under PDFPlugin::createScrollbar and PDFPlugin::updateScrollbars
        https://bugs.webkit.org/show_bug.cgi?id=214845
        <rdar://problem/59293598>

        Reviewed by Brady Eidson.

        No new tests; timing is such that I can't reproduce without inserting
        intentional delays into the main thread hops, which is further than
        I'm willing to go for a test.

        This is a speculative fix due to the aforementioned reproducibility issue.

        * WebProcess/Plugins/PDF/PDFPlugin.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::destroy):
        Keep track of when destroy() has been called.

        (WebKit::PDFPlugin::receivedNonLinearizedPDFSentinel):
        (WebKit::PDFPlugin::threadEntry):
        If the PDFPlugin is destroyed (explicit destroy(), not the destructor, which won't run since we're protecting `this`)
        during the window in which the PDF thread is dispatching to the main thread, just ignore
        the callback. We don't want to run it, because many of the things we depend on (like PluginView)
        are disconnected at this point.

        (WebKit::PDFPlugin::scrollbarStyleChanged):
        It appears that in some much rarer case, even before the PDF thread existed, WebScrollerImpPairDelegate could
        call us back after being destroy()'d but before being deallocated. Use the new bit to guard scrollbarStyleChanged().

2020-07-27  Megan Gardner  <megan_gardner@apple.com>

        Trying to lookup when WebView is in a popover causes process to hang.
        https://bugs.webkit.org/show_bug.cgi?id=214773
        <rdar://problem/52317762>

        Reviewed by Devin Rousso.

        The Lookup framework does not populate the menus that it vends with the option to 'lookup'
        words that are selected in popovers. WebKit should follow the pattern and not put the
        item in the menu as Lookup is not able to handle this situation. Also if Lookup is disabled
        via defaults, we should not show it in the menu.

        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::getContextMenuFromItems):

2020-07-27  Kate Cheney  <katherine_cheney@apple.com>

        Remove API::Object::Type::RenderLayer and API::Object::Type::RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=214772
        <rdar://problem/52734803>

        Reviewed by Simon Fraser.

        These APIs are no longer used, so we should remove them.

        * Shared/API/APIObject.h:
        * Shared/API/c/WKBase.h:
        * Shared/API/c/WKRenderLayer.cpp: Removed.
        * Shared/API/c/WKRenderLayer.h: Removed.
        * Shared/API/c/WKRenderObject.cpp: Removed.
        * Shared/API/c/WKRenderObject.h: Removed.
        * Shared/UserData.cpp:
        (WebKit::UserData::encode):
        (WebKit::UserData::decode):
        * Shared/WebRenderLayer.cpp: Removed.
        * Shared/WebRenderLayer.h: Removed.
        * Shared/WebRenderObject.cpp: Removed.
        * Shared/WebRenderObject.h: Removed.
        * Sources.txt:
        * UIProcess/API/C/WKAPICast.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageCopyRenderTree): Deleted.
        (WKBundlePageCopyRenderLayerTree): Deleted.
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

2020-07-27  Youenn Fablet  <youenn@apple.com>

        Check m_connection in NetworkRTCProvider::createResolver/stopResolver
        https://bugs.webkit.org/show_bug.cgi?id=214818

        Reviewed by Eric Carlson.

        We need to check for m_connection when hopping to main thread as the NetworkRTCProvider might already be closed.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createResolver):
        (WebKit::NetworkRTCProvider::stopResolver):

2020-07-27  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK] GeoclueGeolocationProvider uses very low accuracy setting (city) as default geolocation API
        https://bugs.webkit.org/show_bug.cgi?id=214566

        Reviewed by Carlos Garcia Campos.

        No new tests needed.

        * UIProcess/geoclue/GeoclueGeolocationProvider.cpp:
        (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel): Use
        GeoclueAccuracySteetLevel when high accuracy was not requested.

2020-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE][GTK] Add API to support "Privacy Report"
        https://bugs.webkit.org/show_bug.cgi?id=213493

        Reviewed by Adrian Perez de Castro.

        Add WebKitITPFirstParty and WebKitITPThirdParty boxed types to expose the data returned by the ITP summary.

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (_WebKitITPFirstParty::_WebKitITPFirstParty):
        (webkitITPFirstPartyCreate):
        (webkit_itp_first_party_ref):
        (webkit_itp_first_party_unref):
        (webkit_itp_first_party_get_domain):
        (webkit_itp_first_party_get_website_data_access_allowed):
        (webkit_itp_first_party_get_last_update_time):
        (_WebKitITPThirdParty::_WebKitITPThirdParty):
        (_WebKitITPThirdParty::~_WebKitITPThirdParty):
        (webkitITPThirdPartyCreate):
        (webkit_itp_third_party_ref):
        (webkit_itp_third_party_unref):
        (webkit_itp_third_party_get_domain):
        (webkit_itp_third_party_get_first_parties):
        (webkit_website_data_manager_get_itp_summary):
        (webkit_website_data_manager_get_itp_summary_finish):
        * UIProcess/API/gtk/WebKitAutocleanups.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitAutocleanups.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2020-07-27  Youenn Fablet  <youenn@apple.com>

        Fix null pointer crash in NetworkRTCProvider::createServerTCPSocket
        https://bugs.webkit.org/show_bug.cgi?id=214796

        Reviewed by Darin Adler.

        In case of creating a TCP socket, NetworkRTCProvider will hop to the main thread before creating the socket.
        In that case, NetworkRTCProvider may actually be closed between the time of receiving the message and hoping to the main thread.
        Protect from this by adding nullptr checks.

        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createServerTCPSocket):
        (WebKit::NetworkRTCProvider::createClientTCPSocket):

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

        Scroll Snap broken when using RTL layout
        https://bugs.webkit.org/show_bug.cgi?id=193671
        <rdar://problem/47457471>

        Reviewed by Wenson Hsieh.

        There were various places in the scroll snapping code which confused scroll offsets (zero-based)
        with scroll positions (relative to scroll origin, can be negative). This broke snapping in
        `direction: rtl` content.
        
        The computation of snap locations in updateSnapOffsetsForScrollableArea() was also broken
        in RTL; we need to snap the right edge of boxes to the right edge of the scroller for the 'start'
        alignment. (Snapping for LTR boxes in an RTL scroller is poorly defined; for now, follow Gecko.)

        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (WebKit::dump):
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _updateVisibleContentRects]):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling const):
        (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling const):
        (WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint const):
        (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveContentInsetAdjustedSnapOffset const):
        (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveContentInsetAdjustedSnapPoint const): Deleted.

2020-07-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r264690): [ iOS wk2 ] editing/selection/shift-click-includes-existing-selection.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=214688
        <rdar://problem/65993683>

        Reviewed by Darin Adler.

        Remove logging added in r264882, r264890, r264892, and r264896.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _singleTapIdentified:]):
        (-[WKContentView _singleTapRecognized:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::commitPotentialTap):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleSyntheticClick):

2020-07-22  Darin Adler  <darin@apple.com>

        Stop using live ranges in SpellChecker.h and TextCheckingHelper.h
        https://bugs.webkit.org/show_bug.cgi?id=214648

        Reviewed by Sam Weinig.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp: Added an include
        of Range.h, no longer pulled in indirectly by another header.

2020-07-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, partially revert r264896.
        https://bugs.webkit.org/show_bug.cgi?id=214688

        This logging is no longer needed.

        * Platform/spi/ios/UIKitSPI.h:

2020-07-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, add even more logging to try and diagnose a flaky test
        https://bugs.webkit.org/show_bug.cgi?id=214688
        <rdar://problem/65993683>

        Add another IPI declaration on UIApplication.

        * Platform/spi/ios/UIKitSPI.h:

2020-07-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r264690): [ iOS wk2 ] editing/selection/shift-click-includes-existing-selection.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=214688
        <rdar://problem/65993683>

        Reviewed by Tim Horton.

        Add an SPI declaration on UIApplication.

        * Platform/spi/ios/UIKitSPI.h:

2020-07-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r264690): [ iOS wk2 ] editing/selection/shift-click-includes-existing-selection.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=214688
        <rdar://problem/65993683>

        Reviewed by Megan Gardner.

        Add more logging to try and see why this test is failing on some post-commit iOS bots. In particular, these logs
        should test a theory that it's possible for `UIScriptControllerIOS::singleTapAtPointWithModifiers` to try and
        synthesize and send HID events for the tap before GraphicsServices has registered the fact that a modifier key
        is being held, which would lead to a regular tap instead of a shift-tap in this test.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _singleTapIdentified:]):
        (-[WKContentView _singleTapRecognized:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::commitPotentialTap):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleSyntheticClick):

2020-07-24  Brady Eidson  <beidson@apple.com>

        Hard code some MFi controller devices instead of dynamically managing HID vs GameController.framework.
        rdar://problem/65961406 and https://bugs.webkit.org/show_bug.cgi?id=214664

        Reviewed by Tim Horton.

        Add more test-only SPI to monitor the state of connected gamepads.
        
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _numberOfConnectedGamepadsForTesting]):
        (-[WKProcessPool _numberOfConnectedHIDGamepadsForTesting]):
        (-[WKProcessPool _numberOfConnectedGameControllerFrameworkGamepadsForTesting]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::numberOfConnectedGamepadsForTesting):
        * UIProcess/WebProcessPool.h:

2020-07-24  Devin Rousso  <drousso@apple.com>

        Followup, adopt more descriptive symbol image name for non-LTR
        https://bugs.webkit.org/show_bug.cgi?id=214764
        <rdar://problem/64000059>

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]):

2020-07-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r264858.

        Caused spurious CRASHING TEST logging during layout test runs

        Reverted changeset:

        "WebKit::setCrashReportApplicationSpecificInformation() should
        also log to WTFLogAlways()"
        https://bugs.webkit.org/show_bug.cgi?id=214756
        https://trac.webkit.org/changeset/264858

2020-07-24  Tadeu Zagallo  <tzagallo@apple.com>

        WKStringGetMaximumUTF8CStringSize should cast before arithmetic
        https://bugs.webkit.org/show_bug.cgi?id=214750
        <rdar://problem/65884455>

        Reviewed by Mark Lam.

        When the string is long enough, the multiplication can result in an integer overflow.

        Test: js/throw-large-string-oom.html

        * Shared/API/c/WKString.cpp:
        (WKStringGetMaximumUTF8CStringSize):

2020-07-24  Devin Rousso  <drousso@apple.com>

        Adopt more descriptive symbol image name
        https://bugs.webkit.org/show_bug.cgi?id=214764
        <rdar://problem/64000059>

        Reviewed by Dean Jackson.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]):

2020-07-24  Kate Cheney  <katherine_cheney@apple.com>

        CrashTracer: com.apple.WebKit.WebContent at com.apple.WebKit: WebKit::WebFrame::shouldEnableInAppBrowserPrivacyProtections
        https://bugs.webkit.org/show_bug.cgi?id=214745
        <rdar://66018965>

        Reviewed by Chris Dumez.

        We should stop iterating if the frame is null, even if it is not
        the main frame, to avoid calling functions on a null frame.

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

2020-07-24  David Kilzer  <ddkilzer@apple.com>

        WebKit::setCrashReportApplicationSpecificInformation() should also log to WTFLogAlways()
        <https://webkit.org/b/214756>

        Reviewed by Chris Dumez.

        * Platform/cocoa/WKCrashReporter.mm:
        (WebKit::setCrashReportApplicationSpecificInformation):
        - Also output the log information via WTFLogAlways() in case
          Application Specific Information is overwritten or is not
          included in the crash log.

2020-07-24  Chris Dumez  <cdumez@apple.com>

        Crash under PreconnectTask::start()
        https://bugs.webkit.org/show_bug.cgi?id=214747
        <rdar://problem/65989668>

        Reviewed by Geoffrey Garen.

        All user of PreconnectTask construct a PreconnectTask and then call start() on it.
        start() dereferences m_networkLoad unconditionally. However, the PreconnectTask
        constructor may return early and not initialize m_networkLoad if there is not
        NetworkSession for the given sessionID.

        To address the issue, update call sites to pass in a valid NetworkSession, so that
        the PreconnectTask now always initializes m_networkLoad.

        No new tests, we do not know how to reproduce, likely due to a race between
        a preconnect request being issued and a network session getting destroyed.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::sendH2Ping):
        (WebKit::NetworkConnectionToWebProcess::preconnectTo):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::PreconnectTask):
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource):

2020-07-24  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] Add nullptr checks for WebPage::m_activeColorChooser
        <https://webkit.org/b/214699>
        <rdar://problem/65850975>

        Reviewed by Darin Adler.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didEndColorPicker):
        (WebKit::WebPage::didChooseColor):
        - Add nullptr check before dereferencing m_activeColorChooser.

2020-07-24  David Kilzer  <ddkilzer@apple.com>

        Add/Update CRASH_WITH_INFO() for invalid IPC message logging
        <https://webkit.org/b/214713>

        Reviewed by Anders Carlsson.

        * Platform/IPC/cocoa/ConnectionCocoa.mm:
        (IPC::Connection::sendMessage):
        - Simplify logging by removing CString and using
          IPC::MessageName enum value instead of hash.
        * Shared/Cocoa/AuxiliaryProcessCocoa.mm:
        (WebKit::AuxiliaryProcess::didReceiveInvalidMessage):
        - Add IPC::MessageName enum value to
          setCrashReportApplicationSpecificInformation() output.
        - Change CRASH() to CRASH_WITH_INFO() and pass IPC::MessageName
          enum value.

2020-07-24  Youenn Fablet  <youenn@apple.com>

        Use one socket server for the whole network process instead of one socket server per web process connection
        https://bugs.webkit.org/show_bug.cgi?id=214593

        Reviewed by Alex Christensen.

        Instead of a socket server per web process, we will only create one for all web processes.
        Conversely, we do the same for the network manager.
        This should allow to reduce our use of sockets in network process and hopefully reduce the occurence of sockets fd above FD_SETSIZE.
        Covered by existing tests.

        * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
        (WebKit::networkManager):
        (WebKit::NetworkManagerWrapper::addListener):
        (WebKit::NetworkManagerWrapper::removeListener):
        (WebKit::NetworkManagerWrapper::onNetworksChanged):
        (WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
        (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded):
        (WebKit::NetworkRTCMonitor::stopUpdating):
        (WebKit::NetworkRTCMonitor::onNetworksChanged):
        * NetworkProcess/webrtc/NetworkRTCMonitor.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::rtcNetworkThread):
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
        (WebKit::NetworkRTCProvider::close):
        (WebKit::NetworkRTCProvider::createSocket):
        (WebKit::NetworkRTCProvider::createUDPSocket):
        (WebKit::NetworkRTCProvider::createServerTCPSocket):
        (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
        (WebKit::NetworkRTCProvider::sendToSocket):
        (WebKit::NetworkRTCProvider::closeSocket):
        (WebKit::NetworkRTCProvider::setSocketOption):
        (WebKit::NetworkRTCProvider::addSocket):
        (WebKit::NetworkRTCProvider::takeSocket):
        (WebKit::NetworkRTCProvider::newConnection):
        (WebKit::NetworkRTCProvider::callOnRTCNetworkThread):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        (WebKit::NetworkRTCProvider::connection):

2020-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Tapping QuickType suggestions for a misspelled word does nothing in Mail compose
        https://bugs.webkit.org/show_bug.cgi?id=214705
        <rdar://problem/58320785>

        Reviewed by Tim Horton.

        In WebKit2-based editing contexts on iOS (such as Mail compose), tapping on a misspelled word will result in
        QuickType suggestions in the input accessory row either showing up blank (i.e. with no suggestions), or will
        show suggestions that are contextual to the text selection prior to selecting the misspelled word. Subsequently,
        attempting to choose of these suggestions results in no text being inserted. This happens for a couple of
        reasons:

        1.  UIKit doesn't attempt to re-request the autocorrection context after tapping on a misspelled word. UIKit
            just uses `-selectWordForReplacement` to extend the selection over the misspelled word, which doesn't
            currently fire any of the selection change callbacks on UIInputDelegate. As a result, UIKit will instead
            believe that the selection is collapsed to the start or end of the misspelled word.

        2.  Upon attempting to compute text suggestions for QuickType, `-[UIKeyboardImpl replacementsFromSelectedText]`
            uses `-textInRange:` to grab the currently selected text, which (in WKContentView) is currently hard-coded
            to always return `nil`.

        We address (1) by bookending `-selectWordForReplacement` with calls to `-beginSelectionChange` and
        `-endSelectionChange`, and address (2) by teaching `-textInRange:` to return the current text selection, only in
        the case where the given `UITextRange` is equal to the current ranged selection.

        Test: SelectionTests.SelectedTextAfterSelectingWordForReplacement

        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::extendSelection):
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView textInRange:]):

        Special-case the scenario where the input text range is exactly the same as `self.selectedTextRange` by
        returning the currently selected text that is cached on EditorState. In all other cases, continue to return
        `nil`.

        (-[WKContentView selectedTextRange]):

        Cache the current selected text range on WKContentView, such that repeated calls to selectedTextRange when the
        selection has not changed does not require a new WKTextRange to be constructed every time.

        (-[WKContentView _selectionChanged]):

        Invalidate the cached selected text range whenever the selection has changed.

        (-[WKContentView selectWordForReplacement]):

        Use the completion callback added below to bookend this method with `-(begin|end)SelectionChange`.

        (-[WKContentView _updateChangedSelection:]):

        Invalidate the cached selected text range whenever we're about to tell UIKit to repaint the selection.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::extendSelection):

        Add an optional completion callback to `extendSelection`.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::extendSelection):

2020-07-23  Peng Liu  <peng.liu6@apple.com>

        Safari Related Leaked Assertions after Playing YouTube Video
        https://bugs.webkit.org/show_bug.cgi?id=214706

        Reviewed by Jer Noble.

        A 10 second grace period before removing the activity token was introduced in r252692.
        However, some websites, e.g., youtube.com, requests the video element to play the
        next video 10 seconds after completing the current one (when the Safari is in the background).
        That can lead to a race condition between the web process and the UI process. They may send
        IPC messages to each other at the same time:
        1) The web process sends a WebPageProxy::IsPlayingMediaDidChange message to the UI process
        to notify that video/audio is playing, so the UI process will take a MediaPlayback assertion.
        2) The UI process sends a WebProcess::PrepareToSuspend message to the web process, which
        will suspend the web process.

        Eventually, the web process will suspend, which means no video/audio playback.
        But the UI process believes that there is a web process playing video/audio, so it will
        take a MediaPlayback assertion.

        This patch fixes the race condition by ignoring the WebPageProxy::IsPlayingMediaDidChange
        message in the UIProcess if the process throttler believes that the process should not be
        running, so that the MediaPlayback assertion will not be created.

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

2020-07-23  Per Arne Vollan  <pvollan@apple.com>

        Crash in block in WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver
        https://bugs.webkit.org/show_bug.cgi?id=214702

        Reviewed by Chris Dumez.

        Calling xpc_connection_send_message in the block in WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver will
        sometimes crash because the XPC connection object is invalid. The block is called on a secondary thread, and the m_connections
        member variable needs to be protected by a lock. Also, make sure the XPC connections objects in m_connections are valid by
        retaining them when captured in a block. This is done by redeclaring a local XPC connection variable as an OSObjectPtr instead
        of a raw XPC connection object.

        No new tests, since I have not been able to reproduce this issue.

        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h:
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm:
        (WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::startObserving):
        (WebKit::LaunchServicesDatabaseObserver::handleEvent):
        * Shared/Cocoa/XPCEndpoint.mm:
        (WebKit::XPCEndpoint::XPCEndpoint):

2020-07-23  Brian Burg  <bburg@apple.com>

        Web Inspector: developerExtrasEnabled should be respected when opening local Web Inspector (part 2)
        https://bugs.webkit.org/show_bug.cgi?id=214669

        Reviewed by Devin Rousso and Joseph Pecoraro.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::save):
        (WebKit::WebInspectorProxy::append): Add missing check for developerExtrasEnabled.

2020-07-23  Sihui Liu  <sihui_liu@appe.com>

        Allow IndexedDB in third-party frames
        https://bugs.webkit.org/show_bug.cgi?id=214583
        <rdar://problem/61278487>

        Reviewed by Geoffrey Garen.

        Do no append extra space to displayName if host is empty.

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

2020-07-23  David Quesada  <david_quesada@apple.com>

        Unable to present file upload picker after interactively dismissing a previously opened picker
        https://bugs.webkit.org/show_bug.cgi?id=209613
        rdar://problem/60931009

        Reviewed by Daniel Bates.

        -[<UIDocumentPickerViewController> documentPickerWasCancelled:] doesn't get called if you
        dismiss the view controller using the interactive swipe dismissal gesture added in iOS 13.
        As a result, the web view will continue to think it's showing a file picker after dismissing
        it this way, meaning you can't present any other file pickers from the same web view. Fix
        this by implementing UIAdaptivePresentationControllerDelegate in WKFileUploadPanel to cancel
        and tear down the file picker operation when the view controller is interactively dismised.

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

2020-07-23  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Datalist dropdown scrollbar position does not match visible region
        https://bugs.webkit.org/show_bug.cgi?id=214656

        Reviewed by Wenson Hsieh.

        Currently, the content insets for the dropdown are set on an NSScrollView's contentView,
        rather than the NSScrollView itself. On the latest macOS, this results in accurate state
        within the NSScrollView, leading to an inaccurate scrollbar position. To fix, set the
        content insets directly on the NSScrollView.

        However, on older macOS, setting content insets on the NSScrollView causes the view to start
        out slightly scrolled (by a value equal to the top inset). This issue is solved by preserving
        the existing behavior (setting insets on the contentView) on older macOS.

        Also, set the style of the embedded NSTableView to NSTableViewStyleFullWidth, to ensure the
        view respects the insets we specify.

        No new tests, as the change is purely visual and affects native UI.

        * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
        (-[WKDataListSuggestionTableView initWithElementRect:]):
        (-[WKDataListSuggestionsController initWithInformation:inView:]):

2020-07-23  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] WebKit::ArgumentCoder<BlobPart>::decode() and encode() should use enum BlobPart::Type
        <https://webkit.org/b/214665>
        <rdar://problem/65777948>

        Reviewed by Darin Adler.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<BlobPart>::encode):
        - Change BlobPart::Type enums to use fully qualified name.
        - Encode using WebCore::BlobPart::Type value.
        - Change break statements to early return statements.
        - Add ASSERT_NOT_REACHED() to catch bugs.
        (IPC::ArgumentCoder<BlobPart>::decode):
        - Change BlobPart::Type enums to use fully qualified name.
        - Decode using Optional<WebCore::BlobPart::Type> variable.
        - Change break statements to early return statements.
        - Remove default: label, move `return WTF::nullopt` to the end
          of the method, and add ASSERT_NOT_REACHED() to catch bugs.

2020-07-23  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] FilterOperation decode/encode should use early returns
        <https://webkit.org/b/214667>
        <rdar://problem/65946400>

        Reviewed by Darin Adler.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<FilterOperation>::encode):
        - Change break statements to early return statements.
        - Add ASSERT_NOT_REACHED() to catch bugs.
        (IPC::decodeFilterOperation):
        - Change break statements to early return statements.
        - Remove call to `decoder.markInvalid()` since it is redundant.
        - Return `false` from FilterOperation::APPLE_INVERT_LIGHTNESS
          label to match FilterOperation::NONE and
          FilterOperation::REFERENCE.
        - Add ASSERT_NOT_REACHED() to catch bugs.
        - Change final return statement from `true` to `false` since
          valid decoding returns `true` earlier.

2020-07-23  Brady Eidson  <beidson@apple.com>

        Add Gamepad tests that exercise the native frameworks
        <rdar://problem/65343674> and https://bugs.webkit.org/show_bug.cgi?id=214188

        Reviewed by Tim Horton.

        Add some testing-only SPI for TestWebKitAPI.

        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (-[WKProcessPool _numberOfConnectedGamepadsForTesting]):
        (-[WKProcessPool _setUsesOnlyHIDGamepadProviderForTesting:]):
        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

        * UIProcess/Gamepad/UIGamepadProvider.h:
        (WebKit::UIGamepadProvider::numberOfConnectedGamepads const):

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::numberOfConnectedGamepadsForTesting):
        (WebKit::WebProcessPool::setUsesOnlyHIDGamepadProviderForTesting):
        * UIProcess/WebProcessPool.h:

2020-07-22  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Add feature flag for WebM & VP9
        https://bugs.webkit.org/show_bug.cgi?id=214672
        <rdar://problem/65959506>

        Reviewed by Beth Dakin.

        * FeatureFlags/WebKit.plist:
        * Shared/WebPreferences.yaml:
        * Shared/WebPreferencesDefaultValues.cpp:
        (WebKit::defaultVP9DecoderEnabled):
        (WebKit::defaultWebMParserEnabled):
        * Shared/WebPreferencesDefaultValues.h:

2020-07-22  Conrad Shultz  <conrad_shultz@apple.com>

        Update macOS Version macros
        https://bugs.webkit.org/show_bug.cgi?id=214653

        Reviewed by Tim Horton.

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

2020-07-22  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo][32bit] ConnectionWin.cpp(327): error C2664: 'BOOL RegisterWaitForSingleObject(...)': cannot convert argument 3 from 'void (__cdecl *)(...)' to 'WAITORTIMERCALLBACK'
        https://bugs.webkit.org/show_bug.cgi?id=214658

        Reviewed by Darin Adler.

        __cdecl and __stdcall calling conventions don't match.
        <https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions>

        * Platform/IPC/Connection.h: Added WINAPI to Connection::EventListener::callback method.

2020-07-22  David Kilzer  <ddkilzer@apple.com>

        Follow-up: [IPC hardening] WebKit::ObjCObjectGraph::decode() and encode() should use enum ObjCType type
        <https://webkit.org/b/214618>
        <rdar://problem/65777899>

        Unreviewed fix to get rid of extra namespace blocks.

        * Shared/mac/ObjCObjectGraph.mm:
        (enum class WebKit::ObjCType):
        - Move enum class definition back to its original location.
        (WTF::EnumTraits<WebKit::ObjCType>):
        - Move to the end of the file.  Noticed this worked in
          ColorSpaceData.mm.

2020-07-22  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] WebKit::ObjCObjectGraph::decode() and encode() should use enum ObjCType type
        <https://webkit.org/b/214618>
        <rdar://problem/65777899>

        Unreviewed fix to include the better header.

        * Shared/mac/ObjCObjectGraph.mm:
        - Switch #include from OptionSet.h to EnumTraits.h.

2020-07-22  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix after r264710; add a HAVE_AVPLAYER_VIDEORANGEOVERRIDE guard.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updatePageScreenProperties):

2020-07-22  Jer Noble  <jer.noble@apple.com>

        [macOS] Adopt AVPlayer.videoRangeOverride
        https://bugs.webkit.org/show_bug.cgi?id=213902
        <rdar://problem/63953509>

        Reviewed by Youenn Fablet.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::screenPropertiesDidChange):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::updatePageScreenProperties):

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

        Scrolling tesla.com on iPad is not smooth
        https://bugs.webkit.org/show_bug.cgi?id=214627
        <rdar://problem/65568979>

        Reviewed by Tim Horton.

        This is the iOS equivalent of the fix in r264203; if the user is scrolling (or we're animating for
        scroll snap), layout should not trigger scroll position changes via computation of the current snap
        location.

        To fix this, we need to send data from the UI process to the web process about which scrolling tree
        nodes the user is scrolling. That's done via RemoteScrollingUIState, which will, in the long term,
        become a more general UI -> WebProcess scrolling state updating mechanism. For now, it just keeps
        track of nodes undergoing scroll snap and user scrolls (only the latter is hooked up for now).

        * Shared/RemoteLayerTree/RemoteScrollingUIState.cpp: Added.
        (WebKit::RemoteScrollingUIState::encode const):
        (WebKit::RemoteScrollingUIState::decode):
        (WebKit::RemoteScrollingUIState::addNodeWithActiveScrollSnap):
        (WebKit::RemoteScrollingUIState::removeNodeWithActiveScrollSnap):
        (WebKit::RemoteScrollingUIState::addNodeWithActiveUserScroll):
        (WebKit::RemoteScrollingUIState::removeNodeWithActiveUserScroll):
        * Shared/RemoteLayerTree/RemoteScrollingUIState.h: Added.
        (WebKit::RemoteScrollingUIState::changes const):
        (WebKit::RemoteScrollingUIState::clearChanges):
        (WebKit::RemoteScrollingUIState::nodesWithActiveScrollSnap const):
        (WebKit::RemoteScrollingUIState::nodesWithActiveUserScrolls const):
        * SourcesCocoa.txt:
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
        (WebKit::RemoteScrollingCoordinatorProxy::sendUIStateChangedIfNecessary):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartPanGesture):
        (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartScroll):
        (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndScroll):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
        (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart const):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd const):
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture const):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in:
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
        (WebKit::RemoteScrollingCoordinator::isUserScrollInProgress const):
        (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress const):
        (WebKit::RemoteScrollingCoordinator::scrollingStateInUIProcessChanged):

2020-07-22  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] WebKit::ObjCObjectGraph::decode() and encode() should use enum ObjCType type
        <https://webkit.org/b/214618>
        <rdar://problem/65777899>

        Reviewed by Youenn Fablet.

        * Shared/mac/ObjCObjectGraph.h:
        - Drive-by fix to use #pragma once.  This is included in some
          plain C++ source files.

        * Shared/mac/ObjCObjectGraph.mm:
        (WebKit::ObjCType):
        - Move enum definition to the top of the file so that the
          EnumTraits<> can be defined after it, but before it's used.
        (WTF::EnumTraits<WebKit::ObjCType>): Add.
        - Define so that IPC::Decoder and IPC::Encoder can validate enum
          values.
        (WebKit::ObjCObjectGraph::encode):
        - Encode using WebKit::ObjCType value.
        - Add ObjCType::Null label so that default: label can be
          removed.  Change break statements to early return statements.
        - Move ASSERT_NOT_REACHED() to the end of the method.
        (WebKit::ObjCObjectGraph::decode):
        - Decode using WebKit::ObjCType value.
        - Change break statements to early return statements.
        - Remove default: label, and move `return false` to the end of
          the method.  Add ASSERT_NOT_REACHED().

2020-07-22  Megan Gardner  <megan_gardner@apple.com>

        Tapped DataDetected links present sub-menus from the wrong location.
        https://bugs.webkit.org/show_bug.cgi?id=214628
        <rdar://problem/64808642>

        When getting the positionInformation associated with presenting DataDetectors UI
        we were not indicating that we need the linkIndicator data. This caused the
        resulting CGRect to not be filled out, and we were returning a zeroed out CGRect
        to the DataDetectors framework for the location that it should present the subMenu from.
        Setting this bit ensures that all the necessary data is calculated and returned
        when a DataDetector link is tapped.

        Reviewed by Wenson Hsieh.

        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
        (WebKit::WebChromeClient::showDataDetectorsUIForElement):

2020-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] ITP: use the database store unconditionally
        https://bugs.webkit.org/show_bug.cgi?id=214590

        Reviewed by Adrian Perez de Castro.

        The memory store is now considered legacy.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): Use
        FileSystem::pathByAppendingComponent() to create the database path.
        (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase): Ensure the directory exists before trying to
        open the database.
        * UIProcess/soup/WebProcessPoolSoup.cpp:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess): Always enable the ITP databae by default.

2020-07-19  Darin Adler  <darin@apple.com>

        Remove live ranges from Editor.h and EditorClient.h
        https://bugs.webkit.org/show_bug.cgi?id=214261

        Reviewed by Sam Weinig.

        * UIProcess/mac/WKPrintingView.mm:
        (-[WKPrintingView rectForPage:]): Use NSZeroRect.

        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
        (WebKit::WebEditorClient::shouldDeleteRange): Updated for live
        range changes and also removed gratuitous call to notImplemented
        since the function is implemented.
        (WebKit::WebEditorClient::shouldBeginEditing): Ditto.
        (WebKit::WebEditorClient::shouldEndEditing): Ditto.
        (WebKit::WebEditorClient::shouldInsertNode): Ditto.
        (WebKit::WebEditorClient::shouldInsertText): Ditto.
        (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
        (WebKit::WebEditorClient::shouldApplyStyle): Ditto.
        (WebKit::WebEditorClient::shouldMoveRangeAfterDelete): Ditto.
        (WebKit::WebEditorClient::didBeginEditing): Ditto.
        (WebKit::WebEditorClient::didEndEditing): Ditto.
        (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
        (WebKit::WebEditorClient::getClientPasteboardData): Ditto.
        (WebKit::WebEditorClient::performTwoStepDrop): Ditto.
        (WebKit::WebEditorClient::overflowScrollPositionChanged): Ditto.
        (WebKit::WebEditorClient::subFrameScrollPositionChanged): Ditto.
        (WebKit::WebEditorClient::setInputMethodState): Ditto.

        * WebProcess/WebCoreSupport/WebEditorClient.h: Updated
        for changes to EditorClient.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::getMarkedRangeAsync): Updated to reduce
        the use of local values and live ranges.
        (WebKit::WebPage::getSelectedRangeAsync): Ditto.
        (WebKit::WebPage::characterIndexForPointAsync): Ditto.
        (WebKit::WebPage::firstRectForCharacterRangeAsync): Ditto.
        (WebKit::WebPage::setCompositionAsync): Ditto.
        * WebProcess/WebPage/glib/WebPageGLib.cpp:
        (WebKit::WebPage::getPlatformEditorState const): Ditto.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getPlatformEditorState const): Ditto.
        (WebKit::WebPage::selectWithGesture): Ditto.
        (WebKit::WebPage::autocorrectionContext): Ditto.
        (WebKit::focusedElementPositionInformation): Ditto.
        (WebKit::WebPage::requestDocumentEditingContext): Ditto.

2020-07-21  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Add experimental MSE WebM parser
        https://bugs.webkit.org/show_bug.cgi?id=214529
        <rdar://problem/65782467>

        Reviewed by Eric Carlson.

        Add an Experimental setting to enable the MSE WebM parser (off by default).

        * Shared/WebPreferences.yaml:

2020-07-21  Tim Horton  <timothy_horton@apple.com>

        watchOS: Web Content process crashes when it tries to open files
        https://bugs.webkit.org/show_bug.cgi?id=214614
        <rdar://problem/65900517>

        Reviewed by Darin Adler.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        Allow reading kern.maxfilesperproc, as it is allowed on macOS and in the Network process sandbox, and libc needs it.

2020-07-21  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Layout tests exiting early with crashes
        https://bugs.webkit.org/show_bug.cgi?id=214612
        <rdar://problem/65897905>

        Reviewed by Brent Fulgham.

        This is caused by the WebContent process making a syscall not allowed by the sandbox.

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

2020-07-21  David Kilzer  <ddkilzer@apple.com>

        WebKit::ColorSpaceData::decode() does not need default: case
        <https://webkit.org/b/214587>
        <rdar://problem/65777868>

        Reviewed by Darin Adler.

        * Shared/mac/ColorSpaceData.mm:
        (WebKit::ColorSpaceData::decode):
        - Remove default: case and add ASSERT_NOT_REACHED() and
          move `return false;` to bottom of the method.

2020-07-21  James Savage  <james.savage@apple.com>

        Unable to call WKScriptMessageHandlerWithReply's replyHandler with a nil errorMessage in Swift
        https://bugs.webkit.org/show_bug.cgi?id=214581
        <rdar://problem/65639342>

        Reviewed by Brady Eidson.

        * UIProcess/API/Cocoa/WKScriptMessageHandlerWithReply.h: Modify the block
        signature to allow nil for either argument.

2020-07-21  Kate Cheney  <katherine_cheney@apple.com>

        Frequent Network error messages: "ResourceLoadStatisticsDatabaseStore::topPrevalentResourceWithUserInteractionDaysSinceUserInteractionStatement query failed to step, error message: no more rows available"
        https://bugs.webkit.org/show_bug.cgi?id=214597
        <rdar://65884740>

        Reviewed by John Wilander.

        We should not log an error message when no rows are returned when running
        telemetry queries, because this is not an error.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::getMedianOfPrevalentResourcesWithUserInteraction):
        (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const):
        Remove unnecessary error logging and only check for telemetry results if the
        query returns a row.

2020-07-21  Youenn Fablet  <youenn@apple.com>

        NetworkConnectionToWebProcess should not handle NetworkRTCProvider messages
        https://bugs.webkit.org/show_bug.cgi?id=214547

        Reviewed by Alex Christensen.

        Normally NetworkRTCProvider is created when starting to monitor the network.
        In case network process is crashing though, there might be requests to open RTC socket on the new network process which has not started to monitor the network.
        In that case, we will go through NetworkConnectionToWebProcess as NetworkRTCProvider is not yet created.
        To properly handle this case, on web process side, we send an IPC message to explictly create the NetworkRTCProvider.
        Once done, we set the IPC connection to the socket factory which will start sending messages to open sockets if needed.
        Until its connection is set, the socket factory will buffer messages to open sockets.
        Covered by test no longer crashing in debug.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        (WebKit::NetworkConnectionToWebProcess::createRTCProvider):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * WebProcess/Network/webrtc/LibWebRTCNetwork.cpp:
        (WebKit::LibWebRTCNetwork::setAsActive):
        (WebKit::LibWebRTCNetwork::setConnection):
        (WebKit::LibWebRTCNetwork::setSocketFactoryConnection):
        * WebProcess/Network/webrtc/LibWebRTCNetwork.h:
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
        (WebKit::LibWebRTCSocketFactory::setConnection):
        (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createUdpSocket):
        (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
        (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:

2020-07-21  Youenn Fablet  <youenn@apple.com>

        Fetch/XHR loads done by extensions should opt out of response sanitisation done in network process
        https://bugs.webkit.org/show_bug.cgi?id=214588
        <rdar://problem/65060560>

        Reviewed by Alex Christensen.

        Send to network process the CORS disabling patterns.
        Disable sanitization for fetch/xhr loads whose pages have a matching pattern.

        Covered by API test.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::setCORSDisablingPatterns):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::shouldDisableCORSForRequestTo const):
        (WebKit::NetworkProcess::setCORSDisablingPatterns):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::shouldSanitizeResponse):
        (WebKit::NetworkResourceLoader::sanitizeResponseIfPossible):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::parseAndAllowAccessToCORSDisablingPatterns):
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        (WebKit::WebPage::~WebPage):
        (WebKit::WebPage::updateCORSDisablingPatterns):
        (WebKit::WebPage::synchronizeCORSDisablingPatternsWithNetworkProcess):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::ensureNetworkProcessConnection):

2020-07-21  Eric Carlson  <eric.carlson@apple.com>

        Use AVRoutePickerView when available for choosing AirPlay devices
        https://bugs.webkit.org/show_bug.cgi?id=213497
        <rdar://problem/58610662>

        Reviewed by Jer Noble.

        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::platformView const): Add new override.

2020-07-21  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Adopt VTRegisterSupplementalVideoDecoderIfAvailable
        https://bugs.webkit.org/show_bug.cgi?id=214585
        <rdar://problem/65863651>

        Reviewed by Youenn Fablet.

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

2020-07-21  Michael Catanzaro  <mcatanzaro@gnome.org>

        [GTK] WebKitSettings:enable-private-browsing missing G_PARAM_DEPRECATED
        https://bugs.webkit.org/show_bug.cgi?id=214554

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init):

2020-07-21  Adrian Perez de Castro  <aperez@igalia.com>

        Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.29.1 release

        * wpe/NEWS: Add release notes for 2.29.1.

2020-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        Fix ITP data summary when using the memory store and blocking all third-party cookies
        https://bugs.webkit.org/show_bug.cgi?id=214401

        Reviewed by Michael Catanzaro.

        The memory store behaves differently than the database one, it only includes prevalent resources in the list,
        while the database store includes all resources when cooking blocking policy is All.

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::aggregatedThirdPartyData const): Only check isPrevalentResource if
        third party cookie blocking mode is not All to decide whether to include the domain in the report.

2020-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Prepare unit tests for GTK4
        https://bugs.webkit.org/show_bug.cgi?id=214251

        Reviewed by Adrian Perez de Castro.

        Make it possible to test input methods.

        * UIProcess/API/glib/InputMethodFilter.h:
        * UIProcess/API/gtk/InputMethodFilterGtk.cpp:
        (WebKit::InputMethodFilter::filterKeyEvent): Added to receive the key event properties instead of the GdkEvent.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSynthesizeMouseEvent): Create a GdkEvent for right clicks since it's needed by GTK3 API.
        (webkitWebViewBaseSynthesizeKeyEvent): Send key press and release events to the IM filter.

2020-07-20  Megan Gardner  <megan_gardner@apple.com>

        Add OK button to Date/Time form controls.
        https://bugs.webkit.org/show_bug.cgi?id=214195
        <rdar://problem/65006000>

        Reviewed by Darin Adler.

        Add 'OK' button to add clarity to UI, and increase the default size of the control to
        ensure space for both buttons. Also fixed a crash that happened when closing the control before
        the animation completed.

        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
        (-[WKDateTimeContextMenuViewController preferredContentSize]):
        (-[WKDateTimePicker contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKDateTimePicker contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
        (-[WKDateTimePicker contextMenuInteraction:willEndForConfiguration:animator:]):
        (-[WKDateTimePicker ok:]):

2020-07-20  Adrian Perez de Castro  <aperez@igalia.com>

        Non unified build fixes, midsummer 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=213616

        Unreviewed build fix.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp: Add missing inclusion of NetworkProcess.h

2020-07-20  Brian Burg  <bburg@apple.com>

        Web Inspector: developerExtrasEnabled should be respected when opening local Web Inspector
        https://bugs.webkit.org/show_bug.cgi?id=214573
        <rdar://problem/65848496>

        Reviewed by David Kilzer.

        Ensure that WKPreferences.developerExtrasEnabled is true prior to opening a Web Inspector
        window. This matches the check in WebCore when deciding to show "Inspect Element" menu item.

        * UIProcess/Inspector/WebInspectorProxy.cpp:
        (WebKit::WebInspectorProxy::connect):
        (WebKit::WebInspectorProxy::openLocalInspectorFrontend):

2020-07-20  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] WebPopupItem should always be forward declared as struct
        https://bugs.webkit.org/show_bug.cgi?id=214569

        Unreviewed build fix.

        No new tests needed.

        * UIProcess/API/wpe/WebKitWebViewClient.h: Forward-declare WebPopupItem as a struct.

2020-07-20  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r263551) Main thread often hangs while saving cookies
        https://bugs.webkit.org/show_bug.cgi?id=214564
        <rdar://problem/65779712>

        Reviewed by Geoffrey Garen.

        I had assumed that CFNetwork wouldn't write cookies on the main thread, but I was wrong.
        That change caused spins, so let's just do the work on the WebsiteDataStore's queue instead.

        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
        (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::dispatchOnQueue):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-07-20  David Kilzer  <ddkilzer@apple.com>

        WebPageProxyIdentifier parameter of WebPageProxy::CreateNewPage() should not be Optional
        <https://webkit.org/b/214542>
        <rdar://problem/65768644>

        Reviewed by Darin Adler.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::createNewPage):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::createNewPage):
        * UIProcess/WebPageProxy.messages.in:
        - Remove Optional<> wrapper for WebPageProxyIdentifier
          parameter since the value is used unconditionally.

2020-07-20  Adrian Perez de Castro  <aperez@igalia.com>

        Some classes have final destructors but are non-final
        https://bugs.webkit.org/show_bug.cgi?id=214549

        Reviewed by Youenn Fablet.

        No new tests needed.

        * NetworkProcess/ServiceWorker/WebSWServerConnection.h: Mark WebSWServerConnection
        class as final.
        * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Ditto.

2020-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        valgrind claims uninitialized memory when opening inspector (WebKit::InspectorBrowserAgent::enable(WTF::String&))
        https://bugs.webkit.org/show_bug.cgi?id=209468

        Reviewed by Michael Catanzaro.

        Initialize m_targetAgent.

        * UIProcess/Inspector/WebPageInspectorController.h:

2020-07-19  Sam Weinig  <weinig@apple.com>

        Rename Color::transparent to Color::transparentBlack to more clearly state what it is
        https://bugs.webkit.org/show_bug.cgi?id=214522

        Reviewed by Darin Adler.

        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (scrollViewBackgroundColor):
        (-[WKWebView _setOpaqueInternal:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::setDrawsBackground):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_transcodingQueue):
        * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
        (webkitWebPageDidReceiveMessage):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::snapshotNode):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
        Color::transparent to Color::transparentBlack.

2020-07-19  Sam Weinig  <weinig@apple.com>

        Remove ColorBuilder
        https://bugs.webkit.org/show_bug.cgi?id=214521

        Reviewed by Darin Adler.

        * WebProcess/Inspector/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::drawRect):
        Update for rename from colorWithAlpha to colorWithAlphaByte.

2020-07-19  Michael Catanzaro  <mcatanzaro@gnome.org>

        Enable cross-platform release logging in ResourceLoadStatisticsDatabaseStore.cpp
        https://bugs.webkit.org/show_bug.cgi?id=214538

        Reviewed by Darin Adler.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

2020-07-18  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r264563.
        https://bugs.webkit.org/show_bug.cgi?id=214518

        Broke the watchOS build

        Reverted changeset:

        "Add OK button to Date/Time form controls."
        https://bugs.webkit.org/show_bug.cgi?id=214195
        https://trac.webkit.org/changeset/264563

2020-07-18  Rob Buis  <rbuis@igalia.com>

        Only use enum classes in HTTPParsers
        https://bugs.webkit.org/show_bug.cgi?id=214451

        Reviewed by Darin Adler.

        Adjust to XFrameOptionsDisposition change.

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

2020-07-17  Sam Weinig  <weinig@apple.com>

        Remove final vestigates of SimpleColor
        https://bugs.webkit.org/show_bug.cgi?id=214439

        Reviewed by Simon Fraser.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::drawInContext):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _tapHighlightColorForFastClick:]):
        * WebProcess/Inspector/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::drawRect):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::paintSnapshotAtSize):
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        Replace remaining makeSimpleColor() uses.

2020-07-17  Megan Gardner  <megan_gardner@apple.com>

        Add OK button to Date/Time form controls.
        https://bugs.webkit.org/show_bug.cgi?id=214195
        <rdar://problem/65006000>

        Reviewed by Darin Adler.

        Add 'OK' button to add clarity to UI, and increase the default size of the control to
        ensure space for both buttons. Also fixed a crash that happened when closing the control before
        the animation completed.

        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
        (-[WKDateTimeContextMenuViewController preferredContentSize]):
        (-[WKDateTimePicker contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKDateTimePicker contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
        (-[WKDateTimePicker contextMenuInteraction:willEndForConfiguration:animator:]):
        (-[WKDateTimePicker ok:]):

2020-07-17  Lauro Moura  <lmoura@igalia.com>

        [GTK] fast/events/context-activated-by-key-event.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=199444

        Reviewed by Michael Catanzaro.

        GTK supports showing the context menu for keyboard events. In these
        cases there may be no pending mouse events, causing the assert to
        fail.

        Covered by existing tests.

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

2020-07-17  Per Arne Vollan  <pvollan@apple.com>

        Add Launch Services database update logging
        https://bugs.webkit.org/show_bug.cgi?id=214500

        Reviewed by Geoffrey Garen.

        Log if the WebContent process is waiting a considerable amount of time for the initial update of the Launch Services database.

        No new tests, since this patch is not introducing any behavior change.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):

2020-07-17  Brent Fulgham  <bfulgham@apple.com>

        Remove logging for necessary sysctl call
        https://bugs.webkit.org/show_bug.cgi?id=214497
        <rdar://problem/65737636>

        Reviewed by Per Arne Vollan.

        We discovered that kern.proc.pid is needed in SecTaskCopyDebugDescription, so
        we can remove that telemetry and logging.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-07-17  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Cache the PIN to improve NFC user experience
        https://bugs.webkit.org/show_bug.cgi?id=213900
        <rdar://problem/60073622>

        Reviewed by Brent Fulgham.

        Cache the PIN to improve NFC user experience. Users might not hold the NFC key against the NFC scanner all the time
        while entering the PIN. Therefore, we cache the PIN from the previous connection and immediately return the cached PIN to
        the current connection such that users don't need to enter the PIN again.

        The only downside for this optimization is that a wrong PIN could be used if the user switch to another authenticator for
        the new connection. Given there is no UUID to identify a particular authenticator, there is nothing we can do to resolve the
        issue. The probability of the issue, however, should be rare.

        Covered by new API tests.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::authenticatorStatusUpdated):
        (WebKit::AuthenticatorManager::requestPin):
        Where the above logic is implemented.

        * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
        (WebKit::NfcConnection::transact const):
        Adds a comment.

        * UIProcess/WebAuthentication/WebAuthenticationRequestData.h:
        * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp:
        (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential):
        (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion):
        Adds a field for the cached PIN.

2020-07-17  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Crash under WebProcess::handleXPCEndpointMessages
        https://bugs.webkit.org/show_bug.cgi?id=214490

        Reviewed by Chris Dumez.

        According to crash logs, it seems possible that the parent process XPC connection can be null. Add a null check,
        and also check that the connection XPC object really is an XPC connection object.

        No new tests, since I have not been able to reproduce this issue.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const):

2020-07-17  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Use MediaOnly user gesture
        https://bugs.webkit.org/show_bug.cgi?id=213595
        <rdar://problem/64946612>

        Reviewed by Brent Fulgham.

        MediaOnly user gesture is more flexible than regular user gesture. For example, it can be propagated through XHR.
        A common use case for WebAuthn is to call the API within XHR events, which could be triggered by user activated events initially.
        By using MediaOnly user gesture, it allows developer to keep using this XHR model.

        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):

2020-07-17  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] Add nullptr checks to WebKit::WebInspectorProxy::platformStartWindowDrag()
        <https://webkit.org/b/214436>
        <rdar://problem/59645910>

        Reviewed by Brent Fulgham.

        * UIProcess/Inspector/mac/WebInspectorProxyMac.mm:
        (WebKit::WebInspectorProxy::platformStartWindowDrag):
        - Add nullptr checks.

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

        Make ScrollbarControlSize an enum class
        https://bugs.webkit.org/show_bug.cgi?id=199325

        Reviewed by Sam Weinig.

        Make ScrollbarControlSize an enum class, and make some RenderScrollbar methods const.

        * UIProcess/win/WebPopupMenuProxyWin.cpp:
        (WebKit::WebPopupMenuProxyWin::showPopupMenu):
        (WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::createScrollbar):

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

        Add a addition point for extra user media sandbox extensions
        https://bugs.webkit.org/show_bug.cgi?id=214445
        <rdar://problem/65148262>

        Reviewed by Per Arne Vollan.

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::UserMediaProcessManager::willCreateMediaStream):
        (WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-07-17  Truitt Savell  <tsavell@apple.com>

        Unreviewed, reverting r264477.

        Broke the internal build

        Reverted changeset:

        "Use AVRoutePickerView when available for choosing AirPlay
        devices"
        https://bugs.webkit.org/show_bug.cgi?id=213497
        https://trac.webkit.org/changeset/264477

2020-07-16  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Add a console message: "User gesture is required to use the platform authenticator."
        https://bugs.webkit.org/show_bug.cgi?id=214380
        <rdar://problem/65300587>

        Reviewed by Devin Rousso.

        Covered by existing tests.

        * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp:
        (WebKit::WebAuthenticatorCoordinator::makeCredential):
        (WebKit::WebAuthenticatorCoordinator::getAssertion):

2020-07-16  Per Arne Vollan  <pvollan@apple.com>

        XPC connection should be suspended before setting target queue
        https://bugs.webkit.org/show_bug.cgi?id=214427

        Reviewed by Darin Adler.

        According to system logs, an active XPC connection should be suspended before setting a new target queue.

        No new tests, since there should be no behavior change introduced by this patch.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const):

2020-07-16  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WTF] Remove the unnecessary inner class DefaultHash<T>::Hash
        https://bugs.webkit.org/show_bug.cgi?id=214389

        Reviewed by Darin Adler.

        * NetworkProcess/Downloads/DownloadID.h:
        * NetworkProcess/cache/NetworkCache.h:
        * NetworkProcess/cache/NetworkCacheKey.h:
        * Platform/IPC/MessageReceiverMap.h:
        * Platform/IPC/StringReference.h:
        * Shared/CallbackID.h:
        * UIProcess/API/cpp/WKRetainPtr.h:

2020-07-16  Takashi Komori  <Takashi.Komori@sony.com>

        [WinCairo][CURL] NetworkProcess consumes CPU resource greedily
        https://bugs.webkit.org/show_bug.cgi?id=214383

        Reviewed by Fujii Hironori.

        Add PolicyAction::Ignore handling routine in NetworkDataTaskCurl::invokeDidReceiveResponse()
        If we don't cancel the ignored requests the worker thread for curl scheduler goes busy-looping because the fds of the requests continue to be monitored.

        No tests needed as existing tests cover this change.

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

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

        iPad cursor is sometimes slow to change to I-beam (e.g. on reddit.com)
        https://bugs.webkit.org/show_bug.cgi?id=214424
        <rdar://problem/59503572>

        Reviewed by Wenson Hsieh.

        No new tests, just an optimization.

        * Shared/ios/InteractionInformationRequest.h:
        * Shared/ios/InteractionInformationRequest.cpp:
        (WebKit::InteractionInformationRequest::encode const):
        (WebKit::InteractionInformationRequest::decode):
        (WebKit::InteractionInformationRequest::isValidForRequest):
        (WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
        'const'-ify these getters

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::positionInformation):
        Make it possible to disable computation of the 'nodeAtPositionHasDoubleClickHandler' property,
        because it can be quite expensive for some web content. We will still compute it by default,
        but high-rate interaction information requests (like those for the cursor) can optionally disable it.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
        (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
        (-[WKContentView _positionInformationDidChange:]):
        When position information updates come in, only clear the outstanding request
        if the reply is valid for that request; otherwise, the outstanding request is
        definitely still outstanding, and we've probably just sent multiple requests.
        A more formal mechanism that actually keeps track of all requests might be
        more appropriate here in the future, but this helps us avoid re-requesting
        position information for the same point repeatedly, just because old (stale)
        updates are coming in.

        (-[WKContentView _cursorInteraction:regionForLocation:defaultRegion:completion:]):
        Instead of requesting an interaction information update for every cursor update,
        and then dropping them on the floor when they return, if a new request was sent,
        simply coalesce all requests that come in while we have an outstanding one.
        This avoids a great deal of unnecessary (and ignored) work when the Web Content
        process is responding to requests at a slower rate than the cursor interaction
        is trying to retrieve new regions.

2020-07-16  Megan Gardner  <megan_gardner@apple.com>

        Selection is not always clearing when tapping.
        https://bugs.webkit.org/show_bug.cgi?id=214326
        <rdar://problem/65069201>

        Reviewed by Wenson Hsieh.

        In r262280 we stopped the UIWKGestureOneFingerTap gesture from starting if the tap was not inside
        the current selection. That caused the selection to not always be cleared, especially when tapping
        on an element that could create an overlay in which the selection was supposed to be obscured. We 
        short circuited this gesture because it used to cause a sync IPC message to be sent to the web process,
        but that code has subsequently changed, so allowing the gesture to start and clear the selection in all
        cases is no longer a performance concern, so changing the behavior back to allowing the gesture to always
        start, even if the touch is not inside the selection rect.

        Test: editing/selection/ios/hide-selection-after-tap-on-prevent-default-element.html

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

2020-07-16  Eric Carlson  <eric.carlson@apple.com>

        Use AVRoutePickerView when available for choosing AirPlay devices
        https://bugs.webkit.org/show_bug.cgi?id=213497
        <rdar://problem/58610662>

        Reviewed by Jer Noble.

        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::platformView const): Add new override.

2020-07-16  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Add MediaCapabilities support for SW VP9 decoder.
        https://bugs.webkit.org/show_bug.cgi?id=214316

        Reviewed by Eric Carlson.

        Pass the system AC state to the WebContent process at creation time, and also create
        a power state listener so the WebProcess can be updated dynamically.

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

2020-07-16  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Add syscall to WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=214394
        <rdar://problem/65638758>

        Reviewed by Darin Adler.

        Add required syscall to WebContent process on macOS.

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

2020-07-16  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix logging added in r264414 that was incorrectly marked as "error" logging.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

2020-07-16  Tuomas Karkkainen  <tuomas.webkit@apple.com>

        ASAN builds of WebKit should not freeze when an EXC_RESOURCE is delivered
        https://bugs.webkit.org/show_bug.cgi?id=214346

        Reviewed by Mark Lam.

        When the WebContent process allocates 1000 MB of memory or starts 32
        threads, it receives an EXC_RESOURCE. This requires iterating all the
        mappings of the process. For the case of a process instrumented with
        AddressSanitizer, the mappings total 20 terabytes, and cause the
        process to "freeze" for several minutes. 

        Setting the sysctl debug.toggle_address_reuse to 1 causes the
        EXC_RESOURCE mechanism to skip iteration of all the mappings. 

        With this patch, setting the environment variable 
        DISABLE_FREEZING_ON_EXC_RESOURCE will set the sysctl mentioned above
        for WebContent and Networking processes.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:

2020-07-15  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed, revert part of r264385.

        The change set r264385 speculatively added two messages to the mach-kernel-endpoint filter on iOS.
        These messages are not needed, and should be removed.

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

2020-07-15  Darin Adler  <darin@apple.com>

        Remove a few more uses of the terms black/white list
        https://bugs.webkit.org/show_bug.cgi?id=214371

        Reviewed by Alex Christensen.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): Reworded a comment.

2020-07-15  Devin Rousso  <drousso@apple.com>

        should represent `TextPlaceholderElement` as an `NSTextAttachmentCharacter` instead of a `\n`
        https://bugs.webkit.org/show_bug.cgi?id=214331
        <rdar://problem/64779558>

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/UIKitSPI.h:
        Add missing SPI declarations.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView removeTextPlaceholder:willInsertText:completionHandler:]):
        Drive-by: ensure that the `completionHandler` is always called.

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

        itsnicethat.com page is sometimes non-scrollable
        https://bugs.webkit.org/show_bug.cgi?id=214362
        <rdar://problem/65431127>

        Reviewed by Tim Horton.

        This page uses 'clip-path: inset(1px); on a 1px x 1px element to hit descendants from
        hit-testing and compositing code turns this into a layer mask using a CAShapeLayer.
        Our layer/view hit-testing code failed to check for masking; if a layer has a mask,
        it needs to be handled like -masksToBounds, in that points outside the mask should
        never hit descendant layers.

        Make a -_web_maskContainsPoint: to test whether the point is inside the mask layer,
        and _web_maskMayIntersectRect: which does approximate testing using path bounds
        intersection (this is used for editable regions).

        Also convert some hard-coded winding rule strings to use the CA constants.

        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::collectDescendantViewsAtPoint):
        (WebKit::collectDescendantViewsInRect):

2020-07-15  Chris Dumez  <cdumez@apple.com>

        Improve navigation policy decision release logging to help better diagnose issues
        https://bugs.webkit.org/show_bug.cgi?id=214368

        Reviewed by Alex Christensen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didReceivePolicyDecision):

2020-07-15  Chris Dumez  <cdumez@apple.com>

        [WK2] Make establishing a connection between the WebProcess and the Network process more robust
        https://bugs.webkit.org/show_bug.cgi?id=214307
        <rdar://problem/64592340>

        Reviewed by Alex Christensen.

        Make establishing a connection between the WebProcess and the Network process more robust.
        When the network process is crashy, it is not uncommon for the WebProcess to fail to establish
        a connection to the network process. Previously, we would try twice and then give up by calling
        CRASH(). I have tweaked the logic so that we now try 10 times and wait 100 ms between each
        attempt to make a best effort at establishing the connection. I also updated the logic to exit
        cleanly instead of crashing if the IPC connection to the UIProcess becomes invalid (i.e. the
        UIProcess has severed the connection because this WebProcess is no longer needed).

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

2020-07-15  Rob Buis  <rbuis@igalia.com>

        Building AccessibilitySupportSPI with the macOS Big Sur public SDK fails
        https://bugs.webkit.org/show_bug.cgi?id=214237

        Reviewed by Alex Christensen.

        Need to include HIServicesSPI.h for _AXUIElementRequestServicedBySecondaryAXThread.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:

2020-07-15  Brady Eidson  <beidson@apple.com>

        Update a WKPreferences API comment.
        https://bugs.webkit.org/show_bug.cgi?id=214360

        Rubberstamped by Tim Horton

        * UIProcess/API/Cocoa/WKPreferences.h:

2020-07-15  Lauro Moura  <lmoura@igalia.com>

        [SOUP] Artificial delay to WebSocket connection to mitigate port scanning attacks
        https://bugs.webkit.org/show_bug.cgi?id=214293

        Reviewed by Carlos Garcia Campos.

        r264306 added an artificial delay when NetworkSocketStream closed due
        to closed ports but Soup-based ports use another code path and were
        still returning immediately.

        SOUP WebSocket errors do not distinguish closed ports separately, so
        this commit checks for connections that finished with NOT_WEBSOCKET
        errors.

        Covered by existing tests.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::randomClosedPortDelay): Move the delay
        calculation here to be shared between the different code paths.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSocketStream.cpp:
        (WebKit::NetworkSocketStream::didFailSocketStream): Use the shared
        delay.
        (WebKit::randomDelay): Deleted.
        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::WebSocketTask): Add a oneShot timer with
        random duration when failing to connect to something that is not a
        WebSocket.
        (WebKit::WebSocketTask::delayFailTimerFired):

2020-07-14  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add missing messages to message filter in WebContent sandbox
        https://bugs.webkit.org/show_bug.cgi?id=214334
        <rdar://problem/65529952>

        Reviewed by Brent Fulgham.

        Allow some messages which are required in the message filter in the WebContent process on iOS.

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

2020-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r264101): Sharing a link attaches an image instead of the URL
        https://bugs.webkit.org/show_bug.cgi?id=214329
        <rdar://problem/65513607>

        Reviewed by Tim Horton and Devin Rousso.

        r264101 added logic that attempts to share an activated (i.e. long-pressed) element as an image, if the image
        URL scheme for the element is equal to "data" (ignoring case sensitivity). However, in the case where the image
        URL is nil, the call to `[element.imageURL.scheme caseInsensitiveCompare:@"data"]` is 0, which (conveniently) is
        equal to `NSOrderedSame`. This causes us to incorrectly proceed by sharing the element as an image.

        Fix this by going through URL::protocolIsData(), so we don't end up with 0 (`NSOrderedSame`) when
        `element.imageURL.scheme` is `nil`.

        Test: ShareSheetTests.ShareAnchorElementAsURL

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant handleElementActionWithType:element:needsInteraction:]):

2020-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] The completion handler in -handleKeyWebEvent:withCompletionHandler: is sometimes never called
        https://bugs.webkit.org/show_bug.cgi?id=214295
        <rdar://problem/60539389>

        Reviewed by Devin Rousso.

        This is a speculative fix for <rdar://problem/60539389>, wherein hardware key commands seemingly stop working in
        a web page that is (presumably) otherwise responsive. It's possible that the bug exercises a scenario in which
        the completion handler in `-[WKContentView handleKeyWebEvent:withCompletionHandler:]` is never invoked, which
        subsequently leads to the keyboard task queue being backed up with key events.

        This can happen in several ways. For instance, if the web process is swapped or terminates in the middle of
        handling a key event, the key event queue will be cleared, but the UI process will still retain the (uncalled)
        completion handler for that key event. Additionally, `WebPageProxy::handleKeyboardEvent` may not even have
        attempted to propagate the event to the web process, in which case we shouldn't be saving the completion handler
        and waiting for a response.

        Test:   KeyboardInputTests.HandleKeyEventsInCrashedOrUninitializedWebProcess
                KeyboardInputTests.HandleKeyEventsWhileSwappingWebProcess

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

        Make this return a `bool` indicating whether the key event was sent to the web process. If not, then we
        should immediately invoke the completion handler in -handleKeyWebEvent:withCompletionHandler: below, instead of
        stashing the Objective-C block and waiting for a response from the web process (which is presumably not
        running).

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView _cancelPendingKeyEventHandler]):

        When the web process terminates or swaps in the middle of handling a key event, go ahead and invoke the key
        event completion handler early with the queued event, since we aren't going to receive a response from the web
        process anyways.

        (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):

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

        Flashes of incorrect scroll position when zooming on quip
        https://bugs.webkit.org/show_bug.cgi?id=214273
        <rdar://problem/59385421>

        Reviewed by Tim Horton.
        
        Quip uses a non-scrollable "body { overflow:hidden }")" page, but aggressively scrolls to 0,0 if it
        gets a scroll event and top/left are non-zero. Panning is necessarily allowed on overflow:hidden pages,
        so to avoid programmatic scrolls yanking the content to 0,0 during interaction, ignore them if
        the page is non-scrollable yet zoomed.
        
        When refusing such a scroll, we have to inform the web process to avoid mismatched ui/web process state,
        and work around the fact that WebPageProxy::updateVisibleContentRects() would bail if the update
        appeared to be the same as the last one.

        Test: fast/scrolling/ios/programmatic-scroll-while-zoomed.html

        * UIProcess/API/Cocoa/WKWebViewInternal.h:
        * UIProcess/API/ios/WKWebViewIOS.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _updateScrollViewForTransaction:]):
        (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
        (-[WKWebView _scheduleForcedVisibleContentRectUpdate]):
        (-[WKWebView _updateVisibleContentRects]):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const):
        (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableOrZoomedMainFrame const):
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WKContentView.h:
        * UIProcess/ios/WKContentView.mm:
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:sendEvenIfUnchanged:]):
        (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::updateVisibleContentRects):

2020-07-14  Kate Cheney  <katherine_cheney@apple.com>

        [ macOS iOS ] http/tests/resourceLoadStatistics/telemetry-generation-basic-functionality-database.html is a rare flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=212165
        <rdar://problem/63462045>

        Reviewed by Brent Fulgham.

        Test was flaking because of multiple async calls to submit telemetry,
        which happen when a new ITP store is created and again when the test
        makes an SPI call. If the first telemetry call is reported after the test
        sets notifyPagesWhenTelemetryWasCaptured but before the SPI call to capture
        telemetry is submitted, the test will receive the wrong data.
        To fix this, we should simplify by removing the separate function to
        tell ITP to report telemetry, and instead always report when the testing
        SPI call is made. 

        No new tests, will fix flaky tests.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry const):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
        Pass in new enum value to indicate when the telemetry call is coming
        from the testing SPI.

        (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenTelemetryWasCaptured): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
        (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
        (WebKit::WebResourceLoadStatisticsTelemetry::submitTelemetry):
        (WebKit::WebResourceLoadStatisticsTelemetry::setNotifyPagesWhenTelemetryWasCaptured): Deleted.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h:
        Remove static bool variable notifyPagesWhenTelemetryWasCaptured and
        rely on the submitTelemetry function call to let us know when to report telemetry.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::setNotifyPagesWhenTelemetryWasCaptured): Deleted.
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured): Deleted.
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setNotifyPagesWhenTelemetryWasCaptured): Deleted.
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured): Deleted.
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        Remove setNotifyPagesWhenTelemetryWasCaptured function.

2020-07-14  Daniel Bates  <dabates@apple.com>

        [iOS] Sometimes unable to type Japanese on docs.google.com
        https://bugs.webkit.org/show_bug.cgi?id=214272
        <rdar://problem/59449972>

        Reviewed by Wenson Hsieh.

        Tell the web process to restore the selection of the focused element when re-focusing it
        on page activation.

        When resigning first responder the text interaction assistant is deactivated and calls
        back into WKContentView's -clearSelection, which clears the focused element and tells
        the web process to clear the selection. Keep in mind that the focused element in the web
        process is not changed. When the WKContentView subsequently becomes first responder the
        web process messages the UI process to tell it to start assistance (aka focus) for focused
        element. However the selection is not restored and thus the editor state the UI process
        has, and is even sent up until there is a selection change, mismatches with the focused
        element information it also has. To match Mac, key events are only passed to the input
        manager if an editable element is focused (see <https://bugs.webkit.org/show_bug.cgi?id=199122>).
        So, key events are not passed to the input manager when in this state. To prevent this,
        restore the selection of the focused element when the element is re-focused because the
        page became active again.

        Selection restoration is driven by the UI process (not the web process) because element re-
        focusing may be denied by the embedding client. In this case, selection should not be restored
        because UI assistance was not started. For the same reason, I do not restore it in -becomeFirstResponderForWebView.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView _didCommitLoadForMainFrame]):
        Clear out the flag. See below for more details.

        (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): Pass the key to the input manager
        if the _treatAsContentEditableUntilNextEditorStateUpdate is YES.
        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
        If this request is a result of the page activating (aka focus activity change) into an editable field
        (i.e. mayContainSelectableText() resturns YES) and assistance is not being suppressed then tell the web
        process to restore the selection. As part of this I tell the text interaction assistant to activate even
        though -becomeFirstResponderForWebView was called beforehand because -becomeFirstResponderForWebView only
        activates it if there is a non-empty selection. (Note the page having an empty selection could have been
        a result of -clearSelection having been called though the page could have done it programmatically as well).
        I also set a new flag to YES and schedule a full editor state update to ensure this flag is cleared.
        The flag is so that key events that come in between now and the next editor state update are passed to the
        input manager.
        (-[WKContentView _didUpdateEditorState]): Clear out the flag. See above for more details.

2020-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed non-unified build fixes

        * NetworkProcess/NetworkSocketStream.cpp:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreGetAllStorageAccessEntries):
        * UIProcess/WebContextMenuProxy.cpp:
        * UIProcess/WebOpenPanelResultListenerProxy.h:

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

        Add more logging for navigation policy decisions on UIProcess side
        https://bugs.webkit.org/show_bug.cgi?id=214277

        Reviewed by Geoffrey Garen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):

2020-07-13  Ryan Haddad  <ryanhaddad@apple.com>

        Remove live ranges from Document.h, AlternativeTextController.h, DictionaryLookup.h, and WebPage.h
        https://bugs.webkit.org/show_bug.cgi?id=214109

        Unreviewed Catalyst build fix.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::dictionaryPopupInfoForRange):

2020-07-13  Kate Cheney  <katherine_cheney@apple.com>

        Followup to bug 213143: Add artificial delay to WebSocket connections to mitigate port scanning attacks
        https://bugs.webkit.org/show_bug.cgi?id=213143

        Reviewed by Darin Adler.

        Convert min and max millisecond values from double/int to Seconds.

        No new tests, behavior should not change.

        * NetworkProcess/NetworkSocketStream.cpp:
        (WebKit::randomDelay):

2020-07-13  Eric Carlson  <eric.carlson@apple.com>

        Impossible to pause playback of MediaStream video track
        https://bugs.webkit.org/show_bug.cgi?id=214262
        <rdar://problem/65483729>

        Reviewed by Jer Noble.

        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        (WebKit::RemoteSampleBufferDisplayLayer::play):
        (WebKit::RemoteSampleBufferDisplayLayer::pause):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
        (WebKit::SampleBufferDisplayLayer::play):
        (WebKit::SampleBufferDisplayLayer::pause):
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:

2020-07-13  Sam Weinig  <weinig@apple.com>

        Replace single argument makeSimpleColor uses with their implementation
        https://bugs.webkit.org/show_bug.cgi?id=214240

        Reviewed by Darin Adler.

        * UIProcess/API/wpe/WebKitColor.cpp:
        (webkitColorToWebCoreColor):
        Replace makeSimpleColor with convertToComponentBytes.

2020-07-13  Per Arne Vollan  <pvollan@apple.com>

        Crash under WebKit::LaunchServicesDatabaseManager::didConnect()
        https://bugs.webkit.org/show_bug.cgi?id=214263

        Reviewed by Darin Adler.

        There is a crash under WebKit::LaunchServicesDatabaseManager::didConnect() when trying to send a message to an invalid connection.

        No new tests, since I have not been able to reproduce.

        * WebProcess/cocoa/LaunchServicesDatabaseManager.mm:
        (WebKit::LaunchServicesDatabaseManager::didConnect):

2020-07-13  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION (r262538): Nullptr Deref in WTF::Detail::CallableWrapper<WebKit::WebResourceLoadStatisticsStore::performDailyTasks()::$_66, void>::call
        https://bugs.webkit.org/show_bug.cgi?id=214264
        <rdar://problem/65093949>

        Reviewed by Darin Adler.

        A new type check was added outside of the protecting nullptr check. This introduced
        a new nullptr dereference bug.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):

2020-07-13  Kate Cheney  <katherine_cheney@apple.com>

        Add artificial delay to WebSocket connections to mitigate port scanning attacks
        https://bugs.webkit.org/show_bug.cgi?id=213143
        <rdar://problem/64308927>

        Reviewed by Alex Christensen.

        When establishing web socket connections, closed ports typically
        return an error more quickly than open ports due to the additional
        time it takes open ports to perform a TLS handshake. This patch
        adds a delay to the closed-port case to prevent distinguishing these
        cases.

        Test: http/tests/websocket/tests/hybi/closed-port-delay.html

        * NetworkProcess/NetworkSocketStream.cpp:
        (WebKit::NetworkSocketStream::NetworkSocketStream):
        (WebKit::randomDelay):
        Add a random delay between 10 and 100ms before sending IPC.

        (WebKit::NetworkSocketStream::sendDelayedFailMessage):
        (WebKit::NetworkSocketStream::didFailSocketStream):
        Only delay for the proper error code indicating the connection
        was refused for a closed port.

        * NetworkProcess/NetworkSocketStream.h:

2020-07-13  Zan Dobersek  <zdobersek@igalia.com>

        [GTK][WPE] WTR and API-tests timing out after r264283
        https://bugs.webkit.org/show_bug.cgi?id=214244

        Reviewed by Carlos Garcia Campos.

        r264283 broke local file loads at least for GTK and WPE ports due to
        additionally-introduced ENABLE(SANDBOX_EXTENSIONS) build guards.

        This patch reverts to using the sandboxing code without these guards,
        relying instead on no-op SandboxExtension implementations for ports not
        yet providing the system-specific sandboxing functionality. Uses of the
        audit token functionality (only available on Cocoa platforms) gain
        HAVE(AUDIT_TOKEN) guards. Overall the changes keep the r264283-enabled
        code running where viable while unbreaking local file loading for other
        ports.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load):

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

        [macOS]: A HEIF image, selected from the OpenPanel, should be converted to an accepted MIME type
        https://bugs.webkit.org/show_bug.cgi?id=213347
        <rdar://problem/57258464>

        Reviewed by Darin Adler.

        Transcode the images given the list of the selected file and the allowed
        MIME types. Only selected files whose MIME types do not exist in the allowed
        MIME types will be transcoded. Right now, this only will apply to the HEIF
        images on macOS.

        * Platform/ImageUtilities.h: Renamed from Source/WebKit/Platform/cg/CGUtilities.h.
        * Platform/Logging.h:
        * Platform/cg/CGUtilities.cpp: Removed.
        * Platform/cg/ImageUtilitiesCG.cpp: Added.
        (WebKit::transcodeImage):
        (WebKit::findImagesForTranscoding):
        (WebKit::transcodeImages):
        Implement a function that transcodes images among a set of files given
        the allowedMIMETypes. The destination MIME type of these images is the
        first MIME type in the allowedMIMETypes which CG supports encoding to.

        * Shared/cg/ShareableBitmapCG.cpp:
        (WebKit::ShareableBitmap::paint):
        Call drawNativeImage() after renaming paintImage() to drawNativeImage().

        * SourcesCocoa.txt:

        * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
        (WKOpenPanelParametersCopyAllowedMIMETypes):
        * UIProcess/API/C/WKOpenPanelParametersRef.h:
        * UIProcess/API/C/WKOpenPanelResultListener.cpp:
        (WKOpenPanelResultListenerChooseFiles):
        * UIProcess/API/C/WKOpenPanelResultListener.h:
        Transfer the list of the allowed MIME types from the OpenPanel to the
        file chooser listener.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_transcodingQueue):
        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithImageTranscoding):
        Transcode the images in a work queue so the UI process is not blocked. 
        Once the transcoding finishes, the message will be sent to the WebPage.

        (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
        * UIProcess/WebPageProxy.h:
        * WebKit.xcodeproj/project.pbxproj:

2020-07-12  Darin Adler  <darin@apple.com>

        REGRESSION (r261152): 9 blocks of critical sandboxing code disabled because they are guarded with HAVE(SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN)
        https://bugs.webkit.org/show_bug.cgi?id=214233

        Reviewed by Per Arne Vollan.

        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const): Remove #if HAVE.
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Ditto.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): Ditto.
        (WebKit::WebPageProxy::loadRequestWithNavigationShared): Ditto.
        (WebKit::WebPageProxy::loadFile): Ditto.
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shouldSendPendingMessage): Ditto.
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): Ditto.

2020-07-11  Darin Adler  <darin@apple.com>

        Remove live ranges from AccessibilityObject.h, AccessibilityObjectInterface.h, AccessibilityRenderObject.h, AXIsolatedObject.h
        https://bugs.webkit.org/show_bug.cgi?id=214215

        Reviewed by Sam Weinig.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext): Use nested if for start and end
        so we don't do the work on end if the test fails on start.

2020-07-10  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Prompt for requestStorageAccess is inverted in WKWebView 
        https://bugs.webkit.org/show_bug.cgi?id=214198
        <rdar://problem/65369725>

        Reviewed by Darin Adler.

        The labels for "allow" and "deny" StorageAccess API were inverted in the WKWebView
        implementation.

        * UIProcess/Cocoa/WKStorageAccessAlert.mm:
        (WebKit::presentStorageAccessAlert):

2020-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Prevent SPI clients from making the minimum layout height or width negative
        https://bugs.webkit.org/show_bug.cgi?id=214199
        <rdar://problem/64109242>

        Reviewed by Tim Horton.

        It's an error in the embedding client to override the minimum layout size with a negative width or height (in
        this case, Mail on iOS). This happens when double tapping on a contact pill in the "To:" line in Mail compose,
        which causes the top content inset of the web view's scroll view to increase such that Mail's logic for
        overriding layout width ends up passing a negative height.

        After a recent change (<https://trac.webkit.org/r261874>), this now results in the web view immediately
        scrolling to an incorrect content offset when rotating into landscape mode after double tapping a contact. Fix
        this by clamping the overridden layout size to a minimum of (0, 0), to prevent SPI clients from triggering
        subtle bugs like this in the future.

        Test: WebKit.OverrideMinimumLayoutSizeWithNegativeHeight

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):

2020-07-08  Darin Adler  <darin@apple.com>

        Remove live ranges from Document.h, AlternativeTextController.h, DictionaryLookup.h, and WebPage.h
        https://bugs.webkit.org/show_bug.cgi?id=214109

        Reviewed by Sam Weinig.

        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
        (-[WKWebProcessPlugInBrowserContextController selectedRange]): Updated since
        WebPage::currentSelectionAsRange returns SimpleRange.

        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::performDictionaryLookupAtLocation): Updated since
        DictionaryLookup::rangeAtHitTestResult returns SimpleRange.
        (WebKit::WebPage::performDictionaryLookupForSelection): Updated since
        DictionaryLookup::rangeForSelection returns SimpleRange.
        (WebKit::WebPage::performDictionaryLookupForRange): Take SimpleRange.
        (WebKit::WebPage::dictionaryPopupInfoForRange): Ditto.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::currentSelectionAsRange): Return SimpleRange.

        * WebProcess/WebPage/WebPage.h: Use SimpleRange instead of live ranges.

        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::selectWithGesture): Updated since m_startingGestureRange
        is SimpleRange.
        (WebKit::WebPage::clearSelection): Ditto.
        (WebKit::WebPage::rangeForGranularityAtPoint): Return SimpleRange.
        (WebKit::WebPage::selectTextWithGranularityAtPoint): Update since
        rangeForGranularityAtPoint returns SimpleRange.
        (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): Use
        SimpleRange.
        (WebKit::WebPage::updateSelectionWithExtentPoint): Use auto.

        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performImmediateActionHitTestAtLocation): Update
        since lookupTextAtLocation returns SimpleRange.
        (WebKit::WebPage::lookupTextAtLocation): Return SimpleRange.

2020-07-10  Brady Eidson  <beidson@apple.com>

        Limit MultiGamepadProvider to Catalina and Big Sur.
        https://bugs.webkit.org/show_bug.cgi?id=214190

        Unreviewed build fix.

        * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
        (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):

2020-07-10  Brent Fulgham  <bfulgham@apple.com>

        [IPC hardening] Use MESSAGE_CHECK in WebPageProxy::setColorPickerColor()
        https://bugs.webkit.org/show_bug.cgi?id=214168
        <rdar://problem/58632672>

        Reviewed by David Kilzer.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setColorPickerColor): Replace ASSERT with
        MESSAGE_CHECK.

2020-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Flush the cairo surface after painting when using software
        https://bugs.webkit.org/show_bug.cgi?id=214177

        Reviewed by Adrian Perez de Castro.

        This is similar to bug #210636 but it happens under wayland when using GTK4. It's good idea to flush always
        after painting in any case, so we do ity in case of GTK3 as well.

        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::snapshot): Call cairo_surface_flush() after drawing.
        (WebKit::AcceleratedBackingStoreWayland::paint): Ditto.

2020-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK4 build

        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (fileChooserDialogResponseCallback):
        (webkitWebViewRunFileChooser):
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::snapshot):

2020-07-09  Brady Eidson  <beidson@apple.com>

        Multiplex the HID and GameController gamepad providers on Mac.
        <rdar://problem/63192532> and https://bugs.webkit.org/show_bug.cgi?id=214126

        Reviewed by Tim Horton.

        * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
        (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):

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

        "ESPN Fantasy Sports" does not respond to mouse events, only touch events
        https://bugs.webkit.org/show_bug.cgi?id=214165
        <rdar://problem/64671543>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView shouldUseMouseGestureRecognizer]):
        Add a bundle check.

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

        [macOS] Adopt the WebKit-specific PAC key and entitlements
        https://bugs.webkit.org/show_bug.cgi?id=214162
        <rdar://problem/65099687>

        Reviewed by Geoffrey Garen.

        Add the relevant entitlements for PAC use and exceptions on macOS. This will be
        ignored on Intel, but will be a great thing on Apple Silicon!

        * Scripts/process-entitlements.sh:

2020-07-09  Per Arne Vollan  <pvollan@apple.com>

        Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=214099

        Reviewed by Alex Christensen.

        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h:
        * Shared/Cocoa/XPCEndpoint.h: Copied from Source/WebCore/platform/cocoa/XPCEndpoint.h.
        * Shared/Cocoa/XPCEndpoint.mm: Copied from Source/WebCore/platform/cocoa/XPCEndpoint.mm.
        (WebCore::XPCEndpoint::XPCEndpoint): Deleted.
        (WebCore::XPCEndpoint::sendEndpointToConnection): Deleted.
        (WebCore::XPCEndpoint::endpoint const): Deleted.
        * Shared/Cocoa/XPCEndpointClient.h: Copied from Source/WebCore/platform/cocoa/XPCEndpointClient.h.
        (WebCore::XPCEndpointClient::~XPCEndpointClient): Deleted.
        * Shared/Cocoa/XPCEndpointClient.mm: Copied from Source/WebCore/platform/cocoa/XPCEndpointClient.mm.
        (WebCore::XPCEndpointClient::setEndpoint): Deleted.
        (WebCore::XPCEndpointClient::connection): Deleted.
        * UIProcess/Network/NetworkProcessProxyCocoa.mm:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/cocoa/LaunchServicesDatabaseManager.h:
        * WebProcess/cocoa/LaunchServicesDatabaseManager.mm:
        * WebProcess/cocoa/WebProcessCocoa.mm:

2020-07-09  Zalan Bujtas  <zalan@apple.com>

        [iOS] Conversation view messages in Mail are too small and scrollable
        https://bugs.webkit.org/show_bug.cgi?id=214157
        <rdar://problem/64788069>

        Reviewed by Wenson Hsieh.

        Revert the drive-by contentSize set optimization introduced in r262721.
        iOS Mail relies on this delayed/late setContentSize call on WKScrollView (see rdar://problem/65277759).

        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]):

2020-07-09  Lauro Moura  <lmoura@igalia.com>

        [GTK] Remaining build fix after r264179

        Like last revision, avoid "missing binary operator before(" errors
        when WPE libraries are not installed.

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

2020-07-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r259840): Pressing Esc or ⌘+"." does not dismiss time picker on iOS
        https://bugs.webkit.org/show_bug.cgi?id=214122
        <rdar://problem/64940487>

        Reviewed by Tim Horton.

        Prior to r259840, when presenting context menus for certain input types (i.e. "time" and "datetime-local") on
        iOS, UIKit would tell the presented view controller's view (a `UIDatePicker` in this case) to become first
        responder. As a result, `WKContentView` would resign first responder, which (by default) blurs the focused
        element and dismisses the context menu. The result is thats time pickers would immediately dismiss upon
        presentation.

        To mitigate this, r259840 adopted the existing active focus retaining mechanism to temporarily decouple
        WKContentView's first responder status from the currently focused form element. However, this also causes
        `-endEditingAndUpdateFocusAppearanceWithReason:` to bail, due to `self.webView._retainingActiveFocusedState`
        returning `YES`. This means that codepaths meant to immediately dismiss UI for the focused element (for example,
        when pressing Escape on a hardware keyboard on iOS) will not be able to dismiss UI.

        To fix this, push the flag that keeps track of whether we're relinquishing first responder to the focused
        element down into `WKContentView`, and have `WKContentView` automatically stop relinquishing first responder to
        the focused element in `-[WKContentView accessoryDone]`.

        Fixes an existing test: fast/forms/ios/dismiss-picker-using-keyboard.html

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

        Stop relinquishing focus to the focused element, so that form elements that require first responder can be
        dismissed when triggering `-accessoryDone` (e.g. when pressing the Esc key on a hardware keyboard).

        (-[WKContentView startRelinquishingFirstResponderToFocusedElement]):
        (-[WKContentView stopRelinquishingFirstResponderToFocusedElement]):

        Renamed from `-preserveFocus` and `-releaseFocus`, respectively. Also, made these methods idempotent using a new
        `BOOL` flag, `_isRelinquishingFirstResponderToFocusedElement`.

        (-[WKContentView preserveFocus]): Deleted.
        (-[WKContentView releaseFocus]): Deleted.
        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
        (-[WKDateTimePicker controlBeginEditing]):
        (-[WKDateTimePicker controlEndEditing]):

        Use the renamed WKContentView methods, and also remove the `_preservingFocus` flag.

        * UIProcess/ios/forms/WKFormPopover.mm:
        (-[WKRotatingPopover presentPopoverAnimated:]):
        (-[WKRotatingPopover dismissPopoverAnimated:]):

        Use the renamed WKContentView methods.

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

        [iOS] Stop telemetry collection for the 'hw.cpu64bit_capable' sysctl
        https://bugs.webkit.org/show_bug.cgi?id=214148
        <rdar://problem/65222086>

        Reviewed by Per Arne Vollan.

        Telemetry shows that SQLite3 on iOS-based builds needs read access to the
        'hw.cpu64bit_capable' sysctl. We can stop logging this.

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

2020-07-09  Lauro Moura  <lmoura@igalia.com>

        [GTK] Buildfix when WPEBackend-fdo is not available

        Using the && operator for WPE_FDO_CHECK_VERSION was giving the
        "missing binary operator before(" error as the macro was not defined
        when the backend is not installed, like in the LTS/Debian vanilla
        bots.

        Unreviewed build fix.

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

2020-07-09  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Update Launch Services database in the WebContent process from the Network process
        https://bugs.webkit.org/show_bug.cgi?id=213794

        Reviewed by Brent Fulgham.

        To be able to deny mach lookup access to the Launch Services database mapping service in the WebContent process, the database needs to be
        sent from the Networking process to the WebContent process, represented by an xpc object. The Networking process is chosen instead of the UI
        process, since WebKit is controlling the sandbox of the Networking process. There is already a direct connection between the Networking
        process and the WebContent process, but this is a CoreIPC connection. Since the database is represented by an xpc object, an xpc connection
        is requiered to transfer the database. This patch creates a direct xpc connection between the Networking process and the WebContent process,
        by creating an xpc endpoint in the Networking process, sending this to the UI process over the bootstrap xpc connection, and then providing
        each WebContent process with this endpoint by sending it over the bootstrap xpc connection between the UI process and the WebContent process.
        This endpoint has to be sent via the xpc connections to the UI process, since the already existing direct connection between the Networking
        process and the WebContent process is a lower level CoreIPC connection, which does not support transferring xpc objects like the xpc endpoint.
        When the WebContent process receives the endpoint, it will create an xpc connection from the endpoint, which will create a direct connection
        with the Networking process. A message is then sent over the connection to request the database xpc object. When the Networking process
        receives this message, it checks the entitlement of the remote end to make sure it is communicating with a WebContent process, and then sends
        the database if the entitlement check succeeds. When the WebContent process receives this message, it performs an entitlement check as well,
        and if successful, the database object is consumed. Consuming this database object, will make sure UTI to MIME type mapping is working
        correctly in the WebContent process.

        For the UI process to be able to pick up xpc messages on the bootstrap connection, a new virtual method, handleXPCEvent, is added to the
        ProcessLauncher Client class. This way, a ProcessLauncher client will be able to pick up xpc messages from the xpc bootstrap connection.
        Previously the event handler for the bootstrap connection in the UI process would handle only xpc error messages. It has now been expanded
        to handle normal messages, which are being forwarded to the ProcessLauncher client. In this case the client is the Network process proxy,
        which will check the message received, and if it turns out to be a message containing an xpc endpoint, the message will be forwarded to
        all Web processes. The ProcessLauncher client can be expanded to handle any xpc message, but right not the Network process proxy only
        handles the xpc endpoint message. The handleXPCEvent virtual method return a RefPtr to an XPCEventHandler, which is captured in the event
        handler of the bootstrap xpc connection.

        No new tests, since there already exist tests for this. UTI to MIME type mapping is being used in WebKit and underlying framework, and many
        tests would fail if this mapping was not working.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeConnection):
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: Added.
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm: Added.
        (WebKit::LaunchServicesDatabaseObserver::singleton):
        (WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::startObserving):
        (WebKit::LaunchServicesDatabaseObserver::~LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageNameKey const):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageName const):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointNameKey const):
        (WebKit::LaunchServicesDatabaseObserver::handleEvent):
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Scripts/process-entitlements.sh:
        * Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h: Added.
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::xpcEndpointMessage const):
        (WebKit::WebProcessPool::sendNetworkProcessXPCEndpointToWebProcess):
        * UIProcess/Cocoa/XPCEventHandler.h: Added.
        (WebKit::XPCEventHandler::~XPCEventHandler):
        * UIProcess/Launcher/ProcessLauncher.h:
        (WebKit::ProcessLauncher::Client::xpcEventHandler const):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxyCocoa.mm: Added.
        (WebKit::NetworkProcessProxy::xpcEventHandler const):
        (WebKit::NetworkProcessProxy::XPCEventHandler::handleXPCEvent const):
        (WebKit::NetworkProcessProxy::XPCEventHandler::XPCEventHandler):
        (WebKit::NetworkProcessProxy::XPCEventHandler::~XPCEventHandler):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/LaunchServicesDatabaseManager.h: Added.
        * WebProcess/cocoa/LaunchServicesDatabaseManager.mm: Added.
        (WebKit::LaunchServicesDatabaseManager::singleton):
        (WebKit::LaunchServicesDatabaseManager::handleEvent):
        (WebKit::LaunchServicesDatabaseManager::didConnect):
        (WebKit::LaunchServicesDatabaseManager::waitForDatabaseUpdate):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const):
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-07-09  Eric Carlson  <eric.carlson@apple.com>

        Reset AVSystemController_PIDToInheritApplicationStateFrom when mediaserverd dies
        https://bugs.webkit.org/show_bug.cgi?id=214112
        <rdar://problem/65229214>

        Reviewed by Jer Noble.

        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.cpp:
        (WebKit::RemoteMediaSessionHelperProxy::providePresentingApplicationPID): Don't bother
        tracking whether or not providePresentingApplicationPID has been called, the session
        helper already does that.
        * GPUProcess/media/ios/RemoteMediaSessionHelperProxy.h:

2020-07-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Occasional crash under -[UIView _setViewDelegate:] when presenting date and time pickers
        https://bugs.webkit.org/show_bug.cgi?id=214120
        <rdar://problem/65246918>

        Reviewed by Darin Adler.

        This crash happens when attempting to present a date picker (`<input type=date>`) immediately after dismissing
        it. We encounter an Objective-C exception thrown by UIKit, due to the `WKDateTimeContextMenuViewController`'s
        view (the `UIDatePicker`) being presented while it is still owned by the preview view controller. We often avoid
        this crash because the `WKDateTimeContextMenuViewController` is usually only owned by `WKDateTimePicker`, so
        when we set `_viewController` to a new instance of `WKDateTimeContextMenuViewController`, the old view
        controller is destroyed, and thus no longer owns the `UIDatePicker` view.

        However, it's possible for anything (e.g. animation blocks in UIKit) to cause the old view controller to live
        past the creation of the new view controller. If this happens, when we go and call `-setView:` on the new view
        controller with the date picker view, the date picker view may still be the view of the old controller, and we
        end up crashing.

        To fix this, explicitly unload the old view controller's view before attempting to create the new view
        controller.

        Test: fast/forms/ios/show-and-dismiss-date-input.html

        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
        (-[WKDateTimePicker contextMenuInteraction:configurationForMenuAtLocation:]):
        (-[WKDateTimePicker contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
        (-[WKDateTimePicker contextMenuInteraction:willEndForConfiguration:animator:]):

        Make it possible to test date and time picker presentation and dismissal by calling into the private testing-
        only subclassing hooks on `WKWebView` when we finish presenting and dismissing the date picker context menu.

        (-[WKDateTimePicker removeContextMenuInteraction]):

2020-07-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Add support for shm buffers in AcceleratedBackingStoreWayland when using the WPE renderer
        https://bugs.webkit.org/show_bug.cgi?id=214135

        Reviewed by Žan Doberšek.

        It's available since wpe-fdo 1.7.0. This makes accelerated compositing work in platforms where
        EGL_WL_bind_wayland_display is not available. It can also be forced with the environment variable
        LIBGL_ALWAYS_SOFTWARE.

        * UIProcess/glib/WebProcessPoolGLib.cpp:
        (WebKit::WebProcessPool::platformInitializeWebProcess): Use AcceleratedBackingStoreWayland::checkRequirements()
        instead of calling wpe_fdo_initialize_for_egl_display() again.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::tryInitializeEGL): Moved EGL specific initialization here.
        (WebKit::tryInitializeSHM): Added SHM initialization.
        (WebKit::AcceleratedBackingStoreWayland::checkRequirements): Try to initialize EGL first and then SHM if EGL failed.
        (WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): Create a EGL exportable only when
        using EGL implementation.
        (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): Release EGL resources only when using
        EGL implementation.
        (WebKit::AcceleratedBackingStoreWayland::unrealize): Ditto.
        (WebKit::AcceleratedBackingStoreWayland::tryEnsureGLContext): Return early when not using EGL implementation.
        (WebKit::AcceleratedBackingStoreWayland::update): Add implementation for the SHM case.
        (WebKit::AcceleratedBackingStoreWayland::displayImage): Renamed.
        (WebKit::AcceleratedBackingStoreWayland::displayBuffer): SHM implementation, copy the shm buffer into a cairo
        image surface.
        (WebKit::AcceleratedBackingStoreWayland::tryEnsureTexture):
        (WebKit::AcceleratedBackingStoreWayland::downloadTexture):
        (WebKit::AcceleratedBackingStoreWayland::snapshot): Handle the SHM case.
        (WebKit::AcceleratedBackingStoreWayland::paint): Ditto.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.h:

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

        Unreviewed, reverting r264148.
        https://bugs.webkit.org/show_bug.cgi?id=214136

        Introduced layout test failures

        Reverted changeset:

        "[Cocoa] Update Launch Services database in the WebContent
        process from the Network process"
        https://bugs.webkit.org/show_bug.cgi?id=213794
        https://trac.webkit.org/changeset/264148

2020-07-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] Add support for HTTPCookieAcceptPolicy::OnlyFromMainDocumentDomain
        https://bugs.webkit.org/show_bug.cgi?id=213954

        Reviewed by Michael Catanzaro.

        Use ExclusivelyFromMainDocumentDomain for WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY instead of
        OnlyFromMainDocumentDomain.

        * UIProcess/API/glib/WebKitCookieManager.cpp:
        (toWebKitCookieAcceptPolicy):
        (toHTTPCookieAcceptPolicy):
        * UIProcess/WebProcessPool.h:

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

        [Cocoa] Update Launch Services database in the WebContent process from the Network process
        https://bugs.webkit.org/show_bug.cgi?id=213794

        Reviewed by Brent Fulgham.

        To be able to deny mach lookup access to the Launch Services database mapping service in the WebContent process, the database needs to be
        sent from the Networking process to the WebContent process, represented by an xpc object. The Networking process is chosen instead of the UI
        process, since WebKit is controlling the sandbox of the Networking process. There is already a direct connection between the Networking
        process and the WebContent process, but this is a CoreIPC connection. Since the database is represented by an xpc object, an xpc connection
        is requiered to transfer the database. This patch creates a direct xpc connection between the Networking process and the WebContent process,
        by creating an xpc endpoint in the Networking process, sending this to the UI process over the bootstrap xpc connection, and then providing
        each WebContent process with this endpoint by sending it over the bootstrap xpc connection between the UI process and the WebContent process.
        This endpoint has to be sent via the xpc connections to the UI process, since the already existing direct connection between the Networking
        process and the WebContent process is a lower level CoreIPC connection, which does not support transferring xpc objects like the xpc endpoint.
        When the WebContent process receives the endpoint, it will create an xpc connection from the endpoint, which will create a direct connection
        with the Networking process. A message is then sent over the connection to request the database xpc object. When the Networking process
        receives this message, it checks the entitlement of the remote end to make sure it is communicating with a WebContent process, and then sends
        the database if the entitlement check succeeds. When the WebContent process receives this message, it performs an entitlement check as well,
        and if successful, the database object is consumed. Consuming this database object, will make sure UTI to MIME type mapping is working
        correctly in the WebContent process.

        For the UI process to be able to pick up xpc messages on the bootstrap connection, a new virtual method, handleXPCEvent, is added to the
        ProcessLauncher Client class. This way, a ProcessLauncher client will be able to pick up xpc messages from the xpc bootstrap connection.
        Previously the event handler for the bootstrap connection in the UI process would handle only xpc error messages. It has now been expanded
        to handle normal messages, which are being forwarded to the ProcessLauncher client. In this case the client is the Network process proxy,
        which will check the message received, and if it turns out to be a message containing an xpc endpoint, the message will be forwarded to
        all Web processes. The ProcessLauncher client can be expanded to handle any xpc message, but right not the Network process proxy only
        handles the xpc endpoint message. The handleXPCEvent virtual method return a RefPtr to an XPCEventHandler, which is captured in the event
        handler of the bootstrap xpc connection.

        No new tests, since there already exist tests for this. UTI to MIME type mapping is being used in WebKit and underlying framework, and many
        tests would fail if this mapping was not working.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeConnection):
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: Added.
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm: Added.
        (WebKit::LaunchServicesDatabaseObserver::singleton):
        (WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::startObserving):
        (WebKit::LaunchServicesDatabaseObserver::~LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageNameKey const):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageName const):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointNameKey const):
        (WebKit::LaunchServicesDatabaseObserver::handleEvent):
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Scripts/process-entitlements.sh:
        * Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h: Added.
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::xpcEndpointMessage const):
        (WebKit::WebProcessPool::sendNetworkProcessXPCEndpointToWebProcess):
        * UIProcess/Cocoa/XPCEventHandler.h: Added.
        (WebKit::XPCEventHandler::~XPCEventHandler):
        * UIProcess/Launcher/ProcessLauncher.h:
        (WebKit::ProcessLauncher::Client::xpcEventHandler const):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxyCocoa.mm: Added.
        (WebKit::NetworkProcessProxy::xpcEventHandler const):
        (WebKit::NetworkProcessProxy::XPCEventHandler::handleXPCEvent const):
        (WebKit::NetworkProcessProxy::XPCEventHandler::XPCEventHandler):
        (WebKit::NetworkProcessProxy::XPCEventHandler::~XPCEventHandler):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/LaunchServicesDatabaseManager.h: Added.
        * WebProcess/cocoa/LaunchServicesDatabaseManager.mm: Added.
        (WebKit::LaunchServicesDatabaseManager::singleton):
        (WebKit::LaunchServicesDatabaseManager::handleEvent):
        (WebKit::LaunchServicesDatabaseManager::didConnect):
        (WebKit::LaunchServicesDatabaseManager::waitForDatabaseUpdate):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const):
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-07-08  Brady Eidson  <beidson@apple.com>

        Aggressively prime GameController.framework gamepad provider.
        https://bugs.webkit.org/show_bug.cgi?id=214094

        Reviewed by Darin Adler.

        * WebProcess/Gamepad/WebGamepadProvider.cpp:
        (WebKit::WebGamepadProvider::gamepadConnected):
        (WebKit::WebGamepadProvider::gamepadDisconnected):
        (WebKit::WebGamepadProvider::gamepadActivity):

2020-07-08  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r264132 and r264139.
        https://bugs.webkit.org/show_bug.cgi?id=214108

        Introduced assert failure.

        Reverted changesets:

        "[Cocoa] Update Launch Services database in the WebContent
        process from the Network process"
        https://bugs.webkit.org/show_bug.cgi?id=213794
        https://trac.webkit.org/changeset/264132

        "Unreviewed build fix attempt after r264132."
        https://trac.webkit.org/changeset/264139

2020-07-08  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILURE: Completion handlers not invalidated when WebPage::~WebPage() invoked navigating to docs.google.com and signing in
        https://bugs.webkit.org/show_bug.cgi?id=214098
        <rdar://problem/64848288>

        Reviewed by Geoffrey Garen.

        Make sure the WebPage destructor calls its "markLayersAsVolatile" CompletionHandlers before destroying
        them.

        Change is covered by new API test.

        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _processWillSuspendForTesting:]):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::~WebPage):

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

        [Cocoa] Update Launch Services database in the WebContent process from the Network process
        https://bugs.webkit.org/show_bug.cgi?id=213794

        Reviewed by Brent Fulgham.

        To be able to deny mach lookup access to the Launch Services database mapping service in the WebContent process, the database needs to be
        sent from the Networking process to the WebContent process, represented by an xpc object. The Networking process is chosen instead of the UI
        process, since WebKit is controlling the sandbox of the Networking process. There is already a direct connection between the Networking
        process and the WebContent process, but this is a CoreIPC connection. Since the database is represented by an xpc object, an xpc connection
        is requiered to transfer the database. This patch creates a direct xpc connection between the Networking process and the WebContent process,
        by creating an xpc endpoint in the Networking process, sending this to the UI process over the bootstrap xpc connection, and then providing
        each WebContent process with this endpoint by sending it over the bootstrap xpc connection between the UI process and the WebContent process.
        This endpoint has to be sent via the xpc connections to the UI process, since the already existing direct connection between the Networking
        process and the WebContent process is a lower level CoreIPC connection, which does not support transferring xpc objects like the xpc endpoint.
        When the WebContent process receives the endpoint, it will create an xpc connection from the endpoint, which will create a direct connection
        with the Networking process. A message is then sent over the connection to request the database xpc object. When the Networking process
        receives this message, it checks the entitlement of the remote end to make sure it is communicating with a WebContent process, and then sends
        the database if the entitlement check succeeds. When the WebContent process receives this message, it performs an entitlement check as well,
        and if successful, the database object is consumed. Consuming this database object, will make sure UTI to MIME type mapping is working
        correctly in the WebContent process.

        For the UI process to be able to pick up xpc messages on the bootstrap connection, a new virtual method, handleXPCEvent, is added to the
        ProcessLauncher Client class. This way, a ProcessLauncher client will be able to pick up xpc messages from the xpc bootstrap connection.
        Previously the event handler for the bootstrap connection in the UI process would handle only xpc error messages. It has now been expanded
        to handle normal messages, which are being forwarded to the ProcessLauncher client. In this case the client is the Network process proxy,
        which will check the message received, and if it turns out to be a message containing an xpc endpoint, the message will be forwarded to
        all Web processes. The ProcessLauncher client can be expanded to handle any xpc message, but right not the Network process proxy only
        handles the xpc endpoint message. The handleXPCEvent virtual method return a RefPtr to an XPCEventHandler, which is captured in the event
        handler of the bootstrap xpc connection.

        No new tests, since there already exist tests for this. UTI to MIME type mapping is being used in WebKit and underlying framework, and many
        tests would fail if this mapping was not working.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::initializeConnection):
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: Added.
        * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.mm: Added.
        (WebKit::LaunchServicesDatabaseObserver::singleton):
        (WebKit::LaunchServicesDatabaseObserver::LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::startObserving):
        (WebKit::LaunchServicesDatabaseObserver::~LaunchServicesDatabaseObserver):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageNameKey const):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointMessageName const):
        (WebKit::LaunchServicesDatabaseObserver::xpcEndpointNameKey const):
        (WebKit::LaunchServicesDatabaseObserver::handleEvent):
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Scripts/process-entitlements.sh:
        * Shared/Cocoa/LaunchServicesDatabaseXPCConstants.h: Added.
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        * SourcesCocoa.txt:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::xpcEndpointMessage const):
        (WebKit::WebProcessPool::sendNetworkProcessXPCEndpointToWebProcess):
        * UIProcess/Cocoa/XPCEventHandler.h: Added.
        (WebKit::XPCEventHandler::~XPCEventHandler):
        * UIProcess/Launcher/ProcessLauncher.h:
        (WebKit::ProcessLauncher::Client::xpcEventHandler const):
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::ProcessLauncher::launchProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxyCocoa.mm: Added.
        (WebKit::NetworkProcessProxy::xpcEventHandler const):
        (WebKit::NetworkProcessProxy::XPCEventHandler::handleXPCEvent const):
        (WebKit::NetworkProcessProxy::XPCEventHandler::XPCEventHandler):
        (WebKit::NetworkProcessProxy::XPCEventHandler::~XPCEventHandler):
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didFinishLaunching):
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeConnection):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/LaunchServicesDatabaseManager.h: Added.
        * WebProcess/cocoa/LaunchServicesDatabaseManager.mm: Added.
        (WebKit::LaunchServicesDatabaseManager::singleton):
        (WebKit::LaunchServicesDatabaseManager::handleEvent):
        (WebKit::LaunchServicesDatabaseManager::didConnect):
        (WebKit::LaunchServicesDatabaseManager::waitForDatabaseUpdate):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::handleXPCEndpointMessages const):
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-07-08  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Silence spam reports about deprecated logging system
        https://bugs.webkit.org/show_bug.cgi?id=214090
        <rdar://problem/63943836>

        Reviewed by Per Arne Vollan.

        Change the default 'block' behavior for 'com.apple.system.logger' to
        block "with no-report" so that we don't spend time generating backtraces
        when non-WebKit code attempts to use this deprecated logging system.

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

2020-07-08  Sihui Liu  <sihui_liu@appe.com>

        Network process crashes in WebKit::WebIDBServer::removeConnection
        https://bugs.webkit.org/show_bug.cgi?id=214071
        <rdar://problem/64853929>

        Reviewed by Chris Dumez.

        In network process, WebIDBServer may be removed and destroyed before web process using the same session 
        disconnects. Then a new WebIDBServer can be added before disconnection of web process and the new WebIDBServer 
        does not have information about the web process connection.

        To solve this issue, now we only remove WebIDBServer when session is destroyed and there is no web process 
        connection of that session.

        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
        (WebKit::NetworkProcess::destroySession):
        (WebKit::NetworkProcess::removeWebIDBServerIfPossible):
        (WebKit::NetworkProcess::connectionToWebProcessClosed):
        * NetworkProcess/NetworkProcess.h:

2020-07-08  Andy Estes  <aestes@apple.com>

        REGRESSION (r207558): [Mac] Context clicks on links sometimes result in navigations
        https://bugs.webkit.org/show_bug.cgi?id=213793
        <rdar://problem/64294015>

        Reviewed by Tim Horton.

        WebPageProxy::showContextMenu was written with the assumption that WebContextMenuProxy::show
        would present a context menu and spin a nested run loop, blocking until the menu dismisses.
        Once WebContextMenuProxy::show returns, showContextMenu would send the
        WebPage::ContextMenuHidden message, telling the WebContent process that it's OK to resume
        processing mouse events.

        This assumption was invalidated in r207558 (and again in several subsequent changes), which
        added asynchronous APIs to WKPageContextMenuClient. If the context menu client provides
        context menu items asynchronously, WebContextMenuProxy::show would return -- and the
        WebContent process would resume processing mouse events -- before the context menu was even
        presented. Since context menu presentation is triggered by a mouse press event, it's
        possible that the corresponding mouse release event would be delivered after
        getContextMenuFromProposedMenuAsync was dispatched but before the client responded with menu
        items to present. If this happened, since mouse event processing was not disabled, the
        WebContent process would dispatch a DOM click event to the page, possibly triggering a
        navigation.

        Fix this by teaching WebPageProxy to defer sending WebPage::ContextMenuHidden until the
        context menu has been dismissed, even in cases where the context menu client provides menu
        items asynchronously. Also, take the opportunity to modernize WebContextMenuProxy and its
        subclasses by, e.g., moving duplicated subclass code into the base class, using the client
        pattern, and using WeakPtrs instead of raw pointers/references.

        New API tests: ContextMenuMouseEvents.*

        * UIProcess/API/APIContextMenuClient.h:
        (API::ContextMenuClient::showContextMenu):
        (API::ContextMenuClient::canShowContextMenu const):
        * UIProcess/API/C/WKPage.cpp:
        (WKPageSetPageContextMenuClient): Added canShowContextMenu to determine whether the client
        can show a context menu without actually showing it.

        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createContextMenuProxy): Passed page to
        WebContextMenuProxyWPE::create.

        * UIProcess/WebContextMenuListenerProxy.cpp:
        (WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy):
        (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
        (WebKit::WebContextMenuListenerProxy::invalidate): Deleted. Not needed now that m_client is
        a WeakPtr.

        * UIProcess/WebContextMenuListenerProxy.h:
        (WebKit::WebContextMenuListenerProxy::create): Rather than store a raw pointer to a
        WebContextMenuProxy, store a WeakPtr to a WebContextMenuListenerProxy::Client (which
        WebContextMenuProxy implements).

        * UIProcess/WebContextMenuProxy.cpp:
        (WebKit::WebContextMenuProxy::WebContextMenuProxy): Stored a WeakPtr to a WebPageProxy
        rather than storing a raw pointer to the same in each subclass.
        (WebKit::WebContextMenuProxy::proposedItems const): Added a virtual function to create
        proposed WebContextMenuItems from m_context's menu items. WebContextMenuProxyGtk overrides
        this to do something slightly different.
        (WebKit::WebContextMenuProxy::show): Added a base class implementation that creates a
        WebContextMenuListenerProxy and calls ContextMenuClient::getContextMenuFromProposedMenu.
        (WebKit::WebContextMenuProxy::useContextMenuItems): Added a base class implementation that
        performs the work previously done in WebPageProxy::showContextMenu. Calls
        showContextMenuWithItems, which now always synchronously presents the menu.

        * UIProcess/WebContextMenuProxy.h: Inherited from WebContextMenuListenerProxy::Client.
        (WebKit::WebContextMenuProxy::page const): Added for use by WKSharingServicePickerDelegate.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::showContextMenu): Moved code that assumes synchronous menu
        presentation to WebContextMenuProxy::useContextMenuItems.

        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::proposedItems const): Implemented GTK's special version
        that excludes ContextMenuItemTagShareMenu.
        (WebKit::WebContextMenuProxyGtk::show): Deleted. WebContextMenuProxy::show handles this now.
        (WebKit::WebContextMenuProxyGtk::append):
        (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
        * UIProcess/gtk/WebContextMenuProxyGtk.h: Moved m_page to WebContextMenuProxy.

        * UIProcess/mac/WKSharingServicePickerDelegate.mm:
        (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Changed now that
        WebContextMenuProxy::page returns a pointer.

        * UIProcess/mac/WebContextMenuProxyMac.h:
        (WebKit::WebContextMenuProxyMac::page const): Deleted.

        * UIProcess/mac/WebContextMenuProxyMac.mm:
        (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
        (WebKit::WebContextMenuProxyMac::~WebContextMenuProxyMac): No need to invalidate
        m_contextMenuListener now that it stores a WeakPtr to its WebContextMenuProxy.
        (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
        (WebKit::WebContextMenuProxyMac::showServicesMenu):
        (WebKit::WebContextMenuProxyMac::show):
        (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Overrode to handle service menus.
        (WebKit::WebContextMenuProxyMac::useContextMenuItems): Overrode to get the standard Mac menu
        items and dispatch ContextMenuClient::menuFromProposedMenu before showing the menu.
        (WebKit::WebContextMenuProxyMac::showContextMenu): Deleted. WebContextMenuProxy::show now
        handles this.

        * UIProcess/win/WebContextMenuProxyWin.cpp:
        (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
        (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
        (WebKit::WebContextMenuProxyWin::show): Deleted. WebContextMenuProxy::show now handles this.
        * UIProcess/win/WebContextMenuProxyWin.h:

        * UIProcess/wpe/WebContextMenuProxyWPE.h: Passed page to the WebContextMenuProxy ctor.

2020-07-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        autocapitalize="words" capitalizes every word's second character
        https://bugs.webkit.org/show_bug.cgi?id=148504
        <rdar://problem/57814304>

        Reviewed by Tim Horton.

        This bug resurfaced in iOS 13 due to timing changes that caused a task added to UIKeyboardTaskQueue to no longer
        get dequeued after the next editor state update is received in the UI process; as a result, UIKit asks us for
        the context before the caret selection (i.e. `characterBeforeSelection`) before we have a chance to update it,
        which means that UIKeyboardImpl's autoshift state will always be off by one character whie typing.

        Note that solely deferring this update until after the next editor state update is received is insufficient to
        fix this bug, since the keyboard's shift state will still be incorrect when typing characters very quickly (or
        if the web process is unresponsive).

        Instead, completely address this bug by adding a mechanism for WKContentView to cache the last character in the
        string that is currently being inserted using `-insertText:`, and return it in `-_characterBeforeCaretSelection`
        until the next editor state update comes in with the real character before the selection. This way, we're able
        to respond to UIKit's requests immediately with a (reasonable) guess of what the character before the selection
        should be, and then follow it up with the actual up-to-date value from the web process during the next editor
        state update (invalidating the stale shift state if necessary). This cached last character should only be
        incorrect in the case where the page uses script to influence what was typed, or the typed character was never
        inserted at all (e.g. typing a newline character in a single line input element).

        Test: fast/forms/ios/autocapitalize-words.html

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView _characterBeforeCaretSelection]):

        Use `_lastInsertedCharacterToOverrideCharacterBeforeSelection`, if it is set.

        (-[WKContentView _characterInRelationToCaretSelection:]):
        (-[WKContentView insertText:]):

        Update `_lastInsertedCharacterToOverrideCharacterBeforeSelection` and ensure an editor state update immediately
        after text is inserted, if we're currently editing an element with `autocapitalize="words"`. The editor state
        update could be unnecessarily expensive, so we don't want to do this unconditionally. Also,
        `autocapitalize="words"` is special in the sense that it is the only autocapitalization type where the platform
        (UIKit) will ask for the last character immediately and use it to unshift the keyboard. Even in the case of
        `autocapitalize="sentences"`, UIKit makes the decision to unshift using information from `kbd` instead.

        (-[WKContentView _elementDidBlur]):
        (-[WKContentView _selectionChanged]):

        Clear out `_lastInsertedCharacterToOverrideCharacterBeforeSelection` when the next editor state update is
        received, and invalidate the current keyboard shift state by calling `-clearShiftState`. This SPI method
        automatically schedules a shift state update, as well.

        Note the extra `_usingGestureForSelection` check here, which prevents the keyboard from autoshifting and
        unshifting while changing the selection via loupe gesture.

2020-07-07  Antoine Quint  <graouts@webkit.org>

        [iOS] Sharing an <img> element with a base64-encoded URL shares the URL as raw text instead of an image
        https://bugs.webkit.org/show_bug.cgi?id=214042
        <rdar://problem/56669102>

        Reviewed by Wenson Hsieh.

        In the case where the <img> element that was the target when the share sheet was brought has its data encoded
        as a base64 URL, we need to share the UIImage that was created as its snapshot as a file rather than the URL
        to avoid a base64 string to be shared instead of the image data.

        To support testing of this, we add a new optional WKShareSheet delegate to indicate that the share sheet will
        show and the provided activity items, which we forward to a new optional WKUIDelegatePrivate delegate method.
        API tests can thus be written to check the data provided to the share sheet.

        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/WKShareSheet.h:
        * UIProcess/Cocoa/WKShareSheet.mm:
        (-[WKShareSheet presentWithShareDataArray:inRect:]):
        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant handleElementActionWithType:element:needsInteraction:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView shareSheet:willShowActivityItems:]):
        (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
        (-[WKContentView actionSheetAssistant:shareElementWithImage:rect:]):

2020-07-08  Philippe Normand  <pnormand@igalia.com>

        [WPE][Qt] Deprecation warnings
        https://bugs.webkit.org/show_bug.cgi?id=214074

        Reviewed by Carlos Garcia Campos.

        * UIProcess/API/wpe/qt/WPEQtView.cpp:
        (WPEQtView::updatePaintNode): Switch to new createTextureFromNativeObject API when building against Qt 5.15.
        * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
        (WPEQtViewBackend::dispatchWheelEvent): Switch to new WPE axis 2D event API.

2020-07-08  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.29.3 release

        * gtk/NEWS: Add release notes for 2.29.3.

2020-07-07  Alex Christensen  <achristensen@webkit.org>

        Modernize FindOptions IPC code
        https://bugs.webkit.org/show_bug.cgi?id=214063

        Reviewed by Chris Dumez.

        Use callWithAsyncReply instead of GenericCallback.
        Use OptionSet<FindOptions> instead of FindOptions or uint32_t.
        No change in behavior.

        * Shared/API/c/WKSharedAPICast.h:
        (WebKit::toFindOptions):
        * Shared/WebFindOptions.h:
        (): Deleted.
        * UIProcess/API/Cocoa/WKWebView.mm:
        (toFindOptions):
        (-[WKWebView findString:withConfiguration:completionHandler:]):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findStringMatches):
        (WebKit::WebPageProxy::findString):
        (WebKit::WebPageProxy::countStringMatches):
        (WebKit::WebPageProxy::findStringCallback): Deleted.
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::findString):
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::core):
        (WebKit::FindController::countStringMatches):
        (WebKit::FindController::updateFindUIAfterPageScroll):
        (WebKit::FindController::findString):
        (WebKit::FindController::findStringMatches):
        * WebProcess/WebPage/FindController.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-07-07  Sam Weinig  <weinig@apple.com>

        Part 2 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them
        https://bugs.webkit.org/show_bug.cgi?id=213981

        Reviewed by Darin Adler.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::paintSnapshotAtSize):
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        Make calls to makeSimpleColor more consistent. Use decimal rather than hex, don't pass unncessary
        255 as the 4th argument.

2020-07-07  Alex Christensen  <achristensen@webkit.org>

        Use sendWithAsyncReply instead of EditingRangeCallback
        https://bugs.webkit.org/show_bug.cgi?id=214056

        Reviewed by Chris Dumez.

        No change in behavior.

        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
        (-[WKReloadFrameErrorRecoveryAttempter initWithWebView:frameHandle:urlString:]):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::selectedRangeWithCompletionHandler):
        (WebKit::WebViewImpl::markedRangeWithCompletionHandler):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::getMarkedRangeAsync):
        (WebKit::WebPageProxy::getSelectedRangeAsync):
        (WebKit::WebPageProxy::editingRangeCallback): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-07-07  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Allow additional IOKit classes for Apple Silicon
        https://bugs.webkit.org/show_bug.cgi?id=214021

        Reviewed by Sam Weinig.
        <rdar://problem/63696732>

        Update two of the arm64-specific sandbox rules to include additional
        IOKit classes (and one IOKit property).

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

2020-07-07  Sihui Liu  <sihui_liu@appe.com>

        Network process crashes in WebKit::StorageManagerSet::deleteSessionStorageForOrigins
        https://bugs.webkit.org/show_bug.cgi?id=214050

        Reviewed by Chris Dumez.

        In NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains, deleteSessionStorageForOrigins is called 
        in a callback without checking if session still exists.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):

2020-07-07  Chris Dumez  <cdumez@apple.com>

        WebContent process sometimes kills itself because it is receiving too much IPC from the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=214048
        <rdar://problem/64844770>

        Reviewed by Darin Adler.

        There was logic in IPC::Connection::enqueueIncomingMessage() that would kill the XPC connection
        if too many IPC messages had been queued without the main thread processing them. The intention
        was to protect the UIProcess again a badly behavior WebProcess sending too much IPC and it would
        in effect terminate that WebProcess. However, the logic would actually apply too ALL IPC
        connections. In <rdar://problem/64844770>, we see that the WebProcess is stuck on a sync IPC and
        thus not processing other incoming IPCs. The UIProcess is sending it a lot of IPC so the
        WebProcess decides to kill its IPC connection, thus terminating itself, which does not make much
        sense. To address the issue, we now enable to killing on too much IPC behavior only if IPC message
        throttling is enabled for the IPC connection, which means it only impacts the UIProcess connections
        to its WebProcesses.

        * Platform/IPC/Connection.cpp:
        (IPC::Connection::enableIncomingMessagesThrottling):
        (IPC::Connection::enqueueIncomingMessage):
        * Platform/IPC/Connection.h:
        (IPC::Connection::isIncomingMessagesThrottlingEnabled const):

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

        Unable to scroll elcomerico.pe page until the page finishes loading
        https://bugs.webkit.org/show_bug.cgi?id=214027
        <rdar://problem/64646259>

        Reviewed by Antti Koivisto.

        The same issue with non-invertible transforms existed on iOS. r248015 attempted to
        fix some instances of this, but failed to take into account the fact that a non-invertible
        transfrom should also prevent hit-testing of descendant views.

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

2020-07-07  Alex Christensen  <achristensen@webkit.org>

        Add WebCoreNSURLSession SPI to send HTTP/2 ping
        https://bugs.webkit.org/show_bug.cgi?id=214030
        <rdar://problem/64495827>

        Reviewed by Jer Noble.

        The SPI to do this through CFNetwork requires setting a block on the task
        between construction and resumption.  To allow this, I made PreconnectTask
        and NetworkLoad require a start() call, and I added start() calls everywhere
        they were implied with construction before.

        * NetworkProcess/Downloads/PendingDownload.cpp:
        (WebKit::PendingDownload::PendingDownload):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::sendH2Ping):
        (WebKit::NetworkConnectionToWebProcess::preconnectTo):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::setH2PingCallback):
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkLoad.cpp:
        (WebKit::NetworkLoad::NetworkLoad):
        (WebKit::NetworkLoad::start):
        (WebKit::NetworkLoad::setH2PingCallback):
        (WebKit::NetworkLoad::initialize): Deleted.
        * NetworkProcess/NetworkLoad.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):
        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::startNetworkLoad):
        * NetworkProcess/PreconnectTask.cpp:
        (WebKit::PreconnectTask::setH2PingCallback):
        (WebKit::PreconnectTask::start):
        (WebKit::PreconnectTask::~PreconnectTask): Deleted.
        * NetworkProcess/PreconnectTask.h:
        * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
        (WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::setH2PingCallback):
        * Shared/WebErrors.cpp:
        (WebKit::internalError): Deleted.
        * Shared/WebErrors.h:
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::generateLoadIdentifier):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):
        (WebKit::generateLoadIdentifier): Deleted.
        * WebProcess/Network/WebLoaderStrategy.h:
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::sendH2Ping):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2020-07-07  Brady Eidson  <beidson@apple.com>

        Forward declare WKContentWorld in WKUserScript.h
        <rdar://problem/65164826> and https://bugs.webkit.org/show_bug.cgi?id=214046

        Unreviewed.

        * UIProcess/API/Cocoa/WKUserScript.h:

2020-07-07  Brady Eidson  <beidson@apple.com>

        Fix CrashTracer reported in PDFPlugin::ByteRangeRequest::maybeComplete.
        <rdar://problem/64884982> and https://bugs.webkit.org/show_bug.cgi?id=214026

        Reviewed by Tim Horton.

        No new tests (CrashTracer with no reproduction)
        
        Due to the racy-ness of how PDFKit calls us on the background thread vs. what might be
        happening with the main thread, sometimes the main thread is asked to handle a data
        request either:
        - Before m_data is allocated
          or
        - After it is deallocated

        In either case it's okay to just not handle it.

        Despite understanding how to reproduce in theory, writing a test case has been elusive.
        
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::ByteRangeRequest::maybeComplete): Null check m_data before doing anything with it.

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

        REGRESSION(r262680): [GTK] Crash in WebKit::DropTarget::didPerformAction
        https://bugs.webkit.org/show_bug.cgi?id=213885

        Reviewed by Michael Catanzaro.

        Just compare if new operation is the same as the current one, the == operator of Optional already takes care of
        values being nullopt.

        * UIProcess/API/gtk/DropTargetGtk3.cpp:
        (WebKit::DropTarget::didPerformAction):
        * UIProcess/API/gtk/DropTargetGtk4.cpp:
        (WebKit::DropTarget::didPerformAction):

2020-07-07  Tomoki Imai  <Tomoki.Imai@sony.com>

        [Win] Implement Pasteboard::writeCustomData for Web Inspector Console tab
        https://bugs.webkit.org/show_bug.cgi?id=213986

        Reviewed by Fujii Hironori.

        * Shared/WebPreferencesDefaultValues.h: Turn DEFAULT_CUSTOM_PASTEBOARD_DATA_ENABLED on for Windows

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

        High CPU usage on Stash search results pages
        https://bugs.webkit.org/show_bug.cgi?id=214018
        <rdar://problem/64832917>

        Reviewed by Tim Horton.
        
        Stash search results pages can contain a lot of overflow:scroll areas, so scrolling thread CA commits
        would take a long time because ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters() would
        open and close a CA commit for each scroller.

        Fix by not explicitly starting a CA commit, and only entering this code if a gesture is active and in
        the momentum phase.

        Also sprinkle BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS in more places that call into Core
        Animation.

        * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):

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

        BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS should not have trailing semicolons
        https://bugs.webkit.org/show_bug.cgi?id=214019

        Reviewed by Tim Horton.

        These macros are defined as:
        
        #define BEGIN_BLOCK_OBJC_EXCEPTIONS @try {
        #define END_BLOCK_OBJC_EXCEPTIONS } @catch(NSException *localException) { ReportBlockedObjCException(localException); }
        
        so they should not be used with trailing semicolons.

        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::decodeFontInternal):
        * Shared/Cocoa/CoreTextHelpers.mm:
        (WebKit::fontWithAttributes):
        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::updateFontManagerIfNeeded):
        * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
        (-[WKScrollbarPartAnimation invalidate]):
        (-[WKScrollerImpDelegate cancelAnimations]):
        (-[WKScrollerImpDelegate invalidate]):
        (WebKit::ScrollerMac::updateValues):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView assignLegacyDataForContextMenuInteraction]):
        (-[WKContentView continueContextMenuInteractionWithDataDetectors:]):
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (WebKit::PlatformCAAnimationRemote::updateLayerAnimations):

2020-07-06  Brady Eidson  <beidson@apple.com>

        Get rid of concept of "initial connected gamepads"
        https://bugs.webkit.org/show_bug.cgi?id=214010

        Reviewed by Tim Horton.

        * Scripts/webkit/messages.py:

        * UIProcess/Gamepad/UIGamepadProvider.cpp:
        (WebKit::UIGamepadProvider::gamepadSyncTimerFired):
        (WebKit::UIGamepadProvider::platformGamepadConnected):
        (WebKit::UIGamepadProvider::platformGamepadInputActivity):
        (WebKit::UIGamepadProvider::setInitialConnectedGamepads): Deleted.
        * UIProcess/Gamepad/UIGamepadProvider.h:

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::gamepadActivity):
        * UIProcess/WebPageProxy.h:

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::gamepadConnected):
        (WebKit::WebProcessPool::setInitialConnectedGamepads): Deleted.
        * UIProcess/WebProcessPool.h:

        * WebProcess/Gamepad/WebGamepadProvider.cpp:
        (WebKit::WebGamepadProvider::gamepadConnected):
        (WebKit::WebGamepadProvider::gamepadActivity):
        * WebProcess/Gamepad/WebGamepadProvider.h:

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

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

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

        Regression(r249303) Crash under NetworkLoad::NetworkLoad()
        https://bugs.webkit.org/show_bug.cgi?id=214008
        <rdar://problem/64853936>

        Reviewed by Alex Christensen.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
        (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
        Do some hardening and fail the SpeculativeLoad if the network session is null, instead of dereferencing
        the network session unconditionally. The NetworkCache owns the NetworkCacheSpeculativeLoadManager and
        the NetworkCache is RefCounted so it may outlive its NetworkSession in theory and schedule speculative
        loads for a session that was just destroyed.

        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
        (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
        (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
        Capture weakThis in a few lambda and check it when the lambda gets called. It looked unsafe so I
        decided to do some hardening.

2020-07-06  Peng Liu  <peng.liu6@apple.com>

        REGRESSION (r261001): ASSERTION FAILED: m_clientCounts.contains(contextId) in WebKit::VideoFullscreenManagerProxy::removeClientForContext
        https://bugs.webkit.org/show_bug.cgi?id=212986

        Reviewed by Jer Noble.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::removeClientForContext):
        Function removeClientForContext() could be called multiple times with the same contextId.
        We should bail out if m_clientCounts does not contain the contextId.

2020-07-06  Kate Cheney  <katherine_cheney@apple.com>

        update-webkit-localizable-strings exits without writing localized strings because of an R"" string
        https://bugs.webkit.org/show_bug.cgi?id=213274
        <rdar://problem/64427891>

        Reviewed by Darin Adler.

        Remove R"" string, use adjacent string literals instead.

        No new tests, functionality tested by existing tests, specifically
        (http/tests/resourceLoadStatistics/telemetry-generation-basic-functionality-database.html
        and http/tests/resourceLoadStatistics/telemetry-generation-advanced-functionality-database.html).

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::joinSubStatisticsForSorting):
        (WebKit::CompletionHandler<void): Deleted.

2020-07-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] Unable to change focus between Google Docs windows by tapping
        https://bugs.webkit.org/show_bug.cgi?id=213985
        <rdar://problem/57083267>

        Reviewed by Darin Adler.

        When putting two Google Docs windows side-by-side on iPad, it's currently not possible to change the window to
        which keyboard input is routed. In native views (e.g. two side-by-side Notes windows), this is normally handled
        by `UITextMultiTapRecognizer`, which is part of the `UITextSelectionInteraction`; tapping to place the text
        selection calls into `-[UITextInteractionAssistant setFirstResponderIfNecessaryActivatingSelection:]`, which
        updates the key window if needed. This doesn't apply to Google Docs because they instead use touch events to
        drive their own "text interaction"-like behaviors instead of relying on system gesture recognizers, which we
        suppress due to the fact that the selection is within a hidden contenteditable.

        But even in non-hidden editable areas, the initial tap to focus an editable element still doesn't automatically
        make the window key, since the editable text interaction gestures are still inactive when tapping to focus an
        editable element. This means two taps are currently required to change the key window when focusing two Safari
        windows side-by-side: the first tap to focus the element (via the synthetic click gesture), and the second tap
        to trigger the editable text interaction tap gesture that is used to set the selection.

        To fix both of these issues, make some minor adjustments to call `-makeKeyWindow` from WebKit when focusing
        editable elements. See below for more details.

        Test: editing/selection/ios/become-key-window-when-focusing-editable-area.html

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

        For the case in Google Docs where a hidden editable element is used and tapping in the page does not result in
        the element being refocused, we additionally need to make sure that we make our window key anyways. Limit this
        hack to tap gestures, and only when there is a hidden focused editable element to emulate platform behavior of
        updating the key window based on the text tap gesture.

        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):

        Make the content view's window key when focusing an editable element.

        (-[WKContentView hasHiddenContentEditable]):

        Consider the selection to be inside a hidden editable area if the `WebKit::FocusedElementIsTooSmall` flag is set
        as well. While this doesn't affect Google Docs, it does affect some other custom editors, such as Quip.

        (-[WKContentView mouseGestureRecognizerChanged:]):

        Additionally make the current window key when clicking in a hidden editable area with a trackpad on iOS.

2020-07-06  Sam Weinig  <weinig@apple.com>

        Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls
        https://bugs.webkit.org/show_bug.cgi?id=213949

        Reviewed by Darin Adler.

        * Shared/FocusedElementInformation.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
        (-[WKContentView requiresAccessoryView]):
        (-[WKContentView textInputTraits]):
        (mayContainSelectableText):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):
        Remove DateTime from the InputType enum. This should have been removed when datetime was removed.

        * Shared/WebPreferences.yaml:
        Add preferences for all the date/time related input types, and have them automatically
        link up with the newly added WebCore Settings of the same names (this is the default 
        behavior if no explicit webcoreBinding: is provided).

        * Shared/WebPreferencesDefaultValues.h:
        Disable date/time input elements by default for non iOS/watchOS cocoa platforms. For non-Cocoa platforms
        (and iOS/watchOS), they are enabled by default, but only actually get enabled if the appropriate ENABLE_*
        macro is also set.

2020-07-06  Haelwenn (lanodan) Monnier  <contact@hacktivis.me>

        BubblewrapLauncher.cpp: Add paths required for sndio
        https://bugs.webkit.org/show_bug.cgi?id=212524

        Information about the paths currently ins't into the sndio
        documentation but it can be found in this email:
        http://www.sndio.org/arch/0077.html

        Reviewed by Adrian Perez de Castro.

        Manually tested, there is currently no automatic tests for it

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindSndio):
        (WebKit::bubblewrapSpawn):

2020-07-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Change the cookies accept policy when ITP is enabled
        https://bugs.webkit.org/show_bug.cgi?id=213502

        Reviewed by Michael Catanzaro.

        * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp:
        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Use NetworkStorageSession::setCookieAcceptPolicy().
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::setCookiePersistentStorage): Do not change the accept policy, it's now done by
        NetworkStorageSession when the new cookie jar is set.
        * UIProcess/API/glib/WebKitCookieManager.cpp: Update API docs.
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: Ditto.

2020-07-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r263960.
        https://bugs.webkit.org/show_bug.cgi?id=213980

        Re-land, because r263959 somehow fixed the build issue caused
        by r263953

        Reverted changeset:

        "Unreviewed, reverting r263953 and r263959."
        https://bugs.webkit.org/show_bug.cgi?id=213979
        https://trac.webkit.org/changeset/263960

2020-07-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r263953 and r263959.
        https://bugs.webkit.org/show_bug.cgi?id=213979

        Broke internal build

        Reverted changesets:

        "[Cocoa] Move almost all features from FeatureDefines.xcconfig
        to PlatformEnableCocoa.h"
        https://bugs.webkit.org/show_bug.cgi?id=212542
        https://trac.webkit.org/changeset/263953

        "[Cocoa] Remove FEATURE_DEFINES from the Cocoa/Xcode build
        system"
        https://bugs.webkit.org/show_bug.cgi?id=213976
        https://trac.webkit.org/changeset/263959

2020-07-05  Darin Adler  <darin@apple.com>

        [Cocoa] Remove FEATURE_DEFINES from the Cocoa/Xcode build system
        https://bugs.webkit.org/show_bug.cgi?id=213976

        Reviewed by Sam Weinig.

        * Configurations/BaseTarget.xcconfig: Removed FEATURE_DEFINES, and added
        WK_ENABLE_EXPERIMENTAL_FEATURES,

        * Configurations/FeatureDefines.xcconfig: Removed everything except for ENABLE_WEB_RTC.

2020-07-05  Darin Adler  <darin@apple.com>

        [Cocoa] Move almost all features from FeatureDefines.xcconfig to PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=212542

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig: Delete everything except
        ENABLE_EXPERIMENTAL_FEATURES and ENABLE_WEBRTC.

        * Configurations/WebKit.xcconfig: Added include of WebKitTargetConditionals.xcconfig.

2020-07-05  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [macOS] Allow selecting HEIF images if the 'accept' attribute includes an image MIME type that the platform can transcode the HEIF to
        https://bugs.webkit.org/show_bug.cgi?id=212489

        Reviewed by Darin Adler.

        Make WKOpenPanelParameters call allowedFileExtensions() and allowedMIMETypes()
        of MIMETypeRegistry via OpenPanelParameters.

        UIDelegate will get allowedMIMETypes() and pass it to WebOpenPanelResultListenerProxy
        which will pass it to WebPageProxy. In a following patch, WebPageProxy
        will use allowedMIMETypes to transcode the selected images before sending
        them to WebPage.

        * UIProcess/API/APIOpenPanelParameters.cpp:
        (API::OpenPanelParameters::allowedMIMETypes const):
        (API::OpenPanelParameters::allowedFileExtensions const):
        (API::OpenPanelParameters::mediaCaptureType const): Deleted.
        * UIProcess/API/APIOpenPanelParameters.h:
        (API::OpenPanelParameters::mediaCaptureType const):
        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _allowedFileExtensions]):
        (-[WKOpenPanelParameters _allowedFileExtensionsTitles]): Deleted.
        * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::UIClient::runOpenPanel):
        * UIProcess/WebOpenPanelResultListenerProxy.cpp:
        (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
        * UIProcess/WebOpenPanelResultListenerProxy.h:
        (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
        * UIProcess/WebPageProxy.h:

2020-07-04  Darin Adler  <darin@apple.com>

        [Cocoa] Remove all features from FeatureDefines.xcconfig that are already mentioned in PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=213962

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig: Removed all features that were mentioned
        in PlatformEnableCocoa.h; the rules in that file now define whether they are enabled.

2020-07-04  Darin Adler  <darin@apple.com>

        [Cocoa] Remove unconditional features from FeatureDefines.xcconfig, making sure they are covered in PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=212418

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig: Removed features that are either unconditionally not enabled,
        or unconditionally enabled. Double checked that all the enabled ones are either in PlatformEnable.h or
        PlatformEnableCocoa.h.

2020-07-04  Sam Weinig  <weinig@apple.com>

        Part 1 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them
        https://bugs.webkit.org/show_bug.cgi?id=213948

        Reviewed by Darin Adler.

        * UIProcess/API/wpe/WebKitColor.cpp:
        (webkitColorFillFromWebCoreColor):
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::beginSwipeGesture):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (WebKit::animationValueFromKeyframeValue):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::getDocumentBackgroundColor):
        Adapt to use templatized toSRGBALossy<float/uint8_t>.

2020-07-03  Darin Adler  <darin@apple.com>

        Make generate-unified-sources.sh not depend on features being listed in FEATURE_DEFINES environment variable
        https://bugs.webkit.org/show_bug.cgi?id=212420

        Reviewed by Don Olmstead.

        * Scripts/generate-unified-sources.sh: Removed --feature-flags from the
        arguments passed to generate-unified-source-bundles.rb. Also removed many
        unneeded quotes.

2020-07-04  Darin Adler  <darin@apple.com>

        Update comment in FeatureDefines.xcconfig since PlatformEnableCocoa.h should be used instead
        https://bugs.webkit.org/show_bug.cgi?id=213952

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig: Updated comment.

2020-07-04  Youenn Fablet  <youenn@apple.com>

        Enable VTB required low latency code path
        https://bugs.webkit.org/show_bug.cgi?id=210609
        <rdar://problem/61890332>

        Reviewed by Darin Adler.

        Add a runtime flag to enable/disable the low latency code path.

        * Shared/WebPreferences.yaml:

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

        MediaRecorder should support peer connection remote video tracks
        https://bugs.webkit.org/show_bug.cgi?id=213924

        Reviewed by Darin Adler.

        Pass a boolean instead of width/height for the video track.

        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        (WebKit::RemoteMediaRecorder::create):
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        (WebKit::RemoteMediaRecorderManager::createRecorder):
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::startRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:

2020-07-03  Sam Weinig  <weinig@apple.com>

        Remove support for ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE
        https://bugs.webkit.org/show_bug.cgi?id=213932

        Reviewed by Darin Adler.

        Removes support for non-standard <input type="datetime">, currently being 
        guarded by the macro ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE. This macro, was
        added back in 2013 as a temporary measure to support some engines who shipped
        support for <input type="datetime">. It is currently not enabled for any
        ports so now seems like as good a time as any to remove it.

        * Configurations/FeatureDefines.xcconfig:

2020-07-03  Sam Weinig  <weinig@apple.com>

        Add "-Wliteral-conversion" warning to Xcode based builds and fix the issues it finds
        https://bugs.webkit.org/show_bug.cgi?id=213931

        Reviewed by Darin Adler.

        * Configurations/Base.xcconfig:
        Add -Wliteral-conversion.

2020-07-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r263882.
        https://bugs.webkit.org/show_bug.cgi?id=213933

        Broke the build

        Reverted changeset:

        "Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to
        replace _WKProcessPoolConfiguration.hstsStorageDirectory"
        https://bugs.webkit.org/show_bug.cgi?id=213048
        https://trac.webkit.org/changeset/263882

2020-07-03  Michael Catanzaro  <mcatanzaro@gnome.org>

        [WPE][GTK] Bubblewrap sandbox should not attempt to bind empty paths
        https://bugs.webkit.org/show_bug.cgi?id=202880

        Reviewed by Carlos Garcia Campos.

        If an empty path is set in LD_LIBRARY_PATH (e.g. /foo::/bar), we wind up passing
        --ro-bind-try   --ro-bind-try to bwrap, where the second --ro-bind-try is treated as the
        source path to mount, and the next flag we pass gets treated as the destination path. The
        web process crashes with this confusing error:

        bwrap: Can't create file at /.flatpak-info: Read-only file system

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bindIfExists):

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

        Allow registering VP9 as a VT decoder
        https://bugs.webkit.org/show_bug.cgi?id=213837
        <rdar://problem/64984881>

        Reviewed by Jer Noble.

        Add a runtime flag to enable registration of VP9 as a VT decoder.
        Register conditionally this decoder on creation of page based on this flag.

        Test: media/vp9.html

        * Scripts/GeneratePreferences.rb:
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * Shared/WebPreferences.yaml:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::enableVP9Decoder):
        * WebProcess/WebProcess.h:

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

        MediaRecorder stopRecorder() returns empty Blob after first use
        https://bugs.webkit.org/show_bug.cgi?id=212274
        <rdar://problem/63601298>

        Reviewed by Eric Carlson.

        Update implementation to do initialization as part of startRecording.

        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        (WebKit::RemoteMediaRecorderManager::releaseRecorder):
        Remove ASSERT as recorder creation in WebProcess is always ok while creation in GPUProcess may fail and m_recorders may not be populated.
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::startRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:

2020-07-03  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Change the names of MIMETypeRegistry methods to comply with webkit naming style
        https://bugs.webkit.org/show_bug.cgi?id=213912

        Reviewed by Youenn Fablet.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::didSendRequest):
        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
        (API::mimeTypeInferredFromFileExtension):
        (API::Attachment::setFileWrapperAndUpdateContentType):
        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _allowedFileExtensions]):
        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
        (webkitURISchemeRequestReadCallback):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::fileCanBeAcceptedForUpload):
        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::findPlugin):
        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel presentWithParameters:resultListener:]):
        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::objectContentType):

2020-07-03  Alexander Mikhaylenko  <alexm@gnome.org>

        [GTK4] Support kinetic scrolling
        https://bugs.webkit.org/show_bug.cgi?id=213791

        Reviewed by Carlos Garcia Campos.

        GtkEventControllerScroll skips the last event and exposes it in a separate signal.
        Normally one would add the KINETIC flag and listen to decelerate signal, but since
        WebKit already has code for calculating the velocity for GTK3, just use the same
        code path as scroll signal handler.

        * Shared/gtk/NativeWebWheelEventGtk.cpp:
        (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebWheelEvent):
        * Shared/gtk/WebEventFactory.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseScrollEnd):
        (webkitWebViewBaseConstructed):

2020-07-02  Alex Christensen  <achristensen@webkit.org>

        Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to replace _WKProcessPoolConfiguration.hstsStorageDirectory
        https://bugs.webkit.org/show_bug.cgi?id=213048

        Reviewed by Youenn Fablet.

        This uses CFNetwork SPI introduced in rdar://problem/50109631 to allow HSTS storage per NSURLSession.
        To be complete, I also deprecated our UI process HSTS state removal attempt SPIs, WKContextResetHSTSHosts and
        WKContextResetHSTSHostsAddedAfterDate, which had their last use removed in rdar://problem/64220838.

        I manually verified that this new SPI puts HSTS data in the specified location, and I also verified that HSTS
        state querying and removal works with the new CFNetwork SPI as it did with the old one.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::hostNamesWithHSTSCache const):
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
        (WebKit::NetworkProcess::clearHSTSCache):
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::hstsStorage const):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::hostNamesWithHSTSCache const):
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
        (WebKit::NetworkProcess::clearHSTSCache):
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache): Deleted.
        * UIProcess/API/C/mac/WKContextPrivateMac.h:
        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextResetHSTSHosts):
        (WKContextResetHSTSHostsAddedAfterDate):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration hstsStorageDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setHSTSStorageDirectory:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::privateBrowsingSession): Deleted.
        (WebKit::WebProcessPool::resetHSTSHosts): Deleted.
        (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::resolvedHSTSStorageDirectory const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2020-07-02  Alex Christensen  <achristensen@webkit.org>

        Update Mac CMake build

        * PlatformMac.cmake:

2020-07-02  Kate Cheney  <katherine_cheney@apple.com>

        Custom URL schemes should be treated as app-bound
        https://bugs.webkit.org/show_bug.cgi?id=213889
        <rdar://problem/64804671>

        Reviewed by Brent Fulgham.

        For applications which opt-in to App-Bound Domains, allow
        specification of app-bound custom URL schemes. All content loaded
        using an app-bound scheme will have access to otherwise restricted
        APIs. A custom scheme is specified by a colon at the end of a string
        in the WKAppBoundDomains list. Custom schemes are included in the
        count of 10 app-bound domains.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore _appBoundSchemes:]):
        * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
        SPI for testing.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::appBoundSchemes):
        (WebKit::WebsiteDataStore::initializeAppBoundDomains):
        Change variable name from appBoundDomains to appBoundData now that
        more than domains can be specified in the Info.plist. 

        (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
        Return both domains and schemes to avoid code duplication, at the expense
        of occasionally returning an unused parameter if only domains or only 
        schemes are needed.

        (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
        (WebKit::WebsiteDataStore::getAppBoundDomains const):
        (WebKit::WebsiteDataStore::getAppBoundSchemes const):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-07-02  Austin Blackwood  <ablackwoood@apple.com>

        Crash in +[UIViewController _viewControllerForFullScreenPresentationFromView:] when WKContentView is deallocated
        https://bugs.webkit.org/show_bug.cgi?id=213867

        Reviewed by Darin Adler.

        +[UIViewController _viewControllerForFullScreenPresentationFromView:]
        asserts that the view parameter is non-nil. WKFileUploadPanel
        passes its view (a weak pointer to the WKContentView), which may
        have already been nil'd out when the content view tries to dismiss
        the panel in its own dealloc.

        * UIProcess/ios/forms/WKFileUploadPanel.mm:
        (-[WKFileUploadPanel dismiss]):
        Check for nil.

2020-07-02  Chris Dumez  <cdumez@apple.com>

        FloatingPointEnvironment::saveMainThreadEnvironment() is not called for macOS Catalyst apps on Apple Silicon
        https://bugs.webkit.org/show_bug.cgi?id=213897
        <rdar://problem/64607098>

        Reviewed by Darin Adler.

        FloatingPointEnvironment::saveMainThreadEnvironment() is not called for macOS Catalyst apps on Apple Silicon
        This causes crashes because FloatingPointEnvironment::propagateMainThreadEnvironment() is called for worker
        threads for such apps on this platform.

        * Shared/ios/AuxiliaryProcessIOS.mm:
        (WebKit::AuxiliaryProcess::initializeSandbox):
        Drop some dead code for PLATFORM(MACCATALYST) since the whole file is protected with !PLATFORM(MACCATALYST).
        Mac Catalyst uses AuxiliaryProcessMac.mm instead.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::AuxiliaryProcess::platformInitialize):
        Call FloatingPointEnvironment::saveMainThreadEnvironment() on AuxiliaryProcessMac.mm since this
        platformInitialize() is used for Mac Catalyst and Catalyst apps may now run on Apple Silicon / ARM.
        Note that FloatingPointEnvironment::saveMainThreadEnvironment() is a no-op on platforms where it is
        not needed.

2020-07-02  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r263633, r263651, and r263671.

        Still seeing MediaRecorder test crashes after re-landing
        r263633

        Reverted changesets:

        "MediaRecorder stopRecorder() returns empty Blob after first
        use"
        https://bugs.webkit.org/show_bug.cgi?id=212274
        https://trac.webkit.org/changeset/263633

        "MediaRecorder.start() Method is Ignoring the "timeslice"
        Parameter"
        https://bugs.webkit.org/show_bug.cgi?id=202233
        https://trac.webkit.org/changeset/263651

        "Support MediaRecorder.onstart"
        https://bugs.webkit.org/show_bug.cgi?id=213720
        https://trac.webkit.org/changeset/263671

2020-07-02  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit::NetworkProcessProxy::updateProcessAssertion()
        https://bugs.webkit.org/show_bug.cgi?id=213891
        <rdar://problem/65017909>

        Reviewed by Alex Christensen.

        The crash was due to NetworkProcessProxy::updateProcessAssertion() re-entering while
        in the middle of the `m_activityFromWebProcesses = nullptr;` assignment. Calling
        the ProcessThrottler::BackgroundActivity destructor, could cause updateProcessAssertion()
        to get called again, in which case we may dereference m_activityFromWebProcesses and
        crash. To address the issue, use `std::exchange(m_activityFromWebProcesses, nullptr);`
        instead, so that m_activityFromWebProcesses becomes null BEFORE the BackgroundActivity
        destructor gets called. updateProcessAssertion() will still re-enter but
        m_activityFromWebProcesses will be nullptr and updateProcessAssertion() will do the
        right thing.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updateProcessAssertion):

2020-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK4 build

        * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
        (webkitScriptDialogImplConstructed):
        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp:
        (WebKit::WebDataListSuggestionsDropdownGtk::WebDataListSuggestionsDropdownGtk):
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::createPopupMenu):

2020-07-01  Said Abou-Hallawa  <sabouhallawa@apple.com>

        MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types
        https://bugs.webkit.org/show_bug.cgi?id=213826

        Reviewed by Darin Adler.

        Replace extensionsForMIMEType() with MIMETypeRegistry::getExtensionsForMIMEType().

        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _allowedFileExtensions]):

2020-07-01  Lauro Moura  <lmoura@igalia.com>

        [SOUP] Build fix after r263797 for older soup versions.

        Build was failing in LTS distributions due to -fpermissive

        Unreviewed build fix.

        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::sendString):

2020-07-01  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Allow the File object to be created with a replacement file
        https://bugs.webkit.org/show_bug.cgi?id=213825

        Reviewed by Darin Adler.

        The UIProcess passes a list of strings which represents the replacement
        paths along with a list to the original paths to the WebProcess. The 
        WebProcess passes these two list to FileChooser which creates the File
        objects and register the Blobs.

        The WebProcess registers the Blobs in the NetworkProcess which creates
        BlobDataFileReference objects with both the original path and the
        replacement path.

        The WebProcess unregisters the Blobs from the NetworkProcess which deletes
        the corresponding BlobDataFileReference from its registry. Upon destroying
        the BlobDataFileReference, the replacement file should be deleted.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
        * NetworkProcess/NetworkConnectionToWebProcess.h:
        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
        * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
        (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
        * Shared/BlobDataFileReferenceWithSandboxExtension.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
        (WebKit::BlobRegistryProxy::registerFileBlobURL):
        * WebProcess/FileAPI/BlobRegistryProxy.h:
        * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
        (WebKit::WebOpenPanelResultListener::didChooseFiles):
        * WebProcess/WebPage/WebOpenPanelResultListener.h:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didChooseFilesForOpenPanel):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:

2020-07-01  Tim Horton  <timothy_horton@apple.com>

        Swipe snapshot is removed too early when swiping away from a page that is still loading
        https://bugs.webkit.org/show_bug.cgi?id=213763
        <rdar://problem/64576811>

        Reviewed by Darin Adler.

        Test: http/tests/swipe/swipe-back-with-outstanding-load-cancellation.html

        When swiping back from a page that is still loading, when the swipe commits,
        and we start navigating back to the previous page, the unfinished forward navigation
        is cancelled.

        This cancellation resulted in a "didFailLoadForMainFrame" making it to ViewGestureController,
        which took it as an indication that the navigation *it* was interested in (the back navigation)
        had failed, and immediately removed the snapshot.

        Instead of listening to any random navigation's load notifications, keep track of the navigation
        started by goToBackForwardItem, and only listen to notifications from it, ignoring the others.

        This requires a bunch of plumbing to get the navigation from WebPageProxy to ViewGestureController,
        but is otherwise fairly trivial.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didFinishNavigation):
        (WebKit::PageClientImpl::didFailNavigation):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame): Deleted.
        (WebKit::PageClientImpl::didFailLoadForMainFrame): Deleted.
        * UIProcess/API/gtk/PageClientImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseDidFinishLoadForMainFrame):
        (webkitWebViewBaseDidFailLoadForMainFrame):
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/API/ios/WKWebViewIOS.h:
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _didFinishNavigation:]):
        (-[WKWebView _didFailNavigation:]):
        (-[WKWebView _didFinishLoadForMainFrame]): Deleted.
        (-[WKWebView _didFailLoadForMainFrame]): Deleted.
        * UIProcess/API/wpe/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didFinishNavigation):
        (WebKit::PageClientImpl::didFailNavigation):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame): Deleted.
        (WebKit::PageClientImpl::didFailLoadForMainFrame): Deleted.
        * UIProcess/API/wpe/PageClientImpl.h:
        * UIProcess/PageClient.h:
        * UIProcess/ViewGestureController.cpp:
        (WebKit::ViewGestureController::didReachNavigationTerminalState):
        (WebKit::ViewGestureController::willEndSwipeGesture):
        (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState): Deleted.
        * UIProcess/ViewGestureController.h:
        (WebKit::ViewGestureController::didFinishNavigation):
        (WebKit::ViewGestureController::didFailNavigation):
        (WebKit::ViewGestureController::didFinishLoadForMainFrame): Deleted.
        (WebKit::ViewGestureController::didFailLoadForMainFrame): Deleted.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFinishLoadForFrame):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
        * UIProcess/ios/PageClientImplIOS.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::didFinishNavigation):
        (WebKit::PageClientImpl::didFailNavigation):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame): Deleted.
        (WebKit::PageClientImpl::didFailLoadForMainFrame): Deleted.
        * UIProcess/ios/ViewGestureControllerIOS.mm:
        (WebKit::ViewGestureController::willEndSwipeGesture):
        (WebKit::ViewGestureController::resetState):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::didFinishNavigation):
        (WebKit::PageClientImpl::didFailNavigation):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame): Deleted.
        (WebKit::PageClientImpl::didFailLoadForMainFrame): Deleted.
        * UIProcess/mac/ViewGestureControllerMac.mm:
        (WebKit::ViewGestureController::resetState):
        * UIProcess/playstation/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didFinishNavigation):
        (WebKit::PageClientImpl::didFailNavigation):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame): Deleted.
        (WebKit::PageClientImpl::didFailLoadForMainFrame): Deleted.
        * UIProcess/playstation/PageClientImpl.h:
        * UIProcess/win/PageClientImpl.cpp:
        (WebKit::PageClientImpl::didFinishNavigation):
        (WebKit::PageClientImpl::didFinishLoadForMainFrame): Deleted.
        * UIProcess/win/PageClientImpl.h:

2020-07-01  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Allow the WebContent sandbox to check the 'hw.product' sysctl
        https://bugs.webkit.org/show_bug.cgi?id=213861
        <rdar://problem/64988957>

        Reviewed by Per Arne Vollan.

        Telemetry shows that we need to read the 'hw.product' sysctl in the font subsystem,
        primarily to enable certain font features (for various products) in different locales.

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

2020-07-01  Tim Horton  <timothy_horton@apple.com>

        Upstream application accent color support
        https://bugs.webkit.org/show_bug.cgi?id=213859

        Reviewed by Wenson Hsieh.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/Cocoa/PageClientImplCocoa.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/mac/PageClientImplMac.h:
        * UIProcess/mac/PageClientImplMac.mm:
        (WebKit::PageClientImpl::accentColor):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::setAccentColor):
        Plumb accent color to the Web Content process so that it is used when
        deciding the colors of selection and form controls.

2020-07-01  Keith Miller  <keith_miller@apple.com>

        Add WebXR to WebKit.plist preferences, off by default
        https://bugs.webkit.org/show_bug.cgi?id=213860
        <rdar://64411568>

        Reviewed by Tim Horton.

        Right now we look for "WebXR" in the plist, however, it's not in
        the file. It so happens that, *I think*, we fall back to false for
        missing keys. We should have an entry for readability and
        consistency, though.

        No tests needed because this shouldn't change behavior.

        * FeatureFlags/WebKit.plist:

2020-07-01  Chris Dumez  <cdumez@apple.com>

        Regression(r259242) WebKit no longer does client navigations at foreground priority for extensions
        https://bugs.webkit.org/show_bug.cgi?id=213852
        <rdar://problem/63300428>

        Reviewed by Alex Christensen.

        r259242 tried to address a ASSERT(window) debug assertion hit in applicationType()
        by only calling applicationType() when the window is non-null and assuming the
        process is an application when the window is null. However, this is not correct
        for extensions. The first thing isApplicationVisible() does is call 
         _UIApplicationIsExtension() to determine if we are an extension. It does not need
        the window to make this determination. As a result, I have reverted r259242 and
        simply dropped the ASSERT(window) assertion in isApplicationVisible() instead.

        This fixes the regression tracked by <rdar://problem/63300428> by reverting the
        change that caused it (r259242) and drops the assertion that was hit before r259242.

        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::applicationType):
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::isApplicationVisible):

2020-07-01  Daniel Bates  <dabates@apple.com>

        [iOS] Implement support for UIWKDocumentRequestSpatialAndCurrentSelection
        https://bugs.webkit.org/show_bug.cgi?id=213704
        <rdar://problem/59738878>

        Reviewed by Wenson Hsieh.

        Implement support for the new request type UIWKDocumentRequestSpatialAndCurrentSelection.
        Requests of this type return the contents inside the range that covers both the specified
        rect and the current selection, if there is one.

        The flag UIWKDocumentRequestSpatialAndCurrentSelection was added in <rdar://problem/64867540>.

        * Platform/spi/ios/UIKitSPI.h: Same thing I did in TestWebKitAPI/ios/UIKitSPI.h. See Tools ChangeLog for why.
        * Shared/DocumentEditingContext.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toWebDocumentRequestOptions):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDocumentEditingContext):

2020-07-01  Chris Dumez  <cdumez@apple.com>

        Crash under IPC::isValidMessageName()
        https://bugs.webkit.org/show_bug.cgi?id=213751
        <rdar://problem/64773416>

        Reviewed by Geoffrey Garen.

        This is a speculative fix for the crashes tracked by <rdar://problem/64773416>.
        The suspicion is that the compiler optimizes the code for IPC::isValidMessageName()
        because its parameter is of type MessageName. It may therefore assume the parameter
        is a valid MessageName enum value, which is ironic because the purpose of this
        function is to check whether or not the enum value is valid.

        To address the issue, I got rid of the #ifdefs in MessageName enum so that the
        enum values have an underlying value in the range [0, MessageName::Last]. I then
        updated the isValidEnum template specialization to verify that the input integer
        is indeed in the range [0, MessageName::Last] before casting it to a MessageName
        and calling IPC::isValidMessageName().

        * Scripts/webkit/messages.py:

2020-07-01  Kate Cheney  <katherine_cheney@apple.com>

        WKUserScripts injecting into all frames seem to violate app-bound domains
        https://bugs.webkit.org/show_bug.cgi?id=213816
        <rdar://problem/64872296>

        Reviewed by Brady Eidson.

        Patch to make app-bound domain checks on a per-frame basis instead
        of per-page-based-on-main-frame. This will prevent WKUserScripts from
        being injected in subframes when the main frame is app-bound. Now, all
        ancestors of a frame must be app-bound in order for a frame to
        evaluate user script.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomainAndCheckIfPermitted):
        Move 'isMainFrame' check to be inside of the check for
        m_limitsNavigationsToAppBoundDomains. The navigation should fail if
        the main frame is not app-bound and the WKWebView is marked with the
        limitsNavigationToAppBoundDomains flag, but non-app-bound subframe
        loads are allowed to continue.

        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isTopFrameNavigatingToAppBoundDomain const):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::download):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
        (WebKit::WebLoaderStrategy::startPingLoad):
        (WebKit::WebLoaderStrategy::preconnectTo):
        For reporting loads to the Network Process, we only care if the main
        frame is app bound, so we need to store that info in the WebPage and
        WebPageProxy.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::shouldEnableInAppBrowserPrivacyProtections const):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::startDownload):
        (WebKit::WebFrame::convertMainResourceLoadToDownload):
        (WebKit::WebFrame::shouldEnableInAppBrowserPrivacyProtections):
        (WebKit::WebFrame::isTopFrameNavigatingToAppBoundDomain const):
        * WebProcess/WebPage/WebFrame.h:
        (WebKit::WebFrame::setIsNavigatingToAppBoundDomain):
        (WebKit::WebFrame::isNavigatingToAppBoundDomain const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::loadRequest):
        (WebKit::WebPage::loadDataImpl):
        (WebKit::WebPage::didReceivePolicyDecision):
        (WebKit::WebPage::runJavaScript):
        (WebKit::WebPage::setIsNavigatingToAppBoundDomain):
        (WebKit::WebPage::shouldEnableInAppBrowserPrivacyProtections): Deleted.
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::needsInAppBrowserPrivacyQuirks):
        (WebKit::WebPage::isNavigatingToAppBoundDomain const): Deleted.
        Move all app-bound domain logic from the WebPage to the WebFrame now
        that checks are on a per-frame basis.

2020-07-01  Youenn Fablet  <youenn@apple.com>

        Make NetworkSendQueue use CString instead of String for UTF-8 data
        https://bugs.webkit.org/show_bug.cgi?id=213714

        Reviewed by Darin Adler.

        Update code to use CString/DataReference to transmit WebSocket text messages.

        * NetworkProcess/NetworkSocketChannel.cpp:
        (WebKit::NetworkSocketChannel::sendString):
        * NetworkProcess/NetworkSocketChannel.h:
        * NetworkProcess/NetworkSocketChannel.messages.in:
        * NetworkProcess/WebSocketTask.h:
        (WebKit::WebSocketTask::sendString):
        * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
        * NetworkProcess/cocoa/WebSocketTaskCocoa.mm:
        (WebKit::WebSocketTask::sendString):
        * NetworkProcess/soup/WebSocketTaskSoup.h:
        * NetworkProcess/soup/WebSocketTaskSoup.cpp:
        (WebKit::WebSocketTask::sendString):
        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::createMessageQueue):
        (WebKit::WebSocketChannel::send):

2020-07-01  James Savage  <james.savage@apple.com>

        Fix Swift overlay build after r263727.
        https://bugs.webkit.org/show_bug.cgi?id=213823.

        Unreviewed, follow up build fix.

        * SwiftOverlay/Tests/WebKitTests.swift:
        (WebKitTests.testAPI): Fix tests to refer to new parameter name.
        * UIProcess/API/Cocoa/WebKitSwiftOverlay.swift:
        (callAsyncJavaScript(_:arguments:in:in:completionHandler:Error:)): Use
        the imported ObjC name that the compiler expects.
        (evaluateJavaScript(_:in:in:completionHandler:Error:)): Ditto.

2020-07-01  Youenn Fablet  <youenn@apple.com>

        Make NetworkRTCProvider receive IPC messages from a background thread
        https://bugs.webkit.org/show_bug.cgi?id=213557

        Reviewed by Geoffrey Garen.

        To ensure webrtc packets do not get blocked on the main thread,
        we process WebProcess IPC message directly in the socket thread.
        For new sockets, we still go through the main thread, to check suspension or proxy values.
        For sending packets/setting options/closing sockets, we stay in the background thread.

        * DerivedSources-output.xcfilelist:
        * DerivedSources.make:
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
        * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
        (WebKit::LibWebRTCSocketClient::sendTo):
        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
        (WebKit::NetworkRTCProvider::close):
        (WebKit::NetworkRTCProvider::createSocket):
        (WebKit::NetworkRTCProvider::createUDPSocket):
        (WebKit::NetworkRTCProvider::createServerTCPSocket):
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
        (WebKit::NetworkRTCProvider::sendToSocket):
        (WebKit::NetworkRTCProvider::closeSocket):
        (WebKit::NetworkRTCProvider::setSocketOption):
        (WebKit::NetworkRTCProvider::addSocket):
        (WebKit::NetworkRTCProvider::takeSocket):
        (WebKit::NetworkRTCProvider::newConnection):
        (WebKit::NetworkRTCProvider::dispatchToThread):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:
        (WebKit::NetworkRTCProvider::didReceiveNetworkRTCMonitorMessage):
        * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
        * NetworkProcess/webrtc/NetworkRTCSocket.cpp: Removed.
        * NetworkProcess/webrtc/NetworkRTCSocket.h: Removed.
        * NetworkProcess/webrtc/NetworkRTCSocket.messages.in: Removed.
        * SourcesCocoa.txt:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
        (WebKit::LibWebRTCSocket::SendTo):
        (WebKit::LibWebRTCSocket::Close):
        (WebKit::LibWebRTCSocket::SetOption):
        (WebKit::LibWebRTCSocket::suspend):

2020-06-30  Sam Weinig  <weinig@apple.com>

        Split Color serialization out of Color classes
        https://bugs.webkit.org/show_bug.cgi?id=213820

        Reviewed by Darin Adler.

        Adopt ColorSerialization.h serialization functions.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (dictionaryRepresentationForEditorState):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (-[WKTextTouchBarItemController _wkChangeColor:]):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _setTextColorForWebView:sender:]):
        * UIProcess/ios/forms/WKFormColorPicker.mm:
        (-[WKColorPicker setControlValueFromUIColor:]):
        * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
        (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
        * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
        (WebKit::PDFPluginTextAnnotation::createAnnotationElement):

2020-06-30  Geoffrey Garen  <ggaren@apple.com>

        [Cocoa] [GTK] RunLoop::Timer::isActive() is incorrect for timers while they are firing
        https://bugs.webkit.org/show_bug.cgi?id=213771

        Unreviewed assertion fix.

        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
        (WebKit::AuthenticatorManager::timeOutTimerFired): Removed this ASSERT.
        One-shot timers are not active while they are firing.

2020-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        Several key event tests in fast/events/ios are failing after <rdar://problem/62197116>
        https://bugs.webkit.org/show_bug.cgi?id=213821
        <rdar://problem/64821309>

        Reviewed by Megan Gardner.

        Add an SPI method declaration.

        * Platform/spi/ios/UIKitSPI.h:

2020-06-30  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Remove whitelistedRpId
        https://bugs.webkit.org/show_bug.cgi?id=213817
        <rdar://problem/60108131>

        Reviewed by Geoffrey Garen.

        Remove the whitelist such that we can test the attestation service in a wider range.

        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
        (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
        (WebKit::LocalAuthenticatorInternal::whitelistedRpId): Deleted.

2020-06-30  Brady Eidson  <beidson@apple.com>

        Fix Swift overlay build after r263727.
        <rdar://problem/64962370> and https://bugs.webkit.org/show_bug.cgi?id=213823

        Reviewed by Darin Adler.

        No new tests (No behavior change).
        
        Adapt the Swift overlay refinemnt to handle the inFrame: argument for these methods.

        * UIProcess/API/Cocoa/WebKitSwiftOverlay.swift:
        (callAsyncJavaScript(_:arguments:in:in:completionHandler:Error:)):
        (evaluateJavaScript(_:in:in:completionHandler:Error:)):
        (callAsyncJavaScript(_:arguments:in:completionHandler:Error:)): Deleted.
        (evaluateJavaScript(_:in:completionHandler:Error:)): Deleted.

2020-06-30  Brady Eidson  <beidson@apple.com>

        App-bound JavaScript and Navigation failures should have specific error codes.
        <rdar://problem/64940268> and https://bugs.webkit.org/show_bug.cgi?id=213808

        Reviewed by Tim Hatcher.
        (Informally by Kate Cheney)

        * UIProcess/API/Cocoa/WKError.h:
        * UIProcess/API/Cocoa/WKError.mm:
        (localizedDescriptionForErrorCode):

        * UIProcess/API/Cocoa/WKWebView.mm:
        (nsErrorFromExceptionDetails):

        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::errorForUnpermittedAppBoundDomainNavigation):

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        * UIProcess/WebPageProxy.h:

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

2020-06-30  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Connections to the preference daemon are established before entering the sandbox
        https://bugs.webkit.org/show_bug.cgi?id=213379

        Reviewed by Darin Adler.

        On macOS, connections to the preference daemon are established before entering the sandbox. These connections also persist
        after entering the sandbox and denying access to the preference daemon. There should not be attempts to connect to the
        preference daemon before entering the sandbox, since these attempts will not be stopped by the sandbox. This patch moves
        code that connects to the preference daemon to be executed after the sandbox has been entered. That includes code to
        prevent connections to the Dock and code to initialize WebKit logging. Also, instead of calling [NSBundle bundleForClass:],
        call [NSBundle bundleWithIdentifier:], since calling [NSBundle bundleForClass:] will connect to the preference daemon.
        Finally, allow the syscall SYS_gethostuuid, since that is needed by CoreFoundation when there is no access to the
        preference daemon.

        No new tests. This should be covered by existing tests. It would be nice to have a test to make sure that there are no
        connections to the preference daemon just before entering the sandbox, but I am not aware of how to implement this.

        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeSandbox):
        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initialize):
        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::webKit2Bundle):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::initializeSandbox):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-06-30  Brent Fulgham  <bfulgham@apple.com>

        Partially revert r257135 now that the underlying bug is resolved
        https://bugs.webkit.org/show_bug.cgi?id=213814
        <rdar://problem/59859573>

        Reviewed by Per Arne Vollan.

        This patch is a partial revert of the code change in Bug 208033, where a temporary
        workaround was added for a bug in an underlying framework. Now that the bug has been
        fixed, we can remove this workaround.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::gpuProcessSessionParameters):

2020-06-30  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Stop blocking two audio-related user client classes
        https://bugs.webkit.org/show_bug.cgi?id=213807
        <rdar://problem/64874902>

        Reviewed by Per Arne Vollan.

        Restore IOAudioControlUserClient and IOAudioEngineUserClient since we find them being
        actively used on macOS for some media playback purposes.

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

2020-06-30  Peng Liu  <peng.liu6@apple.com>

        Enable the support of FULLSCREEN_API in WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=213774

        Reviewed by Youenn Fablet.

        Replace the definition of ENABLE_FULLSCREEN_API in FeatureDefines.xcconfig with
        the one in PlatformEnableCocoa.h. We have to do that because WebKitTestRunner
        does not have a FeatureDefines.xcconfig but it uses "ENABLE(FULLSCREEN_API)"
        to conditionally compile code to test the element fullscreen API.
        WebKitTestRunner can use the macro defined in PlatformEnableCocoa.h.

        * Configurations/FeatureDefines.xcconfig:

2020-06-30  Daniel Bates  <dabates@apple.com>

        [iOS] Editable regions causes ~1% slowdown in PLT5
        https://bugs.webkit.org/show_bug.cgi?id=213659
        <rdar://problem/64361390>

        Reviewed by Simon Fraser.

        Fix up RemoteLayerTreeViews now that the editable region is an Optional<>. Have
        the UI process message the web process to enable editable region on the first
        invocation of _requestTextInputContextsInRect, which is good indicator that there
        would be benefit to computing it as a typical client that calls it will call it
        many times.

        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
        (WebKit::mayContainEditableElementsInRect): Fix up the logic now that there may
        be not be an editable region sent over in the last event region update. If there
        isn't one then we don't know if there are editable elements in the rect of not.
        So, return true, which could turn out to be a false positive if there aren't any
        editable elements in the rect. The caller will have to message the web process
        to find out the real answer if they want it. Just to clarify, it's OK for this
        function to have false positives, but it must never have false negatives.
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::textInputContextsInRect): Enable editable region. If it's already
        enabled then doing so again does nothing.

2020-06-30  Peng Liu  <peng.liu6@apple.com>

        Scrunching a video to PiP can result in broken animation and leave Safari in a bad state
        https://bugs.webkit.org/show_bug.cgi?id=213175

        Reviewed by Jer Noble.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController _completedExitFullScreen]):
        Update _exitRequested after exiting fullscreen to make sure the following
        enter fullscreen request can be processed.
        (-[WKFullScreenWindowController _dismissFullscreenViewController]):
        Make sure _completedExitFullScreen function will always execute.
        (-[WKFullScreenWindowController _interactivePinchDismissChanged:]):
        Remove a function call which corrupts the state machine under stress test.

2020-06-30  Antoine Quint  <graouts@webkit.org>

        [iOS] Crash under WebKit::WebPage::getFocusedElementInformation()
        https://bugs.webkit.org/show_bug.cgi?id=213798
        <rdar://problem/62754594>

        Reviewed by Wenson Hsieh.

        Since LabelableElement::labels() returns a RefPtr<NodeList>, ensure we get a value before attempting to read data from it.

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

2020-06-30  Andy Estes  <aestes@apple.com>

        [Xcode] Enable the "My Mac (Mac Catalyst)" destination in WebKit Xcode projects
        https://bugs.webkit.org/show_bug.cgi?id=213740

        Reviewed by Darin Adler.

        * Configurations/Base.xcconfig: Set SUPPORTS_MACCATALYST to YES to tell Xcode that this
        project supports building for Mac Catalyst.

2020-06-30  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r263724.
        https://bugs.webkit.org/show_bug.cgi?id=213781


        Reverted changeset:

        "Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to
        replace _WKProcessPoolConfiguration.hstsStorageDirectory"
        https://bugs.webkit.org/show_bug.cgi?id=213048
        https://trac.webkit.org/changeset/263724

2020-06-30  Youenn Fablet  <youenn@apple.com>

        Add VP9 WebRTC codec runtime flag
        https://bugs.webkit.org/show_bug.cgi?id=213724

        Reviewed by Eric Carlson.

        * Shared/WebPreferences.yaml:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):

2020-06-29  Brady Eidson  <beidson@apple.com>

        JavaScript cannot be injected into iframes
        <rdar://problem/54168946> and https://bugs.webkit.org/show_bug.cgi?id=213556

        Reviewed by Geoff Garen.
        
        This adds a few mechanisms:
        - Allows for WKUserScripts to have a target content world
        - Allows "evaluateJavaScript" and "callAsyncJavaScript" to target a specific frame
        - Allows for the completion handlers of those methods to be able to distinguish 
          failure-due-to-missing-frame.

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

        * UIProcess/API/Cocoa/WKError.h:
        * UIProcess/API/Cocoa/WKError.mm:
        (localizedDescriptionForErrorCode):

        * UIProcess/API/Cocoa/WKUserScript.h:
        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
        (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:inContentWorld:]):
        * UIProcess/API/Cocoa/WKWebView.h:

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView evaluateJavaScript:inFrame:inContentWorld:completionHandler:]):
        (-[WKWebView callAsyncJavaScript:arguments:inFrame:inContentWorld:completionHandler:]):
        (nsErrorFromExceptionDetails):
        (-[WKWebView _evaluateJavaScript:asAsyncFunction:withSourceURL:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]):
        (-[WKWebView callAsyncJavaScript:arguments:inContentWorld:completionHandler:]): Deleted.

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

2020-06-29  Alex Christensen  <achristensen@webkit.org>

        Make _WKWebsiteDataStoreConfiguration SPI for HSTS storage to replace _WKProcessPoolConfiguration.hstsStorageDirectory
        https://bugs.webkit.org/show_bug.cgi?id=213048

        Reviewed by Youenn Fablet.

        This uses CFNetwork SPI introduced in rdar://problem/50109631 to allow HSTS storage per NSURLSession.
        To be complete, I also deprecated our UI process HSTS state removal attempt SPIs, WKContextResetHSTSHosts and
        WKContextResetHSTSHostsAddedAfterDate, which had their last use removed in rdar://problem/64220838.

        I manually verified that this new SPI puts HSTS data in the specified location, and I also verified that HSTS
        state querying and removal works with the new CFNetwork SPI as it did with the old one.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::hostNamesWithHSTSCache const):
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
        (WebKit::NetworkProcess::clearHSTSCache):
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache): Deleted.
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::hstsStorage const):
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::hostNamesWithHSTSCache const):
        (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
        (WebKit::NetworkProcess::clearHSTSCache):
        (WebKit::NetworkProcess::getHostNamesWithHSTSCache): Deleted.
        * UIProcess/API/C/mac/WKContextPrivateMac.h:
        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextResetHSTSHosts):
        (WKContextResetHSTSHostsAddedAfterDate):
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
        * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
        (-[_WKWebsiteDataStoreConfiguration hstsStorageDirectory]):
        (-[_WKWebsiteDataStoreConfiguration setHSTSStorageDirectory:]):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::privateBrowsingSession): Deleted.
        (WebKit::WebProcessPool::resetHSTSHosts): Deleted.
        (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Deleted.
        * UIProcess/WebProcessPool.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
        (WebKit::WebsiteDataStore::parameters):
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::resolvedHSTSStorageDirectory const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
        (WebKit::WebsiteDataStoreConfiguration::copy const):
        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2020-06-29  Tim Horton  <timothy_horton@apple.com>

        Adopt adjusted symbol image names
        https://bugs.webkit.org/show_bug.cgi?id=213768
        <rdar://problem/64472257>

        Reviewed by Andy Estes.

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction imageForElementActionType:]):

2020-06-29  Guowei Yang  <guowei_yang@apple.com>

        Adding Experimental Feature Flags for CoreImage backed SVG/CSS Filters
        https://bugs.webkit.org/show_bug.cgi?id=213578

        Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield.

        Preparing to implement CoreImage backed filter rendering
        Needs Compiler guards and experimental feature guard.

        * Shared/WebPreferences.yaml: added feature flag definition

2020-06-29  Peng Liu  <peng.liu6@apple.com>

        Video spills over PiP screen a little when using Picture in Picture
        https://bugs.webkit.org/show_bug.cgi?id=213658

        Reviewed by Eric Carlson.

        Add the video content dimensions to the IPC message VideoFullscreenManagerProxy::SetupFullscreenWithID.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
        (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
        (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):

2020-06-29  Chris Dumez  <cdumez@apple.com>

        Unreviewed, reverting r262004.
        <rdar://problem/64540215>

        Revert r262004 as it is not OK to have a data vault in
        TMPDIR.

        Reverted changeset:

        "[WK2] WebKit abandons compiled sandbox profiles"
        https://bugs.webkit.org/show_bug.cgi?id=212177
        https://trac.webkit.org/changeset/262004

2020-06-29  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>

        Remove ENABLE_STREAMS_API compilation flag
        https://bugs.webkit.org/show_bug.cgi?id=213728

        Reviewed by Sam Weinig.

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

2020-06-29  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Temporarily open up sandbox for mapping of Launch Services database
        https://bugs.webkit.org/show_bug.cgi?id=213756
        <rdar://problem/64707000>

        Reviewed by Brent Fulgham.

        Address review comments.

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

2020-06-29  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Temporarily open up sandbox for mapping of Launch Services database
        https://bugs.webkit.org/show_bug.cgi?id=213756
        <rdar://problem/64707000>

        Reviewed by Brent Fulgham.

        Temporarily open up sandbox for mapping of Launch Services database in the WebContent process on iOS.
        This is just a short term fix, and access to the service will be closed again soon.

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

2020-06-29  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rebaseline messages.py tests.

        * Scripts/MessageNames.cpp:
        (IPC::description):
        (IPC::receiverName):
        (IPC::isValidMessageName):
        * Scripts/MessageNames.h:
        (WTF::isValidEnum):
        * Scripts/test-superclassMessagesReplies.h:

2020-06-29  David Kilzer  <ddkilzer@apple.com>

        Crash in NetworkProcessProxy::getNetworkProcessConnection() lambda due to missing Optional<> value check
        <https://webkit.org/b/213700>
        <rdar://problem/64852903>

        Reviewed by Darin Adler.

        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::getGPUProcessConnection):
        - Rename `connectionIdentifier` to `identifier`.
        - Return early from the lamba if `identifier` does not contain a
          value.
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
        - Ditto.

2020-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] editing/selection/ios/select-text-after-changing-focus.html sometimes fails
        https://bugs.webkit.org/show_bug.cgi?id=213745
        Work towards <rdar://problem/64808138>

        Reviewed by Tim Horton.

        This test first taps an input field to focus it, taps a button below the input field to focus the button and
        dismiss the keyboard, and finally long presses to select a word below the button. On recent iOS 14 builds, this
        test occasionally fails due to recent changes in UIKit that may cause the callout bar appearance callback to
        fire after focusing the input field. If this happens, we end up showing the callout bar with a single option to
        "Select All" (despite the field being empty), and the subsequent tap that's intended to hit the button instead
        hit-tests to this callout bar item. The tests subsequently times out waiting for the keyboard to dismiss, which
        never happens because the input field remains focused.

        Showing the "Select All" callout bar option in empty text fields is inconsistent with the rest of the platform
        (iOS), and appears to have been unintentionally introduced in iOS 12 by <https://trac.webkit.org/r231726>. While
        it's still unknown which exact system changes caused this test to begin timing out, we can at least fix it by
        addressing this existing regression in behavior.

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

        Check `-hasContent` here, instead of just checking if the selection is a caret. Note that we don't need to check
        whether the selection is none separately, since `-hasContent` will always return `NO` if there is no selection.

2020-06-29  Sam Weinig  <weinig@apple.com>

        Remove remaining makeSimpleColorFrom* variants
        https://bugs.webkit.org/show_bug.cgi?id=213706

        Reviewed by Darin Adler.

        * UIProcess/API/wpe/WebKitColor.cpp:
        (webkitColorToWebCoreColor):
        Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats.

        * WebProcess/Inspector/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::drawRect):
        Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for
        constant expression creation of SimpleColors.

2020-06-29  Youenn Fablet  <youenn@apple.com>

        Send WebRTC packets received from network process to web process from a background thread
        https://bugs.webkit.org/show_bug.cgi?id=213548

        Reviewed by Eric Carlson.

        Make LibWebRTCSocketClient take a ref to an IPC connection at creation time.
        Use this connection from the RTC network thread to send received packets to improve performances.
        Covered by existing tests.

        * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
        (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
        (WebKit::LibWebRTCSocketClient::signalReadPacket):
        (WebKit::LibWebRTCSocketClient::signalSentPacket):
        (WebKit::LibWebRTCSocketClient::signalAddressReady):
        (WebKit::LibWebRTCSocketClient::signalConnect):
        (WebKit::LibWebRTCSocketClient::signalClose):
        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
        (WebKit::NetworkRTCProvider::createSocket):
        (WebKit::NetworkRTCProvider::createUDPSocket):
        (WebKit::NetworkRTCProvider::createServerTCPSocket):
        (WebKit::NetworkRTCProvider::createClientTCPSocket):
        (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
        * NetworkProcess/webrtc/NetworkRTCProvider.h:

2020-06-29  Elliot  <CheeseEBoi@mailo.com>

        [GTK] Dark mode for GTK themes that end with -Dark
        https://bugs.webkit.org/show_bug.cgi?id=213465

        Reviewed by Carlos Garcia Campos.

        WebKitGtk has support for automatic detection of dark mode when it comes to GTK themes with the "-dark" and
        ":dark" suffixes. However, when using GTK themes that end with "-Dark" or ":Dark", this is not the case. This
        affects many themes like "Arc" and "Flat-Remix".

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
        (WebKit::PageClientImpl::themeName const):

2020-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add webkit_authentication_request_get_security_origin
        https://bugs.webkit.org/show_bug.cgi?id=213596

        Reviewed by Michael Catanzaro.

        Returns the security origin for the authentication protection space.

        * UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
        (webkit_authentication_request_get_security_origin):
        * UIProcess/API/gtk/WebKitAuthenticationRequest.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitAuthenticationRequest.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2020-06-29  Alexander Mikhaylenko  <alexm@gnome.org>

        [GTK4] Context menu is misaligned
        https://bugs.webkit.org/show_bug.cgi?id=213703

        Reviewed by Carlos Garcia Campos.

        Set halign on the context menu popover to the same value other context menus in GTK use,
        like in GtkEntry.

        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::createMenuWidget): Set halign for the context menu to 'start'.

2020-06-28  Chris Dumez  <cdumez@apple.com>

        Fix thread-safety issue in webProcessPoolHighDynamicRangeDidChangeCallback()
        https://bugs.webkit.org/show_bug.cgi?id=213689
        <rdar://problem/64443996>

        Reviewed by Darin Adler.

        webProcessPoolHighDynamicRangeDidChangeCallback() gets called on a background thread so we
        need to make sure we dispatch to the main thread before we iterate over the process pools.

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

2020-06-28  Geoffrey Garen  <ggaren@apple.com>

        Rename initializeThreading to initialize
        https://bugs.webkit.org/show_bug.cgi?id=213674

        Reviewed by Mark Lam.

        * Shared/API/c/WKString.cpp:
        (WKStringCopyJSString):
        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2):

2020-06-28  Daniel Bates  <dabates@apple.com>

        [iOS] Clean up visible position comparisons in WebPage::requestDocumentEditingContext()
        https://bugs.webkit.org/show_bug.cgi?id=213701

        Reviewed by Geoffrey Garen.

        Use std::min and std::max when the result needs to be copied instead of doing the comparison
        by hand to make the code a tiny bit more clear. Also, don't copy a VisiblePosition when doing
        the min/max in-place. Both of these things are unlikely to effect code generation. If they do,
        the latter makes things a tiny bit more efficient.

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

2020-06-28  Youenn Fablet  <youenn@apple.com>

        MediaRecorder stopRecorder() returns empty Blob after first use
        https://bugs.webkit.org/show_bug.cgi?id=212274
        <rdar://problem/63601298>

        Reviewed by Eric Carlson.

        Update implementation to do initialization as part of startRecording.

        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        (WebKit::RemoteMediaRecorderManager::releaseRecorder):
        Remove ASSERT as recorder creation in WebProcess is always ok while creation in GPUProcess may fail and m_recorders may not be populated.
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::startRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:

2020-06-28  Philippe Normand  <pnormand@igalia.com>

        Unreviewed GTK/WPE Debug build fix after r263589.

        * Platform/Logging.h: Define a log category for Memory Pressure.

2020-06-27  Daniel Bates  <dabates@apple.com>

        Revert r262654 because it caused <rdar://problem/64664156>.
        Moreover it is no longer necessary as the embedding client
        changes selection through a different SPI after focusing.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView _didCommitLoadForMainFrame]):
        (-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]):

2020-06-26  David Kilzer  <ddkilzer@apple.com>

        Crash at WebKit: __62-[WKContentView(WKInteraction) resignFirstResponderForWebView]_block_invoke
        <https://webkit.org/b/213666>
        <rdar://problem/64238661>

        Reviewed by Darin Adler.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView resignFirstResponderForWebView]):
        - Speculative fix to return early if there are no queued key
          events available by the time the block runs.

2020-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Layout tests sometimes assert under -[WKContentView hasContent]
        https://bugs.webkit.org/show_bug.cgi?id=213656
        <rdar://problem/64818648>

        Reviewed by Tim Horton.

        Make it safe to invoke `-[WKContentView hasContent]` when post-layout data is not present, and there is no
        ranged or caret selection. Some editing layout tests on iOS tend to hit the post-layout data assertion due to
        the callout bar presentation callback firing while we reset the test harness to a consistent state (and spin the
        runloop while doing so).

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

2020-06-26  Pablo Saavedra  <psaavedra@igalia.com>

        [GTK][WPE] Fix the matching of an empty value in getCgroupControllerPath() when only cgroupsV2 hierarchy is found
        https://bugs.webkit.org/show_bug.cgi?id=213646

        Reviewed by Adrian Perez de Castro.

        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::getCgroupFile):
        (WebKit::getCgroupControllerPath):
        (WebKit::systemMemoryUsedAsPercentage):

2020-06-26  Jason Lawrence  <lawrence.j@apple.com>

        Unreviewed, reverting r263511, r263514, and r263565.

        r263511 caused MediaRecorder test crashes on internal testers.

        Reverted changesets:

        "MediaRecorder stopRecorder() returns empty Blob after first
        use"
        https://bugs.webkit.org/show_bug.cgi?id=212274
        https://trac.webkit.org/changeset/263511

        "Unreviewed iOS build fix after r263511."
        https://trac.webkit.org/changeset/263514

        "MediaRecorder.start() Method is Ignoring the "timeslice"
        Parameter"
        https://bugs.webkit.org/show_bug.cgi?id=202233
        https://trac.webkit.org/changeset/263565

2020-06-26  Geoffrey Garen  <ggaren@apple.com>

        Initializing the main thread should initialize the main run loop
        https://bugs.webkit.org/show_bug.cgi?id=213637

        Reviewed by Anders Carlsson.

        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        (WebKit::InitializeWebKit2):
        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2):

2020-06-26  Chris Dumez  <cdumez@apple.com>

        [iOS] Network process is crashing when launching TJMaxx app due to invalid NetworkProcess::DestroySession IPC message
        https://bugs.webkit.org/show_bug.cgi?id=213625
        <rdar://problem/64737890>

        Reviewed by Alex Christensen.

        The app is calling [WKWebsiteDataStore init] despite the method being marked as unavailable in
        WKWebsiteDataStore.h. As a result, they end up with a WKWebsiteDataStore object whose internal
        _websiteDataStore is bad because its constructor was never called. When [WKWebsiteDataStore dealloc]
        gets called later own, it calls the ~WebsiteDataStore() destructor for _websiteDataStore but its
        m_sessionID is 0 because we never called the constructor. This causes us to send a
        NetworkProcess::DestroySession IPC with a sessionID that is 0, which is not valid so the
        NetworkProcess crashes.

        To address the issue, we now provide an implementation of [WKWebsiteDataStore init] which raises an
        exception, behind a linked-on-after check. To keep the app working, [WKWebsiteDataStore init] returns
        a new ephemeral data store until rebuilt with the new SDK.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
        Mark "new" as unavailable, otherwise [WKWebsiteDataStore new] builds.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore init]):
        Raise an exception with latest SDK, a new ephemeral data store otherwise.

        * UIProcess/Cocoa/VersionChecks.h:
        Add linked-on-after check.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        Add a release assertion to make sure that m_sessionID is always valid when the destructor is called.

2020-06-26  Stephan Szabo  <stephan.szabo@sony.com>

        [WinCairo] Cannot build without resource load statistics
        https://bugs.webkit.org/show_bug.cgi?id=213534

        Reviewed by Don Olmstead.

        Build fix for !ENABLE(RESOURCE_LOAD_STATISTICS)

        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:

2020-06-25  Alex Christensen  <achristensen@webkit.org>

        WKHTTPCookieStore.setCookie should flush the cookies to disk before calling completion handler when we are using the UIProcess's default cookie storage
        https://bugs.webkit.org/show_bug.cgi?id=213636

        Reviewed by Brady Eidson.

        This fixes a race condition that many, many third party developers run into, causing them to not be logged in when they thought they did.

        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::saveCookies):
        * UIProcess/API/APIHTTPCookieStore.cpp:
        (API::HTTPCookieStore::setCookies):
        (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
        (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):
        * UIProcess/API/APIHTTPCookieStore.h:
        * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
        (API::HTTPCookieStore::flushDefaultUIProcessCookieStore):

2020-06-25  Megan Gardner  <megan_gardner@apple.com>

        Upstream date/time picker style
        https://bugs.webkit.org/show_bug.cgi?id=213630

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
        (-[WKDateTimePicker datePickerStyle]):

2020-06-25  Chris Dumez  <cdumez@apple.com>

        Unreviewed, reverting r263545.

        Patch will need refining

        Reverted changeset:

        "[iOS] Network process is crashing when launching TJMaxx app
        due to invalid NetworkProcess::DestroySession IPC message"
        https://bugs.webkit.org/show_bug.cgi?id=213625
        https://trac.webkit.org/changeset/263545

2020-06-25  Chris Dumez  <cdumez@apple.com>

        [iOS] Network process is crashing when launching TJMaxx app due to invalid NetworkProcess::DestroySession IPC message
        https://bugs.webkit.org/show_bug.cgi?id=213625
        <rdar://problem/64737890>

        Reviewed by Geoffrey Garen.

        The app is calling [WKWebsiteDataStore init] despite the method being marked as unavailable in
        WKWebsiteDataStore.h. As a result, they end up with a WKWebsiteDataStore object whose internal
        _websiteDataStore is bad because its constructor was never called. When [WKWebsiteDataStore dealloc]
        gets called later own, it calls the ~WebsiteDataStore() destructor for _websiteDataStore but its
        m_sessionID is 0 because we never called the constructor. This causes us to send a
        NetworkProcess::DestroySession IPC with a sessionID that is 0, which is not valid so the
        NetworkProcess crashes.

        To address the issue, we now provide an implementation of [WKWebsiteDataStore init] which returns nil
        behind a linked-on-after check (since this crashes the app). To keep the app working,
        [WKWebsiteDataStore init] returns the default data store until rebuilt with the new SDK. Note that
        I tried returning a new ephemeral data store instead but this was getting the app in a bad state.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
        Mark "new" as unavailable, otherwise [WKWebsiteDataStore new] builds.

        * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
        (-[WKWebsiteDataStore init]):
        Return nil with latest SDK, the default data store otherwise.

        * UIProcess/Cocoa/VersionChecks.h:
        Add linked-on-after check.

        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::~WebsiteDataStore):
        Add a release assertion to make sure that m_sessionID is always valid when the destructor is called.

2020-06-25  Daniel Bates  <dabates@apple.com>

        [iOS] -_requestTextInputContextsInRect cannot find empty Quip spreadsheet title
        https://bugs.webkit.org/show_bug.cgi?id=213564
        <rdar://problem/59355847>

        Reviewed by Simon Fraser.

        Check if the search rect intersects the interaction rect, even if it's empty, so long as
        there is an assisted element. If there isn't an assisted element just do what we do now.
        Otherwise, if the interaction rect is empty then this means the focused element is an
        empty inline and it's not tracked in the editable region (see WebCore ChangeLog entry for
        more details). In this case, just ask the web process directly to find the contexts.

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

2020-06-25  Kate Cheney  <katherine_cheney@apple.com>

        Allow service workers for web browsers
        https://bugs.webkit.org/show_bug.cgi?id=213573
        <rdar://problem/64712630>

        Reviewed by Brent Fulgham.

        Allows applications with the full web-browser entitlement to use
        service workers.

        * NetworkProcess/ios/NetworkProcessIOS.mm:
        (WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _setupPageConfiguration:]):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):

2020-06-25  Youenn Fablet  <youenn@apple.com>

        MediaRecorder stopRecorder() returns empty Blob after first use
        https://bugs.webkit.org/show_bug.cgi?id=212274
        <rdar://problem/63601298>

        Reviewed by Eric Carlson.

        Update implementation to do initialization as part of startRecording.

        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        (WebKit::RemoteMediaRecorderManager::releaseRecorder):
        Remove ASSERT as recorder creation in WebProcess is always ok while creation in GPUProcess may fail and m_recorders may not be populated.
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
        (WebKit::MediaRecorderPrivate::startRecording):
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:

2020-06-24  James Savage  <james.savage@apple.com>

        Upstream iPadOS 13.0 multi-window support
        https://bugs.webkit.org/show_bug.cgi?id=213590

        Reviewed by Alexey Proskuryakov.

        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
        (-[WKFullScreenWindowController enterFullScreen]): Always construct a
        UIWindow using the expected UIWindowScene.
        (makeWindowFromView): Deleted.

2020-06-24  David Kilzer  <ddkilzer@apple.com>

        Use ObjectIdentifier<>instead of WebCore::nextPlaybackTargetClientContextId() in Document.cpp
        <https://webkit.org/b/213546>
        <rdar://problem/61803576>

        Reviewed by Youenn Fablet.

        Switch from uint64_t to WebCore::PlaybackTargetClientContextIdentifier
        for contextId values.

        * Scripts/webkit/messages.py:
        (types_that_cannot_be_forward_declared):
        - Add WebCore::PlaybackTargetClientContextIdentifier to list.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
        (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
        (WebKit::WebPageProxy::showPlaybackTargetPicker):
        (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
        (WebKit::WebPageProxy::setPlaybackTarget):
        (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
        (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
        (WebKit::WebPageProxy::playbackTargetPickerWasDismissed):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::addPlaybackTargetPickerClient):
        (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
        (WebKit::WebChromeClient::showPlaybackTargetPicker):
        (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::playbackTargetSelected const):
        (WebKit::WebPage::playbackTargetAvailabilityDidChange):
        (WebKit::WebPage::setShouldPlayToPlaybackTarget):
        (WebKit::WebPage::playbackTargetPickerWasDismissed):

2020-06-24  David Kilzer  <ddkilzer@apple.com>

        [IPC] Use WebKit::LayerHostingContextID instead of uint32_t for videoLayerID
        <https://webkit.org/b/213576>
        <rdar://problem/61806253>

        Reviewed by Darin Adler.

        Use WebKit::LayerHostingContextID instead of uint32_t as type
        for videoLayerID since the value comes from
        LayerHostingContext::contextID() in
        VideoFullscreenManager::enterVideoFullscreenForVideoElement().

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):

2020-06-24  Tim Horton  <timothy_horton@apple.com>

        Cannot play back any video on Apple Silicon devices
        https://bugs.webkit.org/show_bug.cgi?id=213584
        <rdar://problem/64714596>

        Reviewed by Per Arne Vollan.

        * WebProcess/com.apple.WebProcess.sb.in:
        An unfortunate and incorrect refactoring caused some of the sandbox exceptions to get dropped on the floor.

2020-06-24  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r260276): Scrolling through shelves on music.apple.com is not smooth
        https://bugs.webkit.org/show_bug.cgi?id=213572
        <rdar://problem/64306590>

        Reviewed by Wenson Hsieh.

        The scroll position for an overflow:scroll element with scroll-snap could jump around
        during scrolling, if layout triggered a call to ScrollableArea::updateScrollSnapState().
        The crux of the issue is that isScrollSnapInProgress() returned false for overflow:scrollers
        which are scrolling asynchronously.

        Fix by extending the existing ScrollingTree::isScrollSnapInProgress() to track all scrolling
        nodes by storing a HashSet<ScrollingNodeID> rather than just a flag for the main frame.

        RenderLayer::isScrollSnapInProgress() then consults the ScrollingCoordinator, which consults
        the scrolling tree for this state.

        Add the ability to test via internals.isScrollSnapInProgress().

        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
        * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
        (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress const):

2020-06-24  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r263295.
        https://bugs.webkit.org/show_bug.cgi?id=213577

        Introduced logging regression

        Reverted changeset:

        "[macOS] Connections to the preference daemon are established
        before entering the sandbox"
        https://bugs.webkit.org/show_bug.cgi?id=213379
        https://trac.webkit.org/changeset/263295

2020-06-24  David Kilzer  <ddkilzer@apple.com>

        Use ObjectIdentifier<> instead of uint64_t for context IDs in VideoFullscreenManagerProxy
        <https://webkit.org/b/212392>
        <rdar://problem/61799040>

        Reviewed by Youenn Fablet.

        Switch from uint64_t to WebKit::PlaybackSessionContextIdentifier
        for contextId values.

        * Scripts/webkit/messages.py:
        (types_that_cannot_be_forward_declared):
        - Add WebKit::PlaybackSessionContextIdentifier to list.
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
        (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
        (WebKit::PlaybackSessionManagerProxy::createModelAndInterface):
        (WebKit::PlaybackSessionManagerProxy::ensureModelAndInterface):
        (WebKit::PlaybackSessionManagerProxy::ensureModel):
        (WebKit::PlaybackSessionManagerProxy::ensureInterface):
        (WebKit::PlaybackSessionManagerProxy::addClientForContext):
        (WebKit::PlaybackSessionManagerProxy::removeClientForContext):
        (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
        (WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
        (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
        (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
        (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
        (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
        (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
        (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
        (WebKit::PlaybackSessionManagerProxy::mutedChanged):
        (WebKit::PlaybackSessionManagerProxy::volumeChanged):
        (WebKit::PlaybackSessionManagerProxy::durationChanged):
        (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
        (WebKit::PlaybackSessionManagerProxy::rateChanged):
        (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
        (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
        (WebKit::PlaybackSessionManagerProxy::play):
        (WebKit::PlaybackSessionManagerProxy::pause):
        (WebKit::PlaybackSessionManagerProxy::togglePlayState):
        (WebKit::PlaybackSessionManagerProxy::beginScrubbing):
        (WebKit::PlaybackSessionManagerProxy::endScrubbing):
        (WebKit::PlaybackSessionManagerProxy::seekToTime):
        (WebKit::PlaybackSessionManagerProxy::fastSeek):
        (WebKit::PlaybackSessionManagerProxy::beginScanningForward):
        (WebKit::PlaybackSessionManagerProxy::beginScanningBackward):
        (WebKit::PlaybackSessionManagerProxy::endScanning):
        (WebKit::PlaybackSessionManagerProxy::selectAudioMediaOption):
        (WebKit::PlaybackSessionManagerProxy::selectLegibleMediaOption):
        (WebKit::PlaybackSessionManagerProxy::togglePictureInPicture):
        (WebKit::PlaybackSessionManagerProxy::toggleMuted):
        (WebKit::PlaybackSessionManagerProxy::setMuted):
        (WebKit::PlaybackSessionManagerProxy::setVolume):
        (WebKit::PlaybackSessionManagerProxy::setPlayingOnSecondScreen):
        - Remove MESSAGE_CHECK_CONTEXTID() since it is now redundant.
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in:
        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenModelContext::VideoFullscreenModelContext):
        (WebKit::VideoFullscreenManagerProxy::requestRouteSharingPolicyAndContextUID):
        (WebKit::VideoFullscreenManagerProxy::createModelAndInterface):
        (WebKit::VideoFullscreenManagerProxy::ensureModelAndInterface):
        (WebKit::VideoFullscreenManagerProxy::ensureModel):
        (WebKit::VideoFullscreenManagerProxy::ensureInterface):
        (WebKit::VideoFullscreenManagerProxy::findInterface):
        (WebKit::VideoFullscreenManagerProxy::addClientForContext):
        (WebKit::VideoFullscreenManagerProxy::removeClientForContext):
        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
        (WebKit::VideoFullscreenManagerProxy::setHasVideo):
        (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
        (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
        (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
        (WebKit::VideoFullscreenManagerProxy::setInlineRect):
        (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
        (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
        (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
        (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::requestFullscreenMode):
        (WebKit::VideoFullscreenManagerProxy::requestUpdateInlineRect):
        (WebKit::VideoFullscreenManagerProxy::requestVideoContentLayer):
        (WebKit::VideoFullscreenManagerProxy::returnVideoContentLayer):
        (WebKit::VideoFullscreenManagerProxy::didSetupFullscreen):
        (WebKit::VideoFullscreenManagerProxy::willExitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::didExitFullscreen):
        (WebKit::VideoFullscreenManagerProxy::didEnterFullscreen):
        (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
        (WebKit::VideoFullscreenManagerProxy::setVideoLayerFrame):
        (WebKit::VideoFullscreenManagerProxy::setVideoLayerGravity):
        (WebKit::VideoFullscreenManagerProxy::fullscreenModeChanged):
        (WebKit::VideoFullscreenManagerProxy::fullscreenMayReturnToInline):
        - Remove MESSAGE_CHECK_CONTEXTID() since it is now redundant.
        * WebKit.xcodeproj/project.pbxproj:
        - Add PlaybackSessionContextIdentifier.h to the project.
        * WebProcess/cocoa/PlaybackSessionContextIdentifier.h: Add.
        * WebProcess/cocoa/PlaybackSessionManager.h:
        * WebProcess/cocoa/PlaybackSessionManager.messages.in:
        * WebProcess/cocoa/PlaybackSessionManager.mm:
        (WebKit::PlaybackSessionInterfaceContext::PlaybackSessionInterfaceContext):
        (WebKit::PlaybackSessionManager::createModelAndInterface):
        (WebKit::PlaybackSessionManager::ensureModelAndInterface):
        (WebKit::PlaybackSessionManager::ensureModel):
        (WebKit::PlaybackSessionManager::ensureInterface):
        (WebKit::PlaybackSessionManager::removeContext):
        (WebKit::PlaybackSessionManager::addClientForContext):
        (WebKit::PlaybackSessionManager::removeClientForContext):
        (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
        (WebKit::PlaybackSessionManager::clearPlaybackControlsManager):
        (WebKit::PlaybackSessionManager::contextIdForMediaElement):
        (WebKit::PlaybackSessionManager::durationChanged):
        (WebKit::PlaybackSessionManager::currentTimeChanged):
        (WebKit::PlaybackSessionManager::bufferedTimeChanged):
        (WebKit::PlaybackSessionManager::playbackStartedTimeChanged):
        (WebKit::PlaybackSessionManager::rateChanged):
        (WebKit::PlaybackSessionManager::seekableRangesChanged):
        (WebKit::PlaybackSessionManager::canPlayFastReverseChanged):
        (WebKit::PlaybackSessionManager::audioMediaSelectionOptionsChanged):
        (WebKit::PlaybackSessionManager::legibleMediaSelectionOptionsChanged):
        (WebKit::PlaybackSessionManager::externalPlaybackChanged):
        (WebKit::PlaybackSessionManager::audioMediaSelectionIndexChanged):
        (WebKit::PlaybackSessionManager::legibleMediaSelectionIndexChanged):
        (WebKit::PlaybackSessionManager::wirelessVideoPlaybackDisabledChanged):
        (WebKit::PlaybackSessionManager::mutedChanged):
        (WebKit::PlaybackSessionManager::volumeChanged):
        (WebKit::PlaybackSessionManager::isPictureInPictureSupportedChanged):
        (WebKit::PlaybackSessionManager::play):
        (WebKit::PlaybackSessionManager::pause):
        (WebKit::PlaybackSessionManager::togglePlayState):
        (WebKit::PlaybackSessionManager::beginScrubbing):
        (WebKit::PlaybackSessionManager::endScrubbing):
        (WebKit::PlaybackSessionManager::seekToTime):
        (WebKit::PlaybackSessionManager::fastSeek):
        (WebKit::PlaybackSessionManager::beginScanningForward):
        (WebKit::PlaybackSessionManager::beginScanningBackward):
        (WebKit::PlaybackSessionManager::endScanning):
        (WebKit::PlaybackSessionManager::selectAudioMediaOption):
        (WebKit::PlaybackSessionManager::selectLegibleMediaOption):
        (WebKit::PlaybackSessionManager::handleControlledElementIDRequest):
        (WebKit::PlaybackSessionManager::togglePictureInPicture):
        (WebKit::PlaybackSessionManager::toggleMuted):
        (WebKit::PlaybackSessionManager::setMuted):
        (WebKit::PlaybackSessionManager::setVolume):
        (WebKit::PlaybackSessionManager::setPlayingOnSecondScreen):
        (WebKit::nextContextId): Delete.
        - Replace with PlaybackSessionContextIdentifier::generate().
        * WebProcess/cocoa/VideoFullscreenManager.h:
        (WebKit::VideoFullscreenInterfaceContext::create):
        * WebProcess/cocoa/VideoFullscreenManager.messages.in:
        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenInterfaceContext::VideoFullscreenInterfaceContext):
        (WebKit::VideoFullscreenManager::createModelAndInterface):
        (WebKit::VideoFullscreenManager::ensureModelAndInterface):
        (WebKit::VideoFullscreenManager::ensureModel):
        (WebKit::VideoFullscreenManager::ensureInterface):
        (WebKit::VideoFullscreenManager::removeContext):
        (WebKit::VideoFullscreenManager::addClientForContext):
        (WebKit::VideoFullscreenManager::removeClientForContext):
        (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):
        (WebKit::VideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
        (WebKit::VideoFullscreenManager::hasVideoChanged):
        (WebKit::VideoFullscreenManager::videoDimensionsChanged):
        (WebKit::VideoFullscreenManager::requestFullscreenMode):
        (WebKit::VideoFullscreenManager::fullscreenModeChanged):
        (WebKit::VideoFullscreenManager::requestUpdateInlineRect):
        (WebKit::VideoFullscreenManager::requestVideoContentLayer):
        (WebKit::VideoFullscreenManager::returnVideoContentLayer):
        (WebKit::VideoFullscreenManager::didSetupFullscreen):
        (WebKit::VideoFullscreenManager::willExitFullscreen):
        (WebKit::VideoFullscreenManager::didEnterFullscreen):
        (WebKit::VideoFullscreenManager::didExitFullscreen):
        (WebKit::VideoFullscreenManager::didCleanupFullscreen):
        (WebKit::VideoFullscreenManager::setVideoLayerGravityEnum):
        (WebKit::VideoFullscreenManager::fullscreenMayReturnToInline):
        (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
        (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):

2020-06-24  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r262341) Use UTF-8 to decode CFURLRefs from IPC
        https://bugs.webkit.org/show_bug.cgi?id=213565
        <rdar://problem/64408924>

        Reviewed by Darin Adler.

        My assumption that all valid CFURLRefs are ASCII was incorrect.
        Some of them are UTF-8 encoded non-ASCII.
        Using kCFStringEncodingUTF8 covers both.

        Test: fast/url/navigate-non-ascii.html

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode):

2020-06-24  Umar Iqbal  <uiqbal@apple.com>

        We should resurrect the older patch that collects some statistics of web API calls
        https://bugs.webkit.org/show_bug.cgi?id=213319

        Reviewed by Brent Fulgham.

        + Enabled ENABLE_WEB_API_STATISTICS flag
        + Removed .string() from mainFrameRegistrableDomain to append it to topFrameRegistrableDomainsWhichAccessedWebAPIs
         because topFrameRegistrableDomainsWhichAccessedWebAPIs is a HashSet of WebCore::RegistrableDomain

        * Configurations/FeatureDefines.xcconfig:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::logFontLoad):
        (WebKit::WebResourceLoadObserver::logCanvasRead):
        (WebKit::WebResourceLoadObserver::logCanvasWriteOrMeasure):
        (WebKit::WebResourceLoadObserver::logNavigatorAPIAccessed):
        (WebKit::WebResourceLoadObserver::logScreenAPIAccessed):

2020-06-24  Andy Estes  <aestes@apple.com>

        [iOS] Open element actions sometimes result in a hover instead of a click
        https://bugs.webkit.org/show_bug.cgi?id=213530
        <rdar://problem/64176707>

        Reviewed by Darin Adler.

        _WKElementAction implements a standard action handler for _WKElementActionTypeOpen that
        attempts a synthetic click at the interaction location, expecting this click to start a
        navigation to the interaction node's target URL. Synthetic clicks are subject to content
        change observing, however, and if ContentChangeObserver detects a meaningful visible change
        after dispatching a mousemove event at the interaction location then WebPage will refrain
        from dispatching the mousedown and mouseup events that would have started a navigation.

        While this behavior is necessary to support hover menus, it doesn't make sense when the user
        is interacting with a context menu. Since the system might display a preview of the target
        URL found at the interaction location, users expect the "Open" action to navigate to that
        same URL rather than merely display a hover menu.

        This change opts synthetic clicks from the open action out of content change observing by
        ensuring that an interaction is started when handling _WKElementActionTypeOpen (like we do
        for "Copy" and "Save Image"), then checking if WebPage::m_interactionNode matches the node
        found in WebPage::attemptSyntheticClick. If it does, WebPage now bypasses content change
        observing and completes a synthetic click.

        New API test: ElementActionTests.OpenLinkWithHoverMenu

        * UIProcess/API/Cocoa/_WKElementAction.mm:
        (+[_WKElementAction _elementActionWithType:customTitle:assistant:]): Changed to call
        -[WKActionSheetAssistant handleElementActionWithType:element:needsInteraction:] in the
        handlers for _WKElementActionTypeCopy, _WKElementActionTypeOpen,
        _WKElementActionTypeSaveImage, and _WKElementActionTypeShare.

        * UIProcess/ios/WKActionSheetAssistant.h:
        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant handleElementActionWithType:element:needsInteraction:]): Added to
        handle the subset of standard element actions that flow through
        WKActionSheetAssistantDelegate. Used a boolean parameter to decide whether the delegate
        should start and stop an interaction when handling the action.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _highlightLongPressRecognized:]):
        (-[WKContentView actionSheetAssistant:openElementAtLocation:]): Renamed
        -_attemptClickAtLocation:modifierFlags: to -_attemptSyntheticClickAtLocation:modifierFlags:.
        (-[WKContentView _attemptSyntheticClickAtLocation:modifierFlags:]): Changed to call
        WebPageProxy::attemptSyntheticClick instead of WebPageProxy::handleTap.
        (-[WKContentView _simulateElementAction:atLocation:]): Set
        _layerTreeTransactionIdAtLastInteractionStart to better simulate context menu interactions.

        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::attemptSyntheticClick):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::attemptSyntheticClick): Renamed handleTap to attemptSyntheticClick. If the
        node responding to clicks matches the node found on interaction start (m_interactionNode),
        call WebPage::completeSyntheticClick directly.

2020-06-24  Tim Horton  <timothy_horton@apple.com>

        Fix the build once RBSProcessLimitations.h is introduced
        https://bugs.webkit.org/show_bug.cgi?id=213562

        Reviewed by Wenson Hsieh.

        * Platform/spi/ios/RunningBoardServicesSPI.h:
        We can't forward-declare Objective-C SPI if it actually exists
        without inspiring duplicate definition errors.

2020-06-24  Alex Christensen  <achristensen@webkit.org>

        Remove now-invalid assertion after r263441
        https://bugs.webkit.org/show_bug.cgi?id=213527

        The alternative service storage directory is now null when HTTP/3 is disabled, not just in private browsing.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

2020-06-24  Jer Noble  <jer.noble@apple.com>

        REGRESSION (r263328): Crash in bool WTF::WeakHashSet<WebKit::AudioSessionRoutingArbitratorProxy, WTF::EmptyCounter>::contains<WebKit::AudioSessionRoutingArbitratorProxy> const
        https://bugs.webkit.org/show_bug.cgi?id=213526
        <rdar://problem/64591777>

        Reviewed by Eric Carlson.

        Clear the m_routingArbitrator before WebProcessPool::disconnectProcess(), not after.

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

2020-06-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Update OptionsGTK.cmake and NEWS for 2.29.2 release

        * gtk/NEWS: Add release notes for 2.29.2.

2020-06-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to allow applications to handle the HTTP authentication credential storage
        https://bugs.webkit.org/show_bug.cgi?id=213177

        Reviewed by Michael Catanzaro.

        Add API to disable the internal credential storage support when building with libsecret. And add new API to
        WebKitAuthenticationRequest to allow applications to use their own credentials storage:

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::persistentCredentialStorageEnabled const):
        (WebKit::NetworkDataTaskSoup::authenticate):
        (WebKit::NetworkDataTaskSoup::continueAuthenticate):
        (WebKit::NetworkDataTaskSoup::didGetHeaders):
        * NetworkProcess/soup/NetworkDataTaskSoup.h:
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::setPersistentCredentialStorageEnabled):
        * NetworkProcess/soup/NetworkSessionSoup.cpp:
        (WebKit::NetworkSessionSoup::NetworkSessionSoup):
        * NetworkProcess/soup/NetworkSessionSoup.h:
        * UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
        (webkitAuthenticationRequestDispose):
        (webkit_authentication_request_class_init):
        (webkitAuthenticationRequestCreate):
        (webkitAuthenticationRequestDidAuthenticate):
        (webkitAuthenticationRequestGetProposedCredential):
        (webkit_authentication_request_can_save_credentials):
        (webkit_authentication_request_set_can_save_credentials):
        (webkit_authentication_request_get_proposed_credential):
        (webkit_authentication_request_set_proposed_credential):
        (webkit_authentication_request_authenticate):
        (webkit_authentication_request_cancel):
        * UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewCompleteAuthenticationRequest):
        (webkitWebViewLoadChanged):
        (webkitWebViewLoadFailed):
        (webkitWebViewLoadFailedWithTLSErrors):
        (webkitWebViewHandleAuthenticationChallenge):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkit_website_data_manager_set_persistent_credential_storage_enabled):
        (webkit_website_data_manager_get_persistent_credential_storage_enabled):
        * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
        (webkitAuthenticationDialogInitialize):
        * UIProcess/API/gtk/WebKitAuthenticationRequest.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitAuthenticationRequest.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        (WebKit::WebsiteDataStore::persistentCredentialStorageEnabled const):
        * UIProcess/WebsiteData/soup/WebsiteDataStoreSoup.cpp:
        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
        (WebKit::WebsiteDataStore::setPersistentCredentialStorageEnabled):
        * UIProcess/soup/WebProcessPoolSoup.cpp:
        (WebKit::WebProcessPool::platformInitializeNetworkProcess):

2020-06-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Do not set the default configuration again when creating the WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=213340

        Reviewed by Michael Catanzaro.

        WebsiteDataStoreConfiguration already initializes on construction with the default paths, so we only need to
        override the ones set by the user.

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetDataStore):

2020-06-23  Alex Christensen  <achristensen@webkit.org>

        Make HTTP/3 experimental feature work on iOS and only create storage directory if enabled
        https://bugs.webkit.org/show_bug.cgi?id=213527

        Reviewed by Geoffrey Garen.

        Reading the experimental feature wasn't working on iOS because the user defaults prefix is different.
        Also, only resolve and create the directory if it is enabled.  This should help with startup time, which
        has to wait for all directories to be resolved and created.  See rdar://problem/64263228 which this should help with.
        We also respect the system default unless explicitly turned on, which should make it easier for CFNetwork to change things.

        I added an API test that verifies that the default alt-svc storage directory is not created when we don't want it to be.

        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):
        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
        (WebKit::WebsiteDataStore::http3Enabled):

2020-06-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r244633): Mail flashes when copying text in an email
        https://bugs.webkit.org/show_bug.cgi?id=213529
        <rdar://problem/55025522>

        Reviewed by Tim Horton.

        When copying a text selection in Mail conversation view, Mail uses injected bundle hooks to supply additional
        metadata before writing to the pasteboard. Grabbing this data involves temporarily expanding any collapsed
        blockquotes that appear in the mail message, before re-collapsing them after we finish gathering data to be
        written to the pasteboard.

        Prior to r244633, the size of the document while expanding collapsed content would not be propagated to the
        WKWebView, since intrinsic content size changes were batched and sent ahead of the next drawing area flush.
        After r244633, however, updates are now sent every time the layout size changes. This was done to ensure that
        the intrinsic content size was always up to date before sending the first layout milestone to the UI process.

        To preserve the intent of r244633 (with respect to the first layout milestone) as well as intrinsic content size
        behavior prior to r244633 after performing layout, we reintroduce the mechanism for batching intrinsic size
        updates until the next flush, but keep the out-of-band mechanism for immediately sending an up-to-date intrinsic
        size to the UI process before firing the first layout milestone.

        Test: WebKit.AutoLayoutBatchesUpdatesWhenInvalidatingIntrinsicContentSize

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::intrinsicContentsSizeChanged const):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):

        If we have a pending intrinsic content size update, clear it out here so that an out-of-band call to
        updateIntrinsicContentSizeIfNeeded doesn't get overridden by an older intrinsic content size that was previously
        scheduled.

        (WebKit::WebPage::flushPendingIntrinsicContentSizeUpdate):

        Add a helper method to send any pending intrinsic content size update.

        (WebKit::WebPage::scheduleIntrinsicContentSizeUpdate):

        Add a helper method to schedule an intrinsic content size update for the next tiled drawing area flush.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
        (WebKit::TiledCoreAnimationDrawingArea::updateRendering):

2020-06-23  Andy Estes  <aestes@apple.com>

        [Apple Pay] WebPaymentCoordinatorProxy can be destroyed without dismissing its authorization presenter
        https://bugs.webkit.org/show_bug.cgi?id=213423
        <rdar://problem/60416221>

        Reviewed by Youenn Fablet.

        When a website completes a payment session, WebPaymentCoordinatorProxy would set its m_state
        to Idle by calling didReachFinalState, but would wait to call hidePaymentUI until the
        payment authorization presenter calls its presenterDidFinish callback. This allows the
        presenter to display a final message to the user before dismissing. As a catch-all,
        ~WebPaymentCoordinatorProxy would call hidePaymentUI, but only if m_state wasn't Idle. If a
        WebPaymentCoordinatorProxy was destroyed after a website completed a payment session but
        before the presenter called presenterDidFinish, hidePaymentUI would never be called.

        This patch addresses this by simplifying the logic for completing or canceling a payment
        session. It's based on the following observations:

        1. With the exception of the case described above, every caller of didReachFinalState would
           also call hidePaymentUI immediately beforehand. That means that we can move the calls to
           hidePaymentUI inside didReachFinalState. For the completePaymentSession case, rather than
           call didReachFinalState without dismissing the UI, we enter a new Completing state, then
           call didReachFinalState either in ~WebPaymentCoordinatorProxy or presenterDidFinish.

        2. didCancelPaymentSession is really a special case of didReachFinalState that also sends
           the DidCancelPaymentSession message to cancel active sessions in the web process. We can
           teach didReachFinalState to send this message when necessary and remove
           didCancelPaymentSession.

        3. PaymentAuthorizationPresenter stored a "did reach final state" boolean on payment
           completion and passed this value back to the client in the presenterDidFinish callback.
           WebPaymentCoordinatorProxy used this to determine whether to cancel an active session by
           calling didCancelPaymentSession or clean up a completed session by calling hidePaymentUI.
           With the addition of the Completing state and the merging of didCancelPaymentSession and
           hidePaymentUI into didReachFinalState, we can get rid of this final state tracking in
           PaymentAuthorizationPresenter and unconditionally call didReachFinalState in the
           presenterDidFinish callback.

        No new tests possible. A manual test case is described in <rdar://problem/60416221>.

        * Platform/cocoa/PaymentAuthorizationPresenter.h: Removed the didReachFinalState argument
        from Client::presenterDidFinish.

        * Platform/cocoa/PaymentAuthorizationPresenter.mm:
        (WebKit::PaymentAuthorizationPresenter::completePaymentSession): Changed to call
        -[WKPaymentAuthorizationDelegate completePaymentSession:errors:].

        * Platform/cocoa/WKPaymentAuthorizationDelegate.h:
        * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Removed the _didReachFinalState ivar.
        (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:]): Renamed from
        -completePaymentSession:errors:didReachFinalState:. Stopped setting _didReachFinalState.
        (-[WKPaymentAuthorizationDelegate invalidate]): Changed to call
        -completePaymentSession:errors:.
        (-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:]): Ditto.
        (-[WKPaymentAuthorizationDelegate _didFinish]): Stopped passing the value of
        _didReachFinalState to PaymentAuthorizationPresenter::Client::presenterDidFinish.
        (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]):
        Renamed to -completePaymentSession:errors:.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
        (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Replaced calls to
        didCancelPaymentSession with didReachFinalState.
        (WebKit::WebPaymentCoordinatorProxy::completePaymentSession): Set m_state to Completing
        rather than call didReachFinalState.
        (WebKit::WebPaymentCoordinatorProxy::abortPaymentSession): Removed call to hidePaymentUI
        since didReachFinalState was already being called.
        (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Replaced call to
        didCancelPaymentSession with didReachFinalState.
        (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Called didReachFinalState
        unconditionally now that the didReachFinalState boolean has been removed.
        (WebKit::WebPaymentCoordinatorProxy::canBegin const): Returned false for State::Completing.
        (WebKit::WebPaymentCoordinatorProxy::canCancel const): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::canAbort const): Ditto.
        (WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Added an early return if m_state
        is already Idle. Sent the DidCancelPaymentSession message if canCancel is true. Called
        platformHidePaymentUI before clearing m_authorizationPresenter and setting m_state to Idle.
        (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Deleted.

        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        (WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Added a PaymentSessionError&& arg.
        (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Deleted.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Replaced call to
        hidePaymentUI with didReachFinalState.

        * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformHidePaymentUI): Renamed from hidePaymentUI.
        Stopped clearing m_authorizationPresenter since didReachFinalState now does that.
        (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Renamed to platformHidePaymentUI.

        * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Removed call to hidePaymentUI
        since didReachFinalState was already being called.
        (WebKit::WebPaymentCoordinatorProxy::platformHidePaymentUI): Renamed from hidePaymentUI.
        Stopped clearing m_authorizationPresenter since didReachFinalState now does that.
        (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Renamed to platformHidePaymentUI.

2020-06-23  Chris Dumez  <cdumez@apple.com>

        Remove a lot of unnecessary calls to Ref::copyRef()
        https://bugs.webkit.org/show_bug.cgi?id=213533

        Reviewed by Darin Adler.

        Remove a lot of unnecessary calls to Ref::copyRef() now that Ref is copyable.

        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::requestResource):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::CompletionHandler<void):
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
        (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
        (WebKit::ResourceLoadStatisticsMemoryStore::clear):
        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
        (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
        (WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
        (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
        (WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::loadPing):
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didClose):
        (WebKit::NetworkProcess::fetchWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteData):
        (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
        (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
        (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
        (WebKit::NetworkProcess::renameOriginInWebsiteData):
        * NetworkProcess/cache/CacheStorageEngine.cpp:
        (WebKit::CacheStorage::Engine::readCachesFromDisk):
        (WebKit::CacheStorage::Engine::fetchDirectoryEntries):
        (WebKit::CacheStorage::Engine::clearAllCaches):
        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
        (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):
        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
        (WebKit::NetworkProcess::clearDiskCache):
        * NetworkProcess/soup/NetworkProcessSoup.cpp:
        (WebKit::NetworkProcess::clearDiskCache):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreStatisticsResetToConsistentState):
        * UIProcess/API/ios/WKWebViewIOS.mm:
        (-[WKWebView _takeViewSnapshot]):
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::resolveChildFrameHandle):
        (WebKit::WebAutomationSession::resolveParentFrameHandle):
        (WebKit::WebAutomationSession::computeElementLayout):
        (WebKit::WebAutomationSession::selectOptionElement):
        (WebKit::WebAutomationSession::setFilesForInputFileUpload):
        (WebKit::WebAutomationSession::getAllCookies):
        (WebKit::WebAutomationSession::deleteSingleCookie):
        (WebKit::WebAutomationSession::addSingleCookie):
        (WebKit::WebAutomationSession::performMouseInteraction):
        (WebKit::WebAutomationSession::takeScreenshot):
        * UIProcess/Cocoa/NavigationState.mm:
        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::handleSynchronousMessage):
        (WebKit::WebPageProxy::clearServiceWorkerEntitlementOverride):
        (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
        (WebKit::WebPageProxy::decidePolicyForResponseShared):
        (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::processForNavigationInternal):
        (WebKit::WebProcessPool::seedResourceLoadStatisticsForTesting):
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::setMaxStatisticsEntries):
        (WebKit::WebsiteDataStore::setPruneEntriesDownTo):
        (WebKit::WebsiteDataStore::setGrandfatheringTime):
        (WebKit::WebsiteDataStore::setMinimumTimeBetweenDataRecordsRemoval):
        (WebKit::WebsiteDataStore::setPrevalentResource):
        (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
        (WebKit::WebsiteDataStore::setVeryPrevalentResource):
        (WebKit::WebsiteDataStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
        (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
        (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
        (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
        (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
        (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
        (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
        (WebKit::WebsiteDataStore::clearPrevalentResource):
        (WebKit::WebsiteDataStore::resetParametersToDefaultValues):
        (WebKit::WebsiteDataStore::scheduleClearInMemoryAndPersistent):
        (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary):
        (WebKit::WebsiteDataStore::scheduleCookieBlockingUpdate):
        (WebKit::WebsiteDataStore::scheduleStatisticsAndDataRecordsProcessing):
        (WebKit::WebsiteDataStore::setLastSeen):
        (WebKit::WebsiteDataStore::mergeStatisticForTesting):
        (WebKit::WebsiteDataStore::insertExpiredStatisticForTesting):
        (WebKit::WebsiteDataStore::setNotifyPagesWhenDataRecordsWereScanned):
        (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
        (WebKit::WebsiteDataStore::setNotifyPagesWhenTelemetryWasCaptured):
        (WebKit::WebsiteDataStore::setTimeToLiveUserInteraction):
        (WebKit::WebsiteDataStore::logUserInteraction):
        (WebKit::WebsiteDataStore::clearUserInteraction):
        (WebKit::WebsiteDataStore::setGrandfathered):
        (WebKit::WebsiteDataStore::setUseITPDatabase):
        (WebKit::WebsiteDataStore::setCrossSiteLoadWithLinkDecorationForTesting):
        (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
        (WebKit::WebsiteDataStore::deleteCookiesForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldDowngradeReferrerForTesting):
        (WebKit::WebsiteDataStore::setThirdPartyCookieBlockingMode):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldEnbleSameSiteStrictEnforcementForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsToSameSiteStrictCookiesForTesting):
        (WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
        (WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
        (WebKit::WebsiteDataStore::resetQuota):
        (WebKit::WebsiteDataStore::clearAppBoundSession):
        (WebKit::WebsiteDataStore::renameOriginInWebsiteData):
        (WebKit::WebsiteDataStore::forwardAppBoundDomainsToITPIfInitialized):
        (WebKit::WebsiteDataStore::setAppBoundDomainsForITP):
        (WebKit::WebsiteDataStore::updateBundleIdentifierInNetworkProcess):
        (WebKit::WebsiteDataStore::clearBundleIdentifierInNetworkProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::markAllLayersVolatile):

2020-06-23  Fujii Hironori  <Hironori.Fujii@sony.com>

        [curl] Unreviewed build fix for r263407
        https://bugs.webkit.org/show_bug.cgi?id=213409
        <rdar://problem/64654646>

        * NetworkProcess/curl/NetworkDataTaskCurl.h: Include <wtf/MonotonicTime.h>.

2020-06-23  Alex Christensen  <achristensen@webkit.org>

        Expose already-available WKNavigationAction.request.HTTPBody through the API
        https://bugs.webkit.org/show_bug.cgi?id=179077

        Reviewed by Brady Eidson.

        When this bug was written, we needed to serialize the HTTP body to the UI process to expose it through the API.
        The controversial part of this was done in r237639, so this just exposes the data that is already available.

        Verified by an API test.

        * UIProcess/API/Cocoa/WKNavigationAction.mm:
        (-[WKNavigationAction request]):

2020-06-23  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary Timer from NetworkDataTask
        https://bugs.webkit.org/show_bug.cgi?id=213409

        Reviewed by Youenn Fablet.

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::NetworkDataTask):
        (WebKit::NetworkDataTask::scheduleFailure):
        (WebKit::NetworkDataTask::failureTimerFired): Deleted.
        * NetworkProcess/NetworkDataTask.h:
        * NetworkProcess/NetworkDataTaskBlob.cpp:
        (WebKit::NetworkDataTaskBlob::resume):
        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
        (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
        (WebKit::NetworkDataTaskCocoa::resume):

2020-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to configure and handle DOM cache to WebKitWebsiteDataManager
        https://bugs.webkit.org/show_bug.cgi?id=213337

        Reviewed by Adrian Perez de Castro.

        The default path is always used even for apps setting a base data directory. We should handle
        WebsiteDataType::DOMCache to configure the directory and allow to fetch and clear it.

        * UIProcess/API/glib/WebKitWebsiteData.cpp:
        (recordContainsSupportedDataTypes):
        (toWebKitWebsiteDataTypes):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetProperty):
        (webkitWebsiteDataManagerSetProperty):
        (webkitWebsiteDataManagerConstructed):
        (webkit_website_data_manager_class_init):
        (webkitWebsiteDataManagerGetDataStore):
        (webkit_website_data_manager_get_dom_cache_directory):
        (toWebsiteDataTypes):
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::websiteDataStoreFromSessionID): GTK and WPE ports don't use the default website
        data store, so only use it when it already exists. Use the process pool website data store instead.

2020-06-22  John Wilander  <wilander@apple.com>

        Storage Access API: Add the capability to call the Storage Access API as a quirk, on behalf of websites that should be doing it themselves
        https://bugs.webkit.org/show_bug.cgi?id=213418
        <rdar://problem/64549429>

        Reviewed by Alex Christensen.

        These changes are for forwarding ITP's knowledge of user interaction
        for specific quirks domains to the WebKit::WebProcessPool where it in
        turn can be distributed to all existing and new Web Content processes.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::needsUserInteractionQuirk const):
        (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * Shared/WebProcessDataStoreParameters.h:
        (WebKit::WebProcessDataStoreParameters::encode const):
        (WebKit::WebProcessDataStoreParameters::decode):
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::setDomainsWithUserInteraction):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::webProcessDataStoreParameters):
        (WebKit::WebProcessPool::setDomainsWithUserInteraction):
        * UIProcess/WebProcessPool.h:
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
        (WebKit::WebResourceLoadObserver::hasHadUserInteraction const):
        * WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setWebsiteDataStoreParameters):
        (WebKit::WebProcess::setDomainsWithUserInteraction):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-06-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] WebPageProxy::setPromisedDataForImage should sanitize its filename
        https://bugs.webkit.org/show_bug.cgi?id=213486
        <rdar://problem/56522262>

        Reviewed by Megan Gardner.

        Ensure that the filename passed into WebPageProxy::setPromisedDataForImage is sanitized in the UI process prior
        to being used as a suggested filename when writing a dragged image to the pasteboard.

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::setPromisedDataForImage):

2020-06-22  Tim Horton  <timothy_horton@apple.com>

        WebEx can not share video from Safari on arm64
        https://bugs.webkit.org/show_bug.cgi?id=213481

        Reviewed by Dean Jackson.

        * UIProcess/UserMediaProcessManager.cpp:
        (WebKit::needsAppleCameraService):
        (WebKit::UserMediaProcessManager::willCreateMediaStream):
        (WebKit::UserMediaProcessManager::revokeSandboxExtensionsIfNeeded):
        Pass sandbox extension for "com.apple.applecamerad" to the Web Content
        process after the user allows camera access, when running on hardware which requires it.

        * WebProcess/com.apple.WebProcess.sb.in:
        Make it possible to dynamically extend the sandbox as above.

2020-06-22  Tim Horton  <timothy_horton@apple.com>

        Cannot play back encrypted media on arm64
        https://bugs.webkit.org/show_bug.cgi?id=213483

        Reviewed by Jer Noble and Per Arne Vollan.

        * WebProcess/com.apple.WebProcess.sb.in:
        Extend the sandbox as necessary for encrypted media support.

2020-06-22  Michael Catanzaro  <mcatanzaro@gnome.org>

        [WPE][GTK] Public API should not allow trying to register a special URI scheme
        https://bugs.webkit.org/show_bug.cgi?id=209900
        <rdar://problem/61200217>

        Reviewed by Adrian Perez de Castro

        Epiphany prior to 3.36 registers a scheme handler for ftp. This introduced criticals. Let's
        use g_warning() instead, and avoid hardcoding the list of disallowed schemes.

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkit_web_context_register_uri_scheme):

2020-06-22  Tim Horton  <timothy_horton@apple.com>

        dlopen() always fails on arm64, cannot load soft-linked libraries
        https://bugs.webkit.org/show_bug.cgi?id=213480

        Reviewed by Alexey Proskuryakov and Per Arne Vollan.

        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::initializeSandboxParameters):
        Expose the auxiliary process' CPU family as a parameter to the sandbox profile,
        so that it can be used to predicate sandbox expressions.

        * WebProcess/com.apple.WebProcess.sb.in:
        Allow mremap_encrypted from the Web Content process, because the arm64 dlopen() needs it.

2020-06-22  Tim Horton  <timothy_horton@apple.com>

        Update macOS version macros
        https://bugs.webkit.org/show_bug.cgi?id=213484

        Reviewed by Alexey Proskuryakov.

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

2020-06-22  Tim Horton  <timothy_horton@apple.com>

        sysctl() fails due to sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=213482

        Reviewed by Maciej Stachowiak.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * WebProcess/com.apple.WebProcess.sb.in:
        Extend the sandbox as necessary to make sysctl calls work.

2020-06-22  Antoine Quint  <graouts@webkit.org>

        WebKit fails to leave audio routing arbitration during navigation, closing.
        https://bugs.webkit.org/show_bug.cgi?id=213426
        <rdar://problem/64395051>

        Unreviewed build fix for an unannotated switch fall-through between switch labels.

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

2020-06-21  Jer Noble  <jer.noble@apple.com>

        WebKit fails to leave audio routing arbitration during navigation, closing.
        https://bugs.webkit.org/show_bug.cgi?id=213426
        <rdar://problem/64395051>

        Reviewed by Eric Carlson.

        Add testing SPIs to verify whether a WebPage successfully entered or left audio routing
        arbitration. Notify the Arbitration proxy when the page is shut down, which ensures arbitration
        will end if the client closes the WKWebView.

        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
        (-[WKWebView _audioRoutingArbitrationStatus]):
        * UIProcess/API/mac/WKWebViewTestingMac.mm:
        * UIProcess/Media/AudioSessionRoutingArbitratorProxy.h:
        (WebKit::AudioSessionRoutingArbitratorProxy::arbitrationStatus const):
        * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
        (WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
        (WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory):
        (WebKit::AudioSessionRoutingArbitratorProxy::endRoutingArbitration):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::audioSessionRoutingArbitrator):

2020-06-21  Michael Catanzaro  <mcatanzaro@gnome.org>

        [WPE][GTK] Specify underlying storage type for InputMethodState::Hint
        https://bugs.webkit.org/show_bug.cgi?id=213401

        Reviewed by Carlos Garcia Campos.

        Using unsigned types for flags enums seems nice to do.

        * Shared/glib/InputMethodState.h:

2020-06-21  Michael Catanzaro  <mcatanzaro@gnome.org>

        [WPE][GTK] Add autocleanup for WebKitWebsitePolicies
        https://bugs.webkit.org/show_bug.cgi?id=213399

        Reviewed by Carlos Garcia Campos.

        Add missing autocleanups.

        * UIProcess/API/gtk/WebKitAutocleanups.h:
        * UIProcess/API/wpe/WebKitAutocleanups.h:

2020-06-20  Jiewen Tan  <jiewen_tan@apple.com>

        [AppSSO] Should do null check on m_page in dismissViewController()
        https://bugs.webkit.org/show_bug.cgi?id=213415
        <rdar://problem/59672418>

        Reviewed by Alexey Proskuryakov.

        * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
        (WebKit::SOAuthorizationSession::dismissViewController):

2020-06-20  Jer Noble  <jer.noble@apple.com>

        RecoveryOS: PAL::getAVPlayerLayerClass() will crash when AVFoundation is missing
        https://bugs.webkit.org/show_bug.cgi?id=213437
        <rdar://problem/64563064>

        Reviewed by Eric Carlson.

        Check PAL::isAVFoundationAvailable() before calling PAL::getAVPlayerLayerClass();

        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
        (WebKit::PlatformCALayerRemoteCustom::clone const):

2020-06-20  Jer Noble  <jer.noble@apple.com>

        REGRESSION(r259219): Sleep assertion remains active if WKWebView is closed or WebContent process crashes
        https://bugs.webkit.org/show_bug.cgi?id=213434
        <rdar://problem/57541662>

        Reviewed by Eric Carlson.

        Tests: TestWebKitAPI tests:
            SleepDisabler.Basic
            SleepDisabler.Pause
            SleepDisabler.Mute
            SleepDisabler.Unmute
            SleepDisabler.DisableAudioTrack
            SleepDisabler.Loop
            SleepDisabler.ChangeSrc
            SleepDisabler.Load
            SleepDisabler.Unload
            SleepDisabler.Navigate
            SleepDisabler.NavigateBack
            SleepDisabler.Reload
            SleepDisabler.Close
            SleepDisabler.Crash

        Ensure the SleepDisablers are cleared when the WebProcess closes or crashes.

        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):

2020-06-20  Brent Fulgham  <bfulgham@apple.com>

        [iOS, macOS] Allow access to the container manager to support Mail InjectedBundle
        https://bugs.webkit.org/show_bug.cgi?id=213357
        <rdar://problem/63837247>

        Reviewed by Darin Adler.

        The Mail Injected Bundle requires access to the container manager to support certain OS operations. We do not need
        this access for web browsing, and should limit this access to this one case.

        This patch creates a dynamic mach extension to the container manager for this single use case. It also denies the
        non-extension access case with a backtrace so we can see if any other clients are hitting this.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * 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):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-06-19  Chris Dumez  <cdumez@apple.com>

        [Cocoa] Delay issuing ManagedSession & Network Extension sandbox extensions until a load is actually issued
        https://bugs.webkit.org/show_bug.cgi?id=213414
        <rdar://problem/64548684>

        Reviewed by Per Arne Vollan.

        Delay issuing ManagedSession & Network Extension sandbox extensions until a load is actually issued.
        This is a Safari launch time optimization since the checks needed to decide whether or not to issue
        the extensions are expensive and there is no reason to issue them as soon as the process launches
        (especially in the case of a prewarmed process).

        * Shared/Cocoa/LoadParametersCocoa.mm:
        (WebKit::LoadParameters::platformEncode const):
        (WebKit::LoadParameters::platformDecode):
        * Shared/LoadParameters.h:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
        (WebKit::WebPageProxy::addPlatformLoadParameters):
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::addPlatformLoadParameters):
        (WebKit::WebPageProxy::loadRequestWithNavigationShared):
        (WebKit::WebPageProxy::loadFile):
        (WebKit::WebPageProxy::loadDataWithNavigationShared):
        (WebKit::WebPageProxy::loadAlternateHTML):
        (WebKit::WebPageProxy::loadWebArchiveData):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.h:
        (WebKit::WebProcessProxy::hasNetworkExtensionSandboxAccess const):
        (WebKit::WebProcessProxy::markHasNetworkExtensionSandboxAccess):
        (WebKit::WebProcessProxy::hasManagedSessionSandboxAccess const):
        (WebKit::WebProcessProxy::markHasManagedSessionSandboxAccess):
        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
        (WebKit::WebPage::platformDidReceiveLoadParameters):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-06-19  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r263287.

        Caused tests to exit early with crashes on Catalina.

        Reverted changeset:

        "[iOS, macOS] Allow access to the container manager to support Mail InjectedBundle"
        https://bugs.webkit.org/show_bug.cgi?id=213357
        https://trac.webkit.org/changeset/263287

2020-06-19  Chris Dumez  <cdumez@apple.com>

        Crash under WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount()
        https://bugs.webkit.org/show_bug.cgi?id=213417
        <rdar://problem/63477676>

        Reviewed by Darin Adler.

        Make sure |this| is still alive in ProcessAndUIAssertion::processAssertionWasInvalidated()
        after calling ProcessAssertion::processAssertionWasInvalidated() and before calling
        updateRunInBackgroundCount(). Calling ProcessAssertion::processAssertionWasInvalidated()
        notifies the client and the client may destroy the assertion as a result.

        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::ProcessAndUIAssertion::processAssertionWasInvalidated):

2020-06-19  Kate Cheney  <katherine_cheney@apple.com>

        com.apple.WebKit.Networking crash: suspended with locked system files (observations.db)
        https://bugs.webkit.org/show_bug.cgi?id=213391
        <rdar://problem/64494167>

        Reviewed by Chris Dumez.

        ITP is the only database that attempts to close when
        NetworkProcess::didClose() is called. This causes the network process
        to sometimes crash if the database is still closing when checking for
        locked system files. Instead, we should only flush the
        memory store to disk when calling NetworkProcess::didClose (in the
        memory store case), and only close the database when the network session is destroyed. 

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::didDestroyNetworkSession):
        (WebKit::WebResourceLoadStatisticsStore::destroyResourceLoadStatisticsStore):
        (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        Split into two functions, one to flush and destroy the persistent
        store, and one to destroy the memory or database store.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::didClose):
        Only flush the persistent store here, as described above.

        * NetworkProcess/NetworkSession.cpp:
        (WebKit::NetworkSession::flushAndDestroyPersistentStore):
        * NetworkProcess/NetworkSession.h:

2020-06-19  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthn] Provide a _WKWebAuthenticationPanelUpdatePINInvalid update to UI clients if the returned PIN from the client is not valid
        https://bugs.webkit.org/show_bug.cgi?id=213404
        <rdar://problem/64543894>

        Reviewed by Brent Fulgham.

        Provide a _WKWebAuthenticationPanelUpdatePINInvalid update to UI clients if the returned PIN from the client is not valid such that clients can
        reuse the same logic to handle invalid pin from the authenticator. This change makes their life easier.

        Covered by API tests.

        * UIProcess/API/APIWebAuthenticationPanelClient.h:
        (API::WebAuthenticationPanelClient::requestPin const):
        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
        (WebKit::WebAuthenticationPanelClient::requestPin const):
        Now, only null strings are intepreted as cancels.

        * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
        (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived):
        (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
        (WebKit::CtapAuthenticator::continueGetPinTokenAfterRequestPin):
        (WebKit::CtapAuthenticator::continueRequestAfterGetPinToken):
        This patch also removes potential null pointer dereferences.

2020-06-19  Per Arne Vollan  <pvollan@apple.com>

        [macOS] Connections to the preference daemon are established before entering the sandbox
        https://bugs.webkit.org/show_bug.cgi?id=213379

        Reviewed by Darin Adler.

        On macOS, connections to the preference daemon are established before entering the sandbox. These connections also persist
        after entering the sandbox and denying access to the preference daemon. There should not be attempts to connect to the
        preference daemon before entering the sandbox, since these attempts will not be stopped by the sandbox. This patch moves
        code that connects to the preference daemon to be executed after the sandbox has been entered. That includes code to
        prevent connections to the Dock and code to initialize WebKit logging. Also, instead of calling [NSBundle bundleForClass:],
        call [NSBundle bundleWithIdentifier:], since calling [NSBundle bundleForClass:] will connect to the preference daemon.
        Finally, allow the syscall SYS_gethostuuid, since that is needed by CoreFoundation when there is no access to the
        preference daemon.

        No new tests. This should be covered by existing tests. It would be nice to have a test to make sure that there are no
        connections to the preference daemon just before entering the sandbox, but I am not aware of how to implement this.

        * NetworkProcess/mac/NetworkProcessMac.mm:
        (WebKit::NetworkProcess::initializeSandbox):
        * Shared/AuxiliaryProcess.cpp:
        (WebKit::AuxiliaryProcess::initialize):
        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):
        * Shared/mac/AuxiliaryProcessMac.mm:
        (WebKit::webKit2Bundle):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::initializeSandbox):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-06-19  Chris Dumez  <cdumez@apple.com>

        Avoid initializing RenderTheme singleton unnecessarily in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=213406

        Reviewed by Per Arne Vollan.

        Avoid initializing RenderTheme singleton unnecessarily in the UIProcess. Instead, introduce
        a static function to get the focus ring color on iOS.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-06-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed build fix after r263288.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-06-19  Chris Dumez  <cdumez@apple.com>

        Use ASCIILiteral more for SandboxExtension functions
        https://bugs.webkit.org/show_bug.cgi?id=213400

        Reviewed by Per Arne Vollan.

        Use ASCIILiteral more for SandboxExtension functions. Functions like createHandleForMachLookup() / createHandleForIOKitClassExtension()
        don't need to take in Strings, ASCIILiteral is enough.

        * Shared/Cocoa/SandboxExtensionCocoa.mm:
        (WebKit::createHandlesForResources):
        (WebKit::SandboxExtension::createReadOnlyHandlesForFiles):
        (WebKit::SandboxExtension::createHandleForGenericExtension):
        (WebKit::SandboxExtension::createHandleForMachLookup):
        (WebKit::SandboxExtension::createHandlesForMachLookup):
        (WebKit::SandboxExtension::createHandleForIOKitClassExtension):
        (WebKit::SandboxExtension::createHandlesForIOKitClassExtensions):
        * Shared/SandboxExtension.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::mediaRelatedMachServices):
        (WebKit::nonBrowserServices):
        (WebKit::diagnosticServices):
        (WebKit::agxCompilerClasses):
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::enableRemoteInspectorIfNeeded):
        * UIProcess/GPU/GPUProcessProxy.cpp:
        (WebKit::GPUProcessProxy::singleton):
        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
        (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
        (WebKit::WebPageProxy::creationParameters):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::grantAccessToAssetServices):

2020-06-19  Brent Fulgham  <bfulgham@apple.com>

        [iOS, macOS] Allow access to the container manager to support Mail InjectedBundle
        https://bugs.webkit.org/show_bug.cgi?id=213357
        <rdar://problem/63837247>

        Reviewed by Darin Adler.

        The Mail Injected Bundle requires access to the container manager to support certain OS operations. We do not need
        this access for web browsing, and should limit this access to this one case.

        This patch creates a dynamic mach extension to the container manager for this single use case. It also denies the
        non-extension access case with a backtrace so we can see if any other clients are hitting this.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * 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):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-06-19  Andres Gonzalez  <andresg_22@apple.com>

        AX: web process crash in AXObjectCache::postNotification.
        https://bugs.webkit.org/show_bug.cgi?id=213398

        Reviewed by Chris Fleizach.

        AXObjectCache was being instantiated on the AX secondary thread.
        Therefore the timers for the different delayed notifications where
        initialized with the secondary thread. When postNotification was triggered
        on the main thread as it should, and the timer was accessed, the timer
        would assert/crash for being accessed in a thread different than where
        it was created. This change guaranties that AXObjectCache is always
        created on the main thread.

        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
        (-[WKAccessibilityWebPageObjectBase axObjectCache]):
        (-[WKAccessibilityWebPageObjectBase accessibilityPluginObject]):
        (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
        (-[WKAccessibilityWebPageObjectBase setWebPage:]):
        (-[WKAccessibilityWebPageObjectBase setHasMainFramePlugin:]):
        (-[WKAccessibilityWebPageObjectBase setRemoteParent:]):

2020-06-19  Chris Fleizach  <cfleizach@apple.com>

        AX: Make isolated tree enablement status dependent on client preference
        https://bugs.webkit.org/show_bug.cgi?id=213355
        <rdar://problem/64506577>

        Reviewed by Zalan Bujtas.

        We don't want the isolated tree mode in all clients (like Mail or Dictionary).
        As a result, we can set this setting to off and allow safari and mini browser turn on more directly.

        * Shared/WebPreferences.yaml:
        * UIProcess/API/Cocoa/WKPreferences.mm:
        (-[WKPreferences _setAccessibilityIsolatedTreeEnabled:]):
        (-[WKPreferences _accessibilityIsolatedTreeEnabled]):
        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        (WebKit::InjectedBundle::setAccessibilityIsolatedTreeEnabled):
        * WebProcess/InjectedBundle/InjectedBundle.h:

2020-06-19  Rob Buis  <rbuis@igalia.com>

        Enable referrer policy attribute support by default
        https://bugs.webkit.org/show_bug.cgi?id=213285

        Reviewed by Youenn Fablet.

        Enable referrer policy attribute support by default by flipping the switch.

        * Shared/WebPreferences.yaml:

2020-06-19  Youenn Fablet  <youenn@apple.com>

        LibWebRTCSocketClient::sendTo is too verbose in case of error
        https://bugs.webkit.org/show_bug.cgi?id=213380

        Reviewed by Eric Carlson.

        Only log error message if the error code is different from the previous one.

        * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
        (WebKit::LibWebRTCSocketClient::sendTo):
        * NetworkProcess/webrtc/LibWebRTCSocketClient.h:

2020-06-19  Chris Dumez  <cdumez@apple.com>

        Web Inspector: RemoteInspector::singleton() slows down MobileSafari launch
        https://bugs.webkit.org/show_bug.cgi?id=213381
        <rdar://problem/64533003>

        Reviewed by Darin Adler.

        RemoteInspector::singleton() is expensive according to traces. It was called in WebProcessPool::initializeNewWebProcess()
        which happens on MobileSafari launch because we prewarm a WebProcess. However, there is no reason to initialize remote
        Web Inspector at this point. Per associated comment, Remote Web Inspector needs to be initialized once there is a
        sub process hosting one of our Web View. As a result, I moved the initialization call to WebPageProxy::initializeWebPage()
        which is when we actually send the IPC to the WebProcess to create the WebPage that is backing the UI-side WebView.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::initializeWebPage):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::initializeNewWebProcess):

2020-06-19  Chris Dumez  <cdumez@apple.com>

        Move Prefixed WebAudio interfaces behind their own feature flag
        https://bugs.webkit.org/show_bug.cgi?id=213356

        Reviewed by Darin Adler.

        * Shared/WebPreferences.yaml:

2020-06-19  Rob Buis  <rbuis@igalia.com>

        Enable stale-while-revalidate support by default
        https://bugs.webkit.org/show_bug.cgi?id=213286

        Reviewed by Youenn Fablet.

        Enable stale-while-revalidate support for Mac/GTK/WPE by changing the default
        to true. Note that platforms that do not support speculative loads, which s-w-r
        relies on, will not see any change in bahavior.

        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:

2020-06-19  Alexander Mikhaylenko  <alexm@gnome.org>

        REGRESSION(r253360): [GTK] Page starts loading during animation in back/forward gesture
        https://bugs.webkit.org/show_bug.cgi?id=205650

        Reviewed by Carlos Garcia Campos.

        r253360 changed the swipe gesture to start loading the page during the gesture, relying on
        freezing the layer tree state to prevent unwanted redraws. However, it was implemented for
        AC mode, but didn't prevent redraws in non-accelerated mode. Add a simple check to skip
        redraws in this case.

        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
        (WebKit::DrawingAreaCoordinatedGraphics::display): Skip drawing if layer tree state is frozen.

2020-06-19  Carlos Garcia Campos  <cgarcia@igalia.com>

        Add support for fetching registrable domains with resource load statistics
        https://bugs.webkit.org/show_bug.cgi?id=213291

        Reviewed by Adrian Perez de Castro and Youenn Fablet.

        WebsiteDataStore::fetchData() doesn't return anything for resource load statistics because
        NetworkProcess::fetchWebsiteData() doesn't handle WebsiteDataType::ResourceLoadStatistics.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::allDomains const): Query all registrable domains from database.
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::allDomains const): Return all registrable domains in memory map.
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::registrableDomains): Get the list of registrable domains.
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::fetchWebsiteData): Handle WebsiteDataType::ResourceLoadStatistics.
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::encode const): Encode registrableDomainsWithResourceLoadStatistics.
        (WebKit::WebsiteData::decode): Decode registrableDomainsWithResourceLoadStatistics.
        * Shared/WebsiteData/WebsiteData.h:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreRemoveITPDataForDomain): Use WebsiteDataRecord::addResourceLoadStatisticsRegistrableDomain()
        instead of the display name.
        * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
        (WebKit::WebsiteDataRecord::addResourceLoadStatisticsRegistrableDomain): Add the given registrable domain to the list.
        * UIProcess/WebsiteData/WebsiteDataRecord.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::fetchDataAndApply): Handle registrable domains with resource load statistics.
        (WebKit::WebsiteDataStore::removeData): Use resourceLoadStatisticsRegistrableDomains instead of the display name.

2020-06-18  David Kilzer  <ddkilzer@apple.com>

        Use fastMalloc/fastFree in WebCoreArgumentCodersMac.mm
        <https://webkit.org/b/213325>

        Reviewed by Darin Adler.

        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::createArchiveList):
        (IPC::createCFURLRequestFromSerializableRepresentation):

2020-06-18  Tim Horton  <timothy_horton@apple.com>

        Remove some vestiges of the 32-bit Plugin Process
        https://bugs.webkit.org/show_bug.cgi?id=213361

        Reviewed by Dan Bernstein.

        We haven't launched 32-bit plugins for a while, but there are some
        build system complications and random references in the code that we can get rid of.

        * WebKit.xcodeproj/project.pbxproj:
        * Configurations/PluginService.xcconfig: Renamed from Source/WebKit/Configurations/PluginService.64.xcconfig.
        No need for .64 in the name anymore, since it's the only one.
        We do have to leave the .64 in the product name because there are other things in the system that depend on this.

        * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.Info.plist: Renamed from Source/WebKit/PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist.
        No need for .64 in the name anymore.

        * UIProcess/AuxiliaryProcessProxy.cpp:
        (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
        * UIProcess/Launcher/ProcessLauncher.h:
        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
        (WebKit::serviceName):
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
        There need only be one ProcessType for the plugin process now!

        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
        (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::bubblewrapSpawn):
        * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
        (WebKit::ProcessLauncher::launchProcess):
        GTK WebKit appears to also only launch 64-bit plugin processes.

2020-06-18  Megan Gardner  <megan_gardner@apple.com>

        Workaround for UIKit layout bug in time picker.
        https://bugs.webkit.org/show_bug.cgi?id=213346
        <rdar://problem/64042277>

        Reviewed by Tim Horton.

        There is a bug in the layout of UIKit that needs to be fixed.
        Until then, this workaround should give us a view that is viable.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView resignFirstResponderForWebView]):
        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
        (-[WKDateTimeContextMenuViewController preferredContentSize]):

2020-06-18  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] OptionSet<> values should be validated
        <https://webkit.org/b/213199>
        <rdar://problem/64369963>

        Reviewed by Anders Carlsson.

        Summary:
        - Add WTF::EnumTraits<> for all OptionSet<> enums.
        - Specify unsigned backing types for enum classes.

        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkSession.h:
        * Platform/IPC/ArgumentCoders.h:
        (IPC::ArgumentCoder<OptionSet<T>>::encode):
        (IPC::ArgumentCoder<OptionSet<T>>::decode):
        - Add WTF::isValidOptionSet() checks.
        * Platform/IPC/Decoder.h:
        * Platform/IPC/Encoder.h:
        - Replace <wtf/EnumTraits.h> with <wtf/OptionSet.h> since the
          latter now includes the former.
        * Platform/IPC/MessageFlags.h:
        * Shared/DocumentEditingContext.h:
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
        * Shared/WebEvent.h:
        * Shared/WebsiteAutoplayQuirk.h:
        * Shared/WebsiteData/WebsiteData.h:
        * Shared/WebsiteData/WebsiteDataFetchOption.h:
        * Shared/WebsiteData/WebsiteDataType.h:
        * Shared/ios/GestureTypes.h:
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Plugins/PluginProcessManager.h:
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.h:
        * WebProcess/WebProcess.h:

2020-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to configure and handle service worker registrations to WebKitWebsiteDataManager
        https://bugs.webkit.org/show_bug.cgi?id=213290

        Reviewed by Michael Catanzaro.

        The default path is always used even for apps setting a base data directory. We should handle
        WebsiteDataType::ServiceWorkerRegistrations to configure the directory and allow to fetch and clear them.

        * UIProcess/API/glib/WebKitWebsiteData.cpp:
        (recordContainsSupportedDataTypes):
        (toWebKitWebsiteDataTypes):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetProperty):
        (webkitWebsiteDataManagerSetProperty):
        (webkitWebsiteDataManagerConstructed):
        (webkit_website_data_manager_class_init):
        (webkitWebsiteDataManagerGetDataStore):
        (webkit_website_data_manager_get_service_worker_registrations_directory):
        (toWebsiteDataTypes):
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2020-06-18  Yuri Chornoivan  <yurchor@ukr.net>

        Unreviewed. Fix a typo introduced in r263085

        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkit_website_data_manager_class_init):

2020-06-17  Chris Dumez  <cdumez@apple.com>

        Add experimental feature flag for modern & unprefixed WebAudio API
        https://bugs.webkit.org/show_bug.cgi?id=213268

        Reviewed by Jer Noble.

        Add experimental feature flag for modern & unprefixed WebAudio API,
        off by default.

        * Shared/WebPreferences.yaml:

2020-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Shift-tab in a bullet list in Mail Compose jumps back to Subject field
        https://bugs.webkit.org/show_bug.cgi?id=213320
        <rdar://problem/63831962>

        Reviewed by Tim Horton.

        See WebCore/ChangeLog for more detail.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::handleKeyEventByRelinquishingFocusToChrome):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::handleEditingKeyboardEvent):

        Hoist logic for relinquishing focus as a result of shift+tab from EventHandler to WebPage, so that it is the
        default behavior when processing a "keypress" event that corresponds to shift+tab in an editable web view on
        Cocoa platforms. If we do end up relinquishing focus, then we consider the keypress event to be handled.

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

2020-06-17  Beth Dakin  <bdakin@apple.com>

        Remove references to blacklist/whitelist in the old C API
        https://bugs.webkit.org/show_bug.cgi?id=213322

        Reviewed by Tim Horton.

        * UIProcess/API/C/WKPageGroup.cpp:
        (WKPageGroupAddUserStyleSheet):
        (WKPageGroupAddUserScript):
        * UIProcess/API/C/WKPageGroup.h:
        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

2020-06-17  Alex Christensen  <achristensen@webkit.org>

        Null check plugin.m_data before using it in PDFPlugin::ByteRangeRequest::completeUnconditionally
        https://bugs.webkit.org/show_bug.cgi?id=213305
        <rdar://problem/60349279>

        Reviewed by Brady Eidson.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::ByteRangeRequest::completeUnconditionally):

2020-06-17  Darryl Pogue  <darryl@dpogue.ca>

        IndexedDB: Support IDBFactory databases method
        https://bugs.webkit.org/show_bug.cgi?id=211043

        Reviewed by Youenn Fablet.

        Plumbing for returning a list of IDB databases and versions.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNamesAndVersions):
        (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames): Deleted.
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions):
        (WebKit::WebIDBServer::getAllDatabaseNames): Deleted.
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/IndexedDB/WebIDBServer.messages.in:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::getAllDatabaseNamesAndVersions):
        (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNamesAndVersions):
        (WebKit::WebIDBConnectionToServer::getAllDatabaseNames): Deleted.
        (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames): Deleted.
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

2020-06-16  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r255037): Broken position while comparing watch bands on www.apple.com/shop/studio/apple-watch
        https://bugs.webkit.org/show_bug.cgi?id=213282
        <rdar://problem/63862940>

        Reviewed by Antti Koivisto.

        If a scrolling tree commit has a requested scroll position update for a node, we need
        to call applyLayerPositons() to set the UIScrollView's contentOffset.

        Often the layer tree commit will contain a boundsOrigin change for the layer in question
        (which is equivalent to setting the UIScrollView's contentOffset), but some combinations of
        user and programmatic scrolling result in no boundsOrigin change, revealing the bug.

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

2020-06-16  Kate Cheney  <katherine_cheney@apple.com>

        Check for inAppBrowserPrivacyEnabled flag in WebsiteDataStore::initializeAppBoundDomains is expensive and calls a non-static function WebsiteDataStore::parameters().
        https://bugs.webkit.org/show_bug.cgi?id=213261
        <rdar://problem/64317084>

        Reviewed by Brent Fulgham.

        There are two bugs here. First, WebsiteDataStore::parameters()
        does a lot of work aside from returning the parameters, making this an
        expensive call just to check the value of one flag. Second,
        appBoundDomains() is a static hashset, and initializing the hashset
        should not rely on non-static functions.

        * NetworkProcess/NetworkSessionCreationParameters.cpp:
        (WebKit::NetworkSessionCreationParameters::encode const):
        (WebKit::NetworkSessionCreationParameters::decode):
        * NetworkProcess/NetworkSessionCreationParameters.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
        Remove flag, it is no longer used here.

        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
        Save the flag value in a member variable so we can use that later
        when checking app-bound domains. Rename to something more descriptive.

        (WebKit::WebsiteDataStore::initializeAppBoundDomains):
        Remove the check for the non-static runtime flag.

        (WebKit::WebsiteDataStore::ensureAppBoundDomains const):
        Enable test mode quirks. We must do it in two places in case the
        initialization hasn't happened by the time we call
        ensureAppBoundDomains.

        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-06-16  Mark Lam  <mark.lam@apple.com>

        Make Options::useJIT() be the canonical source of truth on whether we should use the JIT.
        https://bugs.webkit.org/show_bug.cgi?id=212556
        <rdar://problem/63780436>

        Reviewed by Saam Barati.

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

2020-06-16  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r262994): Web Inspector is killed when context-clicking anywhere
        <https://webkit.org/b/213224>
        <rdar://problem/64383320>

        Reviewed by Darin Adler.

        * Platform/IPC/Decoder.h:
        * Platform/IPC/Encoder.h:
        - Include <WebCore/ContextMenuItem.h> since the definition of
          the custom WTF::isValidEnum<WebCore::ContextMenuAction>
          function is needed.
        * Scripts/webkit/messages.py:
        (generate_message_names_header):
        - Change the third typename in the template for
          WTF::isValidEnum<IPC::MessageName>() to avoid partial template
          specialization errors from other implementations like
          WTF::isValidEnum<WebCore::ContextMenuAction>().
        - Also replace hard-coded "IPC::MessageName" names with template
          values.

2020-06-16  Chris Dumez  <cdumez@apple.com>

        Stop calling userPreferredLanguages() in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=213214
        <rdar://problem/64317593>

        Reviewed by Darin Adler.

        Follow-up to r263094 to address post-landing feedback from Darin.
        Use makeVector() functionality in WTF to convert the NSArray into a Vector instead
        of doing it by hand. Also mark the NeverDestroyed variable as static const to
        avoid leaking.

        * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
        (WebKit::WebProcessProxy::platformOverrideLanguages const):

2020-06-16  Alex Christensen  <achristensen@webkit.org>

        Provide alternatively-named WKBrowsingContextGroup SPI
        https://bugs.webkit.org/show_bug.cgi?id=213229

        Reviewed by Tim Horton.

        This is unfortunately still used. In order to try to convince the user to make the smallest change possible, make newly named SPI that behaves identically.
        Doubly-deprecate the old SPI and implement it in terms of the new during the transition period.

        * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
        * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
        (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]):
        (-[WKBrowsingContextGroup addUserStyleSheet:baseURL:includeMatchPatternStrings:excludeMatchPatternStrings:mainFrameOnly:]):
        (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]):
        (-[WKBrowsingContextGroup addUserScript:baseURL:includeMatchPatternStrings:excludeMatchPatternStrings:injectionTime:mainFrameOnly:]):

2020-06-16  Youenn Fablet  <youenn@apple.com>

        Loads triggered by an opaque stylesheet should not be visible to service workers
        https://bugs.webkit.org/show_bug.cgi?id=213246

        Reviewed by Alex Christensen.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
        In case the load is triggered from an opaque response, set service worker mode to none.

2020-06-16  Charlie Turner  <cturner@igalia.com>

        [GTK] Disable video autoplay
        https://bugs.webkit.org/show_bug.cgi?id=184845

        Reviewed by Carlos Garcia Campos.

        * PlatformGTK.cmake: Add new source files to the build.
        * PlatformWPE.cmake: Ditto.
        * SourcesGTK.txt: Ditto.
        * SourcesWPE.txt: Ditto.
        * UIProcess/API/glib/WebKitPolicyDecision.cpp:
        (webkit_policy_decision_use_with_policies): : Add an API to
        respond to navigation decisions with policies.
        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextCreatePageForWebView): Plumb in the default
        website policies that are associated with the web view.
        * UIProcess/API/glib/WebKitWebContextPrivate.h:
        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewConstructed):
        (webkitWebViewSetProperty):
        (webkitWebViewGetProperty):
        (webkit_web_view_class_init):
        (webkit_web_view_get_website_policies):
        * UIProcess/API/glib/WebKitWebsitePolicies.cpp: Added.
        (_WebKitWebsitePoliciesPrivate::_WebKitWebsitePoliciesPrivate):
        (webkitWebsitePoliciesGetWebsitePolicies):
        (webkitWebsitePoliciesGetPoliciesData):
        (webkitWebsitePoliciesGetProperty):
        (webkitWebsitePoliciesSetAutoplayPolicy):
        (webkitWebsitePoliciesSetProperty):
        (webkit_website_policies_class_init):
        (webkit_website_policies_new):
        (webkit_website_policies_new_with_policies):
        (webkit_website_policies_get_autoplay_policy):
        * UIProcess/API/glib/WebKitWebsitePoliciesPrivate.h: Added.
        * UIProcess/API/gtk/WebKitPolicyDecision.h:
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (webkit_web_view_new_with_related_view):
        * UIProcess/API/gtk/WebKitWebsitePolicies.h: Added.
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitPolicyDecision.h:
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/WebKitWebsitePolicies.h: Added.
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

2020-06-16  Chris Dumez  <cdumez@apple.com>

        Stop calling userPreferredLanguages() in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=213214
        <rdar://problem/64317593>

        Reviewed by Per Arne Vollan.

        Stop calling userPreferredLanguages() in the UIProcess since this can be slow and may keep
        the main thread busy. Nowadays, the WebProcess is able to call it by itself anyway. The
        sandbox is allowing it.

        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::languageChanged):
        (WebKit::WebProcessPool::initializeNewWebProcess):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::initializeWebProcess):
        (WebKit::WebProcess::userPreferredLanguagesChanged const):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-06-16  Truitt Savell  <tsavell@apple.com>

        Unreviewed, reverting r263079.

        Broke Internal builds.

        Reverted changeset:

        "IndexedDB: Support IDBFactory databases method"
        https://bugs.webkit.org/show_bug.cgi?id=211043
        https://trac.webkit.org/changeset/263079

2020-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to configure and enable resource load statistics
        https://bugs.webkit.org/show_bug.cgi?id=177943

        Reviewed by Michael Catanzaro.

        * UIProcess/API/glib/WebKitWebsiteData.cpp:
        (recordContainsSupportedDataTypes):
        (toWebKitWebsiteDataTypes):
        * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
        (webkitWebsiteDataManagerGetProperty):
        (webkitWebsiteDataManagerSetProperty):
        (webkitWebsiteDataManagerConstructed):
        (webkit_website_data_manager_class_init):
        (webkitWebsiteDataManagerGetDataStore):
        (webkit_website_data_manager_get_itp_directory):
        (webkit_website_data_manager_set_itp_enabled):
        (webkit_website_data_manager_get_itp_enabled):
        (toWebsiteDataTypes):
        * UIProcess/API/gtk/WebKitWebsiteData.h:
        * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitWebsiteData.h:
        * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/glib/WebsiteDataStoreGLib.cpp:
        (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):

2020-06-16  Darryl Pogue  <darryl@dpogue.ca>

        IndexedDB: Support IDBFactory databases method
        https://bugs.webkit.org/show_bug.cgi?id=211043

        Reviewed by Youenn Fablet.

        Plumbing for returning a list of IDB databases and versions.

        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
        (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNamesAndVersions):
        (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames): Deleted.
        * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
        * NetworkProcess/IndexedDB/WebIDBServer.cpp:
        (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions):
        (WebKit::WebIDBServer::getAllDatabaseNames): Deleted.
        * NetworkProcess/IndexedDB/WebIDBServer.h:
        * NetworkProcess/IndexedDB/WebIDBServer.messages.in:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
        (WebKit::WebIDBConnectionToServer::getAllDatabaseNamesAndVersions):
        (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNamesAndVersions):
        (WebKit::WebIDBConnectionToServer::getAllDatabaseNames): Deleted.
        (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames): Deleted.
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

2020-06-15  Pavel Feldman  <pavel.feldman@gmail.com>

        Web Inspector: introduce request interception
        https://bugs.webkit.org/show_bug.cgi?id=207446

        Reviewed by Devin Rousso.

        This change introduces network request interception to the Network 
        protocol domain. It adds Network.interceptWithRequest notification that
        can be continued, modified or fulfilled. NetworkStage enum can now have
        'request' and 'response' values.

        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::WebLoaderStrategy::scheduleLoad):

2020-06-15  Brent Fulgham  <bfulgham@apple.com>

        [macOS] Update sandboxes to reduce logging for media-related operations
        https://bugs.webkit.org/show_bug.cgi?id=213210
        <rdar://problem/64376237>

        Reviewed by Per Arne Vollan.

        Ongoing testing has uncovered a set of additional services and IOKit
        properties that we should allow without logging.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::mediaRelatedMachServices):
        * WebProcess/com.apple.WebProcess.sb.in:

2020-06-15  Alex Christensen  <achristensen@webkit.org>

        Provide alternatively-named SPI for user style sheets and scripts
        https://bugs.webkit.org/show_bug.cgi?id=213206

        Reviewed by Brady Eidson.

        Test-only SPI was just renamed.
        SPI used by other projects was deprecated with a replacement so we can remove the old names soon.

        _WKUserContentWorld/WKContentWorld was tied up in this, and rather than provide replacement SPI with deprecated _WKUserContentWorld,
        this will move some SPI from _WKUserContentWorld to WKContentWorld too.  The most heavy user of _WKUserContentWorld is TestWebKitAPI and we'll remove it soon.

        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetFontAllowList):
        (WKContextSetFontWhitelist): Deleted.
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/API/Cocoa/WKUserContentController.mm:
        (-[WKUserContentController _removeAllUserScriptsAssociatedWithContentWorld:]):
        (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithContentWorld:]):
        (-[WKUserContentController _addScriptMessageHandler:name:contentWorld:]):
        (-[WKUserContentController _removeAllUserScriptsAssociatedWithUserContentWorld:]): Deleted.
        (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]): Deleted.
        * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:associatedURL:contentWorld:deferRunningUntilNotification:]):
        * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
        * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
        (-[_WKUserStyleSheet initWithSource:forWKWebView:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:baseURL:level:contentWorld:]):
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setFontAllowList):
        (WebKit::WebProcessPool::setFontWhitelist): Deleted.
        * UIProcess/WebProcessPool.h:

2020-06-15  Alex Christensen  <achristensen@webkit.org>

        Add SPI to preconnect to a server
        https://bugs.webkit.org/show_bug.cgi?id=213109
        <rdar://problem/64184412>

        Reviewed by Geoff Garen.

        Covered by API tests.

        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _preconnectToServer:]):
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::preconnectTo):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::preconnectTo):
        * UIProcess/WebPageProxy.h:

2020-06-15  Keith Miller  <keith_miller@apple.com>

        Signal handlers should have a two phase installation.
        https://bugs.webkit.org/show_bug.cgi?id=213160

        Reviewed by Mark Lam.

        Put back old WASM fast memory installation.

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

2020-06-15  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>

        Suppress compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=213034

        Reviewed by Darin Adler.

        Convert to std:size_t to compare equal data types.

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

2020-06-15  Chris Dumez  <cdumez@apple.com>

        Revert r260856 as it seems to have regressed PLT on iOS
        https://bugs.webkit.org/show_bug.cgi?id=213194
        <rdar://problem/64331458>

        Unreviewed, revert r260856 due to regression.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::NetworkProcess):
        (WebKit::NetworkProcess::prepareToSuspend):
        (WebKit::NetworkProcess::resume):
        * NetworkProcess/NetworkProcess.h:
        * Shared/WebSQLiteDatabaseTracker.cpp: Added.
        (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
        (WebKit::WebSQLiteDatabaseTracker::~WebSQLiteDatabaseTracker):
        (WebKit::WebSQLiteDatabaseTracker::setIsSuspended):
        (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
        (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
        (WebKit::WebSQLiteDatabaseTracker::setIsHoldingLockedFiles):
        * Shared/WebSQLiteDatabaseTracker.h: Added.
        * SourcesCocoa.txt:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::didClose):
        (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/Network/NetworkProcessProxy.messages.in:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::shutDown):
        (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
        * UIProcess/WebProcessProxy.h:
        * UIProcess/WebProcessProxy.messages.in:
        * WebKit.xcodeproj/project.pbxproj:
        * WebProcess/WebProcess.cpp:
        (WebKit::m_webSQLiteDatabaseTracker):
        (WebKit::WebProcess::prepareToSuspend):
        (WebKit::WebProcess::processDidResume):
        * WebProcess/WebProcess.h:

2020-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API to expose UIClient::requestStorageAccessConfirm
        https://bugs.webkit.org/show_bug.cgi?id=210422

        Reviewed by Michael Catanzaro.

        Add WebKitWebsiteDataAccessPermissionRequest to ask for permission to the user using the existing permission
        request API.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt:
        * SourcesWPE.txt:
        * UIProcess/API/glib/WebKitUIClient.cpp:
        * UIProcess/API/glib/WebKitWebsiteDataAccessPermissionRequest.cpp: Added.
        (webkitWebsiteDataAccessPermissionRequestAllow):
        (webkitWebsiteDataAccessPermissionRequestDeny):
        (webkit_permission_request_interface_init):
        (webkitWebsiteDataAccessPermissionRequestDispose):
        (webkit_website_data_access_permission_request_class_init):
        (webkitWebsiteDataAccessPermissionRequestCreate):
        (webkit_website_data_access_permission_request_get_requesting_domain):
        (webkit_website_data_access_permission_request_get_current_domain):
        * UIProcess/API/glib/WebKitWebsiteDataAccessPermissionRequestPrivate.h: Added.
        * UIProcess/API/gtk/WebKitWebsiteDataAccessPermissionRequest.h: Added.
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
        * UIProcess/API/gtk/webkit2.h:
        * UIProcess/API/wpe/WebKitWebsiteDataAccessPermissionRequest.h: Added.
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/API/wpe/docs/wpe-docs.sgml:
        * UIProcess/API/wpe/webkit.h:

2020-06-14  Sam Weinig  <weinig@apple.com>

        [WPT] html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html fails due to lack of caching of Plugin objects
        https://bugs.webkit.org/show_bug.cgi?id=213185

        Reviewed by Darin Adler.

        * UIProcess/Plugins/PluginInfoStore.h:
        Add missing #include that is now needed due to pruning of unnecessary #includes
        in WebCore.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::pluginSupportsExtension):
        Update to use new webVisibleMimeTypes() rather than the clunky getWebVisibleMimesAndPluginIndices().

2020-06-14  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] Return type of -[NSCoder validateClassSupportsSecureCoding:] is incorrect
        <https://webkit.org/b/213161>
        <rdar://problem/64050085>

        Reviewed by Darin Adler.

        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
        (validateClass):
        - Fix return type of
          -[NSCoder validateClassSupportsSecureCoding:].  Throw an
          NSException in case the method ever returns NO without
          throwing its own NSException.  (Currently this method does
          throw an NSException instead of returning NO.)

2020-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] Disable HSTS for requests when cookies will be blocked by ITP
        https://bugs.webkit.org/show_bug.cgi?id=210739

        Reviewed by Michael Catanzaro.

        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
        (WebKit::NetworkDataTaskSoup::shouldAllowHSTSProtocolUpgrade const):

2020-06-13  Richard Houle  <rhoule@apple.com>

        Fix Overrelease in makeFailureSetForAllTextManipulationItems
        https://bugs.webkit.org/show_bug.cgi?id=213165
        <rdar://problem/61389164>

        Reviewed by Wenson Hsieh.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (makeFailureSetForAllTextManipulationItems):

2020-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Mac Catalyst] Color inputs and selects fail to display popovers when clicked
        https://bugs.webkit.org/show_bug.cgi?id=213157
        <rdar://problem/64004135>

        Reviewed by Tim Horton.

        In Mac Catalyst, presenting popovers using `UIPopoverController` causes the first responder to change. This
        means that the WKContentView will resign first responder, which in turn causes the currently presented popover
        to be dismissed. This means that popovers for color inputs and select elements will be dismissed immediately
        after presentation.

        To mitigate this, adapt the approach taken in r259840 to `WKColorPopover` and `WKSelectPopover` by teaching the
        base class (`WKRotatingPopover`) to temporarily preserve the focused element in light of first responder changes
        while presenting a popover on Mac Catalyst.

        * UIProcess/ios/forms/WKFormPopover.mm:
        (-[WKRotatingPopover presentPopoverAnimated:]):
        (-[WKRotatingPopover dismissPopoverAnimated:]):

2020-06-13  Sam Weinig  <weinig@apple.com>

        Extended Color: Experiment with strongly typed ColorComponents
        https://bugs.webkit.org/show_bug.cgi?id=212396

        Reviewed by Darin Adler.

        * UIProcess/API/wpe/WebKitColor.cpp:
        (webkitColorFillFromWebCoreColor):
        * UIProcess/gtk/ViewGestureControllerGtk.cpp:
        (WebKit::ViewGestureController::beginSwipeGesture):
        * WebProcess/WebPage/WebFrame.cpp:
        (WebKit::WebFrame::getDocumentBackgroundColor):
        Update to call toSRGBALossy() rather than toSRGBAComponentsLossy().

2020-06-13  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>

        Remove FileError.h
        https://bugs.webkit.org/show_bug.cgi?id=213119

        Reviewed by Chris Dumez.

        * WebProcess/Network/WebSocketChannel.cpp:
        (WebKit::WebSocketChannel::createMessageQueue):

2020-06-12  Brian Burg  <bburg@apple.com>

        Automation.computeElementLayout should return iframe-relative element rects (when coordinate system is 'Page')
        https://bugs.webkit.org/show_bug.cgi?id=213139
        <rdar://problem/55042445>

        Reviewed by Devin Rousso.

        Automation.computeElementLayout has two coordinate systems it can use, LayoutViewport (used for hit testing)
        and Page (used for Get Element Rect). Since Get Element Rect expects coordinates relative to the current
        browsing context, make the mode simpler by reporting the bounds from Element::boundingClientRect() which
        are frame-relative.

        Covered by existing WPT suite. The semantics of this command are under review, as
        the remote end steps seem to describe a different result than what the non-normative text does.

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

2020-06-12  David Kilzer  <ddkilzer@apple.com>

        [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum()
        <https://webkit.org/b/211988>
        <rdar://problem/63137695>

        Reviewed by Darin Adler.

        Replace decodeEnum() with decode() and encodeEnum() with
        operator<<().

        * GPUProcess/media/TextTrackPrivateRemoteConfiguration.h:
        (WebKit::TextTrackPrivateRemoteConfiguration::encode const):
        * GPUProcess/media/TrackPrivateRemoteConfiguration.h:
        (WebKit::TrackPrivateRemoteConfiguration::encode const):
        * NetworkProcess/NetworkProcessCreationParameters.cpp:
        (WebKit::NetworkProcessCreationParameters::encode const):
        (WebKit::NetworkProcessCreationParameters::decode):
        * NetworkProcess/NetworkResourceLoadParameters.cpp:
        (WebKit::NetworkResourceLoadParameters::encode const):
        (WebKit::NetworkResourceLoadParameters::decode):
        * Platform/IPC/Decoder.h:
        (IPC::Decoder::decode):
        (IPC::Decoder::operator>>):
        - Make use of std::underlying_type_t<>.
        (IPC::Decoder::decodeEnum): Delete.
        - Replace with calls to decode().
        * Platform/IPC/Encoder.h:
        (IPC::Encoder::operator<<):
        (IPC::Encoder::encode):
        - Make use of WTF::enumToUnderlyingType<>.
        (IPC::Encoder::encodeEnum): Delete.
        - Replace with calls to operator<<().
        * Shared/Cocoa/ArgumentCodersCocoa.mm:
        (IPC::decodeObject):
        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
        (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
        * Shared/ContextMenuContextData.cpp:
        (WebKit::ContextMenuContextData::encode const):
        (WebKit::ContextMenuContextData::decode):
        * Shared/FocusedElementInformation.cpp:
        (WebKit::FocusedElementInformation::encode const):
        (WebKit::FocusedElementInformation::decode):
        * Shared/LoadParameters.cpp:
        (WebKit::LoadParameters::encode const):
        (WebKit::LoadParameters::decode):
        * Shared/NavigationActionData.cpp:
        (WebKit::NavigationActionData::encode const):
        (WebKit::NavigationActionData::decode):
        * Shared/PlatformPopupMenuData.cpp:
        (WebKit::PlatformPopupMenuData::encode const):
        (WebKit::PlatformPopupMenuData::decode):
        * Shared/Plugins/PluginProcessCreationParameters.cpp:
        (WebKit::PluginProcessCreationParameters::encode const):
        (WebKit::PluginProcessCreationParameters::decode):
        * Shared/PrintInfo.cpp:
        (WebKit::PrintInfo::encode const):
        (WebKit::PrintInfo::decode):
        * Shared/RTCPacketOptions.cpp:
        (WebKit::RTCPacketOptions::encode const):
        (WebKit::RTCPacketOptions::decode):
        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
        (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode const):
        (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
        (ArgumentCoder<ScrollingStateNode>::encode):
        (ArgumentCoder<RequestedScrollData>::encode):
        (ArgumentCoder<RequestedScrollData>::decode):
        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
        * Shared/SessionState.cpp:
        (WebKit::HTTPBody::Element::encode const):
        (WebKit::HTTPBody::Element::decode):
        (WebKit::PageState::encode const):
        (WebKit::PageState::decode):
        * Shared/TouchBarMenuItemData.cpp:
        (WebKit::TouchBarMenuItemData::encode const):
        (WebKit::TouchBarMenuItemData::decode):
        * Shared/UserData.cpp:
        (WebKit::UserData::encode):
        (WebKit::UserData::decode):
        * Shared/WebContextMenuItemData.cpp:
        (WebKit::WebContextMenuItemData::encode const):
        (WebKit::WebContextMenuItemData::decode):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<LinearTimingFunction>::encode):
        (IPC::ArgumentCoder<CubicBezierTimingFunction>::encode):
        (IPC::ArgumentCoder<CubicBezierTimingFunction>::decode):
        (IPC::ArgumentCoder<StepsTimingFunction>::encode):
        (IPC::ArgumentCoder<SpringTimingFunction>::encode):
        (IPC::ArgumentCoder<PluginInfo>::encode):
        (IPC::ArgumentCoder<PluginInfo>::decode):
        (IPC::ArgumentCoder<ProtectionSpace>::encode):
        (IPC::ArgumentCoder<ProtectionSpace>::decode):
        (IPC::ArgumentCoder<Credential>::encode):
        (IPC::ArgumentCoder<Credential>::decode):
        (IPC::ArgumentCoder<Cursor>::encode):
        (IPC::ArgumentCoder<Cursor>::decode):
        (IPC::ArgumentCoder<ResourceError>::encode):
        (IPC::ArgumentCoder<ResourceError>::decode):
        (IPC::ArgumentCoder<DragData>::encode):
        (IPC::ArgumentCoder<DragData>::decode):
        (IPC::ArgumentCoder<CompositionUnderline>::encode):
        (IPC::ArgumentCoder<CompositionUnderline>::decode):
        (IPC::ArgumentCoder<FileChooserSettings>::encode):
        (IPC::ArgumentCoder<FileChooserSettings>::decode):
        (IPC::ArgumentCoder<TextCheckingRequestData>::encode):
        (IPC::ArgumentCoder<TextCheckingRequestData>::decode):
        (IPC::ArgumentCoder<TextCheckingResult>::encode):
        (IPC::ArgumentCoder<TextCheckingResult>::decode):
        (IPC::ArgumentCoder<UserStyleSheet>::encode):
        (IPC::ArgumentCoder<UserStyleSheet>::decode):
        (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
        (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
        (IPC::ArgumentCoder<FilterOperation>::encode):
        (IPC::decodeFilterOperation):
        (IPC::ArgumentCoder<FontAttributes>::encode):
        (IPC::ArgumentCoder<FontAttributes>::decode):
        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode):
        (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode):
        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPopupItem.cpp:
        (WebKit::WebPopupItem::encode const):
        (WebKit::WebPopupItem::decode):
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebsiteData/WebsiteData.cpp:
        (WebKit::WebsiteData::Entry::encode const):
        (WebKit::WebsiteData::Entry::decode):
        * Shared/curl/WebCoreArgumentCodersCurl.cpp:
        (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
        (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
        (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
        * Shared/glib/InputMethodState.cpp:
        (WebKit::InputMethodState::encode const):
        (WebKit::InputMethodState::decode):
        * Shared/glib/UserMessage.cpp:
        (WebKit::UserMessage::encode const):
        (WebKit::UserMessage::decode):
        * Shared/mac/ColorSpaceData.mm:
        (WebKit::ColorSpaceData::encode const):
        (WebKit::ColorSpaceData::decode):
        * Shared/mac/SecItemRequestData.cpp:
        (WebKit::SecItemRequestData::encode const):
        (WebKit::SecItemRequestData::decode):
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
        (IPC::ArgumentCoder<WebCore::CertificateInfo>::encode):
        (IPC::ArgumentCoder<WebCore::CertificateInfo>::decode):
        * Shared/soup/WebCoreArgumentCodersSoup.cpp:
        (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode):
        (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode):
        * WebProcess/GPU/media/RemoteMediaPlayerState.h:
        (WebKit::RemoteMediaPlayerState::encode const):
        (WebKit::RemoteMediaPlayerState::decode):
        * WebProcess/Network/NetworkProcessConnectionInfo.h:
        (WebKit::NetworkProcessConnectionInfo::decode):
        * WebProcess/Plugins/Plugin.cpp:
        (WebKit::Plugin::Parameters::encode const):
        (WebKit::Plugin::Parameters::decode):
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
        (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode const):
        (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
        (WebKit::PlatformCAAnimationRemote::Properties::encode const):
        (WebKit::PlatformCAAnimationRemote::Properties::decode):

2020-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPadOS] Focusing selects and color inputs should not bring up the software keyboard
        https://bugs.webkit.org/show_bug.cgi?id=213149
        <rdar://problem/64312450>

        Reviewed by Darin Adler.

        After <trac.webkit.org/r261658>, we now opt into bringing up the software keyboard when focusing color inputs
        and select elements. This is due to the changes in `-_shouldShowAutomaticKeyboardUIIgnoringInputMode`, which
        were intended to make us return `NO` for date and time inputs, but also unintentionally makes us return `YES`
        on iPadOS.

        This patch fixes the bug by returning `!WebKit::currentUserInterfaceIdiomIsPad()` instead, and additionally
        preserves the existing behavior of now showing a color picker for `<input type="color" readonly>` on iPhone.

        Test: fast/forms/ios/ipad/select-should-not-bring-up-software-keyboard.html

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

2020-06-12  Alex Christensen  <achristensen@webkit.org>

        Make API tests tolerant of our relatively new use of WebPageProxy::preconnectTo
        https://bugs.webkit.org/show_bug.cgi?id=213144

        Reviewed by Geofferey Garen.

        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
        (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
        (WebKit::NetworkSessionCocoa::taskServerConnectionSucceeded):
        (WebKit::NetworkSessionCocoa::taskReceivedBytes): Deleted.
        Fix our logic that remembers successful client certificate connections.
        If a task completes with no error (like a preconnect task does), consider that a successful connection.

        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::preconnectTo):
        Remove the check to not preconnect to loopback addresses.
        This was making our tests different than the real internet and prevented me from landing a perfectly good test
        in https://bugs.webkit.org/show_bug.cgi?id=213109

2020-06-12  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Preferences are not being observed if the process pool is being created after activation
        https://bugs.webkit.org/show_bug.cgi?id=213145

        Reviewed by Brent Fulgham.

        If the app is creating the Web process pool after being activated, preferences will not be observed until the app is being backgrounded
        and then foregrounded again, since the preference observer is initialized when handling the app activation notification.

        No new tests, since an API test would make sense in this case, but API tests aren't run on iOS.

        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):

2020-06-12  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] Implement functions to use ResourceLoadStatistics.
        https://bugs.webkit.org/show_bug.cgi?id=207692

        Reviewed by Don Olmstead.

        Implement functions which are required to implement ResourceLoadStatistics for Curl port.

        In NetworkDataTaskCurl.cpp we check if we should block cookies and block if needed.

        Tests: http/tests/resourceLoadStatistics/

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create):
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCurl::blockCookies):
        (WebKit::NetworkDataTaskCurl::unblockCookies):
        (WebKit::NetworkDataTaskCurl::shouldBlockCookies):
        (WebKit::NetworkDataTaskCurl::isThirdPartyRequest):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:
        * NetworkProcess/curl/NetworkSessionCurl.cpp:
        (WebKit::NetworkSessionCurl::NetworkSessionCurl):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreGetAllStorageAccessEntries):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):

2020-06-12  Antoine Quint  <graouts@webkit.org>

        Double tap to zoom out doesn't work after upgrading to iOS 13
        https://bugs.webkit.org/show_bug.cgi?id=205158
        <rdar://problem/205158>

        Reviewed by Wenson Hsieh.

        Test: fast/events/ios/fast-click-double-tap-to-zoom-in-on-text-and-then-again-to-zoom-out.html

        In order to determine whether a significant zoom to happen, we should use the current page scale
        factor and not the initial page scale factor.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]):

2020-06-12  Alex Christensen  <achristensen@webkit.org>

        Add WKUserScript initializer SPI with alternative names
        https://bugs.webkit.org/show_bug.cgi?id=213096

        Reviewed by Youenn Fablet.

        And deprecate the existing ones so we can remove them soon.

        * UIProcess/API/Cocoa/WKUserScript.mm:
        (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:includeMatchPatternStrings:excludeMatchPatternStrings:associatedURL:contentWorld:deferRunningUntilNotification:]):
        * UIProcess/API/Cocoa/WKUserScriptPrivate.h:

2020-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK4 build

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSynthesizeKeyEvent):

2020-06-11  Sam Weinig  <weinig@apple.com>

        Document.currentScript does not work for SVGScriptElements
        https://bugs.webkit.org/show_bug.cgi?id=213104

        Reviewed by Yusuke Suzuki.

        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
        (webkit_dom_document_get_current_script):
        Update to account for change in Document::currentScript() now returning an
        Element* that can be either an HTMLScriptElement or an SVGScriptElement. To
        keep API compatibility, only return non-null for HTMLScriptElements.

2020-06-12  Charlie Turner  <cturner@igalia.com>

        [GTK] Add an internal API to run javascript without forced user gestures
        https://bugs.webkit.org/show_bug.cgi?id=212969

        Reviewed by Carlos Garcia Campos.

        To be used by tests in a follow-up commit.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewRunJavaScriptWithParams): Factor out the glue to run
        JavaScript in the page.
        (webkitWebViewRunJavascriptWithoutForcedUserGestures): Add a new
        internal API for use by tests.
        (webkit_web_view_run_javascript): Modified to use factored out
        glue.
        * UIProcess/API/glib/WebKitWebViewInternal.h: Added. Place to keep
        API test-specific internal APIs.

2020-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Make WebDriver work
        https://bugs.webkit.org/show_bug.cgi?id=212316

        Reviewed by Adrian Perez de Castro.

        Fix UIClient::setWindowFrame to wait for surface size-changed signal after resizing the window and implement
        maximize, minimize and restore windows for GTK4.

        * UIProcess/API/glib/WebKitUIClient.cpp:
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (surfaceStateChangedCallback):
        (webkitWebViewMonitorWindowState):
        (webkitWebViewMaximizeWindow):
        (webkitWebViewMinimizeWindow):
        (webkitWebViewRestoreWindow):

2020-06-11  David Kilzer  <ddkilzer@apple.com>

        [IPC] Add WTF::EnumTraits<> for every enum type used in IPC
        <https://webkit.org/b/213093>

        Reviewed by Darin Adler.

        Summary:
        - Change underlying type of enum class to `bool` when there are
          only two values.  In some cases, reorder the two values so the
          mapping to 0 and 1 makes more sense.  Converting every enum to
          an enum class is not a goal of this patch, so some two-value
          enums stil have WTF::EnumTraits<> defined as noted below.
        - Add WTF::EnumTraits<> for the remaining enum types that are
          used by IPC::Encoder::encodeEnum() and
          IPC::Decoder::decodeEnum() so that WTF::isValidEnum<>() checks
          may be added next.
        - Add #include <WebCore/LibWebRTCEnumTraits.h> as needed.

        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/GPUProcess.h:
        * NetworkProcess/NetworkLoadParameters.h:
        * Shared/API/APIObject.h:
        * Shared/ContextMenuContextData.h:
        * Shared/DrawingAreaInfo.h:
        * Shared/FocusedElementInformation.h:
        * Shared/PrintInfo.h:
        (WTF::EnumTraits<WebKit::PrintInfo::PrintMode>):
        - Define this since PrintMode is not an enum class.
        * Shared/RTCPacketOptions.cpp:
        * Shared/SessionState.h:
        * Shared/TouchBarMenuItemData.h:
        * Shared/WebEvent.h:
        * Shared/WebPopupItem.cpp:
        (WebKit::WebPopupItem::WebPopupItem):
        - Fix reference to WebPopupItem::Type enum.
        * Shared/WebPopupItem.h:
        (WebKit::WebPopupItem::Type):
        - Convert from enum to enum class.
        * Shared/WebsiteData/WebsiteDataType.h:
        * Shared/glib/InputMethodState.h:
        * Shared/glib/UserMessage.h:
        * Shared/mac/ColorSpaceData.mm:
        * Shared/mac/SecItemRequestData.h:
        * UIProcess/mac/WebPopupMenuProxyMac.mm:
        (WebKit::WebPopupMenuProxyMac::populate):
        - Fix reference to WebPopupItem::Type enum.
        * WebProcess/Plugins/Plugin.cpp:
        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
        (WebKit::WebPopupMenu::populateItems):
        - Fix reference to WebPopupItem::Type enum.
        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:

2020-06-11  Alex Christensen  <achristensen@webkit.org>

        Re-enable download resume tests
        https://bugs.webkit.org/show_bug.cgi?id=213098
        <rdar://problem/63512518>

        Reviewed by Geoffrey Garen.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):

2020-06-11  Beth Dakin  <bdakin@apple.com>

        Replace instances of whitelist in WebCore with allowlist
        https://bugs.webkit.org/show_bug.cgi?id=213068

        Reviewed by Tim Horton.

        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
        (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry):
        (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry):
        (WebKit::NetworkConnectionToWebProcess::resetOriginAccessWhitelists):
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<UserStyleSheet>::encode):
        (IPC::ArgumentCoder<UserStyleSheet>::decode):
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::addOriginAccessWhitelistEntry):
        (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry):
        (WebKit::InjectedBundle::resetOriginAccessWhitelists):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-06-11  Jonathan Bedard  <jbedard@apple.com>

        WebKit: Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT)
        https://bugs.webkit.org/show_bug.cgi?id=213076
        <rdar://problem/64254698>

        Reviewed by Tim Horton.

        No new tests, behavior unchanged.

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/API/ios/WKWebViewTestingIOS.mm:
        (-[WKWebView _requestDocumentContext:completionHandler:]): Guard requestDocumentContext with HAVE(UI_WK_DOCUMENT_CONTEXT).
        (-[WKWebView _adjustSelectionWithDelta:completionHandler:]): Ditto.

2020-06-11  Jonathan Bedard  <jbedard@apple.com>

        WebKit: Add UIKit SPI for watchOS and tvOS
        https://bugs.webkit.org/show_bug.cgi?id=213077
        <rdar://problem/64255131>

        Reviewed by Tim Horton.

        No new tests, behavior unchanged.

        * Platform/spi/ios/UIKitSPI.h:

2020-06-11  David Kilzer  <ddkilzer@apple.com>

        [IPC] Adopt enum class for DragSourceAction
        <https://webkit.org/b/212885>
        <rdar://problem/64094134>

        Reviewed by Darin Adler.

        Summary:
        - Convert argument parameters from uint64_t to
          OptionSet<DragSourceAction>.
        - Convert DragSourceAction to OptionSet<DragSourceAction>.

        * Scripts/webkit/messages.py:
        - Map DragSourceAction enum to DragActions.h header.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/DragDropInteractionState.h:
        * UIProcess/ios/DragDropInteractionState.mm:
        (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
        (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource):
        (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
        (WebKit::canUpdatePreviewForActiveDragSource):
        (WebKit::DragDropInteractionState::anyActiveDragSourceIs const):
        (WebKit::DragDropInteractionState::stageDragItem):
        (WebKit::DragDropInteractionState::hasStagedDragSource const):
        (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _startDrag:item:]):
        (-[WKContentView _allowedDragSourceActions]):
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::requestDragStart):
        (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        (WebKit::WebDragClient::dragSourceActionMaskForPoint):
        * WebProcess/WebCoreSupport/WebDragClient.h:
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::allowedDragSourceActions const):
        * WebProcess/WebPage/WebPage.messages.in:
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestDragStart):
        (WebKit::WebPage::requestAdditionalItemsForDragSession):

2020-06-11  Eric Carlson  <eric.carlson@apple.com>

        [Cocoa] MediaUsageManagerCocoa should use a different USVideoUsage initializer
        https://bugs.webkit.org/show_bug.cgi?id=213058

        Reviewed by Jer Noble.

        No new tests, tested manually.

        * UIProcess/Media/cocoa/MediaUsageManagerCocoa.mm:
        (WebKit::MediaUsageManagerCocoa::reset): Drive-by fix: don't call -stop unless the
        element was playing.
        (WebKit::MediaUsageManagerCocoa::updateMediaUsage): Use a different initializer so
        we can pass in the state.

2020-06-11  ChangSeok Oh  <changseok@webkit.org>

        [GTK] Implement button-press-event, button-release-event, and absolute-axis-event of GAMEPAD API.
        https://bugs.webkit.org/show_bug.cgi?id=133850

        Reviewed by Carlos Garcia Campos.

        * UIProcess/Gamepad/UIGamepadProvider.cpp: Add the OS(LINUX) guard.
        * UIProcess/Gamepad/gtk/UIGamepadProviderGtk.cpp:
        (WebKit::getWebPageProxy): Build fix. WebKitWebViewBase is used, not WebKitWebViewPrivate.
        * UIProcess/Gamepad/manette/UIGamepadProviderManette.cpp: Add the OS(LINUX) guard.

2020-06-10  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [macOS]: The File Picker of the <input> file element should show the selection filter
        https://bugs.webkit.org/show_bug.cgi?id=212485

        Reviewed by Darin Adler.

        Add two private helpers to WKOpenPanelParameters.

        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
        (-[WKOpenPanelParameters _allowedFileExtensions]):
        Returns an array of strings representing the allowed extensions.

        (-[WKOpenPanelParameters _allowedFileExtensionsDescription]):
        Returns a string representing a description for the allowed extensions.

        * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h:

2020-06-10  Beth Dakin  <bdakin@apple.com>

        Replace instances of blacklist in WebCore with blocklist
        https://bugs.webkit.org/show_bug.cgi?id=213064

        Reviewed by Tim Horton.

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

2020-06-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] editing/pasteboard/dom-paste tests consistently time out
        https://bugs.webkit.org/show_bug.cgi?id=213061
        <rdar://problem/64211161>

        Reviewed by Darin Adler.

        On recent versions of iOS, system changes have moved the timing of the call to
        `-requestAutocorrectionContextWithCompletionHandler:` when focusing an editable element. This results in a
        consistently reproducible deadlock between the UI process and web process if a page tries to request
        programmatic clipboard access during the click event (importantly, in the same runloop as element focus).

        What ends up happening is that the autocorrection context is requested by the UI process shortly after the
        (unbounded) sync IPC message for the DOM paste arrives, so we end up waiting forever for the sync-IPC-blocked
        web process to respond. Normally this just results in a 1 second hang, and the DOM paste proceeds as normal.
        However these layout tests purposefully opt out of sync IPC timeouts (precisely so that we can catch bugs like
        this). See below for more details.

        * UIProcess/ios/WKContentViewInteraction.h:

        Keep track of the most recent autocorrection context that arrived in the UI process.

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

        Clear out the autocorrection context, in case the web process crashes.

        (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

        If the autocorrection context is requested while handling a DOM paste, we know that the latest autocorrection
        context must be up to date, since the autocorrection context is computed and sent immediately before a DOM paste
        request. Use this to immediately invoke the completion handler, without any sync IPC back to the web process.

        (-[WKContentView _handleAutocorrectionContext:]):

2020-06-10  Hiro (mzp) Mizuno  <mzp@apple.com>

        [iOS] Option + Forward Delete should delete next word
        https://bugs.webkit.org/show_bug.cgi?id=213062
        rdar://64225458

        Reviewed by Daniel Bates.

        Implement support for pressing Option + Forward Delete to delete the next word. This makes text editing
        in WebKit more closely match the platform conventions.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView canPerformAction:withSender:]): Handle _deleteForwardByWord.
        (-[WKContentView _deleteForwardByWord]): Added.

2020-06-10  Geoffrey Garen  <ggaren@apple.com>

        Some style improvements to main thread code
        https://bugs.webkit.org/show_bug.cgi?id=213051

        Reviewed by Darin Adler.

        Updated for rename.

        * Shared/Cocoa/WebKit2InitializeCocoa.mm:
        (WebKit::runInitializationCode):
        (WebKit::InitializeWebKit2):
        * Shared/WebKit2Initialize.cpp:
        (WebKit::InitializeWebKit2):

2020-06-10  Jonathan Bedard  <jbedard@apple.com>

        WebKit:Add PepperUICoreSPI.h (Follow-up fix 2)
        https://bugs.webkit.org/show_bug.cgi?id=212996
        <rdar://problem/64182627>

        Unreviewed build fix.

        * UIProcess/ios/forms/WKNumberPadViewController.mm:
        (-[WKNumberPadViewController addContentViewAnimations:]): Correct APPLE_INTERNAL_SDK macro.
        * UIProcess/ios/forms/WKQuickboardListViewController.mm:
        (-[WKQuickboardListViewController initWithDelegate:]): Ditto.

2020-06-10  Jonathan Bedard  <jbedard@apple.com>

        WebKit:Add PepperUICoreSPI.h (Follow-up fix)
        https://bugs.webkit.org/show_bug.cgi?id=212996
        <rdar://problem/64182627>

        Unreviewed build fix.

        * Platform/spi/watchos/PepperUICoreSPI.h: Add PUICPickerView headers.

2020-06-10  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r262858): Fix macOS build when building EndowmentStateTracker.mm

        * UIProcess/EndowmentStateTracker.mm:
        - Move #if PLATFORM(IOS_FAMILY) to fix macOS build.

2020-06-10  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Return early from preference change notification handler if there is no observer
        https://bugs.webkit.org/show_bug.cgi?id=213050

        Reviewed by Darin Adler.

        Currently, the observer member is checked inside the loop iterating over all the keys,
        but this check should be moved outside of the loop.

        No new tests, since this is not a change in behavior.

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):

2020-06-10  Brady Eidson  <beidson@apple.com>

        Crash growing a CFData with incremental PDF loading.
        <rdar://problem/63670403> and https://bugs.webkit.org/show_bug.cgi?id=213035

        Reviewed by Alex Christensen.

        No test - No reliable way to trigger.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::ensureDataBufferLength): When you call CFDataCreateMutable with a size other than 0,
          your data object can never grow beyond that size.
          And, in fact, CFData will crash on purpose when this is attempted.
          So always create our mutable CFDatas with size 0 even if we immediately plan to grow them.

2020-06-10  Jonathan Bedard  <jbedard@apple.com>

        WebKit: Add ClockKitSPI.h
        https://bugs.webkit.org/show_bug.cgi?id=212994
        <rdar://problem/64181092>

        Reviewed by Wenson Hsieh.

        No new tests, behavior unchanged.

        * Platform/spi/watchos: Added.
        * Platform/spi/watchos/ClockKitSPI.h: Added.
        * UIProcess/ios/forms/WKTimePickerViewController.mm: Import ClockKitSPI.h and UIKitSPI.h.
        * WebKit.xcodeproj/project.pbxproj: Include ClockKitSPI.

2020-06-10  Brian Burg  <bburg@apple.com>

        WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it
        https://bugs.webkit.org/show_bug.cgi?id=208232
        <rdar://problem/59859491>

        Reviewed by Devin Rousso.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
        The provided coordinates are in LayoutViewport coordinate system, which does
        not take topContentInset into account. Add back in the topContentInset
        when translating to flipped window coordinates.

        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
        (WebKit::WebAutomationSessionProxy::computeElementLayout):
        The calculations of element bounds and IVCP have an incorrect handling of
        root coordinates as contents/absolute coordinates. Add the missing conversion.

2020-06-10  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Update sandbox rules for correct sanitizer paths in current OS releases
        https://bugs.webkit.org/show_bug.cgi?id=213040
        <rdar://problem/64187043>

        Reviewed by Per Arne Vollan.

        Update the sandbox rules on iOS platforms to allow access to the
        new system locations for Asan libraries.

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

2020-06-10  Jer Noble  <jer.noble@apple.com>

        Catalyst WebKit apps continue to play audio after quitting
        https://bugs.webkit.org/show_bug.cgi?id=212981
        <rdar://problem/57089471>

        Reviewed by Chris Dumez.

        RunningBoard will track whether a process (and it's associated child processes) are "user-visible" by
        granting those processes an "endowment", similar to the existing endowment for application visibility.
        Track changes to these endowments using a RBSProcessMonitor, and for Catalyst apps, react to losing the
        "user-visible" endowment by suspending all media playback.

        Move all the endowment-related code into a new class, EndowmentStateTracker, which is a singleton object
        that can have mulitple WebPageProxy clients. Update references to the previously global static
        isApplicationForeground() function to refer to EndowmentStateTracker instead.

        Drive-by fix: move some iOS-only functions in WebPageProxy.cpp into WebPageProxyIOS.mm.

        * UIProcess/ApplicationStateTracker.h:
        * UIProcess/ApplicationStateTracker.mm:
        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
        (WebKit::isApplicationForeground): Deleted.
        * UIProcess/EndowmentStateTracker.h: Added.
        (WebKit::EndowmentStateTracker::isVisible const):
        (WebKit::EndowmentStateTracker::isUserFacing const):
        * UIProcess/EndowmentStateTracker.mm: Added.
        (WebKit::handleForPID):
        (WebKit::EndowmentStateTracker::isApplicationForeground):
        (WebKit::EndowmentStateTracker::isApplicationUserFacing):
        (WebKit::EndowmentStateTracker::singleton):
        (WebKit::EndowmentStateTracker::EndowmentStateTracker):
        (WebKit::EndowmentStateTracker::addClient):
        (WebKit::EndowmentStateTracker::removeClient):
        (WebKit::EndowmentStateTracker::setIsUserFacing):
        (WebKit::EndowmentStateTracker::setIsVisible):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::m_limitsNavigationsToAppBoundDomains):
        (WebKit::WebPageProxy::~WebPageProxy):
        (WebKit::WebPageProxy::processWillBecomeSuspended): Deleted.
        (WebKit::WebPageProxy::processWillBecomeForeground): Deleted.
        * UIProcess/WebPageProxy.h:
        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::isApplicationVisible):
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::processWillBecomeSuspended):
        (WebKit::WebPageProxy::processWillBecomeForeground):
        (WebKit::WebPageProxy::isUserFacingChanged):
        (WebKit::WebPageProxy::isVisibleChanged):
        * WebKit.xcodeproj/project.pbxproj:

2020-06-10  Antoine Quint  <graouts@webkit.org>

        Subframes should not autosize independently
        https://bugs.webkit.org/show_bug.cgi?id=212984
        <rdar://problem/64175493>

        Reviewed by Simon Fraser.

        Ensure we only call FrameView::enableSizeToContentAutoSizeMode() for the main frame.

        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):

2020-06-10  Jonathan Bedard  <jbedard@apple.com>

        WebKit:Add PepperUICoreSPI.h
        https://bugs.webkit.org/show_bug.cgi?id=212996
        <rdar://problem/64182627>

        Reviewed by Tim Horton.

        No new tests, behavior unchanged.

        * Platform/spi/watchos: Added.
        * Platform/spi/watchos/PepperUICoreSPI.h: Added.
        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: Include PepperUICoreSPI header.
        * UIProcess/ios/WKScrollView.mm: Ditto.
        * UIProcess/ios/forms/WKDatePickerViewController.mm: Remove headers duplicated in PepperUICoreSPI.h.
        * UIProcess/ios/forms/WKFocusedFormControlView.mm: Ditto.
        * UIProcess/ios/forms/WKNumberPadView.mm: Include PepperUICoreSPI header.
        * UIProcess/ios/forms/WKNumberPadViewController.h: Remove headers duplicated in PepperUICoreSPI.h.
        * UIProcess/ios/forms/WKNumberPadViewController.mm: Ditto.
        (-[WKNumberPadViewController addContentViewAnimations:]): Limit addAnimation to Internal builds.
        * UIProcess/ios/forms/WKQuickboardListViewController.h: Include PepperUICoreSPI header.
        * UIProcess/ios/forms/WKQuickboardListViewController.mm: Remove headers duplicated in PepperUICoreSPI.h.
        (-[WKQuickboardListViewController initWithDelegate:]):
        * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Remove headers duplicated in PepperUICoreSPI.h.
        * UIProcess/ios/forms/WKTextInputListViewController.mm: Ditto.
        * WebKit.xcodeproj/project.pbxproj: Add PepperUICoreSPI.h.

2020-06-10  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Add entitlement for PAC exceptions
        https://bugs.webkit.org/show_bug.cgi?id=213027
        <rdar://problem/63985737>

        Reviewed by Brent Fulgham.

        On iOS, add entitlement for PAC exceptions.

        * Scripts/process-entitlements.sh:

2020-06-10  James Savage  <james.savage@apple.com>

        Swift Overlay API refinements
        https://bugs.webkit.org/show_bug.cgi?id=212939
        <rdar://problem/64140013>

        Reviewed by Darin Adler.

        This patch cleans up some inconsistencies in the various Swift projections,
        and modifies JavaScript evaluation callbacks to be optional to account for
        scripts which may not evaluate to a useful result (such as ones that simply
        modify the DOM without reporting a status). It also standardizes on using
        completionHandler as an argument label to match the rest of WebKit API, and
        the majority of the Swift API refinements.
        
        It also fixes a module issue where the WebKit.h umbrella was missing an
        import of WKScriptReplyWithMessageHandler.h, making the type unusable from
        Swift source files/

        * Shared/API/Cocoa/WebKit.h: Add missing header.
        * UIProcess/API/Cocoa/WebKitSwiftOverlay.swift:
        (callAsyncJavaScript(_:arguments:in:completionHandler:)): Rename completion
            argument, and make optional. Note: Optional closures are implicitly
            @escaping, making the annotation redundant and incompatible, so it must
            be removed. In Swift, Optional.map()'s closure is invoked iff the Optional
            contains some value, and the result of that transform is returned, else
            nil is propagated. This allows us to apply the closure transform if the
            client value is non-nil, without using intermediary variables or if/let.
        (evaluateJavaScript(_:in:completionHandler:)): Ditto.
        * SwiftOverlay/Tests/WebKitTests.swift:
        (WebKitTests.testAPI): Update names to reflect changes.
        * SwiftOverlay/WebKitSwiftOverlay.xcodeproj/xcshareddata/xcschemes/Everything (Catalyst).xcscheme:
            Ensure that the unit test files get built as part of Build & Run, so that
            any changes to names get flagged without even running the tests.
        * SwiftOverlay/WebKitSwiftOverlay.xcodeproj/xcshareddata/xcschemes/Everything.xcscheme:
            Ditto.

2020-06-10  Kate Cheney  <katherine_cheney@apple.com>

        ASSERTION FAILED: suspendedState == State::Running in WebKit::WebResourceLoadStatisticsStore::suspend
        https://bugs.webkit.org/show_bug.cgi?id=213031
        <rdar://problem/64131092>

        Reviewed by Chris Dumez.

        There is a race condition if two calls are made to
        WebResourceLoadStatisticsStore::suspend() simultanously.
        WebResourceLoadStatisticsStore::resume() notifies the background
        thread to continue and releases a lock, then sometimes the second call
        to suspend obtains the lock and updates the suspendedState variable
        before the background thread resumes and checks the result. This patch allows the
        suspendedState to be either State::Running or State::WillSuspend to
        account for this.

        No new tests, this should fix http/wpt/service-workers/service-worker-spinning-fetch.https.html.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
        (WebKit::WebResourceLoadStatisticsStore::suspend):

2020-06-10  Alex Christensen  <achristensen@webkit.org>

        Revert r259770
        https://bugs.webkit.org/show_bug.cgi?id=210097
        <rdar://problem/64175992>

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

2020-06-10  Alex Christensen  <achristensen@webkit.org>

        Add some null checks in PDFPlugin::updatePageAndDeviceScaleFactors
        https://bugs.webkit.org/show_bug.cgi?id=213009
        <rdar://problem/63756100>

        Reviewed by Chris Dumez.

        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::updatePageAndDeviceScaleFactors):

2020-06-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed, reverting r262791.

        WinCairo WebKit1 is crashing.

        Reverted changeset:

        "[Curl] Implement functions to use ResourceLoadStatistics."
        https://bugs.webkit.org/show_bug.cgi?id=207692
        https://trac.webkit.org/changeset/262791

2020-06-09  Tim Horton  <timothy_horton@apple.com>

        Stop using the wrong LaunchServices SPI for getting an app's localized name
        https://bugs.webkit.org/show_bug.cgi?id=213003
        <rdar://problem/64169000>

        Reviewed by Sam Weinig.

        * UIProcess/ios/WKActionSheetAssistant.mm:
        (-[WKActionSheetAssistant _appendAppLinkOpenActionsForURL:actions:elementInfo:]):

2020-06-09  Mark Lam  <mark.lam@apple.com>

        Disambiguate the OverridesGetPropertyNames structure flag
        https://bugs.webkit.org/show_bug.cgi?id=212909
        <rdar://problem/63823557>

        Reviewed by Saam Barati.

        * WebProcess/Plugins/Netscape/JSNPObject.h:

2020-06-09  Dean Jackson  <dino@apple.com>

        Stop using discriminatory names for WebGL and Plugin blocking
        https://bugs.webkit.org/show_bug.cgi?id=213000

        Reviewed by Simon Fraser.

        * Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
        (WebKit::getPlatformPluginModuleInformation):
        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
        (WKContextIsPlugInUpdateAvailable):
        (WKContextShouldBlockWebGL):
        (WKContextShouldSuggestBlockWebGL):
        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
        (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):

2020-06-09  Brian Burg  <bburg@apple.com>

        [Cocoa] Element Send Keys can hang when an automation window becomes unfocused
        https://bugs.webkit.org/show_bug.cgi?id=212985
        <rdar://problem/56354471>

        Reviewed by Devin Rousso.

        * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
        (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
        Make sure to focus the window and set first responder so sending keys doesn't hang.


2020-06-09  Jonathan Bedard  <jbedard@apple.com>

        WebKit: Import NSURLConnectionSPI.h instead of CFNSURLConnection.h
        https://bugs.webkit.org/show_bug.cgi?id=212980
        <rdar://problem/64172694>

        Unreviewed build fix.

        No new tests, behavior unchanged.

        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

2020-06-09  Dean Jackson  <dino@apple.com>

        REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash
        https://bugs.webkit.org/show_bug.cgi?id=212940

        Reviewed by Tim Horton.

        The code to use the singleton for a SwitchingGPUClient was assuming it
        has always been set, which was not the case when
        ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true.

        * WebProcess/cocoa/WebProcessCocoa.mm: Set the singleton unconditionally.
        (WebKit::WebProcess::platformInitializeProcess):

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

        REGRESSION (r260820): [macCatalyst] Web process crashes when uploading a file
        https://bugs.webkit.org/show_bug.cgi?id=212976
        <rdar://problem/64033186>

        Reviewed by Tim Horton.

        On Mac Catalyst, we attempt to take a sandbox extension for `com.apple.frontboard.systemappservices` when
        uploading a file; this service does not exist in Catalyst, and we consequently encounter a release assertion
        under `WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon`.

        Fix this by introducing `HAVE(FRONTBOARD_SYSTEM_APP_SERVICES)`, and using it to guard codepaths that attempt to
        grab a mach extension to this service. (As a followup, we should consider adopting this in other places that
        currently reference `com.apple.frontboard.systemappservices`).

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):

2020-06-09  Jonathan Bedard  <jbedard@apple.com>

        WebKit: Support watchOS and tvOS in xcconfigs
        https://bugs.webkit.org/show_bug.cgi?id=212977
        <rdar://problem/64170532>

        Reviewed by Tim Horton.

        No new tests, behavior unchanged.

        * Configurations/Base.xcconfig: Add tvOS and watchOS major version macros.
        * Configurations/BaseTarget.xcconfig: Include tvOS and watchOS framework stubs.
        * Configurations/BaseXPCService.xcconfig: Generalize excluded files for all embedded platforms.
        * Configurations/GPUService.xcconfig: Generalize INFOPLIST for embedded platforms.
        * Configurations/NetworkService.xcconfig: Ditto.
        * Configurations/WebContentService.xcconfig: Ditto.

2020-06-09  Alex Christensen  <achristensen@webkit.org>

        Expose PDF file URL in shouldAllowPDFToOpenFromFrame SPI
        https://bugs.webkit.org/show_bug.cgi?id=212974

        Reviewed by Tim Horton.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::confirmPDFOpening):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::confirmPDFOpening):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):

2020-06-09  Takashi Komori  <Takashi.Komori@sony.com>

        [Curl] Implement functions to use ResourceLoadStatistics.
        https://bugs.webkit.org/show_bug.cgi?id=207692

        Reviewed by Don Olmstead.

        Implement functions which are required to implement ResourceLoadStatistics for Curl port.

        In NetworkDataTaskCurl.cpp we check if we should block cookies and block if needed.

        Tests: http/tests/resourceLoadStatistics/

        * NetworkProcess/NetworkDataTask.cpp:
        (WebKit::NetworkDataTask::create):
        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
        (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
        (WebKit::NetworkDataTaskCurl::createCurlRequest):
        (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
        (WebKit::NetworkDataTaskCurl::blockCookies):
        (WebKit::NetworkDataTaskCurl::unblockCookies):
        (WebKit::NetworkDataTaskCurl::shouldBlockCookies):
        (WebKit::NetworkDataTaskCurl::isThirdPartyRequest):
        * NetworkProcess/curl/NetworkDataTaskCurl.h:
        * NetworkProcess/curl/NetworkSessionCurl.cpp:
        (WebKit::NetworkSessionCurl::NetworkSessionCurl):
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreGetAllStorageAccessEntries):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::parameters):

2020-06-09  Lauro Moura  <lmoura@igalia.com>

        [WebDriver][WPE] Follow up WPE fix after r262703
        https://bugs.webkit.org/show_bug.cgi?id=212948

        Reviewed by Carlos Garcia Campos.

        Covered by existing tests.

        * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
        (WebKit::WebAutomationSession::platformWebModifiersFromRaw):

2020-06-08  David Kilzer  <ddkilzer@apple.com>

        [IPC] Adopt enum class for IPC::CFType
        <https://webkit.org/b/212921>
        <rdar://problem/64134506>

        Reviewed by Darin Adler.

        Summary:
        - Convert IPC::CFType to enum class.
        - Rule for new enum names is to remove "Ref" suffix from the
          actual type name.
        - Special enum CFType::Null renamed to CFType::Nullptr to
          differentiate from CFType::CFNull objects.

        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::tokenNullTypeRef): Delete.
        (IPC::tokenNullptrTypeRef): Add.
        - Rename tokenNullTypeRef() to tokenNullptrTypeRef().
        (IPC::CFType):
        - Convert to enum class.
        (IPC::typeFromCFTypeRef):
        (IPC::encode):
        - Switch from encodeEnum() to operator<<().
        (IPC::decode):
        - Switch from decodeEnum() to decode().
        (WTF::EnumTraits<IPC::CFType>): Add.
        * Shared/cf/ArgumentCodersCF.h:
        (IPC::tokenNullTypeRef): Delete.
        (IPC::tokenNullptrTypeRef): Add.
        - Rename tokenNullTypeRef() to tokenNullptrTypeRef().
        * Shared/mac/WebCoreArgumentCodersMac.mm:
        (IPC::ArgumentCoder<WebCore::ResourceRequest>::encodePlatformData):
        (IPC::ArgumentCoder<WebCore::ResourceRequest>::decodePlatformData):
        - Switch to use tokenNullptrTypeRef().
        * mac/WebKit2.order:
        - Update symbol name after renaming tokenNullTypeRef().

2020-06-08  Kate Cheney  <katherine_cheney@apple.com>

        ResourceLoadStatisticsDatabaseStore::domainIDFromString failed, error message: bad parameter or other API misuse
        https://bugs.webkit.org/show_bug.cgi?id=212916
        <rdar://problem/64127238>

        Reviewed by Sihui Liu.

        Make sure m_domainIDFromStringStatement is accessed in a separate
        scope in ensureResourceStatisticsForRegistrableDomain() so it will be
        reset before being used again.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const):
        Add debug assert to ensure that tests catch this case.

        (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain const):

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

        Turn some WebPageProxy logging into error logging
        https://bugs.webkit.org/show_bug.cgi?id=212922
        <rdar://problem/63894722>

        Reviewed by Geoffrey Garen.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
        (WebKit::WebPageProxy::didFailLoadForFrame):
        (WebKit::WebPageProxy::processDidTerminate):
        (WebKit::WebPageProxy::dispatchProcessDidTerminate):
        (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
        (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
        (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):

2020-06-08  David Kilzer  <ddkilzer@apple.com>

        [IPC] Adopt enum class for DragOperation
        <https://webkit.org/b/212870>
        <rdar://problem/64069940>

        Reviewed by Darin Adler.

        * Scripts/webkit/messages.py:
        - Remove FIXME now that it's not needed.
        * Shared/API/Cocoa/_WKDragActionsInternal.h:
        (WebKit::coreDragOperationMask):
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::kit):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (dropOperationForWebCoreDragOperation):
        (coreDragOperationForUIDropOperation):
        (-[WKContentView dragDataForDropSession:dragDestinationAction:]):

2020-06-08  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, reverting r262685.
        https://bugs.webkit.org/show_bug.cgi?id=212914

        caused flakey crashes in an iOS test

        Reverted changeset:

        "Clear WebPageProxy event state between tests"
        https://bugs.webkit.org/show_bug.cgi?id=212864
        https://trac.webkit.org/changeset/262685

2020-06-08  Sam Weinig  <weinig@apple.com>

        Extended Color: Unify rounding / clamping conversions between 0-1 float components and 0-255 byte components
        https://bugs.webkit.org/show_bug.cgi?id=212871

        Reviewed by Simon Fraser.

        * UIProcess/API/ios/WKWebViewIOS.mm:
        (scrollViewBackgroundColor):
        Replaces uses of colorWithAlphaUsingAlternativeRounding() with colorWithAlpha().

2020-06-08  Richard Houle  <rhoule@apple.com>

        Links in NSAttributedString passed to -[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:] are ignored
        https://bugs.webkit.org/show_bug.cgi?id=212801
        <rdar://problem/63027631>

        Reviewed by Alex Christensen.

        * UIProcess/API/Cocoa/WKWebView.mm:
        (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): Call the new detailsWithLinks
        implementation, asserting if an URL is non nil.
        (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): Ditto.
        (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:detailsWithLinks:completionHandler:]): Pass the URL to
        the completion handler when appropriate.
        * UIProcess/API/Cocoa/WKWebViewPrivate.h:

2020-06-08  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Adopt read-only mode for preferences in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=212411

        Reviewed by Darin Adler.

        Change name of HAVE define to match SPI name.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):

2020-06-08  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] CFPrefs synchronization does not always work for global preference changes
        https://bugs.webkit.org/show_bug.cgi?id=212783

        Reviewed by Tim Horton.

        In CFPrefs direct mode, synchronization of global preference changes from the UI process to the WebContent process does not always work.
        This is caused by the KVO notification being sent to all or some of the NSUserDefault objects, which leads us to believe a non-global
        preference was changed. Since a global preference change always leads to some NSUserDefaults object receiving the notification, we can
        work around this by checking if the preference being changed really belongs to the domain of the NSUserDefaults object, or if it is a
        global preference. Also, stop creating NSUserDefaults object for the global domain, since this is an error according to the docs.

        API test: WebKit.GlobalPreferenceChangesUsingDefaultsWrite

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKUserDefaults _notifyObserversOfChangeFromValuesForKeys:toValuesForKeys:]):
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):
        (WebKit::WebProcess::notifyPreferencesChanged):

2020-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Hit-testing on icloud.com is offset after closing a tab
        https://bugs.webkit.org/show_bug.cgi?id=212890
        <rdar://problem/58775297>

        Reviewed by Simon Fraser.

        After tapping to create a new tab on the icloud.com settings page (with no other tabs open) and then closing the
        new tab, all hit-testing on the page is offset by -33px until the page is reloaded. This bug appears to be a
        corner case triggered by a combination of the following three changes:

        - <https://trac.webkit.org/r170463>
        - <https://trac.webkit.org/r245006>
        - <rdar://problem/53660458> (which is an iOS-specific Safari change)

        We start on icloud.com's settings page. When closing the newly created tab, Safari hides the tab bar, causing
        both the top content inset and top obscured inset to decrease by 33 points. When applying the top content inset
        change, Safari (after <rdar://problem/53660458>) temporarily sets `_automaticContentOffsetAdjustmentEnabled` on
        `WKScrollView` to `NO`, which means that the scroll view doesn't automatically adjust its content offset to -70;
        instead, it remains at -103 (the content offset when the tab bar is shown).

        Because of this, during the next remote layer tree commit where the content size changes,
        `-_setContentSizePreservingContentOffsetDuringRubberband:` will believe that we're currently rubber-banding by
        33px, and therefore try to adjust the content offset of the scroll view to be -103 instead of allowing it to be
        adjusted back to -70 (see r170463 and `-_restoreContentOffsetWithRubberbandAmount:`).

        This results in the scroll position on the page (`document.scrollingElement.scrollTop`) reporting -33, even
        though the top of the page is flush with the bottom of Safari's browser chrome. Finally, because `WKScrollView`
        is made unscrollable due to `overflow: hidden;` (r245006), we end up permanently stuck in this state until the
        next page load, rather than the next remote layer tree commit that causes any scrolling.

        To fix this, add an additional restriction on the rubberbanding offset restoration code in
        `-_setContentSizePreservingContentOffsetDuringRubberband:`, such that we only try to preserve the current
        rubberbanded offset if we're actually rubberbanding (that is, dragging or bouncing against the edge of the
        scroll view). Note that when rubberbanding against the top of the scroll view on iPad using a trackpad, the
        `-isDragging` property is also true, which matches behavior when panning via touch.

        Test: ScrollViewInsetTests.ChangeInsetWithoutAutomaticAdjustmentWhileWebProcessIsUnresponsive

        * Platform/spi/ios/UIKitSPI.h:
        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]):

        Also, split out the `CGSizeEqualToSize(currentContentSize, contentSize)` case into a separate early return that
        skips the call to `-setContentSize:` altogether.

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

        [Apple Pay] Remove -respondsToSelector: check before calling -[PKPaymentRequest setBoundInterfaceIdentifier:]
        https://bugs.webkit.org/show_bug.cgi?id=212884
        <rdar://problem/64090963>

        Reviewed by Youenn Fablet.

        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Relied on the definition of
        HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER to ensure that PKPaymentRequest will respond to
        -setBoundInterfaceIdentifier:.

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

        [Apple Pay] Remove ENABLE_APPLE_PAY_SETUP, ENABLE_APPLE_PAY_SESSION_V7, and HAVE_PASSKIT_PAYMENT_SETUP
        https://bugs.webkit.org/show_bug.cgi?id=212883
        <rdar://problem/64090763>

        Reviewed by Youenn Fablet.

        These macros evaluate to true whenever ENABLE(APPLE_PAY) is true on platforms supported by
        trunk WebKit, so we can either remove them or replace them with ENABLE(APPLE_PAY).

        * Shared/ApplePay/ApplePayPaymentSetupFeatures.mm:
        * Shared/ApplePay/ApplePayPaymentSetupFeaturesWebKit.h:
        * Shared/ApplePay/PaymentSetupConfiguration.mm:
        * Shared/ApplePay/PaymentSetupConfigurationWebKit.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
        * WebProcess/ApplePay/WebPaymentCoordinator.h:

2020-06-08  youenn fablet  <youenn@apple.com>

        [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
        https://bugs.webkit.org/show_bug.cgi?id=206582
        <rdar://problem/58985368>

        Reviewed by Eric Carlson.

        Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):

2020-06-07  Lauro Moura  <lmoura@igalia.com>

        [WebDriver] Allow platform-dependent modifier keys conversion to WebEvent::Modifier
        https://bugs.webkit.org/show_bug.cgi?id=212848

        Reviewed by Brian Burg.

        WebEvent::Modifier flags does not map directly to the platform flags,
        so we can't directly convert the modifier flags to the OptionSet.

        Covered by existing WebDriver tests.

        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::simulateMouseInteraction): Use
        platform-specific method to convert the modifiers.
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added
        conversion from GDK modifier mask to WebEvent::Modifier.
        (WebKit::WebAutomationSession::platformWebModifiersFromRaw):
        * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Added
        conversion from NSModifierFlag to WebEvent::Modifier.
        (WebKit::WebAutomationSession::platformWebModifiersFromRaw):
        * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Added
        conversion from wpe_input_keyboard_modifier to WebEvent::Modifier.
        (WebKit::WebAutomationSession::platformWebModifiersFromRaw):

2020-06-07  Lauro Moura  <lmoura@igalia.com>

        [WPE] Behave like GDK_CURRENT_TIME when the timestamp is zero
        https://bugs.webkit.org/show_bug.cgi?id=212797

        WebDriver tests come with zero timestamp. So behave like
        GDK_CURRENT_TIME and assume zero timestamp == WallTime::now().

        Reviewed by Carlos Garcia Campos.

        Covered by existing tests.

        * Shared/libwpe/WebEventFactory.cpp:
        (WebKit::wallTimeForEventTime):

2020-06-07  Philippe Normand  <pnormand@igalia.com>

        Remove ENABLE_VIDEO_TRACK ifdef guards
        https://bugs.webkit.org/show_bug.cgi?id=212568

        Reviewed by Youenn Fablet.

        * Configurations/FeatureDefines.xcconfig:
        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::dispatchMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
        (WebKit::RemoteMediaPlayerProxy::textTrackSetMode):
        (WebKit::RemoteMediaPlayerProxy::notifyTrackModeChanged):
        * GPUProcess/media/RemoteMediaPlayerProxy.h:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h:
        * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in:
        * Shared/WebPreferences.yaml:
        * WebProcess/GPU/GPUProcessConnection.cpp:
        (WebKit::GPUProcessConnection::dispatchMessage):
        * WebProcess/GPU/GPUProcessConnection.h:
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
        (WebKit::MediaPlayerPrivateRemote::tracksChanged):
        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
        * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp:
        (WebKit::RemoteMediaPlayerManager::updatePreferences):
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp:
        * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp:
        * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h:
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
        * WebProcess/Network/WebLoaderStrategy.cpp:
        (WebKit::maximumBufferingTime):

2020-06-06  Simon Fraser  <simon.fraser@apple.com>

        Clear WebPageProxy event state between tests
        https://bugs.webkit.org/show_bug.cgi?id=212864

        Reviewed by Anders Carlsson.

        Make sure that event state doesn't leak between tests via events queued in WebPageProxy.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageClearEventState):
        * UIProcess/API/C/WKPage.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::resetStateAfterProcessExited):
        (WebKit::WebPageProxy::clearEventState):
        * UIProcess/WebPageProxy.h:

2020-06-06  Rob Buis  <rbuis@igalia.com>

        Move URL scheme check to NetworkLoadChecker
        https://bugs.webkit.org/show_bug.cgi?id=191924

        Reviewed by Joseph Pecoraro.

        Reduce includes for CustomHeaderFields, I guess these were needed
        at some point but not anymore.

        * Shared/WebsitePoliciesData.cpp:

2020-06-06  David Kilzer  <ddkilzer@apple.com>

        Use OptionSet<DragOperation> for mask values
        <https://webkit.org/b/212605>

        Reviewed by Darin Adler.

        In broad strokes:
        - Replace use of DragOperation with OptionSet<DragOperation> or
          Optional<DragOperation>.
        - Rename function parameters and local variables to denote use
          of mask values.
        - Remove DragOperationNone enum value.
        - Replace DragOperationEvery enum value with anyDragOperation().

        * Platform/spi/ios/UIKitSPI.h:
        (UIDragOperation):
        - Remove unused (and misnamed) UIDragOperation enum typedef.
        * Scripts/webkit/messages.py:
        (types_that_cannot_be_forward_declared):
        (headers_for_type):
        - Add support for WebCore::DragOperation enum.
        * Shared/API/Cocoa/_WKDragActionsInternal.h:
        (WebKit::coreDragOperationMask): Add conversion function.
        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<DragData>::encode):
        (IPC::ArgumentCoder<DragData>::decode):
        - Update to encode/decode OptionSet<DragOperation>.

        * UIProcess/API/gtk/DragSource.h:
        (WebKit::DragSource::begin):
        * UIProcess/API/gtk/DragSourceGtk3.cpp:
        (WebKit::DragSource::begin):
        * UIProcess/API/gtk/DragSourceGtk4.cpp:
        (WebKit::DragSource::begin):
        * UIProcess/API/gtk/DropTarget.h:
        * UIProcess/API/gtk/DropTargetGtk3.cpp:
        (WebKit::DropTarget::didPerformAction):
        (WebKit::DropTarget::leaveTimerFired):
        * UIProcess/API/gtk/DropTargetGtk4.cpp:
        (WebKit::DropTarget::DropTarget):
        (WebKit::DropTarget::didPerformAction):
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::startDrag):
        * UIProcess/API/gtk/PageClientImpl.h:
        (WebKit::PageClientImpl::startDrag):
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseStartDrag):
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        (webkitWebViewBaseStartDrag):

        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::sendDragEndToPage):
        (WebKit::WebViewImpl::draggingEntered):
        (WebKit::kit): Add conversion function.
        (WebKit::WebViewImpl::draggingUpdated):
        (WebKit::WebViewImpl::draggingExited):
        (WebKit::WebViewImpl::performDragOperation):
        - Make use of coreDragOperationMask() conversion function.
        * UIProcess/PageClient.h:
        (WebKit::WebViewImpl::startDrag):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::didPerformDragControllerAction):
        - Remove MESSAGE_CHECK now that we're using the actual type.
        (WebKit::WebPageProxy::startDrag):
        (WebKit::WebPageProxy::dragEnded):
        (WebKit::WebPageProxy::resetCurrentDragInformation):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::didPerformDragControllerAction):
        (WebKit::WebPageProxy::dragEnded):
        (WebKit::WebPageProxy::startDrag):
        (WebKit::WebPageProxy::currentDragOperation const):
        * UIProcess/WebPageProxy.messages.in:
        (WebPageProxy::DidPerformDragControllerAction):
        (WebPageProxy::StartDrag):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _didHandleDragStartRequest:]):
        (dropOperationForWebCoreDragOperation):
        (coreDragOperationForUIDropOperation): Add conversion function.
        - Note that this was not being converted from UIDropOperation to
          WebCore::DragOperation previously, and UIDropOperationMove
          (0x3) was not being properly converted to DragOperationMove
          (0x16).
        (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
        (-[WKContentView _didPerformDragOperation:]):
        (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
        (-[WKContentView dragInteraction:session:didEndWithOperation:]):
        (-[WKContentView dropInteraction:sessionDidEnd:]):
        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
        (WebKit::WebDragClient::startDrag):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::performDragControllerAction):
        (WebKit::WebPage::dragEnded):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::performDragControllerAction):
        (WebKit::WebPage::dragEnded):
        * WebProcess/WebPage/WebPage.messages.in:
        (WebPage::PerformDragControllerAction):
        (WebPage::DragEnded):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::requestAdditionalItemsForDragSession):

2020-06-06  Devin Rousso  <drousso@apple.com>

        Web Inspector: unify the naming scheme for agents used by instrumentation
        https://bugs.webkit.org/show_bug.cgi?id=212859

        Reviewed by Timothy Hatcher.

        Inspector agents fall into one of three categories:
         - "persistent" when Web Inspector is connected
         - "enabled" when that agent is `enable`d, such as if the corresponding tab is visible
         - "tracking" when that agent is part of a timeline recording.

        The only exception to this is the Console agent, as that exists regardless of whether Web
        Inspector is connected as it needs to preserve messages logged before Web Inspector connects.

        Also remove the "Inspector" prefix from getter/setter methods as it adds confusion if that
        agent also has subclasses (e.g. `InspectorRuntimeAgent` and `PageRuntimeAgent`).

        * UIProcess/Inspector/Agents/InspectorBrowserAgent.cpp:
        * UIProcess/Inspector/WebInspectorProxy.cpp:
        * UIProcess/Inspector/WebPageInspectorController.h:
        Simple naming changes elided to avoid a long ChangeLog.

2020-06-05  David Kilzer  <ddkilzer@apple.com>

        [IPC] Adopt enum class for AutocapitalizeType
        <https://webkit.org/b/212846>
        <rdar://problem/64042825>

        Reviewed by Darin Adler.

        Summary:
        - Move AutocapitalizeType into WebCore namespace.
        - Convert AutocapitalizeType to an enum class.
        - Add WTF::EnumTraits<AutocapitalizeType> for IPC.

        * Shared/FocusedElementInformation.cpp:
        (WebKit::FocusedElementInformation::encode const):
        (WebKit::FocusedElementInformation::decode):
        - Stop using decodeEnum() and encodeEnum() now that
          WTF::EnumTraits<AutocapitalizeType> exists.
        * Shared/FocusedElementInformation.h:
        * Shared/glib/InputMethodState.cpp:
        (WebKit::InputMethodState::addHintsForAutocapitalizeType):
        * Shared/glib/InputMethodState.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (toUITextAutocapitalize):
        * WebProcess/WebPage/ios/WebPageIOS.mm:
        (WebKit::WebPage::getFocusedElementInformation):

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

        [iOS] Silence telemetry generated during download operations
        https://bugs.webkit.org/show_bug.cgi?id=212854
        <rdar://problem/63909414>

        Reviewed by Per Arne Vollan.

        Remove reporting and telemetry for the 'com.apple.ProgressReporting' service
        from the Network Process sandbox, since this is a critical part of supplying
        download status to the WebKit UI.

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

2020-06-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r262619, r262625, and r262641.

        Caused mediarecorder layout test crashes.

        Reverted changesets:

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/262619

        "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
        https://bugs.webkit.org/show_bug.cgi?id=206582
        https://trac.webkit.org/changeset/262625

        "Unreviewed, silence deprecation warning to fix build with
        latest SDK."
        https://trac.webkit.org/changeset/262641

2020-06-05  Kate Cheney  <katherine_cheney@apple.com>

        ITP SQLite Database should only vacuum once per day
        https://bugs.webkit.org/show_bug.cgi?id=212712
        <rdar://problem/63939711>

        Reviewed by Brent Fulgham.

        Followup to https://trac.webkit.org/changeset/262538/webkit. We should
        run incremental auto vacuum, not a full vacuum, once per-day, because
        it is less expensive.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):

2020-06-05  Daniel Bates  <dabates@apple.com>

        -_focusTextInputContext should reposition the caret if called for an already focused text input context
        https://bugs.webkit.org/show_bug.cgi?id=212830
        <rdar://problem/64032956>

        Reviewed by Wenson Hsieh.

        Update the code based on new feedback: the caret should now be re-positioned when -_focusTextInputContext
        is called on an already assisted text input context.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView _didCommitLoadForMainFrame]): Reset state. See below for why.

        (-[WKContentView _focusTextInputContext:placeCaretAt:completionHandler:]): I cannot simply remove the early
        return in -_focusTextInputContext that detects if the specified text input context is already focused because
        it could effect user-visible responsiveness due to an Apple internal client invoking this function more times
        than necessary with the same point during a text interaction. See <rdar://problem/59430806>. That radar
        represents a correctness issue. I didn't actually evaluate whether responsiveness is affected by this patch,
        but I would feel more confident that there would be 0 impact when removing the early branch after that radar
        is fixed without the need to even perform a responsiveness analysis. Note that there is already a comment about
        that radar at the top of this function.

2020-06-05  Alex Christensen  <achristensen@webkit.org>

        Fix PDF opening after r262592
        https://bugs.webkit.org/show_bug.cgi?id=212795

        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
        As Darin mentioned and I was about to discover, my last-minute switching things around got the boolean condition backwards.
        We want to do nothing if we're not allowed to open the PDF, and we want to open the PDF if we are allowed to.s

2020-06-05  David Kilzer  <ddkilzer@apple.com>

        [IPC] Adopt enum class for PluginLoadClientPolicy
        <https://webkit.org/b/212827>
        <rdar://problem/64030431>

        Reviewed by Alex Christensen.

        Summary:
        - Update for renamed PluginLoadClientPolicy enums.
        - Update to make PluginLoadClientPolicy type work with IPC.
        - Replace uint8_t with strongly-typed PluginLoadClientPolicy.

        * Scripts/webkit/messages.py:
        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
        (WebKit::NetscapePluginModule::getPluginInfo):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/C/WKAPICast.h:
        (WebKit::toWKPluginLoadClientPolicy):
        (WebKit::toPluginLoadClientPolicy):
        * UIProcess/API/Cocoa/WKProcessPool.mm:
        (toPluginLoadClientPoliciesHashMap):
        (policiesHashMapToDictionary):
        (isPluginLoadClientPolicyAcceptable): Delete.
        - Replace with
          WTF::isValidEnum<WebCore::PluginLoadClientPolicy>().
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::setPluginLoadClientPolicy):
        (WebKit::WebProcessPool::resetPluginLoadClientPolicies):
        * UIProcess/WebProcessPool.h:
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::pluginInfo):
        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::setPluginLoadClientPolicy):
        (WebKit::WebProcess::resetPluginLoadClientPolicies):
        * WebProcess/WebProcess.h:
        * WebProcess/WebProcess.messages.in:

2020-06-05  Alex Christensen  <achristensen@webkit.org>

        Update header documentation for WKPreferences.fraudulentWebsiteWarningEnabled
        https://bugs.webkit.org/show_bug.cgi?id=212843
        <rdar://problem/64010164>

        Reviewed by Geoffrey Garen.

        * UIProcess/API/Cocoa/WKPreferences.h:

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

        [iOS] Remove message filtering telemetry for expected case
        https://bugs.webkit.org/show_bug.cgi?id=212841
        <rdar://problem/63893460>

        Reviewed by Per Arne Vollan.

        Remove unintentional telemetry being captured for expected behavior.

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

2020-06-05  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Adopt read-only mode for preferences in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=212411
        <rdar://problem/63640788>

        Reviewed by Darin Adler.

        The WebContent process should never write preferences. Adopt read-only mode for preferences.
        This will fix some sandbox violations when the UI process is notifying the WebContent process
        about preference changes. When notified, the WebContent process will use the preferences API
        to write those preferences in-process, but there should be no attempt at writing these new
        values to disk, which this patch will ensure.

        No new tests, since this is fixing a benign sandbox violation.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):

2020-06-05  Per Arne Vollan  <pvollan@apple.com>

        [iOS] Fix message filter sandbox violation
        https://bugs.webkit.org/show_bug.cgi?id=212837
        <rdar://problem/63830368>

        Reviewed by Darin Adler.

        Add required message to message filter in the iOS WebContent sandbox.

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

2020-06-05  Peng Liu  <peng.liu6@apple.com>

        REGRESSION (r262456?): [macOS] media/picture-in-picture/picture-in-picture-api tests are flaky timeouts
        https://bugs.webkit.org/show_bug.cgi?id=212762

        Reviewed by Eric Carlson.

        The Picture-in-Picture implementation expects the two callbacks HTMLVideoElement::didBecomeFullscreenElement()
        and HTMLVideoElement::setVideoFullscreenFrame() to come in order. So we need to remove the dispatch_async()
        and call HTMLVideoElement::didBecomeFullscreenElement() directly.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::didEnterFullscreen):

2020-06-05  Adrian Perez de Castro  <aperez@igalia.com>

        Non-unified build fixes, early summer 2020 edition
        https://bugs.webkit.org/show_bug.cgi?id=212819

        Unreviewed build fix.

        * Shared/gtk/NativeWebMouseEventGtk.cpp:
        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Add missing WebCore:: namespace to
        a couple of uses of WebCore::FloatSize.
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Add missing Logging.h header.

2020-06-05  Andy Estes  <aestes@apple.com>

        [Apple Pay] Remove conditionals for ENABLE_APPLE_PAY_SESSION_V(3|4)
        https://bugs.webkit.org/show_bug.cgi?id=212541
        <rdar://problem/63781452>

        Reviewed by Darin Adler.

        APPLE_PAY_SESSION_V(3|4) is now enabled whenever APPLE_PAY itself is enabled.

        * Configurations/FeatureDefines.xcconfig:

2020-06-05  youenn fablet  <youenn@apple.com>

        [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
        https://bugs.webkit.org/show_bug.cgi?id=206582
        <rdar://problem/58985368>

        Reviewed by Eric Carlson.

        Enable RemoteMediaRecorder only for systems supporting AVAssetWriterDelegate.

        * GPUProcess/GPUConnectionToWebProcess.cpp:
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
        * GPUProcess/GPUConnectionToWebProcess.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorder.h:
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.h:
        * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in:
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h:
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp:
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):

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

        REGRESSION(r262184): [GTK] Two fast/forms tests are crashing
        https://bugs.webkit.org/show_bug.cgi?id=212747

        Reviewed by Adrian Perez de Castro.

        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::handleKeyPress): Return early if the menu has already been closed.

2020-06-05  Youenn Fablet  <youenn@apple.com>

        Generate code to set the runtime settings for a service worker process
        https://bugs.webkit.org/show_bug.cgi?id=212467

        Reviewed by Alex Christensen.

        Split the code generated to handle web preference changes to have one method for process wide flags and one for page settings.
        Make the process wide flag method static and reuse it in WebSWContextManagerConnection.
        Covered by existing tests.

        * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::updatePreferences):
        * WebProcess/WebPage/WebPage.h:

2020-06-04  David Kilzer  <ddkilzer@apple.com>

        [IPC] Adopt enum class for PluginProcessType and PluginProcessSandboxPolicy
        <https://webkit.org/b/212758>

        Reviewed by Darin Adler.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializePluginProcess):
        * Scripts/webkit/messages.py:
        * Shared/Plugins/PluginProcessAttributes.h:
        (WebKit::PluginProcessType): Convert to enum class.
        (WebKit::PluginProcessSandboxPolicy): Ditto.
        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::fetchWebsiteData):
        (WebKit::PluginProcessManager::deleteWebsiteData):
        (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::didFinishLaunching):
        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
        (WebKit::PluginProcessProxy::platformGetLaunchOptionsWithAttributes):
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::findPlugin):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::createPlugin):
        (WebKit::WebPage::canPluginHandleResponse):

2020-06-04  Alex Christensen  <achristensen@webkit.org>

        Add WKUIDelegate SPI to confirm before opening a PDF
        https://bugs.webkit.org/show_bug.cgi?id=212795
        <rdar://problem/58715847>

        Reviewed by Tim Horton.

        * UIProcess/API/APIUIClient.h:
        (API::UIClient::confirmPDFOpening):
        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
        * UIProcess/Cocoa/UIDelegate.h:
        * UIProcess/Cocoa/UIDelegate.mm:
        (WebKit::UIDelegate::setDelegate):
        (WebKit::UIDelegate::UIClient::confirmPDFOpening):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
        * UIProcess/mac/WebPageProxyMac.mm:
        (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication):
        * WebProcess/Plugins/PDF/PDFPlugin.mm:
        (WebKit::PDFPlugin::openWithNativeApplication):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::savePDFToTemporaryFolderAndOpenWithNativeApplication):
        * WebProcess/WebPage/WebPage.h:

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

        UIProcess may crash after its prewarmed WebProcess gets terminated
        https://bugs.webkit.org/show_bug.cgi?id=212790
        <rdar://problem/63696191>

        Reviewed by Geoffrey Garen.

        Query WebProcessProxy::isDummyProcessProxy() because trying to look up the process
        in m_dummyProcessProxies. The key for m_dummyProcessProxies is a sessionID but
        not all processes have a sessionID. In particular, prewarmed web processes have
        no associated WebsiteDataStore and thus not sessionID.

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

2020-06-04  Brent Fulgham  <bfulgham@apple.com>

        Reduce telemetry and report generation for WebContent Process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=212779
        <rdar://problem/63769879>

        Reviewed by Per Arne Vollan.

        This patch cleans up a set of telemetry and reports generated during normal
        WebKit operation. Now that we understand the uses of these XPC services, we
        can reduce the logging traffic.

        This is important to do now, since generating the telemetry and reports has
        a non-zero power cost.

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

2020-06-04  Jiewen Tan  <jiewen_tan@apple.com>

        Disable CFNetwork AppSSO interception for Mac Catalyst
        https://bugs.webkit.org/show_bug.cgi?id=212787
        <rdar://problem/63738783>

        Reviewed by Chris Dumez.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

2020-06-04  Brent Fulgham  <bfulgham@apple.com>

        Reduce telemetry and report generation for Network Process sandbox
        https://bugs.webkit.org/show_bug.cgi?id=212778
        <rdar://problem/63891745>

        Reviewed by Per Arne Vollan.

        This patch cleans up a set of telemetry and reports generated during normal
        WebKit operation. Now that we understand the uses of these XPC services, we
        can reduce the logging traffic.

        This is important to do now, since telemetry and report generation has
        battery life and performance impact.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

2020-06-04  Jacob Uphoff  <jacob_uphoff@apple.com>

        Unreviewed, reverting r262546.

        This commit caused internal build failures

        Reverted changeset:

        "[Cocoa] Adopt read-only mode for preferences in the
        WebContent process"
        https://bugs.webkit.org/show_bug.cgi?id=212411
        https://trac.webkit.org/changeset/262546

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

        [iOS] Drop DependentProcessLink ProcessAssertion as it creates power leaks
        https://bugs.webkit.org/show_bug.cgi?id=212768
        <rdar://problem/62408828>

        Reviewed by Alex Christensen.

        Drop DependentProcessLink ProcessAssertion since it creates a process assertion cycle between
        the UIProcess and the WebContent process and leads to power leaks.

        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::WebProcessPool::platformInitializeWebProcess):
        * UIProcess/ProcessAssertion.h:
        * UIProcess/ProcessThrottler.cpp:
        (WebKit::ProcessThrottler::assertionName const):
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::didSetAssertionType):
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (WebKit::runningBoardNameForAssertionType):
        (WebKit::flagsForAssertionType):
        (WebKit::toBKSProcessAssertionReason):
        * WebProcess/WebProcess.h:
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-06-04  Brent Fulgham  <bfulgham@apple.com>

        Revise sandbox to support network stack telemetry without sandbox violation reports
        https://bugs.webkit.org/show_bug.cgi?id=212720
        <rdar://problem/63895783>

        Reviewed by Per Arne Vollan.

        Telemetry captured for various networking configurations has revealed a handful of mach service
        connections that should be allowed in the Network Process to support troubleshooting and field diagnostics.

        This patch revises the sandbox to avoid logging these accesses during normal operation.

        * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Do not generate traces for 'com.apple.diagnosticd'.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Ditto.
        * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Allow 'com.apple.osanalytics.osanalyticshelper' to
          be used on internal development builds.
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode const): Update to handle both 'diagnosticd' and 'osanalyticshelper'
        as optional services for internal builds.
        (WebKit::WebProcessCreationParameters::decode): Ditto.
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
        (WebKit::diagnosticServices): Ditto.
        (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess): Ditto.

2020-06-04  Per Arne Vollan  <pvollan@apple.com>

        [Cocoa] Adopt read-only mode for preferences in the WebContent process
        https://bugs.webkit.org/show_bug.cgi?id=212411
        <rdar://problem/63640788>

        Reviewed by Darin Adler.

        The WebContent process should never write preferences. Adopt read-only mode for preferences.
        This will fix some sandbox violations when the UI process is notifying the WebContent process
        about preference changes. When notified, the WebContent process will use the preferences API
        to write those preferences in-process, but there should be no attempt at writing these new
        values to disk, which this patch will ensure.

        No new tests, since this is fixing a benign sandbox violation.

        * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
        (WebKit::XPCServiceMain):

2020-06-04  Per Arne Vollan  <pvollan@apple.com>

        [iOS] The WebContent process should be allowed to consume an extension to the runningboard service
        https://bugs.webkit.org/show_bug.cgi?id=212753
        <rdar://problem/63948859>

        Reviewed by Chris Dumez.

        The WebContent process on iOS is failing to consume an extension to the runningboard service, because it is not allowed to do so.

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

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

        Work around broken system version macro
        https://bugs.webkit.org/show_bug.cgi?id=212726

        Reviewed by Dan Bernstein.

        * Configurations/DebugRelease.xcconfig:

2020-06-04  Andy Estes  <aestes@apple.com>

        [watchOS] Re-enable content filtering in the simulator build
        https://bugs.webkit.org/show_bug.cgi?id=212711
        <rdar://problem/63938350>

        Reviewed by Wenson Hsieh.

        * Configurations/FeatureDefines.xcconfig:

2020-06-04  Kate Cheney  <katherine_cheney@apple.com>

        ITP SQLite Database should only vacuum once per day
        https://bugs.webkit.org/show_bug.cgi?id=212712
        <rdar://problem/63939711>

        Reviewed by Brent Fulgham.

        Currently the SQLite Database runs a vacuum command each time statistics
        are processed. This is probably too frequent, because the database
        rarely needs to delete large amounts of data. We can cut this down to once a day.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):

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

        Minor optimisation to RemoteAudioBusData::decode
        https://bugs.webkit.org/show_bug.cgi?id=212692

        Reviewed by Eric Carlson.

        * WebProcess/GPU/media/RemoteAudioBusData.h:
        (WebKit::RemoteAudioBusData::decode):
        Use releaseNonNull to remove some count churn.

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

        [watchOS] fast/events/watchos/change-focus-during-change-event.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=212722
        <rdar://problem/60633339>

        Reviewed by Andy Estes.

        When HAVE(QUICKBOARD_COLLECTION_VIEWS) is enabled, the codepath that's used to simulate interacting with the
        select menu view controller on watchOS will crash, since it tries to pretend that the user has selected an item
        in a table view section (`PUICQuickboardListSectionTextOptions`) that only exists when Quickboard collection
        views are disabled. Fix the crash by adjusting the testing codepath to select the item in the first section when
        HAVE(QUICKBOARD_COLLECTION_VIEWS) is defined.

        * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
        (-[WKSelectMenuListViewController selectItemAtIndex:]):

2020-06-03  Jer Noble  <jer.noble@apple.com>

        [iOS] Hide the PiP button in fullscreen mode if PiP is disabled in preferences
        https://bugs.webkit.org/show_bug.cgi?id=212699
        <rdar://problem/60391437>

        Reviewed by Eric Carlson.

        In r260474, we hid the PiP button in fullscreen when PiP was unsupported on the
        current device; we must also hide the PiP button when clients have disabled PiP
        via preferences.

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

2020-06-03  Kate Cheney  <katherine_cheney@apple.com>

        Any active sqlite transactions for the ITP database should be aborted when the network process suspends.
        https://bugs.webkit.org/show_bug.cgi?id=212608
        <rdar://problem/60540768>

        Reviewed by Chris Dumez.

        Calls to WebResourceLoadStatisticsStore::suspend() should abort any
        active SQLite transactions. Unfinished transactions will hold the lock
        of a database file and could cause the network process to crash when
        suspending.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
        (WebKit::ResourceLoadStatisticsDatabaseStore::~ResourceLoadStatisticsDatabaseStore):
        Store all ResourceLoadStatisticsDatabaseStore instances in a static
        HashSet so existing transactions can be aborted when the process is
        preparing to suspend.

        (WebKit::ResourceLoadStatisticsDatabaseStore::interrupt):
        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::suspend):

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

        WebProcessPool::notifyPreferencesChanged() is unsafely called on a background thread
        https://bugs.webkit.org/show_bug.cgi?id=212697
        <rdar://problem/63876652>

        Reviewed by Per Arne Vollan.

        Make sure we dispatch to the main thread in [WKPreferenceObserver preferenceDidChange] before
        we iterate over the process pools and call WebProcessPool::notifyPreferencesChanged() on each
        one.

        * UIProcess/Cocoa/PreferenceObserver.mm:
        (-[WKPreferenceObserver preferenceDidChange:key:encodedValue:]):

2020-06-03  Brent Fulgham  <bfulgham@apple.com>

        [iOS] Reduce sandbox logging by permitting necessary sysctl
        https://bugs.webkit.org/show_bug.cgi?id=212710
        <rdar://problem/63900239>

        Reviewed by Per Arne Vollan.

        Telemetry indicates that we need to access "sysctl.name2oid" in the
        Network process during error handling for HTTP connections. Allow this
        access and avoid generating unnecessary logging for this case.

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

2020-06-03  Youenn Fablet  <youenn@apple.com>

        Add more logging related to service worker fetch event handling
        https://bugs.webkit.org/show_bug.cgi?id=212632
        <rdar://problem/63913271>

        Unreviewed.
        Build fix.

        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse):

2020-06-03  Alex Christensen  <achristensen@webkit.org>

        Pass WebPageProxyIdentifier to PreconnectTask
        https://bugs.webkit.org/show_bug.cgi?id=212648

        Reviewed by Chris Dumez.

        Otherwise, AuthenticationManager::didReceiveAuthenticationChallenge sometimes returned early because there was no pageID.
        Observed connecting to real websites from my home wifi.  Unable to test using local servers because connecting happens too fast.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::preconnectTo):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::preconnectTo):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::preconnectTo):

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

        Make generated C++ code use modern C++
        https://bugs.webkit.org/show_bug.cgi?id=190714

        Reviewed by Jonathan Bedard.

        Replace typedef usage by alias-declaration.

        * Scripts/test-legacyMessages.h:
        * Scripts/test-superclassMessages.h:
        * Scripts/testMessages.h:
        * Scripts/webkit/messages.py:

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

        [GTK4] WTR: Forward key events to the active popup menu
        https://bugs.webkit.org/show_bug.cgi?id=212690

        Reviewed by Adrian Perez de Castro.

        I forgot to remove the ifdefs when added support for popup menus in r262414.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSynthesizeKeyEvent):

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

        [GTK4] Fix input methods
        https://bugs.webkit.org/show_bug.cgi?id=212317

        Reviewed by Adrian Perez de Castro.

        Stop using GdkEvent to synthesize compositing events, add a specific NativeWebKeyboardEvent constructor for them.

        * Shared/NativeWebKeyboardEvent.h:
        * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
        (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp:
        (webkitInputMethodContextImplGtkSetClientWidget):
        (webkitInputMethodContextImplGtkSetClientWindow): Deleted.
        * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRealize):
        (webkitWebViewBaseUnrealize):
        (webkitWebViewBaseKeyPressEvent):
        (webkitWebViewBaseKeyReleaseEvent):
        (webkitWebViewBaseFocusEnter):
        (webkitWebViewBaseFocusLeave):
        (webkitWebViewBaseKeyPressed):
        (webkitWebViewBaseKeyReleased):
        (toplevelWindowIsActiveChanged):
        (webkitWebViewBaseSynthesizeCompositionKeyPress):

2020-06-03  Santosh Mahto  <santosh.mahto@collabora.com>

        [GTK4] Implement file chooser
        https://bugs.webkit.org/show_bug.cgi?id=212322

        Reviewed by Carlos Garcia Campos.

        Port FileChooser to gtk4, Now FileChooser uses undeprecated api's.
        Covered by existing tests.

        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (fileChooserDialogResponseCallback):
        (webkitWebViewRunFileChooser):

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

        [GTK4] Implement emoji chooser
        https://bugs.webkit.org/show_bug.cgi?id=212330

        Reviewed by Adrian Perez de Castro.

        GtkEmojiChooser is public API in GTK4, so just use that instead of our own.

        * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
        (emojiActivated): Close the popover before emitting emoji-picked for consistency with GTK.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
        (_WebKitWebViewBasePrivate::releaseEmojiChooserTimerFired):
        (webkitWebViewBaseDispose):
        (emojiChooserClosed):
        (webkitWebViewBaseShowEmojiChooser):

2020-06-03  Youenn Fablet  <youenn@apple.com>

        Add more logging related to service worker fetch event handling
        https://bugs.webkit.org/show_bug.cgi?id=212632

        Reviewed by Chris Dumez.

        Add logging to identify the page ID and frame ID used by a service worker.
        Add logging to identify what is happening in the case of a response being buffered for navigation purposes.

        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
        (WebKit::ServiceWorkerFrameLoaderClient::ServiceWorkerFrameLoaderClient):
        (WebKit::WebSWContextManagerConnection::installServiceWorker):
        (WebKit::WebSWContextManagerConnection::continueDidReceiveFetchResponse):
        * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
        (WebKit::WebServiceWorkerFetchTaskClient::didFail):
        (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
        (WebKit::WebServiceWorkerFetchTaskClient::continueDidReceiveResponse):

2020-06-02  Chris Dumez  <cdumez@apple.com>

        [iOS] WKProcessAssertionBackgroundTaskManager incorrectly ignores expiration notifications for daemons
        https://bugs.webkit.org/show_bug.cgi?id=212619

        Reviewed by Alex Christensen.

        WKProcessAssertionBackgroundTaskManager was incorrectly ignoring process assertion expiration notifications
        for daemons, because it was relying on visibility to make decisions. For daemons (or ViewServices), we would
        not get application visibility notifications and would therefore always assume the app is visible.
        As a result, _handleBackgroundTaskExpiration would think it received an outdated expiration notification for
        a visible app and would simply re-take the assertion right away.

        To address the issue, we now rely on a RunningBoard API that lets us know if the suspension timer has been
        started or not (and how much remains on the timer). If the suspension timer is not active when get receive
        the expiration notification, we know it is an outdated notification and we ignore it (release and re-take
        assertion right away). This can happen if we did not have time to process the expiration notification before
        suspended and thus only get it upon resuming. It can also happen if the user re-activates the app right after
        the expiration notice has been sent.

        * Platform/spi/ios/RunningBoardServicesSPI.h:
        * UIProcess/ios/ProcessAssertionIOS.mm:
        (processHasActiveRunTimeLimitation):
        (-[WKProcessAssertionBackgroundTaskManager init]):
        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
        (-[WKProcessAssertionBackgroundTaskManager _handleBackgroundTaskExpiration]):
        (-[WKProcessAssertionBackgroundTaskManager _handleBackgroundTaskExpirationOnMainThread]):
        (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):

2020-06-02  Christopher Reid  <chris.reid@sony.com>

        REGRESSION[r260844]: [GTK][WPE] Inspector GResource no longer updated after WebInspectorUI file updates
        https://bugs.webkit.org/show_bug.cgi?id=212583

        Reviewed by Adrian Perez de Castro.

        Add a cmake dependency on inspector resource stamp so the Glib
        Inspector resources rebuild when the stamp is updated.

        * InspectorGResources.cmake:

2020-06-02  Keith Rollin  <krollin@apple.com>

        Revert FEATURES_DEFINES related changes
        https://bugs.webkit.org/show_bug.cgi?id=212664
        <rdar://problem/63893033>

        Reviewed by Andy Estes.

        Bug 262310, Bug 262311, Bug 262318, and Bug 262331 involve changes to
        FEATURE_DEFINES and how the values there relate to those found in the
        Platform*.h files. Those changes break XCBuild (by removing the
        .xcfilelist related to UnifiedSources and the process for generating
        them), and so are being reverted.

        * Configurations/FeatureDefines.xcconfig:

2020-06-02  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, reverting r262424.

        Caused webkitpy test failure

        Reverted changeset:

        "Make generated C++ code use modern C++"
        https://bugs.webkit.org/show_bug.cgi?id=190714
        https://trac.webkit.org/changeset/262424

2020-06-02  Peng Liu  <peng.liu6@apple.com>

        Stressing webkitSetPresentationMode leads to wrong inline video dimensions
        https://bugs.webkit.org/show_bug.cgi?id=202425

        Reviewed by Eric Carlson.

        * WebProcess/cocoa/VideoFullscreenManager.mm:
        (WebKit::VideoFullscreenManager::didEnterFullscreen):
        (WebKit::VideoFullscreenManager::didCleanupFullscreen):

2020-06-02  Kate Cheney  <katherine_cheney@apple.com>

        Assert network process is not suspended when trying to merge new ITP data
        https://bugs.webkit.org/show_bug.cgi?id=212663
        <rdar://problem/63892899>

        Reviewed by Chris Dumez.

        Add a debug assert to check if statistics are being merged into the
        ITP database after prepareToSuspend() has been called. If this assert
        is hit, it means the ITP database thread is not being stopped when
        the process is suspended.

        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
        (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):

2020-06-02  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION(r261387): Introduced sandbox violations
        https://bugs.webkit.org/show_bug.cgi?id=212634

        Reviewed by Darin Adler.

        The change set r261387 introduced some new mach lookup sandbox violations, when attempting to close Launch Services connections that were not open.
        Fix this by only attempting to close open connections, and do it while holding the extension to the database mapping service.

        No new tests, since this patch is fixing benign sandbox violations.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

2020-06-02  Youenn Fablet  <youenn@apple.com>

        Allow using web processes for service workers even though they loaded about URLs
        https://bugs.webkit.org/show_bug.cgi?id=212464

        Reviewed by Chris Dumez.

        Before the patch, a web process that loads about:blank will not be able to run service workers.
        A web process that is running service workers and is loading an about:blank page will also kill its service workers.
        To prevent this, do not take into account about:blank URLs for the computation of the registrable domain of a process.

        Covered by API tests.

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

2020-06-02  Tim Horton  <timothy_horton@apple.com>

        macCatalyst: WKWebView's tint color is not propagated to Web Content process
        https://bugs.webkit.org/show_bug.cgi?id=212630

        Reviewed by Anders Carlsson.

        * Shared/WebPageCreationParameters.cpp:
        (WebKit::WebPageCreationParameters::encode const):
        (WebKit::WebPageCreationParameters::decode):
        * Shared/WebPageCreationParameters.h:
        * UIProcess/Cocoa/PageClientImplCocoa.h:
        * UIProcess/PageClient.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::creationParameters):
        * WebProcess/WebPage/WebPage.cpp:
        * WebProcess/WebPage/WebPage.h:

2020-06-02  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r258949): Dynamic user accent color changes are not respected by WKWebView
        https://bugs.webkit.org/show_bug.cgi?id=212628
        <rdar://problem/63436275>

        Reviewed by Per Arne Vollan.

        Two issues with the "CFPrefs Direct Mode" mechanism caused dynamic changes to the
        user accent color preference to not be respected anymore:

        - the default change, when synchronized to the Web Content process, was
        written into the wrong domain, because of bug 212627.

        - AppKit caches the resolved accent color; the cache is invalidated when the
        a CoreUI notification is posted. Since we synchronize preferences ourselves,
        the ordering of the default change and notification are no longer guaranteed,
        so AppKit sometimes reads and re-caches the old accent color.

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::userAccentColorPreferenceKey):
        (WebKit::shouldWriteToAppDomainForPreferenceKey):
        (WebKit::WebProcess::notifyPreferencesChanged):
        To fix the first problem, write the default into the standardUserDefaults.
        This is just a workaround, we need a more general solution to this problem
        for all global preferences. We know it's OK in this case, because AppKit
        happens to read from standardUserDefaults.

        (WebKit::dispatchSimulatedNotificationsForPreferenceChange):
        To fix the second problem, re-emit the notification once we have synchronized
        the preference to the Web Content process.

2020-06-02  Rob Buis  <rbuis@igalia.com>

        Make generated C++ code use modern C++
        https://bugs.webkit.org/show_bug.cgi?id=190714

        Reviewed by Sam Weinig.

        Replace typedef usage by alias-declaration.

        * Scripts/webkit/messages.py:

2020-06-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Implement data list drop down menu
        https://bugs.webkit.org/show_bug.cgi?id=212333

        Reviewed by Adrian Perez de Castro.

        Use a GtkPopover for GTK4 instead of a GtkMenu.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp:
        (WebKit::WebDataListSuggestionsDropdownGtk::WebDataListSuggestionsDropdownGtk):
        (WebKit::WebDataListSuggestionsDropdownGtk::~WebDataListSuggestionsDropdownGtk):
        (WebKit::WebDataListSuggestionsDropdownGtk::show):
        * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.h:

2020-06-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Make popup menus work
        https://bugs.webkit.org/show_bug.cgi?id=211178

        Reviewed by Adrian Perez de Castro.

        Use a GtkPopover for GTK4 instead of a GtkMenu.

        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createPopupMenuProxy):
        * UIProcess/API/gtk/WebKitPopupMenu.cpp:
        (WebKit::WebKitPopupMenu::WebKitPopupMenu):
        (WebKit::menuCloseCallback):
        (WebKit::WebKitPopupMenu::showPopupMenu):
        (WebKit::WebKitPopupMenu::hidePopupMenu):
        (WebKit::WebKitPopupMenu::cancelTracking):
        (WebKit::WebKitPopupMenu::activateItem):
        * UIProcess/API/gtk/WebKitPopupMenu.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSizeAllocate): Iterate children and call check_resize on every native one.
        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::treeViewButtonReleaseEventCallback):
        (WebKit::WebPopupMenuProxyGtk::createPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
        (WebKit::WebPopupMenuProxyGtk::hidePopupMenu):
        (WebKit::WebPopupMenuProxyGtk::treeViewRowActivatedCallback): Deleted.
        * UIProcess/gtk/WebPopupMenuProxyGtk.h:

2020-06-01  Chris Dumez  <cdumez@apple.com>

        Fix thread-safety issue in [WKProcessAssertionBackgroundTaskManager _handleBackgroundTaskExpiration]
        https://bugs.webkit.org/show_bug.cgi?id=212615
        <rdar://problem/63569049>

        Reviewed by Geoffrey Garen.

        [WKProcessAssertionBackgroundTaskManager _handleBackgroundTaskExpiration] may get called on a background thread
        by RunningBoard. When this happened it would check the _applicationIsBackgrounded flag on a background thread,
        which was not safe, it would also call _releaseBackgroundTask on the background thread which definitely was not
        safe and could lead to crashes such as the one in the radar.

        To address the issue, we now call callOnMainRunLoopAndWait() as soon as _handleBackgroundTaskExpiration gets
        called and run the whole implementation on the main thread. Previously, we were already doing a dispatch_sync()
        to the main thread but only for part of the implementation.

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

2020-06-01  Brent Fulgham  <bfulgham@apple.com>

        Remove unused WebContent process sandbox syscall
        https://bugs.webkit.org/show_bug.cgi?id=212609
        <rdar://problem/63764590>

        Reviewed by Per Arne Vollan.

        After further testing we have determined that the syscall added in
        Bug 206260 is not always enabled. Check if the Sandbox recognizes
        the rule before using it.

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

2020-06-01  David Kilzer  <ddkilzer@apple.com>

        Don't use casts to convert between WebCore::DragDestinationAction and {Web,WK}DragDestinationAction types
        <https://webkit.org/b/212507>

        Reviewed by Darin Adler.

        * Shared/API/Cocoa/_WKDragActionsInternal.h: Add.
        (WebKit::coreDragDestinationActionMask):
        - Add conversion function to avoid casting.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::draggingEntered):
        (WebKit::WebViewImpl::draggingUpdated):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
        - Make use of coreDragDestinationActionMask() conversion
          function.
        - Extract `dragOperationMask` varible for future updates.
        * WebKit.xcodeproj/project.pbxproj:
        - Add _WKDragActionsInternal.h to project.

2020-06-01  Alex Christensen  <achristensen@webkit.org>

        Fix Glib build after r262391
        https://bugs.webkit.org/show_bug.cgi?id=212604

        * UIProcess/API/glib/WebKitWebContext.cpp:
        (webkitWebContextConstructed):

2020-06-01  Alex Christensen  <achristensen@webkit.org>

        Revert r250312
        https://bugs.webkit.org/show_bug.cgi?id=212604
        <rdar://problem/63779241>

        Reviewed by Tim Horton.

        r250312 was a step towards a network process singleton.
        We aren't there yet, so revert it until we are.  There was something trying to keep HSTS storages separate, so let them keep trying.

        * UIProcess/API/APIProcessPoolConfiguration.cpp:
        (API::ProcessPoolConfiguration::copy):
        * UIProcess/API/APIProcessPoolConfiguration.h:
        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
        (-[_WKProcessPoolConfiguration setHSTSStorageDirectory:]):
        (-[_WKProcessPoolConfiguration hstsStorageDirectory]):
        * UIProcess/LegacyGlobalSettings.h:
        (WebKit::LegacyGlobalSettings::setHSTSStorageDirectory): Deleted.
        (WebKit::LegacyGlobalSettings::hstsStorageDirectory const): Deleted.
        * UIProcess/WebProcessPool.cpp:
        (WebKit::WebProcessPool::ensureNetworkProcess):

2020-06-01  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILURE (r220931): !m_function in ~CompletionHandler() after switch tabs
        https://bugs.webkit.org/show_bug.cgi?id=212537
        <rdar://problem/63766838>

        Reviewed by Alex Christensen.

        When WebPage::markAllLayersVolatile(), it would destroy m_pageMarkingLayersAsVolatileCounter,
        which may not have called its completion handler yet. As a result, we would hit an assertion
        in the CompletionHandler destructor.

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::callVolatilityCompletionHandlers):
        (WebKit::WebPage::markLayersVolatile):
        (WebKit::WebPage::cancelMarkLayersVolatile):
        * WebProcess/WebPage/WebPage.h:
        (WebKit::WebPage::markLayersVolatile):
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::prepareToSuspend):
        (WebKit::WebProcess::markAllLayersVolatile):
        (WebKit::WebProcess::cancelMarkAllLayersVolatile):
        * WebProcess/WebProcess.h:

2020-06-01  Sam Weinig  <weinig@apple.com>

        Extended Color: Replace Color constructors taking numeric values with type specific factory functions
        https://bugs.webkit.org/show_bug.cgi?id=212576

        Reviewed by Tim Horton.

        Replaces all remaining implicit and explicit uses of the Color constructors taking numeric
        values with explicit calls to makeSimpleColor/makeSimpleColorFromFloats/makeExtendedColor,
        giving us a consistent way to create colors. Also addes use constexpr SimpleColors where possible.

        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
        (WebKit::RemoteLayerBackingStore::drawInContext):
        * UIProcess/API/wpe/WebKitColor.cpp:
        (webkitColorToWebCoreColor):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _tapHighlightColorForFastClick:]):
        * WebProcess/Inspector/WebInspectorClient.cpp:
        (WebKit::WebInspectorClient::showPaintRect):
        * WebProcess/WebPage/FindController.cpp:
        (WebKit::FindController::drawRect):
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::paintSnapshotAtSize):
        * WebProcess/WebPage/ios/FindControllerIOS.mm:
        (WebKit::FindIndicatorOverlayClientIOS::drawRect):
        (WebKit::highlightColor): Deleted.

2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Add printing support
        https://bugs.webkit.org/show_bug.cgi?id=212320

        Reviewed by Adrian Perez de Castro.

        Printing API hasn't changed, the only problem was that we were using gtk_dialog_run() and gdk threads deprecated API.

        * UIProcess/API/gtk/WebKitPrintOperation.cpp:
        (webkitPrintOperationRunDialog): Remove GTK4 ifdefs.
        * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
        (WebKit::WebPrintOperationGtk::print): Use g_idle_add_full() instead of gdk threads deprecated API.

2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Wheel events are always handled by the main frame view
        https://bugs.webkit.org/show_bug.cgi?id=212593

        Reviewed by Adrian Perez de Castro.

        It's not possible scroll other scrollable areas with the mouse wheel. This is because we are using the given x,
        y delta in the scroll signal as the position. In GTK4 the scroll event doesn't include a position, so we have to
        use the last motion event.

        * Shared/NativeWebWheelEvent.h:
        * Shared/gtk/NativeWebWheelEventGtk.cpp:
        (WebKit::NativeWebWheelEvent::NativeWebWheelEvent): Add wheelTicks parameter.
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebWheelEvent): New create function that receives the wheelTicks.
        * Shared/gtk/WebEventFactory.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseScroll): Use the x, y parameters as the delta and take the position from the last motion event.

2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Monitor root window to update activity state
        https://bugs.webkit.org/show_bug.cgi?id=212581

        Reviewed by Adrian Perez de Castro.

        To update ActivityState::IsInWindow and ActivityState::WindowIsActive.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (toplevelWindowStateEvent):
        (webkitWebViewBaseSetToplevelOnScreenWindow):
        (webkitWebViewBaseDispose):
        (toplevelWindowIsActiveChanged):
        (toplevelWindowStateChanged):
        (toplevelWindowRealized):
        (toplevelWindowUnrealized):
        (webkitWebViewBaseRoot):
        (webkitWebViewBaseUnroot):
        (webkit_web_view_base_class_init):

2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Fix pointer lock in X11
        https://bugs.webkit.org/show_bug.cgi?id=212592

        Reviewed by Adrian Perez de Castro.

        I forgot to forward the motion events for X11 in GTK4.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (MotionEvent::MotionEvent): Add a constructor that receives the positions and state.
        (webkitWebViewBaseMotion): Notify the pointer lock manager about the event. Also save the last motion event and
        compute the movement delta.

2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Make inspector work
        https://bugs.webkit.org/show_bug.cgi?id=212321

        Reviewed by Adrian Perez de Castro.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRemoveDialog): Added instead of the generic webkitWebViewBaseRemoveChild that has been removed.
        (webkitWebViewBaseRemoveWebInspector): Just unparent the inspector view instead of caling webkitWebViewBaseRemoveChild.
        (webkitWebViewBaseDispose): Use specific functions to remove the children.
        (webkitWebViewBaseSnapshot): Call gtk_widget_snapshot_child() on inspector view if present.
        (webkitWebViewBaseRemoveChild): Deleted.
        * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp:
        (WebKit::RemoteWebInspectorProxy::platformSave): Remove GTK4 ifdefs.
        * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp:
        (WebKit::WebInspectorProxy::platformSave): Ditto.
        * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp:
        (webkit_inspector_window_init): Show title buttons in inspector window.
        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
        (WebKit::AcceleratedBackingStoreWayland::snapshot): Use the texture size instead of the view size, since it's
        different when the inspector is attached.

2020-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r262184): fast/forms/implicit-submission.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=212520

        Reviewed by Adrian Perez de Castro.

        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
        (WebKit::WebPopupMenuProxyGtk::activateSelectedItem): Return early if the popup has already been closed.

2020-06-01  Rob Buis  <rbuis@igalia.com>

        Rename ResourceResponseBase::isHTTP to isInHTTPFamily
        https://bugs.webkit.org/show_bug.cgi?id=208782

        Reviewed by Sam Weinig.

        Adapt to API change.

        * NetworkProcess/cache/NetworkCache.cpp:
        (WebKit::NetworkCache::makeStoreDecision):
        * WebProcess/Plugins/PluginView.cpp:
        (WebKit::buildHTTPHeaders):

2020-06-01  Michael Catanzaro  <mcatanzaro@gnome.org>

        [WPE][GTK] pthread_create() fails with EPERM in the second WebKitWebProcess with sandbox on
        https://bugs.webkit.org/show_bug.cgi?id=212380

        Reviewed by Adrian Perez de Castro.

        Dereference scmp_arg_cmp before use.

        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
        (WebKit::setupSeccomp):

2020-05-30  Alex Christensen  <achristensen@webkit.org>

        Deprecate WKBundlePostSynchronousMessage
        https://bugs.webkit.org/show_bug.cgi?id=212536

        Reviewed by Anders Carlsson.

        * WebProcess/InjectedBundle/API/c/WKBundle.h:

2020-05-30  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] WebDriver: stop using GdkEvent API in preparation for GTK4
        https://bugs.webkit.org/show_bug.cgi?id=212465

        Reviewed by Adrian Perez de Castro.

        Use the new internal API to synthesize events.

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSynthesizeKeyEvent): Add type parameter, since WebDriver can send press and release events
        separately. Also add a parameter to indicate that keyval should be translated according to current state that is
        required by WebDriver.
        * UIProcess/API/gtk/WebKitWebViewBaseInternal.h:
        * UIProcess/Automation/WebAutomationSession.cpp:
        (WebKit::WebAutomationSession::documentLoadedForFrame): Call resetClickCount().
        (WebKit::WebAutomationSession::updateClickCount): Update the click count for the given button position and
        maximum time and distance.
        (WebKit::WebAutomationSession::resetClickCount): Reset the click count.
        * UIProcess/Automation/WebAutomationSession.h:
        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
        (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Use webkitWebViewBaseSynthesizeMouseEvent().
        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Use webkitWebViewBaseSynthesizeKeyEvent().
        (WebKit::WebAutomationSession::platformSimulateKeySequence): Ditto.
        (WebKit::doMouseEvent): Deleted.
        (WebKit::doMotionEvent): Deleted.
        (WebKit::doKeyStrokeEvent): Deleted.
        * UIProcess/gtk/KeyBindingTranslator.cpp: Add missing key shortcuts to predefined list.

2020-05-29  Alex Christensen  <achristensen@webkit.org>

        Use correct encoding when converting a WTF::URL to CFURLRef
        https://bugs.webkit.org/show_bug.cgi?id=212486

        Reviewed by Darin Adler.

        * Shared/API/c/cf/WKURLCF.mm:
        (WKURLCopyCFURL):
        * Shared/cf/ArgumentCodersCF.cpp:
        (IPC::decode):

2020-05-29  Peng Liu  <peng.liu6@apple.com>

        Replace callOnMainThread() with callOnMainRunLoop() in AudioSessionRoutingArbitratorProxyCocoa.mm
        https://bugs.webkit.org/show_bug.cgi?id=212553

        Reviewed by Chris Dumez.

        Use callOnMainRunLoop() instead of callOnMainThread() in the UIProcess. Also move
        m_setupArbitrationOngoing flag to the end of the completion handler.

        No new tests, no functional change.

        * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
        (WebKit::SharedArbitrator::beginRoutingArbitrationForArbitrator):

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

        [Cocoa] Improve logging quality for non-ephemeral sessions
        https://bugs.webkit.org/show_bug.cgi?id=212551
        <rdar://problem/62461099>

        Reviewed by David Kilzer.

        In Bug 209522 I switched normal mode logging to use the same privacy-protecting mode we use for ephemeral sessions.
        This had the unintended consequence of removing network load data used to investigate networking issues.

        This patch adopts the more fine-grained logging provided by the low-level 'nw_context_privacy_level' setting.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::configurationForSessionID): Adopt 'nw_context_privacy_level' setting.

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

        [Apple Pay] Remove conditionals for ENABLE_APPLE_PAY_SESSION_V(3|4)
        https://bugs.webkit.org/show_bug.cgi?id=212541

        Reviewed by Darin Adler.

        APPLE_PAY_SESSION_V(3|4) is now enabled whenever APPLE_PAY itself is enabled.

        * Configurations/FeatureDefines.xcconfig:

2020-05-29  Dean Jackson  <dino@apple.com>

        iOS build fix.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::configurationForSessionID):

2020-05-29  Jer Noble  <jer.noble@apple.com>

        [Mac,WK2] Fullscreen animation missing a few frames at beginning
        https://bugs.webkit.org/show_bug.cgi?id=212156
        <rdar://problem/54799415>

        Reviewed by Eric Carlson.

        When starting the enter fullscreen animation, ensure that the fullscreen window is ordered front, and on top
        of the content, as well as having all the animations configured so that their starting state is in place before
        calling -[NSWindow enterFullscreenMode:]. Move all the window creation code into
        -beganEnterFullScreenWithInitialFrame:finalFrame: from _startEnterFullScreenAnimationWithDuration:. Re-use the
        existing zoomAnimation() and maskAnimation() utility methods, but give the animations a very long duration
        (since there is no explicit way to start and stop a CAAnimation). This initial animation will be replaced with
        the final one inside -_startEnterFullScreenAnimationWithDuration:. Separately, explictly disable implicit
        animations of the fullscreen window during -orderIn: and -orderOut:.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController initWithWindow:webView:page:impl:]):
        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
        (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):

2020-05-29  Jan-Michael Brummer  <jan.brummer@tabos.org>

        [GTK][WPE] API for WebView audio mute support
        https://bugs.webkit.org/show_bug.cgi?id=176119

        Reviewed by Michael Catanzaro.

        Test implemented in TestWebKitWebView.

        * UIProcess/API/glib/WebKitWebView.cpp:
        (webkitWebViewSetProperty):
        (webkitWebViewGetProperty):
        (webkit_web_view_class_init):
        (webkit_web_view_set_is_muted):
        (webkit_web_view_is_muted):
        * UIProcess/API/gtk/WebKitWebView.h:
        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
        * UIProcess/API/wpe/WebKitWebView.h:
        * UIProcess/API/wpe/docs/wpe-1.0-sections.txt:
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::isAudioMuted const):

2020-05-29  Darin Adler  <darin@apple.com>

        Remove things from FeatureDefines.xcconfig that are covered by PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=212418

        Rubber-stamped by Simon Fraser.

        * Configurations/FeatureDefines.xcconfig: Add back ENABLE_CSS_CONIC_GRADIENTS, removed
        by accident.

2020-05-29  Peng Liu  <peng.liu6@apple.com>

        ASSERT NOT REACHED in IPC::takeAsyncReplyHandler under WebKit::AudioSessionRoutingArbitrator::beginRoutingArbitrationWithCategory
        https://bugs.webkit.org/show_bug.cgi?id=212533

        Reviewed by Chris Dumez.

        When the m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting flag is set,
        sendWithAsyncReply() may actually send the message synchronously. Therefore, we have
        to set the async reply handler before actually sending the message.

        No new tests, fixing test crashes due to assertion failures.

        * Platform/IPC/Connection.h:
        (IPC::Connection::sendWithAsyncReply):

2020-05-27  Darin Adler  <darin@apple.com>

        Remove things from FeatureDefines.xcconfig that are covered by PlatformEnableCocoa.h
        https://bugs.webkit.org/show_bug.cgi?id=212418

        Reviewed by Andy Estes.

        * Configurations/FeatureDefines.xcconfig: Removed 83 of the 119 things defined in
        this file. There are 36 more that are slightly more complex that we can remove
        carefully later.

2020-05-29  Darin Adler  <darin@apple.com>

        [Cocoa] Pass all defines from Platform.h to various scripts, not just the ones from .xcconfig
        https://bugs.webkit.org/show_bug.cgi?id=212451

        Reviewed by Sam Weinig.

        * DerivedSources.make: Use ":=" when calling $(shell) to make sure the same shell
        command is not invoked over and over again.

2020-05-29  Keith Rollin  <krollin@apple.com>

        Revert switch to XCBuild
        https://bugs.webkit.org/show_bug.cgi?id=212530
        <rdar://problem/63764632>

        Unreviewed build fix.

        Bug 209890 enabled the use of XCBuild by default. Since then, some
        build issues have shown up. While addressing them, temporarily turn
        off the use of XCBuild by default.

        * Configurations/WebKit.xcconfig:
        * WebKit.xcodeproj/project.pbxproj:

2020-05-29  Devin Rousso  <drousso@apple.com>

        Web Inspector: add ITML debuggable/target type
        https://bugs.webkit.org/show_bug.cgi?id=203300
        <rdar://problem/56545896>

        Reviewed by Joseph Pecoraro and Brian Burg.

        * UIProcess/API/Cocoa/_WKInspectorDebuggableInfo.h:
        * UIProcess/API/Cocoa/_WKInspectorDebuggableInfoInternal.h:
        (fromWKInspectorDebuggableType):
        (toWKInspectorDebuggableType):
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
        * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
        (legacyDebuggableTypeToModernDebuggableType):

        * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
        (WebKit::parseDebuggableTypeFromString):

2020-05-29  Simon Fraser  <simon.fraser@apple.com>

        Prepare for async scrolling in passive wheel event handler regions
        https://bugs.webkit.org/show_bug.cgi?id=212455

        Reviewed by Tim Horton.

        Clarify the processing for wheel events by adding OptionSet<WheelEventProcessingSteps>,
        which will, in future, allow us to describe the processing for an event in the passive
        event handler region which does scrolling on the scrolling thread, and is then sent
        to the main thread for DOM event dispatch.
        
        Removed ScrollingEventResult, which conflated "handled" with "send to another thread".
        The thread sending behavior is now encoded in the WheelEventProcessingSteps, and we can just
        use a bool for handled.
        
        Scrolling tree and node handleWheelEvent() functions return a WheelEventHandlingResult, which
        is a tuple of OptionSet<WheelEventProcessingSteps> and 'handled', allowing for a node with
        background-attachment:fixed to add the "send to main thread" processing step.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::handleWheelEvent):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
        (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
        (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.h:
        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):

2020-05-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Implement HTTP auth dialog
        https://bugs.webkit.org/show_bug.cgi?id=212319

        Reviewed by Sergio Villar Senin.

        * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
        (webkitAuthenticationDialogDestroy):
        (okButtonClicked):
        (cancelButtonClicked):
        (authenticationCancelled):
        (webkitAuthenticationDialogInitialize):
        (webkitAuthenticationDialogMap):
        (webkitAuthenticationDialogDispose):
        (webkitAuthenticationDialogNew):
        * UIProcess/API/gtk/WebKitAuthenticationDialog.h:
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (webkitWebViewAuthenticate):

2020-05-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK4] Implement script dialogs
        https://bugs.webkit.org/show_bug.cgi?id=212318

        Reviewed by Adrian Perez de Castro.

        Adapt to the GTK4 API and theme changes.

        * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp:
        (webkitScriptDialogImplClose):
        (webkitScriptDialogImplKeyPressed):
        (webkitScriptDialogImplMap):
        (webkitScriptDialogImplConstructed):
        (webkitScriptDialogImplDispose):
        (webkit_script_dialog_impl_class_init):
        (webkitScriptDialogImplAddButton):
        (webkitScriptDialogImplNew):
        (webkitScriptDialogImplSetEntryText):
        * UIProcess/API/gtk/WebKitScriptDialogImpl.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseAddDialog):
        (webkitWebViewBaseRemoveChild):
        (webkitWebViewBaseSnapshot):
        * UIProcess/API/gtk/WebKitWebViewDialog.cpp:
        (webkitWebViewDialogSnapshot):
        (webkitWebViewDialogSizeAllocate):
        (webkitWebViewDialogConstructed):
        (webkit_web_view_dialog_class_init):
        (webkitWebViewDialogSetChild):
        (webkitWebViewDialogGetChild):
        * UIProcess/API/gtk/WebKitWebViewDialog.h:
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
        (webkitWebViewScriptDialog):

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

        REGRESSION (r261812): editing/async-clipboard/clipboard-item-get-type-basic.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=212281
        <rdar://problem/63554912>

        Reviewed by Tim Horton.

        Declare `-delegateSupportsImagePaste` on UIKeyboardImpl.

        * Platform/spi/ios/UIKitSPI.h:

2020-05-28  Peng Liu  <peng.liu6@apple.com>

        Clean up WebKit.xcodeproj/project.pbxproj
        https://bugs.webkit.org/show_bug.cgi?id=212491

        Reviewed by Tim Horton.

        A follow-up patch to add AudioSessionRoutingArbitratorProxyCocoa.mm to the unified build.

        * SourcesCocoa.txt:
        * WebKit.xcodeproj/project.pbxproj:
        Add AudioSessionRoutingArbitratorProxyCocoa.mm to the unified build.

        * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
        Fix a unified build failure.

2020-05-28  Megan Gardner  <megan_gardner@apple.com>

        Avoid unnecessary sync IPC messages when togging the callout bar for selections.
        https://bugs.webkit.org/show_bug.cgi?id=212508

        The loupe gesture only needs to be activated and evaluated if the tap is inside
        an existing selectionView. We can do that test in the UIProcess without resorting to a sync IPC message.
        Doing that evaluation locally will eliminate unnecessary hangs in the UIProcess.

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView _pointIsInsideSelectionRect:outBoundingRect:]):
        (-[WKContentView _shouldToggleSelectionCommandsAfterTapAt:]):
        (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):

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

        Fix the macOS build

        * WebKit.xcodeproj/project.pbxproj:
        Can't have this file in both the Xcode target and SourcesCocoa.txt...

2020-05-28  Lauro Moura  <lmoura@igalia.com>

        [GTK][WPE] Buildfix after r262242

        Unreviewed build fix.

        * Shared/glib/ArgumentCodersGLib.cpp:
        (IPC::decode):

2020-05-28  Jonathan Bedard  <jbedard@apple.com>

        watchOS: Upstream WKNumberPadView
        https://bugs.webkit.org/show_bug.cgi?id=212499
        <rdar://problem/63736073>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/forms/WKNumberPadView.h: Moved from WebKitAdditions.
        * UIProcess/ios/forms/WKNumberPadView.mm: Ditto.

2020-05-28  Jonathan Bedard  <jbedard@apple.com>

        watchOS: Upstream WKTextInputListViewController
        https://bugs.webkit.org/show_bug.cgi?id=212495
        <rdar://problem/63733949>

        Reviewed by Wenson Hsieh.

        * UIProcess/ios/forms/WKTextInputListViewController.h: Moved from WebKitAdditions.
        * UIProcess/ios/forms/WKTextInputListViewController.mm: Ditto.

2020-05-28  Simon Fraser  <simon.fraser@apple.com>

        Simplify EventDispatcher wheel event dispatch
        https://bugs.webkit.org/show_bug.cgi?id=212490

        Reviewed by Tim Horton.

        The various cross-thread bounces and completion lambdas in EventDispatcher::wheelEvent()
        and ScrollingTree code made the logic very hard to follow.

        Moving the ScrollingThread::dispatch() into EventHandler code simplifies things a little,
        and allows for removal of the hokey "try to handle" ScrollingTree function, as well
        as the clunky completion function.

        Now, EventHandler call shouldHandleWheelEventSynchronously(), then does the
        ScrollingThread::dispatch() which allows the lambda to easily call back into
        EventHandler for the main thread dispatch.

        RemoteScrollingCoordinatorProxy/RemoteLayerTree code is unused at present, and
        will need work.

        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
        (WebKit::RemoteScrollingCoordinatorProxy::handleWheelEvent):
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
        (WebKit::RemoteScrollingTree::tryToHandleWheelEvent): Deleted.
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
        * WebProcess/WebPage/EventDispatcher.cpp:
        (WebKit::EventDispatcher::wheelEvent):
        (WebKit::EventDispatcher::dispatchWheelEventViaMainThread):
        * WebProcess/WebPage/EventDispatcher.h:

2020-05-28  Peng Liu  <peng.liu6@apple.com>

        Clean up WebKit.xcodeproj/project.pbxproj
        https://bugs.webkit.org/show_bug.cgi?id=212491

        Reviewed by Simon Fraser.

        Remove the references to deleted files and merge duplicated folders.

        * WebKit.xcodeproj/project.pbxproj:

2020-05-28  Kate Cheney  <katherine_cheney@apple.com>

        Minimum user interaction time in ResourceLoadStatistics should handle the case of -1
        https://bugs.webkit.org/show_bug.cgi?id=212445
        <rdar://problem/63696470>

        Reviewed by John Wilander.

        Tests: http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction-database.html
               http/tests/resourceLoadStatistics/operating-dates-all-but-cookies-removed-statistics-with-no-user-interaction.html

        Adds a getter for mostRecentUserInteractionTime which returns WTF::nullopt if the 
        timestamp is -1. Then does not consider this case in calculating the
        minimum timestamp.

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
        (WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentUserInteractionTime):
        (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
        Flip sign to be less than, so we hold off on deleting data if the
        oldest interaction was less than the minimum time between removal. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
        (WebKit::ResourceLoadStatisticsMemoryStore::getMostRecentUserInteractionTime):
        (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
        Flip sign to be less than, so we hold off on deleting data if the
        oldest interaction was less than the minimum time between removal. 

        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:

2020-05-28  Megan Gardner  <megan_gardner@apple.com>

        Do not send a second sync request for positition information to the web process if we have not recieved information since the previous sync request.
        https://bugs.webkit.org/show_bug.cgi?id=212289
        <rdar://problem/58494578>

        Reviewed by Tim Horton.

        If we have sent a sync requests to the web process for position information, and timed out, and have not
        received a message with position information in the interim, do not send another sync request. The web
        process is likely still hung, and there is no reason to hang the UIProcess again if we suspect that it
        is unlikely that we will receive a reply.

        * UIProcess/ios/WKContentViewInteraction.h:
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView cleanUpInteraction]):
        (-[WKContentView ensurePositionInformationIsUpToDate:]):
        (-[WKContentView _positionInformationDidChange:]):

2020-05-28  Youenn Fablet  <youenn@apple.com>

        ReadableByteStream should be enabled/disabled in service workers as done in pages
        https://bugs.webkit.org/show_bug.cgi?id=212466

        Reviewed by Alex Christensen.

        Introduce a WebPreference for readable byte stream.
        Use it for enabling it in web processes running service workers as per the given store.

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

2020-05-28  Michael Catanzaro  <mcatanzaro@gnome.org>

        [WPE][GTK] GVariant decoding must copy the serialized data
        https://bugs.webkit.org/show_bug.cgi?id=212441

        Reviewed by Carlos Garcia Campos.

        I tracked this down to ArgumentCodersGLib.cpp. The problem is that we construct a GVariant
        using g_variant_new_from_data(), which does not copy or take ownership of the data, so here
        we accidentally create the GVariant using data we don't own. (Here, the data is owned by the
        Decoder itself in its internal m_buffer.) Anyway, this is fixable by manually copying and
        freeing it with the GDestroyNotify parameter, but it's easier to switch to
        g_variant_new_from_bytes() because GBytes takes ownership when constructed.

        * Shared/glib/ArgumentCodersGLib.cpp:
        (IPC::decode):

2020-05-28  Youenn Fablet  <youenn@apple.com>

        RemoteAudio::audioSamplesAvailable should check for m_buffer to be null
        https://bugs.webkit.org/show_bug.cgi?id=212462
        <rdar://problem/63627642>

        Reviewed by Eric Carlson.

        * WebProcess/cocoa/RemoteCaptureSampleManager.cpp:
        (WebKit::RemoteCaptureSampleManager::RemoteAudio::audioSamplesAvailable):
        m_buffer is initialized by a StorageChanged IPC message which might not always be successful, for instance if the shared memory mapping fails.
        Return early if m_buffer is not yet initialized properly.

2020-05-28  Youenn Fablet  <youenn@apple.com>

        RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp
        https://bugs.webkit.org/show_bug.cgi?id=212402

        Reviewed by Eric Carlson.

        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp:
        (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample):
        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:

2020-05-27  Keith Rollin  <krollin@apple.com>

        Add output file specifications to "Copy Custom WebContent Resources to Framework Private Headers" build phase in WebKit/WebContent
        https://bugs.webkit.org/show_bug.cgi?id=212452
        <rdar://problem/63700546>

        Reviewed by Timothy Hatcher.

        The "Copy Custom WebContent Resources to Framework Private Headers"
        build phase in the WebContent target of the WebKit project doesn't
        advertise the files that it produces. This has consequences on later
        build phases that consume those files. In particular, XCBuild is left
        not knowing where those files are coming from, and it fails saying
        that those files don't exist. Fix this by adding the output files to
        the "output files" section of the custom build phase.

        No new tests -- this is just a build fix.

        * WebKit.xcodeproj/project.pbxproj:

2020-05-27  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (PSON): Resizing WKWebView during cross-site navigation results in the page laying out at the wrong size
        https://bugs.webkit.org/show_bug.cgi?id=212434
        <rdar://problem/51621621>

        Reviewed by Chris Dumez.

        New API test: ProcessSwap.ResizeWebViewDuringCrossSiteProvisionalNavigation.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::swapToProvisionalPage):
        Set m_hasRunningProcess before calling setDrawingArea, instead of immediately after,
        so that setDrawingArea can call methods that check m_hasRunningProcess.

        (WebKit::WebPageProxy::setDrawingArea):
        When swapping DrawingAreas, push the current view size down. DrawingArea
        is initially created with a size, but the size can change while the DrawingArea
        is still provisional.

        * UIProcess/ios/PageClientImplIOS.mm:
        (WebKit::PageClientImpl::viewSize):
        Simplify this implementation now that we don't ever need to support WKContentView
        outside of WKWebView (since 2014 or so).

2020-05-27  Michael Catanzaro  <mcatanzaro@gnome.org>

        REGRESSION(r260318): [WPE][GTK] Uninitialized memory read in MemoryPressureMonitor
        https://bugs.webkit.org/show_bug.cgi?id=212412

        Reviewed by Adrian Perez de Castro.

        I think this is a false-positive, but let's suppress the warning by zero-initializing this
        buffer.

        * UIProcess/linux/MemoryPressureMonitor.cpp:
        (WebKit::systemMemoryUsedAsPercentage):

2020-05-27  Kate Cheney  <katherine_cheney@apple.com>

        App-bound sessions should be for iOS only
        https://bugs.webkit.org/show_bug.cgi?id=212426
        <rdar://problem/63678147>

        Reviewed by Darin Adler.

        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
        (WebKit::SessionWrapper::initialize):
        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):

2020-05-27  Lauro Moura  <lmoura@igalia.com>

        [WPE] Avoid possible WTR event timing going back in time and fix conversion from s to ms
        https://bugs.webkit.org/show_bug.cgi?id=212338

        Reviewed by Michael Catanzaro.

        When converting the input timestamps to WallTime, we must somehow
        adjust them to give meaningful timestamps (due to Dom::Event
        conversion from timestamp wall time to the time origin from document
        loading).

        As WPE timestamps are just intended to be compared among themselves,
        we use the first processed event as the origin, comparing the
        following events to it to get an actual time.

        Test: fast/events/monotonic-event-time.html

        * Shared/libwpe/WebEventFactory.cpp:
        (WebKit::wallTimeForEventTime):

2020-05-27  Kate Cheney  <katherine_cheney@apple.com>

        Make sure bundle identifier testing override is set in the network process
        https://bugs.webkit.org/show_bug.cgi?id=212288
        <rdar://problem/63539061>

        Reviewed by Chris Dumez.

        Set the bundle identifier in the network process if a layout test
        updates it. This value usually only gets updated when a new network
        process is initialized, which does not happen for every test. So it
        should be set/cleared as needed.

        No new tests, will fix http/tests/in-app-browser-privacy/ tests.

        * NetworkProcess/NetworkProcess.cpp:
        (WebKit::NetworkProcess::updateBundleIdentifierInNetworkProcess):
        * NetworkProcess/NetworkProcess.h:
        * NetworkProcess/NetworkProcess.messages.in:
        * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
        (WKWebsiteDataStoreUpdateBundleIdentifierInNetworkProcess):
        * UIProcess/API/C/WKWebsiteDataStoreRef.h:
        * UIProcess/Network/NetworkProcessProxy.cpp:
        (WebKit::NetworkProcessProxy::updateBundleIdentifierInNetworkProcess):
        * UIProcess/Network/NetworkProcessProxy.h:
        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
        (WebKit::WebsiteDataStore::updateBundleIdentifierInNetworkProcess):
        * UIProcess/WebsiteData/WebsiteDataStore.h:

2020-05-27  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed, reverting r260840.

        This patch is no longer needed after preferences root cause
        has been fixed.

        Reverted changeset:

        "[Cocoa] Global preferences are not accessible in the
        WebContent process when CFPrefs direct mode is enabled"
        https://bugs.webkit.org/show_bug.cgi?id=211075
        https://trac.webkit.org/changeset/260840

2020-05-27  Michael Catanzaro  <mcatanzaro@gnome.org>

        Unreviewed, fix -Wcomment build warning after r261986
        https://bugs.webkit.org/show_bug.cgi?id=211950
        <rdar://problem/63482718>

        If we replace the /* with /&ast; then GCC won't complain that it looks like a comment.

        * UIProcess/API/glib/WebKitSettings.cpp:
        (webkit_settings_class_init):

2020-05-27  Brent Fulgham  <bfulgham@apple.com>

        Adjust HTTP3 label to the more correct HTTP/3
        https://bugs.webkit.org/show_bug.cgi?id=212416
        <rdar://problem/63514072>

        Reviewed by Darin Adler.

        No new tests. No change in behavior.

        * Shared/WebPreferences.yaml: Correct label.

2020-05-27  Devin Rousso  <drousso@apple.com>

        Web Inspector: replace `featureGuard` and `availability` with a combined `condition` that accepts any macro
        https://bugs.webkit.org/show_bug.cgi?id=210014

        Reviewed by Brian Burg.

        Previously, the generated InspectorBackendCommands.js would include code for things that the
        backend doesn't actually support. By using actual macros and preprocessing that file, we can
        ensure that the frontend doesn't incorrectly think that something is supported by the page
        being inspected:
         - the `Canvas` commands and events related to shader programs/pipelines should only exist
           when the corresponding context type exists, namely `ENABLE(WEBGL)` and `ENABLE(WEBGPU)`.
         - iOS doesn't support showing rulers, so create a variant of `DOM.setInspectModeEnabled`
           that only exists for `PLATFORM(IOS_FAMILY)` that doesn't have the `showRulers` optional
           parameter, as well as removing `Page.setShowRulers` entirely.
         - setting the forced appearance should only be possible if dark mode is supported.
         - web archives only exist if CF is used.

        * Configurations/FeatureDefines.xcconfig:
        Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.

        * DerivedSources.make:
        * PlatformMac.cmake:
        Remove `platform` as it is handled by `condition`.

        * UIProcess/Automation/Automation.json:

2020-05-27  Zalan Bujtas  <zalan@apple.com>

        [Quirk] Remove stackoverflow.com desktop content quirk.
        https://bugs.webkit.org/show_bug.cgi?id=212414

        Reviewed by Antti Koivisto.

        Mobile content is fixed now.

        * UIProcess/ios/WebPageProxyIOS.mm:
        (WebKit::desktopClassBrowsingRecommendedForRequest):

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

        Crash under WebNotificationManager::removeNotificationFromContextMap()
        https://bugs.webkit.org/show_bug.cgi?id=212410
        <rdar://63496726>

        Reviewed by Alex Christensen.

        Protect the notification object in WebNotificationManager::didDestroyNotification() since
        removing it from m_notificationIDMap will deref it and may end up destroying the notification
        object otherwise.

        Test: http/tests/notifications/crash-on-navigation.html

        * WebProcess/Notifications/WebNotificationManager.cpp:
        (WebKit::WebNotificationManager::didDestroyNotification):

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

        Unreviewed. [GTK] Make webkitWebViewBaseSnapshot static

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseSnapshot):

2020-05-27  David Kilzer  <ddkilzer@apple.com>

        Use OptionSet<DragDestinationAction> for mask values
        <https://webkit.org/b/212115>
        <rdar://problem/63423380>

        Reviewed by Alex Christensen.

        * Shared/WebCoreArgumentCoders.cpp:
        (IPC::ArgumentCoder<DragData>::encode):
        (IPC::ArgumentCoder<DragData>::decode):
        - Switch from decodeEnum() and encodeEnum() to modern
          equivalents that check for valid enum values.
        * UIProcess/Cocoa/WebViewImpl.mm:
        (WebKit::WebViewImpl::draggingEntered):
        (WebKit::WebViewImpl::draggingUpdated):
        * UIProcess/ios/WKContentViewInteraction.mm:
        (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
        * WebProcess/WebCoreSupport/WebDragClient.cpp:
        (WebKit::WebDragClient::willPerformDragDestinationAction):

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

        [GTK4] Make PointerLock work
        https://bugs.webkit.org/show_bug.cgi?id=212314

        Reviewed by Adrian Perez de Castro.

        Use XLib API for warp and grab, since they are no longer available in GTK4. The grab was not actuially needed
        under Wayland. Also stop using GdkEvent to keep track of motion events and create the PointerLockManager to be
        able to test pointer lock and movement delta.

        * Shared/NativeWebMouseEvent.h:
        * Shared/gtk/NativeWebMouseEventGtk.cpp:
        (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Use FloatSize instead of FloatPoint for movement delta.
        * Shared/gtk/WebEventFactory.cpp:
        (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
        * Shared/gtk/WebEventFactory.h:
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (MotionEvent::MotionEvent): Helper struct to keep track of motion events without using GdkEvent.
        (MotionEvent::delta): Return the movement delta for the given current event.
        (webkitWebViewBaseHandleMouseEvent): Use MotionEvent instead of GdkEvent.
        (webkitWebViewBaseMotionNotifyEvent): Pass the event coordinates to the pointer lock manager since that's the
        only thing needed.
        (webkitWebViewBaseRequestPointerLock): Use MotionEvent instead of GdkEvent.
        (webkitWebViewBaseDidLosePointerLock): Remove GTK4 ifdefs.
        (webkitWebViewBaseSynthesizeMouseEvent): Forward the event to the pointer lock manager if present. Also keep
        track of the motion event and set the movement delta.
        * UIProcess/gtk/PointerLockManager.cpp:
        (WebKit::PointerLockManager::create): Receive event information as parameters instead of using GdkEvent.
        (WebKit::PointerLockManager::PointerLockManager): Ditto.
        (WebKit::PointerLockManager::~PointerLockManager):
        (WebKit::PointerLockManager::lock): Remove the grab.
        (WebKit::PointerLockManager::unlock): Remove the ungrab.
        (WebKit::PointerLockManager::handleMotion): Use NativeWebMouseEvent constructor taking all information as parameters.
        * UIProcess/gtk/PointerLockManager.h:
        * UIProcess/gtk/PointerLockManagerWayland.cpp:
        (WebKit::PointerLockManagerWayland::PointerLockManagerWayland): Receive event information as parameters instead of using GdkEvent.
        (WebKit::PointerLockManagerWayland::lock): Hide the cursor.
        (WebKit::PointerLockManagerWayland::unlock): Unhide the cursor.
        * UIProcess/gtk/PointerLockManagerWayland.h:
        * UIProcess/gtk/PointerLockManagerX11.cpp:
        (WebKit::PointerLockManagerX11::PointerLockManagerX11): Receive event information as parameters instead of using GdkEvent.
        (WebKit::PointerLockManagerX11::lock): Use XGrabPointer.
        (WebKit::PointerLockManagerX11::unlock): Use XUngrabPointer.
        (WebKit::PointerLockManagerX11::didReceiveMotionEvent): Use XWarpPointer.
        * UIProcess/gtk/PointerLockManagerX11.h:

2020-05-27  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, build warning fix after r261986

        * UIProcess/API/glib/WebKitSettings.cpp: A colon is needed after the transfer annotation.

2020-05-27  Peng Liu  <peng.liu6@apple.com>

        VideoFullscreenInterfaceAVKit is leaking when a video element enters and exits fullscreen/picture-in-picture
        https://bugs.webkit.org/show_bug.cgi?id=212293

        VideoFullscreenManagerProxy::ensureInterface() makes sure a fullscreen interface object exists (an object
        will be created if it does not exit). That means an extra object will be created by an IPC message from
        the Web process after the original video fullscreen interface object has been destroyed (thats happens
        when a video element is returning to inline from fullscreen or picture-in-picture).

        Reviewed by Youenn Fablet.

        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
        (WebKit::VideoFullscreenManagerProxy::setHasVideo):
        Don't call VideoFullscreenInterface[AVKit|Mac]::hasVideoCh