Skip to content
Open
Changes from all commits
Commits
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
28 changes: 16 additions & 12 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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>


Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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. If |url| is failure or |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.
Expand Down Expand Up @@ -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=],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. If |subscription|'s [=cookie change subscription/name=] is null, or if |cookieName| equals |subscription|'s [=cookie change subscription/name=],
1. If |subscription|'s [=cookie change subscription/name=] is null or |cookieName| is |subscription|'s [=cookie change subscription/name=],

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|.
Expand Down