Title: [284484] branches/safari-613.1.6-branch
Revision
284484
Author
repst...@apple.com
Date
2021-10-19 13:05:16 -0700 (Tue, 19 Oct 2021)

Log Message

Cherry-pick r284483. rdar://problem/84428759

    LayoutTests/imported/w3c:
    Origin of opaque blob: URLs ends up as empty string
    https://bugs.webkit.org/show_bug.cgi?id=231942

    Patch by Alex Christensen <achristen...@webkit.org> on 2021-10-19
    Reviewed by Tim Horton.

    * web-platform-tests/url/a-element-expected.txt:
    * web-platform-tests/url/a-element-origin-expected.txt:
    * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
    * web-platform-tests/url/a-element-xhtml-expected.txt:
    * web-platform-tests/url/resources/urltestdata.json:
    * web-platform-tests/url/url-constructor.any-expected.txt:
    * web-platform-tests/url/url-constructor.any.worker-expected.txt:
    * web-platform-tests/url/url-origin.any-expected.txt:
    * web-platform-tests/url/url-origin.any.worker-expected.txt:

    Source/WebCore:
    Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
    <https://webkit.org/b/231902>
    <rdar://problem/84375203>

    Patch by David Kilzer <ddkil...@apple.com> on 2021-10-19
    Reviewed by Wenson Hsieh.

    * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
    (WebCore::FilterEffectRendererCoreImage::sharedCIContext):
    - Use adoptCF() to fix the leak.

    Source/WebKit:
    REGRESSION (r284079): fast/canvas/gradient-with-clip.html and fast/canvas/gradient-text-with-shadow.html are flaky failures
    https://bugs.webkit.org/show_bug.cgi?id=231681
    rdar://84202478

    Patch by Wenson Hsieh <wenson_hs...@apple.com> on 2021-10-19
    Reviewed by Kimmo Kinnunen.

    These tests occasionally fail when we time out while waiting for the pixel buffer to be populated underneath
    `RemoteImageBufferProxy::getPixelBuffer`; this happens because the GPU process sometimes halts (and never
    resumes) while processing stream messages, and consequently never ends up processing the GetPixelBuffer IPC
    stream message that's necessary to populate the shared memory buffer for GetPixelBuffer.

    This, in turn, happens when the IPC stream buffer is about to exhaust all available capacity (i.e. the write
    cursor is nearing the end of the 2MB buffer), and as a result, we send messages that would normally be encoded
    in the IPC stream as out-of-line IPC messages instead, which are received in the GPU process on the IPC thread
    and appended to the receive queue corresponding to the destination ID in `Connection::processIncomingMessage()`.

    If we happen to have sent `RemoteRenderingBackend::CreateImageBuffer(a)` right before exhausting capacity and
    sending out-of-line messages targeting the RemoteDisplayListRecorder corresponding to the newly created image
    buffer `a`, we'll end up with a race condition where the IPC thread may receive the out-of-line messages meant
    for the new remote display list destination *before* the new remote display list has added itself as an IPC
    receive queue by calling into `StreamServerConnection::startReceivingMessages()`.

    In this particular scenario (where we "lose" the race), `Connection::processIncomingMessage` will skip past the
    early return where it would normally find its corresponding receive queue via `m_receiveQueues.get(*message)`,
    and instead falls through to `Connection::SyncMessageState::processIncomingMessage()`, which will attempt to
    dispatch the incoming message to the Connection's client (GPUConnectionToWebProcess). Of course, the
    GPUConnectionToWebProcess isn't aware of how to process this incoming message, so it simply gets dropped. By the
    time the receive queue is added for the new RemoteDisplayListRecorder, we'll observe a ProcessOutOfStreamMessage
    and end up waiting forever for this out-of-line message to be added to the receive queue, but this never ends up
    happening because it has already been received and dropped by GPUConnectionToWebProcess.

    To address the flaky tests in the short term, we work around this issue by making `CreateImageBuffer` a sync
    message, so we guarantee that any subsequent messages sent to the image buffer's RemoteDisplayListRecorder will
    not be dropped. In the (slightly) longer term, we should turn this back into an async stream message, and add a
    mechanism to redirect all receiver-less RemoteDisplayListRecorder messages to a separate queue.

    * GPUProcess/graphics/RemoteRenderingBackend.cpp:
    (WebKit::RemoteRenderingBackend::createImageBuffer):
    * GPUProcess/graphics/RemoteRenderingBackend.h:
    * GPUProcess/graphics/RemoteRenderingBackend.messages.in:

    Make `CreateImageBuffer` a synchronous stream message for now.

    * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
    (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer):

    LayoutTests:
    Resync web-platform-tests/reporting from upstream
    https://bugs.webkit.org/show_bug.cgi?id=231957

    Reviewed by Alex Christensen.

    Resync web-platform-tests/reporting from upstream 207e223d74fdc1f1.

    * TestExpectations:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284483 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Removed Paths

Diff

