-
Notifications
You must be signed in to change notification settings - Fork 40
make cookie subscription name optional, url default to service worker… #291
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
Open
aamuley
wants to merge
4
commits into
whatwg:main
Choose a base branch
from
aamuley:sub-args
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -443,7 +443,7 @@ When any of the following conditions occur for a [=cookie store=], perform the s | |||||
| A [=service worker registration=] has an associated <dfn>cookie change subscription list</dfn> which is a [=/list=]; | ||||||
| each member is a <dfn>cookie change subscription</dfn>. A [=cookie change subscription=] is | ||||||
| <span dfn-for="cookie change subscription"> | ||||||
| a [=tuple=] of <dfn>name</dfn> and <dfn>url</dfn>. | ||||||
| a [=tuple=] of <dfn>name</dfn> (a [=string=] or null) and <dfn>url</dfn>. | ||||||
| </span> | ||||||
|
|
||||||
|
|
||||||
|
|
@@ -787,11 +787,13 @@ The <dfn method for=CookieStoreManager>subscribe(|subscriptions|)</dfn> method s | |||||
| 1. Run the following steps [=in parallel=]: | ||||||
| 1. Let |subscription list| be |registration|'s associated [=cookie change subscription list=]. | ||||||
| 1. [=list/For each=] |entry| in |subscriptions|, run these steps: | ||||||
| 1. Let |name| be |entry|["{{CookieStoreGetOptions/name}}"]. | ||||||
| 1. [=Normalize=] |name|. | ||||||
| 1. Let |url| be the result of [=basic URL parser|parsing=] |entry|["{{CookieStoreGetOptions/url}}"] with |settings|'s [=environment settings object/API base URL=]. | ||||||
| 1. If |url| does not start with |registration|'s [=service worker registration/scope url=], | ||||||
| then [=reject=] |p| with a {{TypeError}} and abort these steps. | ||||||
| 1. Let |name| be null. | ||||||
| 1. If |entry|["{{CookieStoreGetOptions/name}}"] [=map/exists=]: | ||||||
| 1. Set |name| to |entry|["{{CookieStoreGetOptions/name}}"]. | ||||||
| 1. [=Normalize=] |name|. | ||||||
| 1. Let |url| be |registration|'s [=service worker registration/scope url=]. | ||||||
| 1. If |entry|["{{CookieStoreGetOptions/url}}"] [=map/exists=], then set |url| to the result of [=basic URL parser|parsing=] |entry|["{{CookieStoreGetOptions/url}}"] with |settings|'s [=environment settings object/API base URL=]. | ||||||
| 1. If |url| is failure or if |url| does not start with |registration|'s [=service worker registration/scope url=], then [=reject=] |p| with a {{TypeError}} and abort these steps. | ||||||
| 1. Let |subscription| be the [=cookie change subscription=] (|name|, |url|). | ||||||
| 1. If |subscription list| does not already [=list/contain=] |subscription|, then [=list/append=] |subscription| to |subscription list|. | ||||||
| 1. [=/Resolve=] |p| with undefined. | ||||||
|
|
@@ -844,11 +846,13 @@ The <dfn method for=CookieStoreManager>unsubscribe(|subscriptions|)</dfn> method | |||||
| 1. Run the following steps [=in parallel=]: | ||||||
| 1. Let |subscription list| be |registration|'s associated [=cookie change subscription list=]. | ||||||
| 1. [=list/For each=] |entry| in |subscriptions|, run these steps: | ||||||
| 1. Let |name| be |entry|["{{CookieStoreGetOptions/name}}"]. | ||||||
| 1. [=Normalize=] |name|. | ||||||
| 1. Let |url| be the result of [=basic URL parser|parsing=] |entry|["{{CookieStoreGetOptions/url}}"] with |settings|'s [=environment settings object/API base URL=]. | ||||||
| 1. If |url| does not start with |registration|'s [=service worker registration/scope url=], | ||||||
| then [=reject=] |p| with a {{TypeError}} and abort these steps. | ||||||
| 1. Let |name| be null. | ||||||
| 1. If |entry|["{{CookieStoreGetOptions/name}}"] [=map/exists=]: | ||||||
| 1. Set |name| to |entry|["{{CookieStoreGetOptions/name}}"]. | ||||||
| 1. [=Normalize=] |name|. | ||||||
| 1. Let |url| be |registration|'s [=service worker registration/scope url=]. | ||||||
| 1. If |entry|["{{CookieStoreGetOptions/url}}"] [=map/exists=], then set |url| to the result of [=basic URL parser|parsing=] |entry|["{{CookieStoreGetOptions/url}}"] with |settings|'s [=environment settings object/API base URL=]. | ||||||
| 1. If |url| is failure or if |url| does not start with |registration|'s [=service worker registration/scope url=], then [=reject=] |p| with a {{TypeError}} and abort these steps. | ||||||
| 1. Let |subscription| be the [=cookie change subscription=] (|name|, |url|). | ||||||
| 1. [=list/Remove=] any [=list/item=] from |subscription list| equal to |subscription|. | ||||||
| 1. [=/Resolve=] |p| with undefined. | ||||||
|
|
@@ -1183,7 +1187,7 @@ To <dfn>process cookie changes</dfn>, run the following steps: | |||||
| 1. If |change| is not [=set/contains|in=] the [=observable changes=] for |subscription|'s [=cookie change subscription/url=], | ||||||
| then [=iteration/continue=]. | ||||||
| 1. Let |cookieName| be the result of running [=UTF-8 decode without BOM=] on |cookie|'s [=cookie/name=]. | ||||||
| 1. If |cookieName| equals |subscription|'s [=cookie change subscription/name=], | ||||||
| 1. If |subscription|'s [=cookie change subscription/name=] is null, or if |cookieName| equals |subscription|'s [=cookie change subscription/name=], | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| then [=set/append=] |change| to |changes| and [=iteration/break=]. | ||||||
| 1. If |changes| [=set/is empty=], then [=iteration/continue=]. | ||||||
| 1. Let |changedList| and |deletedList| be the result of running [=prepare lists=] from |changes|. | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.