<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[287000] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/287000">287000</a></dd>
<dt>Author</dt> <dd>chris.reid@sony.com</dd>
<dt>Date</dt> <dd>2021-12-13 17:52:38 -0800 (Mon, 13 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Curl] Improve curl's cookie conformance in WPT
https://bugs.webkit.org/show_bug.cgi?id=232722

Reviewed by Fujii Hironori.

Source/WebCore:

Fix some cases where CookieJarDB differs from WPT expectations.

* platform/network/curl/CookieJarDB.cpp:
__Secure and __Host prefixes are now stricter.
Don't allow empty cookies to be set.
* platform/network/curl/CookieUtil.cpp:
Empty paths should override previous paths in the cookie list.
* platform/network/curl/NetworkStorageSessionCurl.cpp:

Tools:

* WebKitTestRunner/TestController.cpp: Use a unique cookie file for each test on windows

LayoutTests:

Add baseline for wpt cookie tests on wincairo

* platform/wincairo/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwincairoTestExpectations">trunk/LayoutTests/platform/wincairo/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCookieJarDBcpp">trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCookieUtilcpp">trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlNetworkStorageSessionCurlcpp">trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/platform/wincairo/imported/</li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/</li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/</li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/</li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/</li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesattributesinvalidexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/invalid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesattributesmaxageexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/max-age-expected.txt</a></li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/name/</li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesnamenameexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/name/name-expected.txt</a></li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/ordering/</li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesorderingorderingsubexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/ordering/ordering.sub-expected.txt</a></li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/path/</li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiespathmatchexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/path/match-expected.txt</a></li>
<li>trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/</li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiessamesiteaboutblanksubresourcehttpsexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-subresource.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiessamesiteaboutblanktoplevelhttpsexpectedtxt">trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-toplevel.https-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/LayoutTests/ChangeLog 2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-12-13  Christopher Reid  <chris.reid@sony.com>
+
+        [Curl] Improve curl's cookie conformance in WPT
+        https://bugs.webkit.org/show_bug.cgi?id=232722
+
+        Reviewed by Fujii Hironori.
+
+        Add baseline for wpt cookie tests on wincairo
+
+        * platform/wincairo/TestExpectations:
+
</ins><span class="cx"> 2021-12-13  Robert Jenner  <Jenner@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [ iOS ] 8 imported/w3c/web-platform-tests/fetch/api (layout-tests) are flaky text failures
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/TestExpectations     2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations        2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -1427,6 +1427,35 @@
</span><span class="cx"> storage/indexeddb/modern/aborted-put.html [ Timeout Pass ]
</span><span class="cx"> [ Debug ] storage/indexeddb/modern/index-rename-1.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Flaky values in WPT cookie expectations
+imported/w3c/web-platform-tests/cookies/prefix/__secure.header.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite-none-secure/cookies-without-samesite-must-be-secure.https.tentative.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite/iframe.document.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite/multiple-samesite-attributes.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite/sandbox-iframe-nested.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite/sandbox-iframe-subresource.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite/setcookie-lax.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/samesite/setcookie-navigation.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/schemeful-same-site/schemeful-iframe-subresource.tentative.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/schemeful-same-site/schemeful-navigation.tentative.html [ Pass Failure ]
+imported/w3c/web-platform-tests/cookies/schemeful-same-site/schemeful-subresource.tentative.html [ Pass Failure ]
+
+# WPT diff failures that need more investigation
+imported/w3c/web-platform-tests/cookies/domain/domain-attribute-host-with-leading-period.sub.https.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/encoding/charset.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/name/name-ctl.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/secure/set-from-dom.sub.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/secure/set-from-http.sub.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/secure/set-from-ws.sub.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/value/value-ctl.html [ Failure ]
+imported/w3c/web-platform-tests/cookies/value/value.html [ Failure ]
+
+# Skip WPT tests that timeout
+imported/w3c/web-platform-tests/cookies/samesite/form-get-blank-reload.https.html [ Skip ]
+imported/w3c/web-platform-tests/cookies/samesite/form-get-blank.https.html [ Skip ]
+imported/w3c/web-platform-tests/cookies/samesite/form-post-blank-reload.https.html [ Skip ]
+imported/w3c/web-platform-tests/cookies/samesite/form-post-blank.https.html [ Skip ]
+
</ins><span class="cx"> ################################################################################
</span><span class="cx"> ############################   End Storage Issues   ############################
</span><span class="cx"> ################################################################################
</span><span class="lines">@@ -1548,7 +1577,6 @@
</span><span class="cx"> imported/w3c/web-platform-tests/compat [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/console [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/content-security-policy [ Skip ]
</span><del>-imported/w3c/web-platform-tests/cookies [ Skip ]
</del><span class="cx"> imported/w3c/web-platform-tests/cors [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/credential-management [ Skip ]
</span><span class="cx"> imported/w3c/web-platform-tests/css [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesattributesinvalidexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/invalid-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/invalid-expected.txt                              (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/invalid-expected.txt 2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+
+PASS Set cookie with invalid attribute
+PASS Set cookie ending with invalid attribute.
+PASS Set cookie ending with quoted invalid attribute.
+PASS Set cookie ending with double-quoted invalid attribute.
+PASS Set cookie ending with invalid attribute equals.
+PASS Set cookie with two invalid attributes (lol="aaa and bbb).
+PASS Set cookie ending with two invalid attributes (lol="aaa and bbb).
+PASS Set cookie for quoted Secure attribute
+PASS Set cookie for Secure qux
+PASS Ignore invalid attribute name with comma
+PASS Ignore invalid attribute value with comma
+PASS Set cookie ignoring multiple invalid attributes, whitespace, and semicolons
+PASS Set cookie with multiple '='s in its value, ignoring multiple invalid attributes, whitespace, and semicolons
+PASS Set cookie with (invalid) version=1 attribute
+PASS Set cookie with (invalid) version=1000 attribute
+PASS Set cookie ignoring anything after ; (which looks like an invalid attribute)
+PASS Set cookie ignoring anything after ; (which looks like an invalid attribute, with no trailing semicolon)
+PASS Ignore keys after semicolon
+PASS Ignore attributes after semicolon
+PASS Ignore `Set-Cookie: =`
+PASS Ignore empty cookie string
+PASS Ignore `Set-Cookie: =` with other `Set-Cookie` headers
+PASS Ignore name- and value-less `Set-Cookie: ; bar`
+PASS Ignore name- and value-less `Set-Cookie:    `
+PASS Ignore name- and value-less `Set-Cookie: \t`
+PASS Ignore cookie with domain that won't domain match (along with other invalid noise)
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesattributesmaxageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/max-age-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/max-age-expected.txt                              (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/attributes/max-age-expected.txt 2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+
+PASS Ignore max-age attribute with invalid non-zero-digit (containing a comma)
+PASS Set cookie with age
+PASS Set no cookie with max-age=0
+PASS Set no cookie with max-age=-1
+PASS Set no cookie with max-age=-20
+PASS Set multiple cookies with max-age attribute
+PASS Expire later cookie with same name and max-age=0
+PASS Expire later cookie with same name and max-age=0, and don't set cookie with max-age=0
+PASS Set mulitiple cookies with valid max-age values
+PASS Don't set multiple cookies with max-age=0
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesnamenameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/name/name-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/name/name-expected.txt                               (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/name/name-expected.txt  2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+
+PASS Set valueless cookie to its name with empty value
+PASS Set a nameless cookie (that has an = in its value)
+PASS Set a nameless cookie (that has multiple ='s in its value)
+PASS Set a nameless cookie
+PASS Remove trailing WSP characters from the name string
+PASS Remove leading WSP characters from the name string
+PASS Only return the new cookie (with the same name)
+PASS Ignore invalid attributes after nameless cookie
+PASS Ignore invalid attributes after valid name (that looks like Cookie2 Version attribute)
+PASS Set a cookie that has whitespace in its name
+PASS Set a nameless cookie ignoring characters after first ;
+PASS Set a nameless cookie ignoring characters after first ; (2)
+PASS Return the most recent nameless cookie
+PASS Return the most recent nameless cookie, without leading =
+PASS Return the most recent nameless cookie, even if preceded by =
+PASS Return the most recent nameless cookie, even if preceded by =, in addition to other valid cookie
+PASS Use last value for cookies with identical names
+PASS Keep first-in, first-out name order
+PASS Keep first-in, first-out single-char name order
+PASS Keep non-alphabetic first-in, first-out name order
+PASS Keep first-in, first-out order if comma-separated
+PASS Set nameless cookie, given `Set-Cookie: =test16`
+PASS Overwrite nameless cookie
+PASS Ignore cookie with empty name and empty value
+PASS Ignore cookie with no name or value
+PASS URL-encoded cookie name is not decoded
+PASS Name is set as expected for a=test
+PASS Name is set as expected for 1=test
+PASS Name is set as expected for $=test
+PASS Name is set as expected for !a=test
+PASS Name is set as expected for @a=test
+PASS Name is set as expected for #a=test
+PASS Name is set as expected for $a=test
+PASS Name is set as expected for %a=test
+PASS Name is set as expected for ^a=test
+PASS Name is set as expected for &a=test
+PASS Name is set as expected for *a=test
+PASS Name is set as expected for (a=test
+PASS Name is set as expected for )a=test
+PASS Name is set as expected for -a=test
+PASS Name is set as expected for _a=test
+PASS Name is set as expected for +=test
+PASS Name is set as expected for "a=test
+PASS Name is set as expected for "a=b"=test
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiesorderingorderingsubexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/ordering/ordering.sub-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/ordering/ordering.sub-expected.txt                           (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/ordering/ordering.sub-expected.txt      2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Test cookie ordering
+FAIL Cookies with longer path attribute values are ordered before shorter ones assert_equals: The cookie was set as expected. expected "testF=1; testB=1; testC=1; testE=1" but got "testB=1; testC=1"
+FAIL Cookies with longer path attribute values are ordered before shorter ones (2) assert_equals: The cookie was set as expected. expected "testG=2; testB=2; testF=2; testH=2; testC=2" but got "testB=2; testH=2; testC=2"
+PASS Cookies with longer paths are listed before cookies with shorter paths
+PASS For equal length paths, list the cookie with an earlier creation time first
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiespathmatchexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/path/match-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/path/match-expected.txt                              (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/path/match-expected.txt 2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+
+PASS `document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /
+PASS `document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: match.html
+PASS `document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: cookies
+PASS `document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /cookies
+PASS `document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /cookies/
+PASS `document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /cookies/resources/echo-cookie.html
+PASS `document.cookie` on /cookies/resources/echo-cookie.html DOES NOT set cookie for path: /cook
+PASS `document.cookie` on /cookies/resources/echo-cookie.html DOES NOT set cookie for path: /w/
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: match.html
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: cookies
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /cookies
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /cookies/
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: /cookies/resources/echo-cookie.html
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html DOES NOT set cookie for path: /cook
+PASS `Set-Cookie` on /cookies/resources/echo-cookie.html DOES NOT set cookie for path: /w/
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiessamesiteaboutblanksubresourcehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-subresource.https-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-subresource.https-expected.txt                          (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-subresource.https-expected.txt     2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS SameSite cookies on subresource of top-level about:blank window
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoimportedw3cwebplatformtestscookiessamesiteaboutblanktoplevelhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-toplevel.https-expected.txt (0 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-toplevel.https-expected.txt                             (rev 0)
+++ trunk/LayoutTests/platform/wincairo/imported/w3c/web-platform-tests/cookies/samesite/about-blank-toplevel.https-expected.txt        2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS SameSite cookies with top-level about:blank window
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/Source/WebCore/ChangeLog      2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2021-12-13  Christopher Reid  <chris.reid@sony.com>
+
+        [Curl] Improve curl's cookie conformance in WPT
+        https://bugs.webkit.org/show_bug.cgi?id=232722
+
+        Reviewed by Fujii Hironori.
+
+        Fix some cases where CookieJarDB differs from WPT expectations.
+
+        * platform/network/curl/CookieJarDB.cpp:
+        __Secure and __Host prefixes are now stricter.
+        Don't allow empty cookies to be set.
+        * platform/network/curl/CookieUtil.cpp:
+        Empty paths should override previous paths in the cookie list.
+        * platform/network/curl/NetworkStorageSessionCurl.cpp:
+
</ins><span class="cx"> 2021-12-13  J Pascoe  <j_pascoe@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WebAuthn] Allow same-site, cross-origin iframe get()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCookieJarDBcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp       2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp  2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -488,6 +488,18 @@
</span><span class="cx">     return statement.step() == SQLITE_ROW;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool checkSecureCookie(const Cookie& cookie)
+{
+    if (cookie.name.startsWith("__Secure-"_s) && !cookie.secure)
+        return false;
+
+    // Cookies for __Host must have the Secure attribute, path explicitly set to "/", and no domain attribute
+    if (cookie.name.startsWith("__Host-"_s) && (!cookie.secure || cookie.path != "/"_s || !cookie.domain.isEmpty()))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> bool CookieJarDB::canAcceptCookie(const Cookie& cookie, const URL& firstParty, const URL& url, CookieJarDB::Source source)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(PUBLIC_SUFFIX_LIST)
</span><span class="lines">@@ -538,9 +550,12 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     auto cookie = CookieUtil::parseCookieHeader(body);
</span><del>-    if (!cookie)
</del><ins>+    if (!cookie || (cookie->name.isEmpty() && cookie->value.isEmpty()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!checkSecureCookie(*cookie))
+        return false;
+
</ins><span class="cx">     if (cookie->domain.isEmpty())
</span><span class="cx">         cookie->domain = url.host().convertToASCIILowercase();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCookieUtilcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp        2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/Source/WebCore/platform/network/curl/CookieUtil.cpp   2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -124,15 +124,23 @@
</span><span class="cx">             // If there is a max-age attribute as well as an expires attribute
</span><span class="cx">             // the rightmost max-age attribute takes precedence.
</span><span class="cx">             hasMaxAge = true;
</span><ins>+        } else {
+            result.session = true;
+            result.expires = std::nullopt;
</ins><span class="cx">         }
</span><span class="cx">     } else if (equalIgnoringASCIICase(attributeName, "expires") && !hasMaxAge) {
</span><span class="cx">         if (auto expiryTime = parseExpiresMS(attributeValue.utf8().data())) {
</span><span class="cx">             result.expires = expiryTime.value();
</span><span class="cx">             result.session = false;
</span><ins>+        } else if (!hasMaxAge) {
+            result.session = true;
+            result.expires = std::nullopt;
</ins><span class="cx">         }
</span><span class="cx">     } else if (equalIgnoringASCIICase(attributeName, "path")) {
</span><span class="cx">         if (!attributeValue.isEmpty() && attributeValue.startsWith('/'))
</span><span class="cx">             result.path = attributeValue;
</span><ins>+        else
+            result.path = emptyString();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlNetworkStorageSessionCurlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp 2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/Source/WebCore/platform/network/curl/NetworkStorageSessionCurl.cpp    2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -64,8 +64,10 @@
</span><span class="cx">         for (const auto& cookie : *result) {
</span><span class="cx">             if (!cookies.isEmpty())
</span><span class="cx">                 cookies.append("; ");
</span><del>-            cookies.append(cookie.name);
-            cookies.append("=");
</del><ins>+            if (!cookie.name.isEmpty()) {
+                cookies.append(cookie.name);
+                cookies.append("=");
+            }
</ins><span class="cx">             cookies.append(cookie.value);
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/Tools/ChangeLog       2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-12-13  Christopher Reid  <chris.reid@sony.com>
+
+        [Curl] Improve curl's cookie conformance in WPT
+        https://bugs.webkit.org/show_bug.cgi?id=232722
+
+        Reviewed by Fujii Hironori.
+
+        * WebKitTestRunner/TestController.cpp: Use a unique cookie file for each test on windows
+
</ins><span class="cx"> 2021-12-13  Jean-Yves Avenard  <jya@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add SharedBufferBuilder class
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (286999 => 287000)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp  2021-12-14 01:50:21 UTC (rev 286999)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp     2021-12-14 01:52:38 UTC (rev 287000)
</span><span class="lines">@@ -608,6 +608,9 @@
</span><span class="cx">         WKWebsiteDataStoreConfigurationSetMediaKeysStorageDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "MediaKeys", pathSeparator, randomNumber)).get());
</span><span class="cx">         WKWebsiteDataStoreConfigurationSetResourceLoadStatisticsDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "ResourceLoadStatistics", pathSeparator, randomNumber)).get());
</span><span class="cx">         WKWebsiteDataStoreConfigurationSetServiceWorkerRegistrationDirectory(configuration, toWK(makeString(temporaryFolder, pathSeparator, "ServiceWorkers", pathSeparator, randomNumber)).get());
</span><ins>+#if PLATFORM(WIN)
+        WKWebsiteDataStoreConfigurationSetCookieStorageFile(configuration, toWK(makeString(temporaryFolder, pathSeparator, "cookies", pathSeparator, randomNumber, pathSeparator, "cookiejar.db")).get());
+#endif
</ins><span class="cx">         WKWebsiteDataStoreConfigurationSetPerOriginStorageQuota(configuration, 400 * 1024);
</span><span class="cx">         WKWebsiteDataStoreConfigurationSetNetworkCacheSpeculativeValidationEnabled(configuration, true);
</span><span class="cx">         WKWebsiteDataStoreConfigurationSetStaleWhileRevalidateEnabled(configuration, true);
</span></span></pre>
</div>
</div>

</body>
</html>