Modified: branches/safari-613.1.6-branch/LayoutTests/ChangeLog (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/ChangeLog	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/ChangeLog	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,93 +1,186 @@
 2021-10-19  Alan Coon  <alanc...@apple.com>
 
-        Cherry-pick r284466. rdar://problem/84424869
+        Cherry-pick r284483. rdar://problem/84428759
 
-    REGRESSION(r284313): ::marker accelerated animations are broken
-    https://bugs.webkit.org/show_bug.cgi?id=231906
-    <rdar://problem/84383279>
-    
-    Reviewed by Antti Koivisto.
-    
     LayoutTests/imported/w3c:
+    Origin of opaque blob: URLs ends up as empty string
+    https://bugs.webkit.org/show_bug.cgi?id=231942
     
-    WPT now reflect that we correctly do not animate the opacity property and correctly account for
-    other ineffective properties on ::marker, such as line-height.
+    Patch by Alex Christensen <achristen...@webkit.org> on 2021-10-19
+    Reviewed by Tim Horton.
     
-    * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
-    * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+    * web-platform-tests/url/a-element-expected.txt:
+    * web-platform-tests/url/a-element-origin-expected.txt:
+    * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
+    * web-platform-tests/url/a-element-xhtml-expected.txt:
+    * web-platform-tests/url/resources/urltestdata.json:
+    * web-platform-tests/url/url-constructor.any-expected.txt:
+    * web-platform-tests/url/url-constructor.any.worker-expected.txt:
+    * web-platform-tests/url/url-origin.any-expected.txt:
+    * web-platform-tests/url/url-origin.any.worker-expected.txt:
     
     Source/WebCore:
+    Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
+    <https://webkit.org/b/231902>
+    <rdar://problem/84375203>
     
-    Test: webanimations/marker-opacity-animation-no-effect.html
+    Patch by David Kilzer <ddkil...@apple.com> on 2021-10-19
+    Reviewed by Wenson Hsieh.
     
-    We incorrectly supported animations for all known CSS properties on a ::marker since we added
-    support for animation of ::marker, and with r284313 we started returning the correct renderer
-    for ::marker pseudo-elements which meant that accelerated opacity animations started running
-    for the first time.
+    * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+    (WebCore::FilterEffectRendererCoreImage::sharedCIContext):
+    - Use adoptCF() to fix the leak.
     
-    We now correctly ignore disallowed properties for ::marker when animating with those changes.
+    Source/WebKit:
+    REGRESSION (r284079): fast/canvas/gradient-with-clip.html and fast/canvas/gradient-text-with-shadow.html are flaky failures
+    https://bugs.webkit.org/show_bug.cgi?id=231681
+    rdar://84202478
     
-    First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
-    authorDeclarations when adding the keyframe properties.
+    Patch by Wenson Hsieh <wenson_hs...@apple.com> on 2021-10-19
+    Reviewed by Kimmo Kinnunen.
     
-    Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
-    case we're being called for a ::marker pseudo-element.
+    These tests occasionally fail when we time out while waiting for the pixel buffer to be populated underneath
+    `RemoteImageBufferProxy::getPixelBuffer`; this happens because the GPU process sometimes halts (and never
+    resumes) while processing stream messages, and consequently never ends up processing the GetPixelBuffer IPC
+    stream message that's necessary to populate the shared memory buffer for GetPixelBuffer.
     
-    To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
-    we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+    This, in turn, happens when the IPC stream buffer is about to exhaust all available capacity (i.e. the write
+    cursor is nearing the end of the 2MB buffer), and as a result, we send messages that would normally be encoded
+    in the IPC stream as out-of-line IPC messages instead, which are received in the GPU process on the IPC thread
+    and appended to the receive queue corresponding to the destination ID in `Connection::processIncomingMessage()`.
     
-    * Sources.txt:
-    * WebCore.xcodeproj/project.pbxproj:
-    * animation/KeyframeEffect.cpp:
-    (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
-    * style/ElementRuleCollector.cpp:
-    (WebCore::Style::ElementRuleCollector::transferMatchedRules):
-    * style/ElementRuleCollector.h:
-    * style/PropertyAllowlist.cpp: Added.
-    (WebCore::Style::propertyAllowlistForPseudoId):
-    (WebCore::Style::isValidMarkerStyleProperty):
-    (WebCore::Style::isValidCueStyleProperty):
-    * style/PropertyAllowlist.h: Added.
-    * style/PropertyCascade.cpp:
-    (WebCore::Style::PropertyCascade::addMatch):
-    (WebCore::Style::isValidMarkerStyleProperty): Deleted.
-    (WebCore::Style::isValidCueStyleProperty): Deleted.
-    * style/RuleData.cpp:
-    (WebCore::Style::determinePropertyAllowlist):
-    (WebCore::Style::RuleData::RuleData):
-    (WebCore::Style::determinePropertyAllowlistType): Deleted.
-    * style/RuleData.h:
-    (WebCore::Style::RuleData::propertyAllowlist const):
-    (): Deleted.
-    (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
-    * style/StyleResolver.cpp:
-    (WebCore::Style::Resolver::styleForKeyframe):
+    If we happen to have sent `RemoteRenderingBackend::CreateImageBuffer(a)` right before exhausting capacity and
+    sending out-of-line messages targeting the RemoteDisplayListRecorder corresponding to the newly created image
+    buffer `a`, we'll end up with a race condition where the IPC thread may receive the out-of-line messages meant
+    for the new remote display list destination *before* the new remote display list has added itself as an IPC
+    receive queue by calling into `StreamServerConnection::startReceivingMessages()`.
     
+    In this particular scenario (where we "lose" the race), `Connection::processIncomingMessage` will skip past the
+    early return where it would normally find its corresponding receive queue via `m_receiveQueues.get(*message)`,
+    and instead falls through to `Connection::SyncMessageState::processIncomingMessage()`, which will attempt to
+    dispatch the incoming message to the Connection's client (GPUConnectionToWebProcess). Of course, the
+    GPUConnectionToWebProcess isn't aware of how to process this incoming message, so it simply gets dropped. By the
+    time the receive queue is added for the new RemoteDisplayListRecorder, we'll observe a ProcessOutOfStreamMessage
+    and end up waiting forever for this out-of-line message to be added to the receive queue, but this never ends up
+    happening because it has already been received and dropped by GPUConnectionToWebProcess.
+    
+    To address the flaky tests in the short term, we work around this issue by making `CreateImageBuffer` a sync
+    message, so we guarantee that any subsequent messages sent to the image buffer's RemoteDisplayListRecorder will
+    not be dropped. In the (slightly) longer term, we should turn this back into an async stream message, and add a
+    mechanism to redirect all receiver-less RemoteDisplayListRecorder messages to a separate queue.
+    
+    * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+    (WebKit::RemoteRenderingBackend::createImageBuffer):
+    * GPUProcess/graphics/RemoteRenderingBackend.h:
+    * GPUProcess/graphics/RemoteRenderingBackend.messages.in:
+    
+    Make `CreateImageBuffer` a synchronous stream message for now.
+    
+    * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+    (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer):
+    
     LayoutTests:
+    Resync web-platform-tests/reporting from upstream
+    https://bugs.webkit.org/show_bug.cgi?id=231957
     
-    Add a new test that checks we do not visually account for an opacity animation on a ::marker
-    pseudo-element.
+    Reviewed by Alex Christensen.
     
-    * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
-    * webanimations/marker-opacity-animation-no-effect.html: Added.
+    Resync web-platform-tests/reporting from upstream 207e223d74fdc1f1.
     
+    * TestExpectations:
     
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-    2021-10-19  Antoine Quint  <grao...@webkit.org>
+    2021-10-19  Alan Coon  <alanc...@apple.com>
 
-            REGRESSION(r284313): ::marker accelerated animations are broken
-            https://bugs.webkit.org/show_bug.cgi?id=231906
-            <rdar://problem/84383279>
+            Cherry-pick r284466. rdar://problem/84424869
 
-            Reviewed by Antti Koivisto.
+        REGRESSION(r284313): ::marker accelerated animations are broken
+        https://bugs.webkit.org/show_bug.cgi?id=231906
+        <rdar://problem/84383279>
 
-            Add a new test that checks we do not visually account for an opacity animation on a ::marker
-            pseudo-element.
+        Reviewed by Antti Koivisto.
 
-            * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
-            * webanimations/marker-opacity-animation-no-effect.html: Added.
+        LayoutTests/imported/w3c:
 
+        WPT now reflect that we correctly do not animate the opacity property and correctly account for
+        other ineffective properties on ::marker, such as line-height.
+
+        * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+
+        Source/WebCore:
+
+        Test: webanimations/marker-opacity-animation-no-effect.html
+
+        We incorrectly supported animations for all known CSS properties on a ::marker since we added
+        support for animation of ::marker, and with r284313 we started returning the correct renderer
+        for ::marker pseudo-elements which meant that accelerated opacity animations started running
+        for the first time.
+
+        We now correctly ignore disallowed properties for ::marker when animating with those changes.
+
+        First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
+        authorDeclarations when adding the keyframe properties.
+
+        Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
+        case we're being called for a ::marker pseudo-element.
+
+        To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
+        we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
+        * style/ElementRuleCollector.cpp:
+        (WebCore::Style::ElementRuleCollector::transferMatchedRules):
+        * style/ElementRuleCollector.h:
+        * style/PropertyAllowlist.cpp: Added.
+        (WebCore::Style::propertyAllowlistForPseudoId):
+        (WebCore::Style::isValidMarkerStyleProperty):
+        (WebCore::Style::isValidCueStyleProperty):
+        * style/PropertyAllowlist.h: Added.
+        * style/PropertyCascade.cpp:
+        (WebCore::Style::PropertyCascade::addMatch):
+        (WebCore::Style::isValidMarkerStyleProperty): Deleted.
+        (WebCore::Style::isValidCueStyleProperty): Deleted.
+        * style/RuleData.cpp:
+        (WebCore::Style::determinePropertyAllowlist):
+        (WebCore::Style::RuleData::RuleData):
+        (WebCore::Style::determinePropertyAllowlistType): Deleted.
+        * style/RuleData.h:
+        (WebCore::Style::RuleData::propertyAllowlist const):
+        (): Deleted.
+        (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
+        * style/StyleResolver.cpp:
+        (WebCore::Style::Resolver::styleForKeyframe):
+
+        LayoutTests:
+
+        Add a new test that checks we do not visually account for an opacity animation on a ::marker
+        pseudo-element.
+
+        * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
+        * webanimations/marker-opacity-animation-no-effect.html: Added.
+
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2021-10-19  Antoine Quint  <grao...@webkit.org>
+
+                REGRESSION(r284313): ::marker accelerated animations are broken
+                https://bugs.webkit.org/show_bug.cgi?id=231906
+                <rdar://problem/84383279>
+
+                Reviewed by Antti Koivisto.
+
+                Add a new test that checks we do not visually account for an opacity animation on a ::marker
+                pseudo-element.
+
+                * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
+                * webanimations/marker-opacity-animation-no-effect.html: Added.
+
 2021-10-18  Philippe Normand  <pnorm...@igalia.com>
 
         [GStreamer] fast/mediastream/video-rotation tests are failing due to missing TestController::takeViewPortSnapshot
@@ -2849,19 +2942,6 @@
         * platform/mac-wk1/TestExpectations:
         * platform/mac-wk2/TestExpectations:
 
-2021-10-04  Chris Dumez  <cdu...@apple.com>
-
-        Use isolated NSURLSessions for each first party registrable domain
-        https://bugs.webkit.org/show_bug.cgi?id=230750
-        <rdar://83159358>
-
-        Reviewed by Alex Christensen.
-
-        This test is now passing more checks on WebKit2 but still completely fails on WebKit1 so I am
-        adding a WK1-specific baseline.
-
-        * platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt.
-
 2021-10-04  Ayumi Kojima  <ayumi_koj...@apple.com>
 
         Cleaning up expectations for iOS 15.

Copied: branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-expected.txt (from rev 284470, branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt) (0 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-expected.txt	                        (rev 0)
+++ branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction-expected.txt	2021-10-19 20:05:16 UTC (rev 284484)
@@ -0,0 +1,12 @@
+Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Should have and has the session cookie.
+PASS Should have and has the persistent cookie.
+PASS Origin has no isolated session.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py (from rev 284470, branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py) (0 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py	                        (rev 0)
+++ branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py	2021-10-19 20:05:16 UTC (rev 284484)
@@ -0,0 +1,117 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+    'Cache-Control: no-store\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that the session is not switched upon top frame navigation to a prevalent resource without user interaction.");
+    jsTestIsAsync = true;
+
+    const prevalentOrigin = "http://127.0.0.1:8000";
+    const nonPrevalentOrigin = "http://localhost:8000";
+    const sessionCookieName = "sessionCookie";
+    const persistentCookieName = "persistentCookie";
+    const twoMinutesInSeconds = 120;
+
+    function setSessionCookie() {
+        document.cookie = sessionCookieName + "=1; path=/";
+    }
+
+    function setPersistentCookie() {
+        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
+    }
+
+    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
+        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
+            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
+
+        if (shouldHaveSessionCookie && hasSessionCookie)
+            testPassed("Should have and has the session cookie.");
+        else if (shouldHaveSessionCookie && !hasSessionCookie) {
+            testFailed("Should have but doesn\'t have the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
+            testFailed("Shouldn\'t have but has the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn\'t have and doesn\'t have the session cookie.");
+
+
+        if (shouldHavePersistentCookie && hasPersistentCookie)
+            testPassed("Should have and has the persistent cookie.");
+        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
+            testFailed("Should have but doesn\'t have the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
+            testFailed("Shouldn\'t have but has the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn\'t have and doesn\'t have the persistent cookie.");
+    }
+
+    function runTest() {
+        switch (document.location.hash) {
+            case "":
+                if (document.location.origin !== prevalentOrigin)
+                    testFailed("Test is not starting out on " + prevalentOrigin + ".");
+
+                setEnableFeature(true, function () {
+                    if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
+                        testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
+                    document.location.hash = "step1";
+                    runTest();
+                });
+            case "#step1":
+                setSessionCookie();
+                setPersistentCookie();
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
+                    testFailed("Origin has isolated session.");
+                    setEnableFeature(false, finishJSTest);
+                } else
+                    testPassed("Origin has no isolated session.");
+                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py#step2";
+                break;
+            case "#step2":
+                document.location.hash = "step3";
+                if (document.location.origin !== nonPrevalentOrigin)
+                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
+                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
+                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
+                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
+                        setEnableFeature(false, finishJSTest);
+                    }
+                    testRunner.statisticsUpdateCookieBlocking(runTest);
+                });
+                break;
+            case "#step3":
+                document.location.href = "" + "/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py#step4";
+                break;
+            case "#step4":
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
+                    testFailed("Origin has isolated session.");
+                else
+                    testPassed("Origin has no isolated session.");
+                setEnableFeature(false, finishJSTest);
+                break;
+            default:
+                testFailed("Unknown hash.");
+                setEnableFeature(false, finishJSTest);
+        }
+    }
+</script>
+</body>
+</html>''')
\ No newline at end of file

Copied: branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-expected.txt (from rev 284470, branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt) (0 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-expected.txt	                        (rev 0)
+++ branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction-expected.txt	2021-10-19 20:05:16 UTC (rev 284484)
@@ -0,0 +1,12 @@
+Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Should have and has the session cookie.
+PASS Should have and has the persistent cookie.
+PASS Origin has isolated session.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py (from rev 284470, branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py) (0 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py	                        (rev 0)
+++ branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py	2021-10-19 20:05:16 UTC (rev 284484)
@@ -0,0 +1,119 @@
+#!/usr/bin/env python3
+
+import sys
+
+sys.stdout.write(
+    'Cache-Control: no-store\r\n'
+    'Content-Type: text/html\r\n\r\n'
+)
+
+print('''<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+    description("Tests that the session is switched upon top frame navigation to a prevalent resource with user interaction.");
+    jsTestIsAsync = true;
+
+    const prevalentOrigin = "http://127.0.0.1:8000";
+    const nonPrevalentOrigin = "http://localhost:8000";
+    const sessionCookieName = "sessionCookie";
+    const persistentCookieName = "persistentCookie";
+    const twoMinutesInSeconds = 120;
+
+    function setSessionCookie() {
+        document.cookie = sessionCookieName + "=1; path=/";
+    }
+
+    function setPersistentCookie() {
+        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
+    }
+
+    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
+        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
+            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
+
+        if (shouldHaveSessionCookie && hasSessionCookie)
+            testPassed("Should have and has the session cookie.");
+        else if (shouldHaveSessionCookie && !hasSessionCookie) {
+            testFailed("Should have but doesn\'t have the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
+            testFailed("Shouldn\'t have but has the session cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn\'t have and doesn\'t have the session cookie.");
+
+
+        if (shouldHavePersistentCookie && hasPersistentCookie)
+            testPassed("Should have and has the persistent cookie.");
+        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
+            testFailed("Should have but doesn\'t have the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
+            testFailed("Shouldn\'t have but has the persistent cookie.");
+            setEnableFeature(false, finishJSTest);
+        } else
+            testPassed("Shouldn\'t have and doesn\'t have the persistent cookie.");
+    }
+
+    function runTest() {
+        switch (document.location.hash) {
+            case "":
+                if (document.location.origin !== prevalentOrigin)
+                    testFailed("Test is not starting out on " + prevalentOrigin + ".");
+                setEnableFeature(true, function () {
+                    if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
+                        testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
+                    document.location.hash = "step1";
+                    runTest();
+                });
+                break;
+            case "#step1":
+                testRunner.setStatisticsHasHadUserInteraction(prevalentOrigin, true, function() {
+                    setSessionCookie();
+                    setPersistentCookie();
+                    checkCookies(true, true);
+                    if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin)) {
+                        testFailed("Origin has isolated session.");
+                        setEnableFeature(false, finishJSTest);
+                    } else
+                        testPassed("Origin has no isolated session.");
+                    document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py#step2";
+                });
+                break;
+            case "#step2":
+                document.location.hash = "step3";
+                if (document.location.origin !== nonPrevalentOrigin)
+                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
+                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
+                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
+                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
+                        setEnableFeature(false, finishJSTest);
+                    }
+                    testRunner.statisticsUpdateCookieBlocking(runTest);
+                });
+                break;
+            case "#step3":
+                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py#step4";
+                break;
+            case "#step4":
+                checkCookies(true, true);
+                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
+                    testPassed("Origin has isolated session.");
+                else
+                    testFailed("Origin has no isolated session.");
+                setEnableFeature(false, finishJSTest);
+                break;
+            default:
+                testFailed("Unknown hash.");
+                setEnableFeature(false, finishJSTest);
+        }
+    }
+</script>
+</body>
+</html>''')
\ No newline at end of file

Deleted: branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction-expected.txt	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,12 +0,0 @@
-Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS Should have and has the session cookie.
-PASS Should have and has the persistent cookie.
-PASS Origin has isolated session.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,119 +0,0 @@
-#!/usr/bin/env python3
-
-import sys
-
-sys.stdout.write(
-    'Cache-Control: no-store\r\n'
-    'Content-Type: text/html\r\n\r\n'
-)
-
-print('''<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
-    description("Tests that the session is switched upon top frame navigation to a prevalent resource without user interaction.");
-    jsTestIsAsync = true;
-
-    const prevalentOrigin = "http://127.0.0.1:8000";
-    const nonPrevalentOrigin = "http://localhost:8000";
-    const sessionCookieName = "sessionCookie";
-    const persistentCookieName = "persistentCookie";
-    const twoMinutesInSeconds = 120;
-
-    function setSessionCookie() {
-        document.cookie = sessionCookieName + "=1; path=/";
-    }
-
-    function setPersistentCookie() {
-        document.cookie = persistentCookieName + "=1; path=/; Max-Age=" + twoMinutesInSeconds + ";";
-    }
-
-    function checkCookies(shouldHaveSessionCookie, shouldHavePersistentCookie) {
-        let hasSessionCookie = (document.cookie + "").includes(sessionCookieName),
-            hasPersistentCookie = (document.cookie + "").includes(persistentCookieName);
-
-        if (shouldHaveSessionCookie && hasSessionCookie)
-            testPassed("Should have and has the session cookie.");
-        else if (shouldHaveSessionCookie && !hasSessionCookie) {
-            testFailed("Should have but doesn\'t have the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHaveSessionCookie && hasSessionCookie) {
-            testFailed("Shouldn\'t have but has the session cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn\'t have and doesn\'t have the session cookie.");
-
-
-        if (shouldHavePersistentCookie && hasPersistentCookie)
-            testPassed("Should have and has the persistent cookie.");
-        else if (shouldHavePersistentCookie && !hasPersistentCookie) {
-            testFailed("Should have but doesn\'t have the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else if (!shouldHavePersistentCookie && hasPersistentCookie) {
-            testFailed("Shouldn\'t have but has the persistent cookie.");
-            setEnableFeature(false, finishJSTest);
-        } else
-            testPassed("Shouldn\'t have and doesn\'t have the persistent cookie.");
-    }
-
-    function runTest() {
-        switch (document.location.hash) {
-            case "":
-                if (document.location.origin !== prevalentOrigin)
-                    testFailed("Test is not starting out on " + prevalentOrigin + ".");
-
-                setEnableFeature(true, function () {
-                    if (testRunner.isStatisticsPrevalentResource(prevalentOrigin))
-                        testFailed(prevalentOrigin + " was classified as prevalent resource before the test starts.");
-                    document.location.hash = "step1";
-                    runTest();
-                });
-                break;
-            case "#step1":
-                setSessionCookie();
-                setPersistentCookie();
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
-                    testPassed("Origin has isolated session.");
-                else {
-                    testFailed("Origin has no isolated session.");
-                    setEnableFeature(false, finishJSTest);
-                }
-                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step2";
-                break;
-            case "#step2":
-                document.location.hash = "step3";
-                if (document.location.origin !== nonPrevalentOrigin)
-                    testFailed("Step 2 is not on " + nonPrevalentOrigin + ".");
-                testRunner.setStatisticsPrevalentResource(prevalentOrigin, true, function() {
-                    if (!testRunner.isStatisticsPrevalentResource(prevalentOrigin)) {
-                        testFailed(prevalentOrigin + " did not get set as prevalent resource.");
-                        setEnableFeature(false, finishJSTest);
-                    }
-                    testRunner.statisticsUpdateCookieBlocking(runTest);
-                });
-                break;
-            case "#step3":
-                document.location.href = "" + "/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-without-interaction.py#step4";
-                break;
-            case "#step4":
-                checkCookies(true, true);
-                if (testRunner.hasStatisticsIsolatedSession(prevalentOrigin))
-                    testPassed("Origin has isolated session.");
-                else
-                    testFailed("Origin has no isolated session.");
-                setEnableFeature(false, finishJSTest);
-                break;
-            default:
-                testFailed("Unknown hash.");
-                setEnableFeature(false, finishJSTest);
-        }
-    }
-</script>
-</body>
-</html>''')

Modified: branches/safari-613.1.6-branch/LayoutTests/imported/w3c/ChangeLog (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/imported/w3c/ChangeLog	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/imported/w3c/ChangeLog	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,93 +1,186 @@
 2021-10-19  Alan Coon  <alanc...@apple.com>
 
-        Cherry-pick r284466. rdar://problem/84424869
+        Cherry-pick r284483. rdar://problem/84428759
 
-    REGRESSION(r284313): ::marker accelerated animations are broken
-    https://bugs.webkit.org/show_bug.cgi?id=231906
-    <rdar://problem/84383279>
-    
-    Reviewed by Antti Koivisto.
-    
     LayoutTests/imported/w3c:
+    Origin of opaque blob: URLs ends up as empty string
+    https://bugs.webkit.org/show_bug.cgi?id=231942
     
-    WPT now reflect that we correctly do not animate the opacity property and correctly account for
-    other ineffective properties on ::marker, such as line-height.
+    Patch by Alex Christensen <achristen...@webkit.org> on 2021-10-19
+    Reviewed by Tim Horton.
     
-    * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
-    * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+    * web-platform-tests/url/a-element-expected.txt:
+    * web-platform-tests/url/a-element-origin-expected.txt:
+    * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
+    * web-platform-tests/url/a-element-xhtml-expected.txt:
+    * web-platform-tests/url/resources/urltestdata.json:
+    * web-platform-tests/url/url-constructor.any-expected.txt:
+    * web-platform-tests/url/url-constructor.any.worker-expected.txt:
+    * web-platform-tests/url/url-origin.any-expected.txt:
+    * web-platform-tests/url/url-origin.any.worker-expected.txt:
     
     Source/WebCore:
+    Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
+    <https://webkit.org/b/231902>
+    <rdar://problem/84375203>
     
-    Test: webanimations/marker-opacity-animation-no-effect.html
+    Patch by David Kilzer <ddkil...@apple.com> on 2021-10-19
+    Reviewed by Wenson Hsieh.
     
-    We incorrectly supported animations for all known CSS properties on a ::marker since we added
-    support for animation of ::marker, and with r284313 we started returning the correct renderer
-    for ::marker pseudo-elements which meant that accelerated opacity animations started running
-    for the first time.
+    * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+    (WebCore::FilterEffectRendererCoreImage::sharedCIContext):
+    - Use adoptCF() to fix the leak.
     
-    We now correctly ignore disallowed properties for ::marker when animating with those changes.
+    Source/WebKit:
+    REGRESSION (r284079): fast/canvas/gradient-with-clip.html and fast/canvas/gradient-text-with-shadow.html are flaky failures
+    https://bugs.webkit.org/show_bug.cgi?id=231681
+    rdar://84202478
     
-    First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
-    authorDeclarations when adding the keyframe properties.
+    Patch by Wenson Hsieh <wenson_hs...@apple.com> on 2021-10-19
+    Reviewed by Kimmo Kinnunen.
     
-    Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
-    case we're being called for a ::marker pseudo-element.
+    These tests occasionally fail when we time out while waiting for the pixel buffer to be populated underneath
+    `RemoteImageBufferProxy::getPixelBuffer`; this happens because the GPU process sometimes halts (and never
+    resumes) while processing stream messages, and consequently never ends up processing the GetPixelBuffer IPC
+    stream message that's necessary to populate the shared memory buffer for GetPixelBuffer.
     
-    To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
-    we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+    This, in turn, happens when the IPC stream buffer is about to exhaust all available capacity (i.e. the write
+    cursor is nearing the end of the 2MB buffer), and as a result, we send messages that would normally be encoded
+    in the IPC stream as out-of-line IPC messages instead, which are received in the GPU process on the IPC thread
+    and appended to the receive queue corresponding to the destination ID in `Connection::processIncomingMessage()`.
     
-    * Sources.txt:
-    * WebCore.xcodeproj/project.pbxproj:
-    * animation/KeyframeEffect.cpp:
-    (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
-    * style/ElementRuleCollector.cpp:
-    (WebCore::Style::ElementRuleCollector::transferMatchedRules):
-    * style/ElementRuleCollector.h:
-    * style/PropertyAllowlist.cpp: Added.
-    (WebCore::Style::propertyAllowlistForPseudoId):
-    (WebCore::Style::isValidMarkerStyleProperty):
-    (WebCore::Style::isValidCueStyleProperty):
-    * style/PropertyAllowlist.h: Added.
-    * style/PropertyCascade.cpp:
-    (WebCore::Style::PropertyCascade::addMatch):
-    (WebCore::Style::isValidMarkerStyleProperty): Deleted.
-    (WebCore::Style::isValidCueStyleProperty): Deleted.
-    * style/RuleData.cpp:
-    (WebCore::Style::determinePropertyAllowlist):
-    (WebCore::Style::RuleData::RuleData):
-    (WebCore::Style::determinePropertyAllowlistType): Deleted.
-    * style/RuleData.h:
-    (WebCore::Style::RuleData::propertyAllowlist const):
-    (): Deleted.
-    (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
-    * style/StyleResolver.cpp:
-    (WebCore::Style::Resolver::styleForKeyframe):
+    If we happen to have sent `RemoteRenderingBackend::CreateImageBuffer(a)` right before exhausting capacity and
+    sending out-of-line messages targeting the RemoteDisplayListRecorder corresponding to the newly created image
+    buffer `a`, we'll end up with a race condition where the IPC thread may receive the out-of-line messages meant
+    for the new remote display list destination *before* the new remote display list has added itself as an IPC
+    receive queue by calling into `StreamServerConnection::startReceivingMessages()`.
     
+    In this particular scenario (where we "lose" the race), `Connection::processIncomingMessage` will skip past the
+    early return where it would normally find its corresponding receive queue via `m_receiveQueues.get(*message)`,
+    and instead falls through to `Connection::SyncMessageState::processIncomingMessage()`, which will attempt to
+    dispatch the incoming message to the Connection's client (GPUConnectionToWebProcess). Of course, the
+    GPUConnectionToWebProcess isn't aware of how to process this incoming message, so it simply gets dropped. By the
+    time the receive queue is added for the new RemoteDisplayListRecorder, we'll observe a ProcessOutOfStreamMessage
+    and end up waiting forever for this out-of-line message to be added to the receive queue, but this never ends up
+    happening because it has already been received and dropped by GPUConnectionToWebProcess.
+    
+    To address the flaky tests in the short term, we work around this issue by making `CreateImageBuffer` a sync
+    message, so we guarantee that any subsequent messages sent to the image buffer's RemoteDisplayListRecorder will
+    not be dropped. In the (slightly) longer term, we should turn this back into an async stream message, and add a
+    mechanism to redirect all receiver-less RemoteDisplayListRecorder messages to a separate queue.
+    
+    * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+    (WebKit::RemoteRenderingBackend::createImageBuffer):
+    * GPUProcess/graphics/RemoteRenderingBackend.h:
+    * GPUProcess/graphics/RemoteRenderingBackend.messages.in:
+    
+    Make `CreateImageBuffer` a synchronous stream message for now.
+    
+    * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+    (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer):
+    
     LayoutTests:
+    Resync web-platform-tests/reporting from upstream
+    https://bugs.webkit.org/show_bug.cgi?id=231957
     
-    Add a new test that checks we do not visually account for an opacity animation on a ::marker
-    pseudo-element.
+    Reviewed by Alex Christensen.
     
-    * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
-    * webanimations/marker-opacity-animation-no-effect.html: Added.
+    Resync web-platform-tests/reporting from upstream 207e223d74fdc1f1.
     
+    * TestExpectations:
     
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-    2021-10-19  Antoine Quint  <grao...@webkit.org>
+    2021-10-19  Alan Coon  <alanc...@apple.com>
 
-            REGRESSION(r284313): ::marker accelerated animations are broken
-            https://bugs.webkit.org/show_bug.cgi?id=231906
-            <rdar://problem/84383279>
+            Cherry-pick r284466. rdar://problem/84424869
 
-            Reviewed by Antti Koivisto.
+        REGRESSION(r284313): ::marker accelerated animations are broken
+        https://bugs.webkit.org/show_bug.cgi?id=231906
+        <rdar://problem/84383279>
 
-            WPT now reflect that we correctly do not animate the opacity property and correctly account for
-            other ineffective properties on ::marker, such as line-height.
+        Reviewed by Antti Koivisto.
 
-            * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
-            * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+        LayoutTests/imported/w3c:
 
+        WPT now reflect that we correctly do not animate the opacity property and correctly account for
+        other ineffective properties on ::marker, such as line-height.
+
+        * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+
+        Source/WebCore:
+
+        Test: webanimations/marker-opacity-animation-no-effect.html
+
+        We incorrectly supported animations for all known CSS properties on a ::marker since we added
+        support for animation of ::marker, and with r284313 we started returning the correct renderer
+        for ::marker pseudo-elements which meant that accelerated opacity animations started running
+        for the first time.
+
+        We now correctly ignore disallowed properties for ::marker when animating with those changes.
+
+        First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
+        authorDeclarations when adding the keyframe properties.
+
+        Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
+        case we're being called for a ::marker pseudo-element.
+
+        To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
+        we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
+        * style/ElementRuleCollector.cpp:
+        (WebCore::Style::ElementRuleCollector::transferMatchedRules):
+        * style/ElementRuleCollector.h:
+        * style/PropertyAllowlist.cpp: Added.
+        (WebCore::Style::propertyAllowlistForPseudoId):
+        (WebCore::Style::isValidMarkerStyleProperty):
+        (WebCore::Style::isValidCueStyleProperty):
+        * style/PropertyAllowlist.h: Added.
+        * style/PropertyCascade.cpp:
+        (WebCore::Style::PropertyCascade::addMatch):
+        (WebCore::Style::isValidMarkerStyleProperty): Deleted.
+        (WebCore::Style::isValidCueStyleProperty): Deleted.
+        * style/RuleData.cpp:
+        (WebCore::Style::determinePropertyAllowlist):
+        (WebCore::Style::RuleData::RuleData):
+        (WebCore::Style::determinePropertyAllowlistType): Deleted.
+        * style/RuleData.h:
+        (WebCore::Style::RuleData::propertyAllowlist const):
+        (): Deleted.
+        (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
+        * style/StyleResolver.cpp:
+        (WebCore::Style::Resolver::styleForKeyframe):
+
+        LayoutTests:
+
+        Add a new test that checks we do not visually account for an opacity animation on a ::marker
+        pseudo-element.
+
+        * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
+        * webanimations/marker-opacity-animation-no-effect.html: Added.
+
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2021-10-19  Antoine Quint  <grao...@webkit.org>
+
+                REGRESSION(r284313): ::marker accelerated animations are broken
+                https://bugs.webkit.org/show_bug.cgi?id=231906
+                <rdar://problem/84383279>
+
+                Reviewed by Antti Koivisto.
+
+                WPT now reflect that we correctly do not animate the opacity property and correctly account for
+                other ineffective properties on ::marker, such as line-height.
+
+                * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
+                * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+
 2021-10-18  Kiet Ho  <th...@apple.com>
 
         Implement parsing and animation support for offset-distance, offset-position, offset-anchor
@@ -1278,18 +1371,6 @@
         * web-platform-tests/html/semantics/forms/the-textarea-element/placeholder-white-space.tentative-expected.html: Added.
         * web-platform-tests/html/semantics/forms/the-textarea-element/placeholder-white-space.tentative.html: Added.
 
-2021-10-04  Chris Dumez  <cdu...@apple.com>
-
-        Use isolated NSURLSessions for each first party registrable domain
-        https://bugs.webkit.org/show_bug.cgi?id=230750
-        <rdar://83159358>
-
-        Reviewed by Alex Christensen.
-
-        Rebaseline WPT test that is now passing more checks.
-
-        * web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt:
-
 2021-10-04  Sergio Villar Senin  <svil...@igalia.com>
 
         [css-flexbox] Resync WPT tests

Modified: branches/safari-613.1.6-branch/LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,12 +1,12 @@
 
 
-PASS With credentials
-PASS Without credentials
-PASS Cross-site resources with credentials
-PASS Cross-site resources without credentials
-PASS Iframes
-PASS Workers
-PASS Workers with cross-site resources
+FAIL With credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
+FAIL Without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
+FAIL Cross-site resources with credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
+FAIL Cross-site resources without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
+FAIL Iframes promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
+FAIL Workers promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
+FAIL Workers with cross-site resources promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
 FAIL CSP sandbox promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
 FAIL about:blank from opaque origin iframe promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
 

Modified: branches/safari-613.1.6-branch/LayoutTests/platform/gtk/TestExpectations (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/platform/gtk/TestExpectations	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/platform/gtk/TestExpectations	2021-10-19 20:05:16 UTC (rev 284484)
@@ -913,6 +913,8 @@
 
 webkit.org/b/209727 fast/forms/placeholder-content-line-height.html [ ImageOnlyFailure ]
 
+webkit.org/b/210487 http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py [ Failure ]
+
 webkit.org/b/210796 http/tests/resourceLoadStatistics/standalone-web-application-exempt-from-website-data-deletion.html [ Failure ]
 
 webkit.org/b/210849 compositing/overflow/rtl-scrollbar-layer-positioning.html [ Failure ]

Deleted: branches/safari-613.1.6-branch/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fetch/connection-pool/network-partition-key-expected.txt	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,12 +0,0 @@
-
-
-FAIL With credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL Without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL Cross-site resources with credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL Cross-site resources without credentials promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL Iframes promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL Workers promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL Workers with cross-site resources promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL CSP sandbox promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-FAIL about:blank from opaque origin iframe promise_test: Unhandled rejection with value: "assert_equals: Socket unexpectedly reused expected \"ok\" but got \"Multiple partition IDs used on a socket\""
-

Modified: branches/safari-613.1.6-branch/LayoutTests/platform/wpe/TestExpectations (284483 => 284484)


--- branches/safari-613.1.6-branch/LayoutTests/platform/wpe/TestExpectations	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/LayoutTests/platform/wpe/TestExpectations	2021-10-19 20:05:16 UTC (rev 284484)
@@ -600,6 +600,8 @@
 webkit.org/b/210262 fast/selectors/text-field-selection-stroke-color.html [ ImageOnlyFailure ]
 webkit.org/b/210262 fast/selectors/text-field-selection-text-shadow.html [ ImageOnlyFailure ]
 
+webkit.org/b/210487 http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py [ Failure ]
+
 webkit.org/b/211563 fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html [ Failure ]
 
 # Only enabled on Mac/iOS so far.

Modified: branches/safari-613.1.6-branch/Source/WebCore/ChangeLog (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebCore/ChangeLog	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebCore/ChangeLog	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,132 +1,225 @@
 2021-10-19  Alan Coon  <alanc...@apple.com>
 
-        Cherry-pick r284466. rdar://problem/84424869
+        Cherry-pick r284483. rdar://problem/84428759
 
-    REGRESSION(r284313): ::marker accelerated animations are broken
-    https://bugs.webkit.org/show_bug.cgi?id=231906
-    <rdar://problem/84383279>
-    
-    Reviewed by Antti Koivisto.
-    
     LayoutTests/imported/w3c:
+    Origin of opaque blob: URLs ends up as empty string
+    https://bugs.webkit.org/show_bug.cgi?id=231942
     
-    WPT now reflect that we correctly do not animate the opacity property and correctly account for
-    other ineffective properties on ::marker, such as line-height.
+    Patch by Alex Christensen <achristen...@webkit.org> on 2021-10-19
+    Reviewed by Tim Horton.
     
-    * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
-    * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+    * web-platform-tests/url/a-element-expected.txt:
+    * web-platform-tests/url/a-element-origin-expected.txt:
+    * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
+    * web-platform-tests/url/a-element-xhtml-expected.txt:
+    * web-platform-tests/url/resources/urltestdata.json:
+    * web-platform-tests/url/url-constructor.any-expected.txt:
+    * web-platform-tests/url/url-constructor.any.worker-expected.txt:
+    * web-platform-tests/url/url-origin.any-expected.txt:
+    * web-platform-tests/url/url-origin.any.worker-expected.txt:
     
     Source/WebCore:
+    Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
+    <https://webkit.org/b/231902>
+    <rdar://problem/84375203>
     
-    Test: webanimations/marker-opacity-animation-no-effect.html
+    Patch by David Kilzer <ddkil...@apple.com> on 2021-10-19
+    Reviewed by Wenson Hsieh.
     
-    We incorrectly supported animations for all known CSS properties on a ::marker since we added
-    support for animation of ::marker, and with r284313 we started returning the correct renderer
-    for ::marker pseudo-elements which meant that accelerated opacity animations started running
-    for the first time.
+    * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+    (WebCore::FilterEffectRendererCoreImage::sharedCIContext):
+    - Use adoptCF() to fix the leak.
     
-    We now correctly ignore disallowed properties for ::marker when animating with those changes.
+    Source/WebKit:
+    REGRESSION (r284079): fast/canvas/gradient-with-clip.html and fast/canvas/gradient-text-with-shadow.html are flaky failures
+    https://bugs.webkit.org/show_bug.cgi?id=231681
+    rdar://84202478
     
-    First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
-    authorDeclarations when adding the keyframe properties.
+    Patch by Wenson Hsieh <wenson_hs...@apple.com> on 2021-10-19
+    Reviewed by Kimmo Kinnunen.
     
-    Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
-    case we're being called for a ::marker pseudo-element.
+    These tests occasionally fail when we time out while waiting for the pixel buffer to be populated underneath
+    `RemoteImageBufferProxy::getPixelBuffer`; this happens because the GPU process sometimes halts (and never
+    resumes) while processing stream messages, and consequently never ends up processing the GetPixelBuffer IPC
+    stream message that's necessary to populate the shared memory buffer for GetPixelBuffer.
     
-    To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
-    we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+    This, in turn, happens when the IPC stream buffer is about to exhaust all available capacity (i.e. the write
+    cursor is nearing the end of the 2MB buffer), and as a result, we send messages that would normally be encoded
+    in the IPC stream as out-of-line IPC messages instead, which are received in the GPU process on the IPC thread
+    and appended to the receive queue corresponding to the destination ID in `Connection::processIncomingMessage()`.
     
-    * Sources.txt:
-    * WebCore.xcodeproj/project.pbxproj:
-    * animation/KeyframeEffect.cpp:
-    (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
-    * style/ElementRuleCollector.cpp:
-    (WebCore::Style::ElementRuleCollector::transferMatchedRules):
-    * style/ElementRuleCollector.h:
-    * style/PropertyAllowlist.cpp: Added.
-    (WebCore::Style::propertyAllowlistForPseudoId):
-    (WebCore::Style::isValidMarkerStyleProperty):
-    (WebCore::Style::isValidCueStyleProperty):
-    * style/PropertyAllowlist.h: Added.
-    * style/PropertyCascade.cpp:
-    (WebCore::Style::PropertyCascade::addMatch):
-    (WebCore::Style::isValidMarkerStyleProperty): Deleted.
-    (WebCore::Style::isValidCueStyleProperty): Deleted.
-    * style/RuleData.cpp:
-    (WebCore::Style::determinePropertyAllowlist):
-    (WebCore::Style::RuleData::RuleData):
-    (WebCore::Style::determinePropertyAllowlistType): Deleted.
-    * style/RuleData.h:
-    (WebCore::Style::RuleData::propertyAllowlist const):
-    (): Deleted.
-    (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
-    * style/StyleResolver.cpp:
-    (WebCore::Style::Resolver::styleForKeyframe):
+    If we happen to have sent `RemoteRenderingBackend::CreateImageBuffer(a)` right before exhausting capacity and
+    sending out-of-line messages targeting the RemoteDisplayListRecorder corresponding to the newly created image
+    buffer `a`, we'll end up with a race condition where the IPC thread may receive the out-of-line messages meant
+    for the new remote display list destination *before* the new remote display list has added itself as an IPC
+    receive queue by calling into `StreamServerConnection::startReceivingMessages()`.
     
+    In this particular scenario (where we "lose" the race), `Connection::processIncomingMessage` will skip past the
+    early return where it would normally find its corresponding receive queue via `m_receiveQueues.get(*message)`,
+    and instead falls through to `Connection::SyncMessageState::processIncomingMessage()`, which will attempt to
+    dispatch the incoming message to the Connection's client (GPUConnectionToWebProcess). Of course, the
+    GPUConnectionToWebProcess isn't aware of how to process this incoming message, so it simply gets dropped. By the
+    time the receive queue is added for the new RemoteDisplayListRecorder, we'll observe a ProcessOutOfStreamMessage
+    and end up waiting forever for this out-of-line message to be added to the receive queue, but this never ends up
+    happening because it has already been received and dropped by GPUConnectionToWebProcess.
+    
+    To address the flaky tests in the short term, we work around this issue by making `CreateImageBuffer` a sync
+    message, so we guarantee that any subsequent messages sent to the image buffer's RemoteDisplayListRecorder will
+    not be dropped. In the (slightly) longer term, we should turn this back into an async stream message, and add a
+    mechanism to redirect all receiver-less RemoteDisplayListRecorder messages to a separate queue.
+    
+    * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+    (WebKit::RemoteRenderingBackend::createImageBuffer):
+    * GPUProcess/graphics/RemoteRenderingBackend.h:
+    * GPUProcess/graphics/RemoteRenderingBackend.messages.in:
+    
+    Make `CreateImageBuffer` a synchronous stream message for now.
+    
+    * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+    (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer):
+    
     LayoutTests:
+    Resync web-platform-tests/reporting from upstream
+    https://bugs.webkit.org/show_bug.cgi?id=231957
     
-    Add a new test that checks we do not visually account for an opacity animation on a ::marker
-    pseudo-element.
+    Reviewed by Alex Christensen.
     
-    * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
-    * webanimations/marker-opacity-animation-no-effect.html: Added.
+    Resync web-platform-tests/reporting from upstream 207e223d74fdc1f1.
     
+    * TestExpectations:
     
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-    2021-10-19  Antoine Quint  <grao...@webkit.org>
+    2021-10-19  Alan Coon  <alanc...@apple.com>
 
-            REGRESSION(r284313): ::marker accelerated animations are broken
-            https://bugs.webkit.org/show_bug.cgi?id=231906
-            <rdar://problem/84383279>
+            Cherry-pick r284466. rdar://problem/84424869
 
-            Reviewed by Antti Koivisto.
+        REGRESSION(r284313): ::marker accelerated animations are broken
+        https://bugs.webkit.org/show_bug.cgi?id=231906
+        <rdar://problem/84383279>
 
-            Test: webanimations/marker-opacity-animation-no-effect.html
+        Reviewed by Antti Koivisto.
 
-            We incorrectly supported animations for all known CSS properties on a ::marker since we added
-            support for animation of ::marker, and with r284313 we started returning the correct renderer
-            for ::marker pseudo-elements which meant that accelerated opacity animations started running
-            for the first time.
+        LayoutTests/imported/w3c:
 
-            We now correctly ignore disallowed properties for ::marker when animating with those changes.
+        WPT now reflect that we correctly do not animate the opacity property and correctly account for
+        other ineffective properties on ::marker, such as line-height.
 
-            First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
-            authorDeclarations when adding the keyframe properties.
+        * web-platform-tests/css/css-pseudo/marker-animate-expected.txt:
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
 
-            Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
-            case we're being called for a ::marker pseudo-element.
+        Source/WebCore:
 
-            To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
-            we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+        Test: webanimations/marker-opacity-animation-no-effect.html
 
-            * Sources.txt:
-            * WebCore.xcodeproj/project.pbxproj:
-            * animation/KeyframeEffect.cpp:
-            (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
-            * style/ElementRuleCollector.cpp:
-            (WebCore::Style::ElementRuleCollector::transferMatchedRules):
-            * style/ElementRuleCollector.h:
-            * style/PropertyAllowlist.cpp: Added.
-            (WebCore::Style::propertyAllowlistForPseudoId):
-            (WebCore::Style::isValidMarkerStyleProperty):
-            (WebCore::Style::isValidCueStyleProperty):
-            * style/PropertyAllowlist.h: Added.
-            * style/PropertyCascade.cpp:
-            (WebCore::Style::PropertyCascade::addMatch):
-            (WebCore::Style::isValidMarkerStyleProperty): Deleted.
-            (WebCore::Style::isValidCueStyleProperty): Deleted.
-            * style/RuleData.cpp:
-            (WebCore::Style::determinePropertyAllowlist):
-            (WebCore::Style::RuleData::RuleData):
-            (WebCore::Style::determinePropertyAllowlistType): Deleted.
-            * style/RuleData.h:
-            (WebCore::Style::RuleData::propertyAllowlist const):
-            (): Deleted.
-            (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
-            * style/StyleResolver.cpp:
-            (WebCore::Style::Resolver::styleForKeyframe):
+        We incorrectly supported animations for all known CSS properties on a ::marker since we added
+        support for animation of ::marker, and with r284313 we started returning the correct renderer
+        for ::marker pseudo-elements which meant that accelerated opacity animations started running
+        for the first time.
 
+        We now correctly ignore disallowed properties for ::marker when animating with those changes.
+
+        First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
+        authorDeclarations when adding the keyframe properties.
+
+        Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
+        case we're being called for a ::marker pseudo-element.
+
+        To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
+        we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
+        * style/ElementRuleCollector.cpp:
+        (WebCore::Style::ElementRuleCollector::transferMatchedRules):
+        * style/ElementRuleCollector.h:
+        * style/PropertyAllowlist.cpp: Added.
+        (WebCore::Style::propertyAllowlistForPseudoId):
+        (WebCore::Style::isValidMarkerStyleProperty):
+        (WebCore::Style::isValidCueStyleProperty):
+        * style/PropertyAllowlist.h: Added.
+        * style/PropertyCascade.cpp:
+        (WebCore::Style::PropertyCascade::addMatch):
+        (WebCore::Style::isValidMarkerStyleProperty): Deleted.
+        (WebCore::Style::isValidCueStyleProperty): Deleted.
+        * style/RuleData.cpp:
+        (WebCore::Style::determinePropertyAllowlist):
+        (WebCore::Style::RuleData::RuleData):
+        (WebCore::Style::determinePropertyAllowlistType): Deleted.
+        * style/RuleData.h:
+        (WebCore::Style::RuleData::propertyAllowlist const):
+        (): Deleted.
+        (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
+        * style/StyleResolver.cpp:
+        (WebCore::Style::Resolver::styleForKeyframe):
+
+        LayoutTests:
+
+        Add a new test that checks we do not visually account for an opacity animation on a ::marker
+        pseudo-element.
+
+        * webanimations/marker-opacity-animation-no-effect-expected.html: Added.
+        * webanimations/marker-opacity-animation-no-effect.html: Added.
+
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2021-10-19  Antoine Quint  <grao...@webkit.org>
+
+                REGRESSION(r284313): ::marker accelerated animations are broken
+                https://bugs.webkit.org/show_bug.cgi?id=231906
+                <rdar://problem/84383279>
+
+                Reviewed by Antti Koivisto.
+
+                Test: webanimations/marker-opacity-animation-no-effect.html
+
+                We incorrectly supported animations for all known CSS properties on a ::marker since we added
+                support for animation of ::marker, and with r284313 we started returning the correct renderer
+                for ::marker pseudo-elements which meant that accelerated opacity animations started running
+                for the first time.
+
+                We now correctly ignore disallowed properties for ::marker when animating with those changes.
+
+                First, in Style::Resolver::styleForKeyframe(), we pass the relevant allowlist to the MatchResult's
+                authorDeclarations when adding the keyframe properties.
+
+                Then, in KeyframeEffect::isCurrentlyAffectingProperty() we call isValidMarkerStyleProperty() in
+                case we're being called for a ::marker pseudo-element.
+
+                To be able to obtain the allowlist and call isValidMarkerStyleProperty() in those two questions,
+                we had to refactor the related code into a dedicated PropertyAllowlist file and enum.
+
+                * Sources.txt:
+                * WebCore.xcodeproj/project.pbxproj:
+                * animation/KeyframeEffect.cpp:
+                (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const):
+                * style/ElementRuleCollector.cpp:
+                (WebCore::Style::ElementRuleCollector::transferMatchedRules):
+                * style/ElementRuleCollector.h:
+                * style/PropertyAllowlist.cpp: Added.
+                (WebCore::Style::propertyAllowlistForPseudoId):
+                (WebCore::Style::isValidMarkerStyleProperty):
+                (WebCore::Style::isValidCueStyleProperty):
+                * style/PropertyAllowlist.h: Added.
+                * style/PropertyCascade.cpp:
+                (WebCore::Style::PropertyCascade::addMatch):
+                (WebCore::Style::isValidMarkerStyleProperty): Deleted.
+                (WebCore::Style::isValidCueStyleProperty): Deleted.
+                * style/RuleData.cpp:
+                (WebCore::Style::determinePropertyAllowlist):
+                (WebCore::Style::RuleData::RuleData):
+                (WebCore::Style::determinePropertyAllowlistType): Deleted.
+                * style/RuleData.h:
+                (WebCore::Style::RuleData::propertyAllowlist const):
+                (): Deleted.
+                (WebCore::Style::RuleData::propertyAllowlistType const): Deleted.
+                * style/StyleResolver.cpp:
+                (WebCore::Style::Resolver::styleForKeyframe):
+
 2021-10-18  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r284383. rdar://problem/84377173
@@ -10099,22 +10192,6 @@
         * Modules/webxr/XRWebGLLayerInit.idl:
         * WebCore.xcodeproj/project.pbxproj:
 
-2021-10-04  Chris Dumez  <cdu...@apple.com>
-
-        Use isolated NSURLSessions for each first party registrable domain
-        https://bugs.webkit.org/show_bug.cgi?id=230750
-        <rdar://83159358>
-
-        Reviewed by Alex Christensen.
-
-        Fix bug where service worker soft-update requests would have their "first-party-for-cookies"
-        field set to "https:" instead of a full origin (e.g. "https://localhost:8080"). This was
-        causing some service worker test failures now that we use different NSURLSession based on
-        the "first-party-for-cookies" field.
-
-        * workers/service/server/SWServer.cpp:
-        (WebCore::originURL):
-
 2021-10-04  Antti Koivisto  <an...@apple.com>
 
         Make RuleSetBuilder a class

Modified: branches/safari-613.1.6-branch/Source/WebCore/workers/service/server/SWServer.cpp (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebCore/workers/service/server/SWServer.cpp	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebCore/workers/service/server/SWServer.cpp	2021-10-19 20:05:16 UTC (rev 284484)
@@ -455,7 +455,11 @@
 
 URL static inline originURL(const SecurityOrigin& origin)
 {
-    return URL(URL(), origin.data().toString());
+    URL url;
+    url.setProtocol(origin.protocol());
+    url.setHost(origin.host());
+    url.setPort(origin.port());
+    return url;
 }
 
 void SWServer::startScriptFetch(const ServiceWorkerJobData& jobData, SWServerRegistration& registration)

Modified: branches/safari-613.1.6-branch/Source/WebKit/ChangeLog (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebKit/ChangeLog	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebKit/ChangeLog	2021-10-19 20:05:16 UTC (rev 284484)
@@ -1,48 +1,141 @@
-2021-10-18  Alan Coon  <alanc...@apple.com>
+2021-10-19  Alan Coon  <alanc...@apple.com>
 
-        Cherry-pick r284382. rdar://problem/84384768
+        Cherry-pick r284483. rdar://problem/84428759
 
-    Web process occasionally crashes under `RemoteDisplayListRecorderProxy::recordRestore()`
-    https://bugs.webkit.org/show_bug.cgi?id=231900
+    LayoutTests/imported/w3c:
+    Origin of opaque blob: URLs ends up as empty string
+    https://bugs.webkit.org/show_bug.cgi?id=231942
     
+    Patch by Alex Christensen <achristen...@webkit.org> on 2021-10-19
     Reviewed by Tim Horton.
     
-    It's apparently possible for a RemoteImageBufferProxy in the web process to outlive RemoteRenderingBackendProxy.
-    Before the IPC stream refactoring in r284079, we were robust against this possibility because
-    RemoteImageBufferProxy checked for a null rendering backend in `canAppendItemOfType` and returned `false`, which
-    prevented us from trying to call into the rendering backend. However, I accidentally omitted this null check
-    in the new RemoteDisplayListRecorderProxy, which currently assumes that `m_renderingBackend` is always non-null
-    when sending any IPC stream messages.
+    * web-platform-tests/url/a-element-expected.txt:
+    * web-platform-tests/url/a-element-origin-expected.txt:
+    * web-platform-tests/url/a-element-origin-xhtml-expected.txt:
+    * web-platform-tests/url/a-element-xhtml-expected.txt:
+    * web-platform-tests/url/resources/urltestdata.json:
+    * web-platform-tests/url/url-constructor.any-expected.txt:
+    * web-platform-tests/url/url-constructor.any.worker-expected.txt:
+    * web-platform-tests/url/url-origin.any-expected.txt:
+    * web-platform-tests/url/url-origin.any.worker-expected.txt:
     
-    Fix this crash by restoring the null check for the weak `m_renderingBackend` pointer. I only observed this crash
-    once locally and, unfortunately, haven't been able to come up with a test case that consistently reproduces it.
+    Source/WebCore:
+    Fix leak of CGColorSpaceRef in FilterEffectRendererCoreImage::sharedCIContext()
+    <https://webkit.org/b/231902>
+    <rdar://problem/84375203>
     
-    * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
-    (WebKit::RemoteDisplayListRecorderProxy::send):
+    Patch by David Kilzer <ddkil...@apple.com> on 2021-10-19
+    Reviewed by Wenson Hsieh.
     
+    * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+    (WebCore::FilterEffectRendererCoreImage::sharedCIContext):
+    - Use adoptCF() to fix the leak.
     
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+    Source/WebKit:
+    REGRESSION (r284079): fast/canvas/gradient-with-clip.html and fast/canvas/gradient-text-with-shadow.html are flaky failures
+    https://bugs.webkit.org/show_bug.cgi?id=231681
+    rdar://84202478
+    
+    Patch by Wenson Hsieh <wenson_hs...@apple.com> on 2021-10-19
+    Reviewed by Kimmo Kinnunen.
+    
+    These tests occasionally fail when we time out while waiting for the pixel buffer to be populated underneath
+    `RemoteImageBufferProxy::getPixelBuffer`; this happens because the GPU process sometimes halts (and never
+    resumes) while processing stream messages, and consequently never ends up processing the GetPixelBuffer IPC
+    stream message that's necessary to populate the shared memory buffer for GetPixelBuffer.
+    
+    This, in turn, happens when the IPC stream buffer is about to exhaust all available capacity (i.e. the write
+    cursor is nearing the end of the 2MB buffer), and as a result, we send messages that would normally be encoded
+    in the IPC stream as out-of-line IPC messages instead, which are received in the GPU process on the IPC thread
+    and appended to the receive queue corresponding to the destination ID in `Connection::processIncomingMessage()`.
+    
+    If we happen to have sent `RemoteRenderingBackend::CreateImageBuffer(a)` right before exhausting capacity and
+    sending out-of-line messages targeting the RemoteDisplayListRecorder corresponding to the newly created image
+    buffer `a`, we'll end up with a race condition where the IPC thread may receive the out-of-line messages meant
+    for the new remote display list destination *before* the new remote display list has added itself as an IPC
+    receive queue by calling into `StreamServerConnection::startReceivingMessages()`.
+    
+    In this particular scenario (where we "lose" the race), `Connection::processIncomingMessage` will skip past the
+    early return where it would normally find its corresponding receive queue via `m_receiveQueues.get(*message)`,
+    and instead falls through to `Connection::SyncMessageState::processIncomingMessage()`, which will attempt to
+    dispatch the incoming message to the Connection's client (GPUConnectionToWebProcess). Of course, the
+    GPUConnectionToWebProcess isn't aware of how to process this incoming message, so it simply gets dropped. By the
+    time the receive queue is added for the new RemoteDisplayListRecorder, we'll observe a ProcessOutOfStreamMessage
+    and end up waiting forever for this out-of-line message to be added to the receive queue, but this never ends up
+    happening because it has already been received and dropped by GPUConnectionToWebProcess.
+    
+    To address the flaky tests in the short term, we work around this issue by making `CreateImageBuffer` a sync
+    message, so we guarantee that any subsequent messages sent to the image buffer's RemoteDisplayListRecorder will
+    not be dropped. In the (slightly) longer term, we should turn this back into an async stream message, and add a
+    mechanism to redirect all receiver-less RemoteDisplayListRecorder messages to a separate queue.
+    
+    * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+    (WebKit::RemoteRenderingBackend::createImageBuffer):
+    * GPUProcess/graphics/RemoteRenderingBackend.h:
+    * GPUProcess/graphics/RemoteRenderingBackend.messages.in:
+    
+    Make `CreateImageBuffer` a synchronous stream message for now.
+    
+    * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+    (WebKit::RemoteRenderingBackendProxy::createRemoteImageBuffer):
+    
+    LayoutTests:
+    Resync web-platform-tests/reporting from upstream
+    https://bugs.webkit.org/show_bug.cgi?id=231957
+    
+    Reviewed by Alex Christensen.
+    
+    Resync web-platform-tests/reporting from upstream 207e223d74fdc1f1.
+    
+    * TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 
-    2021-10-18  Wenson Hsieh  <wenson_hs...@apple.com>
+    2021-10-18  Alan Coon  <alanc...@apple.com>
 
-            Web process occasionally crashes under `RemoteDisplayListRecorderProxy::recordRestore()`
-            https://bugs.webkit.org/show_bug.cgi?id=231900
+            Cherry-pick r284382. rdar://problem/84384768
 
-            Reviewed by Tim Horton.
+        Web process occasionally crashes under `RemoteDisplayListRecorderProxy::recordRestore()`
+        https://bugs.webkit.org/show_bug.cgi?id=231900
 
-            It's apparently possible for a RemoteImageBufferProxy in the web process to outlive RemoteRenderingBackendProxy.
-            Before the IPC stream refactoring in r284079, we were robust against this possibility because
-            RemoteImageBufferProxy checked for a null rendering backend in `canAppendItemOfType` and returned `false`, which
-            prevented us from trying to call into the rendering backend. However, I accidentally omitted this null check
-            in the new RemoteDisplayListRecorderProxy, which currently assumes that `m_renderingBackend` is always non-null
-            when sending any IPC stream messages.
+        Reviewed by Tim Horton.
 
-            Fix this crash by restoring the null check for the weak `m_renderingBackend` pointer. I only observed this crash
-            once locally and, unfortunately, haven't been able to come up with a test case that consistently reproduces it.
+        It's apparently possible for a RemoteImageBufferProxy in the web process to outlive RemoteRenderingBackendProxy.
+        Before the IPC stream refactoring in r284079, we were robust against this possibility because
+        RemoteImageBufferProxy checked for a null rendering backend in `canAppendItemOfType` and returned `false`, which
+        prevented us from trying to call into the rendering backend. However, I accidentally omitted this null check
+        in the new RemoteDisplayListRecorderProxy, which currently assumes that `m_renderingBackend` is always non-null
+        when sending any IPC stream messages.
 
-            * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
-            (WebKit::RemoteDisplayListRecorderProxy::send):
+        Fix this crash by restoring the null check for the weak `m_renderingBackend` pointer. I only observed this crash
+        once locally and, unfortunately, haven't been able to come up with a test case that consistently reproduces it.
 
+        * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
+        (WebKit::RemoteDisplayListRecorderProxy::send):
+
+
+        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+        2021-10-18  Wenson Hsieh  <wenson_hs...@apple.com>
+
+                Web process occasionally crashes under `RemoteDisplayListRecorderProxy::recordRestore()`
+                https://bugs.webkit.org/show_bug.cgi?id=231900
+
+                Reviewed by Tim Horton.
+
+                It's apparently possible for a RemoteImageBufferProxy in the web process to outlive RemoteRenderingBackendProxy.
+                Before the IPC stream refactoring in r284079, we were robust against this possibility because
+                RemoteImageBufferProxy checked for a null rendering backend in `canAppendItemOfType` and returned `false`, which
+                prevented us from trying to call into the rendering backend. However, I accidentally omitted this null check
+                in the new RemoteDisplayListRecorderProxy, which currently assumes that `m_renderingBackend` is always non-null
+                when sending any IPC stream messages.
+
+                Fix this crash by restoring the null check for the weak `m_renderingBackend` pointer. I only observed this crash
+                once locally and, unfortunately, haven't been able to come up with a test case that consistently reproduces it.
+
+                * WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
+                (WebKit::RemoteDisplayListRecorderProxy::send):
+
 2021-10-18  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r284383. rdar://problem/84377173
@@ -5188,27 +5281,6 @@
 
         * UIProcess/WebPageProxy.cpp:
 
-2021-10-04  Chris Dumez  <cdu...@apple.com>
-
-        Use isolated NSURLSessions for each first party registrable domain
-        https://bugs.webkit.org/show_bug.cgi?id=230750
-        <rdar://83159358>
-
-        Reviewed by Alex Christensen.
-
-        Previously would use up to 10 isolated NSURLSessions only for domains marked as prevalent
-        by ITP *and* that the user interacts with as first party website. We now use different
-        isolated NSURLSession for each top-level registrable domain, not matter their ITP status.
-        This significantly improves privacy.
-
-        To avoid having too many NSURLSession, we clear the ones that haven't been used in the
-        last 10 minutes, every time we add a new one.
-
-        * NetworkProcess/cocoa/NetworkSessionCocoa.h:
-        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
-        (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
-        (WebKit::SessionSet::isolatedSession):
-
 2021-10-04  Tim Horton  <timothy_hor...@apple.com>
 
         process-entitlements should fail if a subcommand fails

Modified: branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h	2021-10-19 20:05:16 UTC (rev 284484)
@@ -93,8 +93,6 @@
 
     bool tryPasswordBasedAuthentication(const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&);
     void applySniffingPoliciesAndBindRequestToInferfaceIfNeeded(RetainPtr<NSURLRequest>&, bool shouldContentSniff, bool shouldContentEncodingSniff);
-    void swapSessionIfNecessary(WebCore::ResourceRequest&);
-    void initializeDataTask(const WebCore::ResourceRequest&);
 
 #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
     static NSHTTPCookieStorage *statelessCookieStorage();
@@ -127,10 +125,6 @@
     bool m_isAlwaysOnLoggingAllowed { false };
     WebCore::ShouldRelaxThirdPartyCookieBlocking m_shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No };
     RefPtr<WebCore::SecurityOrigin> m_sourceOrigin;
-    std::optional<NavigatingToAppBoundDomain> m_isNavigatingToAppBoundDomain;
-#if HAVE(NW_ACTIVITY)
-    RetainPtr<nw_activity_t> m_nwActivity;
-#endif
 };
 
 WebCore::Credential serverTrustCredential(const WebCore::AuthenticationChallenge&);

Modified: branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2021-10-19 20:05:16 UTC (rev 284484)
@@ -301,10 +301,6 @@
     , m_isAlwaysOnLoggingAllowed(computeIsAlwaysOnLoggingAllowed(session))
     , m_shouldRelaxThirdPartyCookieBlocking(parameters.shouldRelaxThirdPartyCookieBlocking)
     , m_sourceOrigin(parameters.sourceOrigin)
-    , m_isNavigatingToAppBoundDomain(parameters.isNavigatingToAppBoundDomain)
-#if HAVE(NW_ACTIVITY)
-    , m_nwActivity(parameters.networkActivityTracker ? parameters.networkActivityTracker->getPlatformObject() : nullptr)
-#endif
 {
     auto request = parameters.request;
     auto url = ""
@@ -331,6 +327,14 @@
     }
 #endif
 
+    bool shouldBlockCookies = false;
+#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
+    shouldBlockCookies = m_storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless;
+    if (auto* networkStorageSession = session.networkStorageSession()) {
+        if (!shouldBlockCookies)
+            shouldBlockCookies = networkStorageSession->shouldBlockCookies(request, frameID(), pageID(), m_shouldRelaxThirdPartyCookieBlocking);
+    }
+#endif
     restrictRequestReferrerToOriginIfNeeded(request);
 
     RetainPtr<NSURLRequest> nsRequest = request.nsURLRequest(WebCore::HTTPBodyUpdatePolicy::UpdateHTTPBody);
@@ -366,21 +370,7 @@
 #endif
     }
 
-    initializeDataTask(request);
-}
-
-void NetworkDataTaskCocoa::initializeDataTask(const WebCore::ResourceRequest& request)
-{
-    bool shouldBlockCookies = false;
 #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
-    shouldBlockCookies = m_storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::EphemeralStateless;
-    if (auto* networkStorageSession = m_session->networkStorageSession()) {
-        if (!shouldBlockCookies)
-            shouldBlockCookies = networkStorageSession->shouldBlockCookies(request, frameID(), pageID(), m_shouldRelaxThirdPartyCookieBlocking);
-    }
-#endif
-
-#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
 #if HAVE(CFNETWORK_CNAME_AND_COOKIE_TRANSFORM_SPI)
     applyCookiePolicyForThirdPartyCNAMECloaking(request);
 #endif
@@ -387,7 +377,7 @@
     if (shouldBlockCookies) {
 #if !RELEASE_LOG_DISABLED
         if (m_session->shouldLogCookieInformation())
-            RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::logCookieInformation: pageID=%" PRIu64 ", frameID=%" PRIu64 ", taskID=%lu: Blocking cookies for URL %s", this, pageID().toUInt64(), frameID().toUInt64(), (unsigned long)[m_task taskIdentifier], request.url().string().utf8().data());
+            RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::logCookieInformation: pageID=%" PRIu64 ", frameID=%" PRIu64 ", taskID=%lu: Blocking cookies for URL %s", this, pageID().toUInt64(), frameID().toUInt64(), (unsigned long)[m_task taskIdentifier], [nsRequest URL].absoluteString.UTF8String);
 #else
         LOG(NetworkSession, "%lu Blocking cookies for URL %s", (unsigned long)[m_task taskIdentifier], [nsRequest URL].absoluteString.UTF8String);
 #endif
@@ -401,8 +391,8 @@
     updateTaskWithFirstPartyForSameSiteCookies(m_task.get(), request);
 
 #if HAVE(NW_ACTIVITY)
-    if (m_nwActivity)
-        m_task.get()._nw_activity = m_nwActivity.get();
+    if (parameters.networkActivityTracker)
+        m_task.get()._nw_activity = parameters.networkActivityTracker->getPlatformObject();
 #endif
 }
 
@@ -553,10 +543,8 @@
         m_client->willPerformHTTPRedirection(WTFMove(redirectResponse), WTFMove(request), [completionHandler = WTFMove(completionHandler), this, weakThis = WeakPtr { *this }] (auto&& request) mutable {
             if (!weakThis || !m_session)
                 return completionHandler({ });
-            if (!request.isNull()) {
+            if (!request.isNull())
                 restrictRequestReferrerToOriginIfNeeded(request);
-                swapSessionIfNecessary(request);
-            }
             completionHandler(WTFMove(request));
         });
     else {
@@ -565,29 +553,6 @@
     }
 }
 
-void NetworkDataTaskCocoa::swapSessionIfNecessary(WebCore::ResourceRequest& request)
-{
-    // We only swap session based on first party registrable domain so only redirects of top level navigations may swap session (when redirecting cross-site).
-    if (!isTopLevelNavigation())
-        return;
-
-    auto& updatedSession = static_cast<NetworkSessionCocoa&>(*m_session).sessionWrapperForTask(m_webPageProxyID, request, m_storedCredentialsPolicy, m_isNavigatingToAppBoundDomain);
-    if (!m_sessionWrapper || m_sessionWrapper == &updatedSession)
-        return;
-
-    auto previousTask = std::exchange(m_task, nullptr);
-
-    m_sessionWrapper->dataTaskMap.remove([previousTask taskIdentifier]);
-    m_sessionWrapper = updatedSession;
-
-    m_task = [m_sessionWrapper->session dataTaskWithRequest:request.nsURLRequest(WebCore::HTTPBodyUpdatePolicy::UpdateHTTPBody)];
-    m_sessionWrapper->dataTaskMap.add([m_task taskIdentifier], this);
-
-    initializeDataTask(request);
-    [m_task resume];
-    request = { };
-}
-
 void NetworkDataTaskCocoa::setPendingDownloadLocation(const WTF::String& filename, SandboxExtension::Handle&& sandboxExtensionHandle, bool allowOverwrite)
 {
     NetworkDataTask::setPendingDownloadLocation(filename, { }, allowOverwrite);

Modified: branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h	2021-10-19 20:05:16 UTC (rev 284484)
@@ -69,7 +69,7 @@
 public:
     SessionWrapper sessionWithCredentialStorage;
     SessionWrapper sessionWithoutCredentialStorage;
-    MonotonicTime lastUsed;
+    WallTime lastUsed;
 };
 
 struct SessionSet : public RefCounted<SessionSet>, public CanMakeWeakPtr<SessionSet> {

Modified: branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (284483 => 284484)


--- branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-10-19 20:00:44 UTC (rev 284483)
+++ branches/safari-613.1.6-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-10-19 20:05:16 UTC (rev 284484)
@@ -97,6 +97,8 @@
 CFStringRef const WebKit2HTTPProxyDefaultsKey = static_cast<CFStringRef>(@"WebKit2HTTPProxy");
 CFStringRef const WebKit2HTTPSProxyDefaultsKey = static_cast<CFStringRef>(@"WebKit2HTTPSProxy");
 
+constexpr unsigned maxNumberOfIsolatedSessions { 10 };
+
 static NSURLSessionResponseDisposition toNSURLSessionResponseDisposition(WebCore::PolicyAction disposition)
 {
     switch (disposition) {
@@ -1402,6 +1404,14 @@
     auto shouldBeConsideredAppBound = isNavigatingToAppBoundDomain ? *isNavigatingToAppBoundDomain : NavigatingToAppBoundDomain::Yes;
     if (isParentProcessAFullWebBrowser(networkProcess()))
         shouldBeConsideredAppBound = NavigatingToAppBoundDomain::No;
+#if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
+    if (auto* storageSession = networkStorageSession()) {
+        auto firstParty = WebCore::RegistrableDomain(request.firstPartyForCookies());
+        if (storageSession->shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor(firstParty))
+            return sessionSetForPage(webPageProxyID).isolatedSession(storedCredentialsPolicy, firstParty, shouldBeConsideredAppBound, *this);
+    } else
+        ASSERT_NOT_REACHED();
+#endif
 
 #if ENABLE(APP_BOUND_DOMAINS)
     if (shouldBeConsideredAppBound == NavigatingToAppBoundDomain::Yes)
@@ -1408,11 +1418,14 @@
         return appBoundSession(webPageProxyID, storedCredentialsPolicy);
 #endif
 
-    auto firstParty = WebCore::RegistrableDomain(request.firstPartyForCookies());
-    if (firstParty.isEmpty())
-        firstParty = WebCore::RegistrableDomain(request.url());
-
-    return sessionSetForPage(webPageProxyID).isolatedSession(storedCredentialsPolicy, firstParty, shouldBeConsideredAppBound, *this);
+    switch (storedCredentialsPolicy) {
+    case WebCore::StoredCredentialsPolicy::Use:
+        return sessionSetForPage(webPageProxyID).sessionWithCredentialStorage;
+    case WebCore::StoredCredentialsPolicy::DoNotUse:
+        return sessionSetForPage(webPageProxyID).sessionWithoutCredentialStorage;
+    case WebCore::StoredCredentialsPolicy::EphemeralStateless:
+        return initializeEphemeralStatelessSessionIfNeeded(webPageProxyID, NavigatingToAppBoundDomain::No);
+    }
 }
 
 #if ENABLE(APP_BOUND_DOMAINS)
@@ -1469,36 +1482,44 @@
 
 SessionWrapper& SessionSet::isolatedSession(WebCore::StoredCredentialsPolicy storedCredentialsPolicy, const WebCore::RegistrableDomain& firstPartyDomain, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain, NetworkSessionCocoa& session)
 {
-    auto addResult = isolatedSessions.ensure(firstPartyDomain, [this, &session, isNavigatingToAppBoundDomain] {
+    auto& entry = isolatedSessions.ensure(firstPartyDomain, [this, &session, isNavigatingToAppBoundDomain] {
         auto newEntry = makeUnique<IsolatedSession>();
         newEntry->sessionWithCredentialStorage.initialize(sessionWithCredentialStorage.session.get().configuration, session, WebCore::StoredCredentialsPolicy::Use, isNavigatingToAppBoundDomain);
         newEntry->sessionWithoutCredentialStorage.initialize(sessionWithoutCredentialStorage.session.get().configuration, session, WebCore::StoredCredentialsPolicy::DoNotUse, isNavigatingToAppBoundDomain);
         return newEntry;
-    });
+    }).iterator->value;
 
-    auto now = MonotonicTime::now();
-    auto& isolatedSession = addResult.iterator->value;
-    isolatedSession->lastUsed = now;
+    entry->lastUsed = WallTime::now();
 
     auto& sessionWrapper = [&] (auto storedCredentialsPolicy) -> SessionWrapper& {
         switch (storedCredentialsPolicy) {
         case WebCore::StoredCredentialsPolicy::Use:
             LOG(NetworkSession, "Using isolated NSURLSession with credential storage.");
-            return isolatedSession->sessionWithCredentialStorage;
+            return entry->sessionWithCredentialStorage;
         case WebCore::StoredCredentialsPolicy::DoNotUse:
             LOG(NetworkSession, "Using isolated NSURLSession without credential storage.");
-            return isolatedSession->sessionWithoutCredentialStorage;
+            return entry->sessionWithoutCredentialStorage;
         case WebCore::StoredCredentialsPolicy::EphemeralStateless:
             return initializeEphemeralStatelessSessionIfNeeded(isNavigatingToAppBoundDomain, session);
         }
     } (storedCredentialsPolicy);
 
-    if (addResult.isNewEntry) {
-        isolatedSessions.removeIf([&](auto& entry) {
-            return (now - entry.value->lastUsed) > 10_min;
-        });
+    if (isolatedSessions.size() > maxNumberOfIsolatedSessions) {
+        WebCore::RegistrableDomain keyToRemove;
+        auto oldestTimestamp = WallTime::now();
+        for (auto& key : isolatedSessions.keys()) {
+            auto timestamp = isolatedSessions.get(key)->lastUsed;
+            if (timestamp < oldestTimestamp) {
+                oldestTimestamp = timestamp;
+                keyToRemove = key;
+            }
+        }
+        LOG(NetworkSession, "About to remove isolated NSURLSession.");
+        isolatedSessions.remove(keyToRemove);
     }
 
+    RELEASE_ASSERT(isolatedSessions.size() <= maxNumberOfIsolatedSessions);
+
     return sessionWrapper;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to