Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookies #501

Merged
merged 53 commits into from
Jan 10, 2024
Merged
Changes from 3 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c94e764
add cookie events, command & result references
lolaodelola Jul 19, 2023
e4deba9
add command & result definitions -wip
lolaodelola Jul 19, 2023
a4e2091
rm ref to events
lolaodelola Jul 19, 2023
3e95822
Reorganize into a new module named "Storage"
jugglinmike Jul 24, 2023
6008d95
Add storage partition keys to capabilities
jugglinmike Jul 24, 2023
d34f406
Support cookies with multiple partition keys
jugglinmike Jul 25, 2023
51d3712
Merge branch 'main' into cookies
jugglinmike Nov 1, 2023
38d02e4
Remove modifications to capabilities processing
jugglinmike Sep 19, 2023
bec7193
Relocate type definitions
jugglinmike Sep 20, 2023
73830f8
Implement commands
jugglinmike Sep 20, 2023
eb87746
Reformat according to document convention
jugglinmike Nov 8, 2023
b252fc2
Rename key in PartitionKey type
jugglinmike Nov 8, 2023
bf0ec23
Duplicate field definitions
jugglinmike Nov 8, 2023
c6ee09a
Add reminder to editors
jugglinmike Nov 8, 2023
eca5072
Define type for sameSite value
jugglinmike Nov 8, 2023
2f9a312
Include partition key in response to GetCookies
jugglinmike Nov 8, 2023
c6a29ba
Tolerate additional fields
jugglinmike Nov 8, 2023
42f9570
Include partition key in response to DeleteCookies
jugglinmike Nov 8, 2023
dac08dc
Merge branch 'main' into cookies
jugglinmike Nov 9, 2023
04f6b40
Reference recently-aligned WebDriver concepts
jugglinmike Nov 9, 2023
a358436
Require specification of source origin
jugglinmike Nov 21, 2023
79a1ac3
Normalize algorithm return type
jugglinmike Nov 21, 2023
eb917e1
Support specification of store w/browsing context
jugglinmike Nov 21, 2023
189e46e
Correct CDDL errors
jugglinmike Nov 30, 2023
9b67743
Rename command parameters
jugglinmike Nov 30, 2023
0a850ab
Make "filter" argument optional
jugglinmike Nov 30, 2023
d7e61f0
Clarify "get the cookie store" algorithm
jugglinmike Dec 7, 2023
f1e3ec0
Define a named type for each kind of partition key
jugglinmike Dec 7, 2023
b379c1c
Update index.bs
jugglinmike Dec 12, 2023
72c6780
Update index.bs
jugglinmike Dec 12, 2023
137c770
Update index.bs
jugglinmike Dec 12, 2023
9e8423e
Update index.bs
jugglinmike Dec 12, 2023
1344e60
Update index.bs
jugglinmike Dec 12, 2023
a5b32e2
Merge branch 'main' into cookies
jugglinmike Dec 13, 2023
2315ab0
Do not infer sourceOrigin; allow UAs to require it
jugglinmike Dec 13, 2023
eb4f77d
Correct algorithm names
jugglinmike Dec 13, 2023
4d74327
Add explanations for userContext and sourceOrigin
jugglinmike Dec 19, 2023
99e812f
Use a string type
jugglinmike Dec 19, 2023
9eebfc1
Incorporate feedback on partition definitions
jugglinmike Dec 20, 2023
35d7fad
Build a new map when expanding partition specifier
jugglinmike Dec 20, 2023
b662141
Correct algorithm invocation
jugglinmike Dec 20, 2023
1fe0667
Add guidance on the contents of data structures
jugglinmike Dec 21, 2023
19b19d9
Update index.bs
jugglinmike Dec 21, 2023
5c85753
Update index.bs
jugglinmike Dec 21, 2023
292e9f9
Update index.bs
jugglinmike Dec 21, 2023
e6a4064
Correct formatting issues
jugglinmike Dec 21, 2023
5e360af
Correct formatting issue
jugglinmike Dec 21, 2023
6000412
Update index.bs
jugglinmike Jan 4, 2024
c49897f
Update index.bs
jugglinmike Jan 4, 2024
39395c5
Update index.bs
jugglinmike Jan 4, 2024
db68541
Relocate issue reference
jugglinmike Jan 4, 2024
d2eb339
Modify visual presentation of table
jugglinmike Jan 4, 2024
5830f5b
Reference algorithm by its full name
jugglinmike Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -9110,8 +9110,8 @@ StorageResult = (

<pre class="cddl local-cddl remote-cddl">
storage.PartitionKey = {
userContext: text,
sourceOrigin: text,
? userContext: text,
? sourceOrigin: text,
Extensible,
}
</pre>
Expand All @@ -9136,7 +9136,7 @@ partition key attributes=].
specified.
<tr>
<td>"<code>sourceOrigin"</code>
<td>The [=serialization of an origin=] from which the storage partition is to be accessed
<td>The [=serialization of an origin|serialization of the origin=] of resources that can access the storage partition
</table>

