Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2022-05-02 22:48:00 UTC (rev 293691)
@@ -1,3 +1,21 @@
+2022-05-02 Alex Christensen <achristen...@webkit.org>
+
+ Update some wpt tests with control characters in cookies
+ https://bugs.webkit.org/show_bug.cgi?id=239966
+ <rdar://92300855>
+
+ Reviewed by Chris Dumez.
+
+ This reflects a change in https://github.com/httpwg/http-extensions/issues/1531
+
+ * web-platform-tests/cookies/name/name-ctl-expected.txt:
+ * web-platform-tests/cookies/name/name-ctl.html:
+ * web-platform-tests/cookies/resources/cookie-test.js:
+ * web-platform-tests/cookies/value/value-ctl-expected.txt:
+ * web-platform-tests/cookies/value/value-ctl.html:
+ * web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt:
+ * web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html:
+
2022-05-02 Oriol Brufau <obru...@igalia.com>
[cssom] Don't index 'all' shorthand in computed styles
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl-expected.txt (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl-expected.txt 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl-expected.txt 2022-05-02 22:48:00 UTC (rev 293691)
@@ -1,7 +1,5 @@
-FAIL Cookie with %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test0" but got ""
-FAIL Cookie with %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test10" but got ""
-FAIL Cookie with %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test13" but got ""
+PASS Cookie with %x0 in name is rejected.
PASS Cookie with %x1 in name is rejected.
PASS Cookie with %x2 in name is rejected.
PASS Cookie with %x3 in name is rejected.
@@ -10,9 +8,11 @@
PASS Cookie with %x6 in name is rejected.
PASS Cookie with %x7 in name is rejected.
PASS Cookie with %x8 in name is rejected.
-FAIL Cookie with %x9 in name is rejected. assert_equals: The cookie was rejected. expected "" but got "test9\tname=9"
+PASS Cookie with %x9 in name is accepted.
+PASS Cookie with %xa in name is rejected.
PASS Cookie with %xb in name is rejected.
PASS Cookie with %xc in name is rejected.
+PASS Cookie with %xd in name is rejected.
PASS Cookie with %xe in name is rejected.
PASS Cookie with %xf in name is rejected.
PASS Cookie with %x10 in name is rejected.
@@ -32,94 +32,4 @@
PASS Cookie with %x1e in name is rejected.
PASS Cookie with %x1f in name is rejected.
PASS Cookie with %x7f in name is rejected.
-FAIL Cookie with %x1 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test1term" but got ""
-FAIL Cookie with %x2 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test2term" but got ""
-FAIL Cookie with %x3 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test3term" but got ""
-FAIL Cookie with %x4 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test4term" but got ""
-FAIL Cookie with %x5 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test5term" but got ""
-FAIL Cookie with %x6 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test6term" but got ""
-FAIL Cookie with %x7 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test7term" but got ""
-FAIL Cookie with %x8 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test8term" but got ""
-FAIL Cookie with %x9 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test9term" but got ""
-FAIL Cookie with %xb after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test11term" but got ""
-FAIL Cookie with %xc after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test12term" but got ""
-FAIL Cookie with %xe after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test14term" but got ""
-FAIL Cookie with %xf after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test15term" but got ""
-FAIL Cookie with %x10 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test16term" but got ""
-FAIL Cookie with %x11 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test17term" but got ""
-FAIL Cookie with %x12 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test18term" but got ""
-FAIL Cookie with %x13 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test19term" but got ""
-FAIL Cookie with %x14 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test20term" but got ""
-FAIL Cookie with %x15 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test21term" but got ""
-FAIL Cookie with %x16 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test22term" but got ""
-FAIL Cookie with %x17 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test23term" but got ""
-FAIL Cookie with %x18 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test24term" but got ""
-FAIL Cookie with %x19 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test25term" but got ""
-FAIL Cookie with %x1a after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test26term" but got ""
-FAIL Cookie with %x1b after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test27term" but got ""
-FAIL Cookie with %x1c after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test28term" but got ""
-FAIL Cookie with %x1d after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test29term" but got ""
-FAIL Cookie with %x1e after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test30term" but got ""
-FAIL Cookie with %x1f after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test31term" but got ""
-FAIL Cookie with %x7f after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test127term" but got ""
-FAIL Cookie with %x1 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test1term" but got ""
-FAIL Cookie with %x2 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test2term" but got ""
-FAIL Cookie with %x3 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test3term" but got ""
-FAIL Cookie with %x4 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test4term" but got ""
-FAIL Cookie with %x5 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test5term" but got ""
-FAIL Cookie with %x6 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test6term" but got ""
-FAIL Cookie with %x7 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test7term" but got ""
-FAIL Cookie with %x8 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test8term" but got ""
-FAIL Cookie with %x9 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test9term" but got ""
-FAIL Cookie with %xb after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test11term" but got ""
-FAIL Cookie with %xc after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test12term" but got ""
-FAIL Cookie with %xe after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test14term" but got ""
-FAIL Cookie with %xf after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test15term" but got ""
-FAIL Cookie with %x10 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test16term" but got ""
-FAIL Cookie with %x11 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test17term" but got ""
-FAIL Cookie with %x12 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test18term" but got ""
-FAIL Cookie with %x13 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test19term" but got ""
-FAIL Cookie with %x14 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test20term" but got ""
-FAIL Cookie with %x15 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test21term" but got ""
-FAIL Cookie with %x16 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test22term" but got ""
-FAIL Cookie with %x17 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test23term" but got ""
-FAIL Cookie with %x18 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test24term" but got ""
-FAIL Cookie with %x19 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test25term" but got ""
-FAIL Cookie with %x1a after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test26term" but got ""
-FAIL Cookie with %x1b after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test27term" but got ""
-FAIL Cookie with %x1c after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test28term" but got ""
-FAIL Cookie with %x1d after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test29term" but got ""
-FAIL Cookie with %x1e after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test30term" but got ""
-FAIL Cookie with %x1f after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test31term" but got ""
-FAIL Cookie with %x7f after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test127term" but got ""
-FAIL Cookie with %x1 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test1term" but got ""
-FAIL Cookie with %x2 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test2term" but got ""
-FAIL Cookie with %x3 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test3term" but got ""
-FAIL Cookie with %x4 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test4term" but got ""
-FAIL Cookie with %x5 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test5term" but got ""
-FAIL Cookie with %x6 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test6term" but got ""
-FAIL Cookie with %x7 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test7term" but got ""
-FAIL Cookie with %x8 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test8term" but got ""
-FAIL Cookie with %x9 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test9term" but got ""
-FAIL Cookie with %xb after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test11term" but got ""
-FAIL Cookie with %xc after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test12term" but got ""
-FAIL Cookie with %xe after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test14term" but got ""
-FAIL Cookie with %xf after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test15term" but got ""
-FAIL Cookie with %x10 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test16term" but got ""
-FAIL Cookie with %x11 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test17term" but got ""
-FAIL Cookie with %x12 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test18term" but got ""
-FAIL Cookie with %x13 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test19term" but got ""
-FAIL Cookie with %x14 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test20term" but got ""
-FAIL Cookie with %x15 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test21term" but got ""
-FAIL Cookie with %x16 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test22term" but got ""
-FAIL Cookie with %x17 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test23term" but got ""
-FAIL Cookie with %x18 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test24term" but got ""
-FAIL Cookie with %x19 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test25term" but got ""
-FAIL Cookie with %x1a after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test26term" but got ""
-FAIL Cookie with %x1b after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test27term" but got ""
-FAIL Cookie with %x1c after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test28term" but got ""
-FAIL Cookie with %x1d after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test29term" but got ""
-FAIL Cookie with %x1e after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test30term" but got ""
-FAIL Cookie with %x1f after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test31term" but got ""
-FAIL Cookie with %x7f after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test127term" but got ""
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl.html (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl.html 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl.html 2022-05-02 22:48:00 UTC (rev 293691)
@@ -7,6 +7,8 @@
<meta name="timeout" content="long">
<script src=""
<script src=""
+ <script src=""
+ <script src=""
<script src=""
</head>
<body>
@@ -14,35 +16,21 @@
<script>
// Tests for control characters (CTLs) in a cookie's name.
// CTLs are defined by RFC 5234 to be %x00-1F / %x7F.
- const {TERMINATING_CTLS, CTLS} = getCtlCharacters();
+ const CTLS = getCtlCharacters();
- // Start with a clean slate.
- dropAllDomCookies();
-
- // Test that terminating CTLs truncate the cookie string.
- for (const ctl of TERMINATING_CTLS) {
- domCookieTest(
- `test${ctl.code}${ctl.chr}name=${ctl.code}`,
- `test${ctl.code}`,
- `Cookie with %x${ctl.code.toString(16)} in name is truncated.`);
- }
-
- // Test that other CTLs result in cookie rejection.
+ // All CTLs, with the exception of %x09 (the tab character), should
+ // cause the cookie to be rejected.
for (const ctl of CTLS) {
- domCookieTest(
+ if (ctl.code === 0x09) {
+ domCookieTest(
`test${ctl.code}${ctl.chr}name=${ctl.code}`,
+ `test${ctl.code}${ctl.chr}name=${ctl.code}`,
+ `Cookie with %x${ctl.code.toString(16)} in name is accepted.`);
+ } else {
+ domCookieTest(
+ `test${ctl.code}${ctl.chr}name=${ctl.code}`,
'',
`Cookie with %x${ctl.code.toString(16)} in name is rejected.`);
- }
-
- // Test that truncation due to terminating CTLs occurs first.
- for (const termCtl of TERMINATING_CTLS) {
- for (const ctl of CTLS) {
- domCookieTest(
- `test${ctl.code}term${termCtl.chr}na${ctl.chr}me=${ctl.code}`,
- `test${ctl.code}term`,
- `Cookie with %x${ctl.code.toString(16)} after ` +
- `%x${termCtl.code.toString(16)} in name is truncated.`);
}
}
</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/resources/cookie-test.js (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/resources/cookie-test.js 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/resources/cookie-test.js 2022-05-02 22:48:00 UTC (rev 293691)
@@ -151,18 +151,10 @@
}, name);
}
-// Returns two arrays of control characters along with their ASCII codes. The
-// TERMINATING_CTLS should result in termination of the cookie string. The
-// remaining CTLS should result in rejection of the cookie. Control characters
-// are defined by RFC 5234 to be %x00-1F / %x7F.
+// Returns an array of control characters along with their ASCII codes. Control
+// characters are defined by RFC 5234 to be %x00-1F / %x7F.
function getCtlCharacters() {
- const termCtlCodes = [0x00 /* NUL */, 0x0A /* LF */, 0x0D /* CR */];
const ctlCodes = [...Array(0x20).keys()]
- .filter(i => termCtlCodes.indexOf(i) === -1)
.concat([0x7F]);
- return {
- TERMINATING_CTLS:
- termCtlCodes.map(i => ({code: i, chr: String.fromCharCode(i)})),
- CTLS: ctlCodes.map(i => ({code: i, chr: String.fromCharCode(i)}))
- };
+ return ctlCodes.map(i => ({ code: i, chr: String.fromCharCode(i) }))
}
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl-expected.txt (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl-expected.txt 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl-expected.txt 2022-05-02 22:48:00 UTC (rev 293691)
@@ -1,7 +1,5 @@
-PASS Cookie with %x0 in value is truncated.
-PASS Cookie with %xa in value is truncated.
-PASS Cookie with %xd in value is truncated.
+FAIL Cookie with %x0 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=0"
FAIL Cookie with %x1 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=1"
FAIL Cookie with %x2 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=2"
FAIL Cookie with %x3 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=3"
@@ -10,9 +8,11 @@
FAIL Cookie with %x6 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=6"
FAIL Cookie with %x7 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=7"
FAIL Cookie with %x8 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=8"
-FAIL Cookie with %x9 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=9\tvalue"
+PASS Cookie with %x9 in value is accepted.
+FAIL Cookie with %xa in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=10"
FAIL Cookie with %xb in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=11"
FAIL Cookie with %xc in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=12"
+FAIL Cookie with %xd in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=13"
FAIL Cookie with %xe in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=14"
FAIL Cookie with %xf in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=15"
FAIL Cookie with %x10 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=16"
@@ -32,94 +32,4 @@
FAIL Cookie with %x1e in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=30"
FAIL Cookie with %x1f in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=31"
FAIL Cookie with %x7f in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=127"
-PASS Cookie with %x1 after %x0 in value is truncated.
-PASS Cookie with %x2 after %x0 in value is truncated.
-PASS Cookie with %x3 after %x0 in value is truncated.
-PASS Cookie with %x4 after %x0 in value is truncated.
-PASS Cookie with %x5 after %x0 in value is truncated.
-PASS Cookie with %x6 after %x0 in value is truncated.
-PASS Cookie with %x7 after %x0 in value is truncated.
-PASS Cookie with %x8 after %x0 in value is truncated.
-PASS Cookie with %x9 after %x0 in value is truncated.
-PASS Cookie with %xb after %x0 in value is truncated.
-PASS Cookie with %xc after %x0 in value is truncated.
-PASS Cookie with %xe after %x0 in value is truncated.
-PASS Cookie with %xf after %x0 in value is truncated.
-PASS Cookie with %x10 after %x0 in value is truncated.
-PASS Cookie with %x11 after %x0 in value is truncated.
-PASS Cookie with %x12 after %x0 in value is truncated.
-PASS Cookie with %x13 after %x0 in value is truncated.
-PASS Cookie with %x14 after %x0 in value is truncated.
-PASS Cookie with %x15 after %x0 in value is truncated.
-PASS Cookie with %x16 after %x0 in value is truncated.
-PASS Cookie with %x17 after %x0 in value is truncated.
-PASS Cookie with %x18 after %x0 in value is truncated.
-PASS Cookie with %x19 after %x0 in value is truncated.
-PASS Cookie with %x1a after %x0 in value is truncated.
-PASS Cookie with %x1b after %x0 in value is truncated.
-PASS Cookie with %x1c after %x0 in value is truncated.
-PASS Cookie with %x1d after %x0 in value is truncated.
-PASS Cookie with %x1e after %x0 in value is truncated.
-PASS Cookie with %x1f after %x0 in value is truncated.
-PASS Cookie with %x7f after %x0 in value is truncated.
-PASS Cookie with %x1 after %xa in value is truncated.
-PASS Cookie with %x2 after %xa in value is truncated.
-PASS Cookie with %x3 after %xa in value is truncated.
-PASS Cookie with %x4 after %xa in value is truncated.
-PASS Cookie with %x5 after %xa in value is truncated.
-PASS Cookie with %x6 after %xa in value is truncated.
-PASS Cookie with %x7 after %xa in value is truncated.
-PASS Cookie with %x8 after %xa in value is truncated.
-PASS Cookie with %x9 after %xa in value is truncated.
-PASS Cookie with %xb after %xa in value is truncated.
-PASS Cookie with %xc after %xa in value is truncated.
-PASS Cookie with %xe after %xa in value is truncated.
-PASS Cookie with %xf after %xa in value is truncated.
-PASS Cookie with %x10 after %xa in value is truncated.
-PASS Cookie with %x11 after %xa in value is truncated.
-PASS Cookie with %x12 after %xa in value is truncated.
-PASS Cookie with %x13 after %xa in value is truncated.
-PASS Cookie with %x14 after %xa in value is truncated.
-PASS Cookie with %x15 after %xa in value is truncated.
-PASS Cookie with %x16 after %xa in value is truncated.
-PASS Cookie with %x17 after %xa in value is truncated.
-PASS Cookie with %x18 after %xa in value is truncated.
-PASS Cookie with %x19 after %xa in value is truncated.
-PASS Cookie with %x1a after %xa in value is truncated.
-PASS Cookie with %x1b after %xa in value is truncated.
-PASS Cookie with %x1c after %xa in value is truncated.
-PASS Cookie with %x1d after %xa in value is truncated.
-PASS Cookie with %x1e after %xa in value is truncated.
-PASS Cookie with %x1f after %xa in value is truncated.
-PASS Cookie with %x7f after %xa in value is truncated.
-PASS Cookie with %x1 after %xd in value is truncated.
-PASS Cookie with %x2 after %xd in value is truncated.
-PASS Cookie with %x3 after %xd in value is truncated.
-PASS Cookie with %x4 after %xd in value is truncated.
-PASS Cookie with %x5 after %xd in value is truncated.
-PASS Cookie with %x6 after %xd in value is truncated.
-PASS Cookie with %x7 after %xd in value is truncated.
-PASS Cookie with %x8 after %xd in value is truncated.
-PASS Cookie with %x9 after %xd in value is truncated.
-PASS Cookie with %xb after %xd in value is truncated.
-PASS Cookie with %xc after %xd in value is truncated.
-PASS Cookie with %xe after %xd in value is truncated.
-PASS Cookie with %xf after %xd in value is truncated.
-PASS Cookie with %x10 after %xd in value is truncated.
-PASS Cookie with %x11 after %xd in value is truncated.
-PASS Cookie with %x12 after %xd in value is truncated.
-PASS Cookie with %x13 after %xd in value is truncated.
-PASS Cookie with %x14 after %xd in value is truncated.
-PASS Cookie with %x15 after %xd in value is truncated.
-PASS Cookie with %x16 after %xd in value is truncated.
-PASS Cookie with %x17 after %xd in value is truncated.
-PASS Cookie with %x18 after %xd in value is truncated.
-PASS Cookie with %x19 after %xd in value is truncated.
-PASS Cookie with %x1a after %xd in value is truncated.
-PASS Cookie with %x1b after %xd in value is truncated.
-PASS Cookie with %x1c after %xd in value is truncated.
-PASS Cookie with %x1d after %xd in value is truncated.
-PASS Cookie with %x1e after %xd in value is truncated.
-PASS Cookie with %x1f after %xd in value is truncated.
-PASS Cookie with %x7f after %xd in value is truncated.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl.html (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl.html 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl.html 2022-05-02 22:48:00 UTC (rev 293691)
@@ -7,6 +7,8 @@
<meta name="timeout" content="long">
<script src=""
<script src=""
+ <script src=""
+ <script src=""
<script src=""
</head>
<body>
@@ -14,35 +16,21 @@
<script>
// Tests for control characters (CTLs) in a cookie's value.
// CTLs are defined by RFC 5234 to be %x00-1F / %x7F.
- const {TERMINATING_CTLS, CTLS} = getCtlCharacters();
+ const CTLS = getCtlCharacters();
- // Start with a clean slate.
- dropAllDomCookies();
-
- // Test that terminating CTLs truncate the cookie string.
- for (const ctl of TERMINATING_CTLS) {
- domCookieTest(
- `test=${ctl.code}${ctl.chr}value`,
- `test=${ctl.code}`,
- `Cookie with %x${ctl.code.toString(16)} in value is truncated.`);
- }
-
- // Test that other CTLs result in cookie rejection.
+ // All CTLs, with the exception of %x09 (the tab character), should
+ // cause the cookie to be rejected.
for (const ctl of CTLS) {
- domCookieTest(
+ if (ctl.code === 0x09) {
+ domCookieTest(
`test=${ctl.code}${ctl.chr}value`,
+ `test=${ctl.code}${ctl.chr}value`,
+ `Cookie with %x${ctl.code.toString(16)} in value is accepted.`);
+ } else {
+ domCookieTest(
+ `test=${ctl.code}${ctl.chr}value`,
'',
`Cookie with %x${ctl.code.toString(16)} in value is rejected.`);
- }
-
- // Test that truncation due to terminating CTLs occurs first.
- for (const termCtl of TERMINATING_CTLS) {
- for (const ctl of CTLS) {
- domCookieTest(
- `test=${ctl.code}term${termCtl.chr}va${ctl.chr}lue`,
- `test=${ctl.code}term`,
- `Cookie with %x${ctl.code.toString(16)} after ` +
- `%x${termCtl.code.toString(16)} in value is truncated.`);
}
}
</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt 2022-05-02 22:48:00 UTC (rev 293691)
@@ -2,6 +2,6 @@
PASS document has no cookie
PASS document.cookie
PASS document.cookie 1
-PASS document.cookie 2
+FAIL document.cookie 2 assert_equals: expected "" but got "b=A"
PASS getting cookie for a cookie-averse document returns empty string, setting does nothing
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html (293690 => 293691)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html 2022-05-02 22:46:58 UTC (rev 293690)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html 2022-05-02 22:48:00 UTC (rev 293691)
@@ -11,7 +11,7 @@
const TEST_CASES = [
{value: "", expected: "", test: "Empty value"},
{value: "a=b", expected: "a=b", test: "A simple cookie"},
- {value: "b=A\0Z", expected: "b=A", test: "A null char"},
+ {value: "b=A\0Z", expected: "", test: "A null char"},
];
test(function(){