You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Let |origin| be |settings|'s [=environment settings object/origin=].
546
546
1. If |origin| is an [=opaque origin=], then return [=a promise rejected with=] a "{{SecurityError}}" {{DOMException}}.
547
547
1. Let |url| be |settings|'s [=environment/creation URL=].
548
-
1. If |options| is empty, then return [=a promise rejected with=] a {{TypeError}}.
549
-
1. If |options|["{{CookieStoreGetOptions/url}}"]is present, then run these steps:
548
+
1. If |options| [=map/is empty=], then return [=a promise rejected with=] a {{TypeError}}.
549
+
1. If |options|["{{CookieStoreGetOptions/url}}"][=map/exists=]:
550
550
1. Let |parsed| be the result of [=basic URL parser|parsing=] |options|["{{CookieStoreGetOptions/url}}"] with |settings|'s [=environment settings object/API base URL=].
551
551
1. If [=/this=]'s [=/relevant global object=] is a {{Window}} object and |parsed| does not [=url/equal=] |url| with [=url/equals/exclude fragments=] set to true,
552
552
then return [=a promise rejected with=] a {{TypeError}}.
1. Let |origin| be |settings|'s [=environment settings object/origin=].
604
604
1. If |origin| is an [=opaque origin=], then return [=a promise rejected with=] a "{{SecurityError}}" {{DOMException}}.
605
605
1. Let |url| be |settings|'s [=environment/creation URL=].
606
-
1. If |options|["{{CookieStoreGetOptions/url}}"]is present, then run these steps:
606
+
1. If |options|["{{CookieStoreGetOptions/url}}"][=map/exists=]:
607
607
1. Let |parsed| be the result of [=basic URL parser|parsing=] |options|["{{CookieStoreGetOptions/url}}"] with |settings|'s [=environment settings object/API base URL=].
608
608
1. If [=/this=]'s [=/relevant global object=] is a {{Window}} object and |parsed| does not [=url/equal=] |url| with [=url/equals/exclude fragments=] set to true,
609
609
then return [=a promise rejected with=] a {{TypeError}}.
@@ -1017,16 +1014,16 @@ and return a [=byte sequence=] corresponding to the closest `cookie-date` repres
1017
1014
1018
1015
<div algorithm>
1019
1016
1020
-
To <dfn>query cookies</dfn> given a [=/URL=] |url| and [=/string=]-or-null |name|:
1017
+
To <dfn>query cookies</dfn> given a [=/URL=] |url| and [=/scalar value string=]-or-null |name|:
1021
1018
1022
1019
1. Perform the steps defined in [[RFC6265BIS-14#name-retrieval-model|Cookies § Retrieval Model]] to compute the "cookie-string from a given cookie store"
1023
1020
with |url| as <var ignore>request-uri</var>.
1024
1021
The |cookie-string| itself is ignored, but the intermediate |cookie-list| is used in subsequent steps.
1025
1022
1026
1023
For the purposes of the steps, the |cookie-string| is being generated for a "non-HTTP" API.
1027
1024
1028
-
1. Let |list| be a new [=/list=].
1029
-
1. [=list/For each=] |cookie| in |cookie-list|, run these steps:
1025
+
1. Let |list| be « ».
1026
+
1. [=list/For each=] |cookie| of |cookie-list|:
1030
1027
1. Assert: |cookie|'s [=cookie/http-only-flag=] is false.
1031
1028
1. If |name| is non-null:
1032
1029
1. [=Normalize=] |name|.
@@ -1057,16 +1054,14 @@ Note: One implementation is known to expose information beyond _name_ and _value
1057
1054
1058
1055
<div algorithm>
1059
1056
1060
-
To <dfn>set a cookie</dfn> with
1061
-
|url|,
1062
-
|name|,
1063
-
|value|,
1064
-
optional |expires|,
1065
-
|domain|,
1066
-
|path|,
1067
-
|sameSite|, and
1068
-
|partitioned|
1069
-
run the following steps:
1057
+
To <dfn>set a cookie</dfn> given a [=/URL=] |url|,
1058
+
[=/scalar value string=] |name|,
1059
+
[=/scalar value string=] |value|,
1060
+
{{DOMHighResTimeStamp}}-or-null |expires|,
1061
+
[=/scalar value string=]-or-null |domain|,
1062
+
[=/scalar value string=] |path|,
1063
+
[=/string=] |sameSite|, and
1064
+
[=/boolean=] |partitioned|:
1070
1065
1071
1066
1. [=Normalize=] |name|.
1072
1067
1. [=Normalize=] |value|.
@@ -1084,34 +1079,34 @@ run the following steps:
1084
1079
1. Let |encodedValue| be the result of [=UTF-8 encode|UTF-8 encoding=] |value|.
1085
1080
1. If the [=byte sequence=][=byte sequence/length=] of |encodedName| plus the [=byte sequence=][=byte sequence/length=] of |encodedValue| is greater than the <a for=cookie>maximum name/value pair size</a>, then return failure.
1086
1081
1. Let |host| be |url|'s [=url/host=]
1087
-
1. Let |attributes| be a new [=/list=].
1088
-
1. If |domain| is not null, then run these steps:
1082
+
1. Let |attributes| be « ».
1083
+
1. If |domain| is non-null:
1089
1084
1. If |domain| starts with U+002E (.), then return failure.
1090
1085
1. If |name|, [=byte-lowercased=], [=byte sequence/starts with=] \``__host-`\`, then return failure.
1091
1086
1. If |domain| [=is a registrable domain suffix of or is equal to|is not a registrable domain suffix of and is not equal to=] |host|, then return failure.
1092
1087
1. Let |parsedDomain| be the result of [=host parser|host parsing=] |domain|.
1093
1088
1. Assert: |parsedDomain| is not failure.
1094
1089
1. Let |encodedDomain| be the result of [=UTF-8 encode|UTF-8 encoding=] |parsedDomain|.
1095
1090
1. If the [=byte sequence=][=byte sequence/length=] of |encodedDomain| is greater than the [=cookie/maximum attribute value size=], then return failure.
1096
-
1. [=list/Append=] \``Domain`\`/|encodedDomain| to |attributes|.
1097
-
1. If |expires| is given, then [=list/append=] \``Expires`\`/|expires| ([=date serialized=]) to |attributes|.
1091
+
1. [=list/Append=](\``Domain`\`, |encodedDomain|) to |attributes|.
1092
+
1. If |expires| is non-null, then [=list/append=](\``Expires`\`, |expires| ([=date serialized=])) to |attributes|.
1098
1093
1. If |path| is the empty string, then set |path| to the [=/serialized cookie default path=] of |url|.
1099
1094
1. If |path| does not start with U+002F (/), then return failure.
1100
1095
1. If |path| is not U+002F (/), and |name|, [=byte-lowercased=], [=byte sequence/starts with=] \``__host-`\`, then return failure.
1101
1096
1. Let |encodedPath| be the result of [=UTF-8 encode|UTF-8 encoding=] |path|.
1102
1097
1. If the [=byte sequence=][=byte sequence/length=] of |encodedPath| is greater than the [=cookie/maximum attribute value size=], then return failure.
1103
-
1. [=list/Append=] \``Path`\`/|encodedPath| to |attributes|.
1104
-
1. [=list/Append=] \``Secure`\`/\`\` to |attributes|.
1098
+
1. [=list/Append=](\``Path`\`, |encodedPath|) to |attributes|.
1099
+
1. [=list/Append=](\``Secure`\`, \`\`) to |attributes|.
1105
1100
1. Switch on |sameSite|:
1106
1101
<dl class=switch>
1107
1102
: "{{CookieSameSite/none}}"
1108
-
:: [=list/Append=] \``SameSite`\`/\``None`\` to |attributes|.
1103
+
:: [=list/Append=](\``SameSite`\`, \``None`\`) to |attributes|.
1109
1104
: "{{CookieSameSite/strict}}"
1110
-
:: [=list/Append=] \``SameSite`\`/\``Strict`\` to |attributes|.
1105
+
:: [=list/Append=](\``SameSite`\`, \``Strict`\`) to |attributes|.
1111
1106
: "{{CookieSameSite/lax}}"
1112
-
:: [=list/Append=] \``SameSite`\`/\``Lax`\` to |attributes|.
1107
+
:: [=list/Append=](\``SameSite`\`, \``Lax`\`) to |attributes|.
1113
1108
</dl>
1114
-
1. If |partitioned| is true, [=list/Append=]\``Partitioned`\`/\`\` to |attributes|.
1109
+
1. If |partitioned| is true, [=list/Append=](``Partitioned`\`, \`\`) to |attributes|.
1115
1110
1. Perform the steps defined in [[RFC6265BIS-14#name-storage-model|Cookies § Storage Model]] for when the user agent "receives a cookie" with
1116
1111
|url| as <var ignore>request-uri</var>,
1117
1112
|encodedName| as <var ignore>cookie-name</var>,
@@ -1133,13 +1128,12 @@ run the following steps:
1133
1128
1134
1129
<div algorithm>
1135
1130
1136
-
To <dfn>delete a cookie</dfn> with
1137
-
|url|,
1138
-
|name|,
1139
-
|domain|,
1140
-
|path|, and
1141
-
|partitioned|
1142
-
run the following steps:
1131
+
To <dfn>delete a cookie</dfn> given
1132
+
a [=/URL=] |url|,
1133
+
[=/scalar value string=] |name|,
1134
+
[=/scalar value string=]-or-null |domain|,
1135
+
[=/scalar value string=] |path|, and
1136
+
[=/boolean=] |partitioned|:
1143
1137
1144
1138
1. Let |expires| be the earliest representable date represented [=as a timestamp=].
1145
1139
@@ -1239,8 +1233,8 @@ To <dfn>fire a change event</dfn> named |type| with |changes| at |target|, run t
1239
1233
1240
1234
To <dfn>prepare lists</dfn> from |changes|, run the following steps:
1241
1235
1242
-
1. Let |changedList| be a new [=/list=].
1243
-
1. Let |deletedList| be a new [=/list=].
1236
+
1. Let |changedList| be « ».
1237
+
1. Let |deletedList| be « ».
1244
1238
1. [=set/For each=] |change| in |changes|, run these steps:
1245
1239
1. Let |item| be the result of running [=create a CookieListItem=] from |change|'s cookie.
1246
1240
1. If |change|'s type is *changed*, then [=list/append=] |item| to |changedList|.
0 commit comments