[=Remote ends=] may support any number of <dfn>extension storage partition key
Expand All @@ -9145,48 +9145,54 @@ attributes must begin with a unique identifier for the vendor and user-agent
followed by U+003A (:).

A [=remote end=] has a [=/map=] of <dfn>default values for storage partition
key attributes</dfn> which contains zero or more implementation-defined
entries. Each key must be a member of the [=table of standard storage partition
key attributes=] or an [=extension storage partition key attribute=].
key attributes</dfn> which contains zero or more entries. Each key must be a
member of the [=table of standard storage partition key attributes=] where the
[=storage partition key=] corresponds to a standard storage partition, or an
[=extension storage partition key attribute=] where it does not. The precise
entries are implementation-defined and are determined by the storage
partitioning adopted by the implementation.

Note: Default values are used by [=storage.getCookies=], [=storage.setCookie=],
and [=storage.deleteCookies=] when the [=local end=] does not specify a value.

A [=remote end=] has a [=/list=] of <dfn>required partition key
attributes</dfn> which contains zero or more implementation-defined entries.
Each key must be a member of the [=table of standard storage partition key
attributes=] or an [=extension storage partition key attribute=].
attributes</dfn> which contains zero or more entries. Each key must be a member
of the [=table of standard storage partition key attributes=] where the
[=storage partition key=] corresponds to a standard storage partition, or an
[=extension storage partition key attribute=] where it does not. The precise
entries are implementation-defined and are determined by the storage
partitioning adopted by the implementation.

<div algorithm>
To <dfn>expand a storage partition spec</dfn> given |partition spec|:

1. If |partition spec| is null:

1. Let |partition key| be an empty [=/map=].
1. Set |partition spec| to an empty [=/map=].

1. Otherwise, if |partition spec|["<code>type</code>"] is "<code>context</code>":

1. Let |browsing context| be the result of [=trying=] to [=get a browsing context=] given |partition spec|.
1. Let |browsing context| be the result of [=trying=] to [=get a browsing context=] given |partition spec|["<code>context</code>"].

1. Let |partition key| be the [=storage partition key|key=] of |browsing context|'s [=associated storage partition=].

1. Return [=success=] with data |partition key|.

1. Otherwise:

1. Assert: |partition spec|["<code>type</code>"] is "<code>storageKey</code>".

1. Let |partition key| be |partition spec|.
1. Let |partition key| be an empty [=/map=].

1. For each |name| → |default value| in the [=default values for storage partition key attributes=]:

1. If |partition key|[|name|] does not [=map/exist=]:
1. Let |value| be |partition spec|[|name|] if it [=map/exists=] or |default value| otherwise.

1. [=map/Set=] |partition key|[|name|] to |default value|.
1. [=map/Set=] |partition key|[|name|] to |value|.

1. For each |name| in the remote end's [=required partition key attributes=]:

1. If |partition key|[|name|] does not [=map/exist=]:
1. If |partition spec|[|name|] [=map/exists=]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this means that you're treating "required" and "default" as mutually exclusive? i.e. the full key will be all the required keys plus all the keys with a default value? I was imagining that "required" would be everything and "default" would be the subset for which a known default exists. Either way works, but I found this quite surprising, so we at least need to be clearer in the definitions what's expected.


1. [=map/Set=] |partition key|][|name|] to |partition spec|[|name|].

1. Otherwise:

1. Return [=error=] with [=error code=] [=underspecified storage partition=].

Expand Down