diff --git a/index.bs b/index.bs index d7357604..df21dfe1 100644 --- a/index.bs +++ b/index.bs @@ -713,11 +713,13 @@ all [=subscription/subscription ids=] that have been issued to the [=local end=] A subscription is a [=/struct=] consisting of a subscription id (a string), -event names (a [=/set=] of event names) -and top-level traversable ids (a [=/set=] of IDs of [=/top-level traversables=]). +event names (a [=/set=] of event names), +top-level traversable ids (a [=/set=] of IDs of [=/top-level traversables=]) +and user context ids (a [=/set=] of IDs of [=user contexts=]). A [=subscription=] |subscription| is global -if |subscription|'s [=subscription/top-level traversable ids=] is an empty set. +if |subscription|'s [=subscription/top-level traversable ids=] is an empty set +and |subscription|'s [=user context ids=] is an empty set.
session.Subscription
type represents a unique subscription iden
session.SubscriptionRequest = {
events: [+text],
? contexts: [+browsingContext.BrowsingContext],
+ ? userContexts: [+browser.UserContext],
}
@@ -1926,12 +1971,17 @@ The [=remote end steps=] with |session| and |command parameters| are:
let |event names| be the [=set/union=] of |event names| and the result of
[=trying=] to [=obtain a set of event names=] with |name|.
+1. Let |input user context ids| be [=set/create|create a set=] with |command parameters|[contexts
].
+
+1. Let |input context ids| be [=set/create|create a set=] with |command parameters|[contexts
].
+
+1. If |input user context ids| is not empty and |input context ids| is not empty,
+ return [=error=] with [=error code=] [=invalid argument=].
+
1. Let |subscription navigables| be a [=/set=].
1. Let |top-level traversable context ids| be a [=/set=].
-1. Let |input context ids| be [=set/create|create a set=] with |command parameters|[contexts
].
-
1. If |input context ids| is not empty:
1. Let |navigables| be [=get navigables by ids=] with |input context ids|.
@@ -1946,12 +1996,26 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. [=set/Append=] |navigable|'s [=navigable id=] to |top-level traversable context ids|.
+1. Otherwise, if |input user context ids| is not empty:
+
+ 1. [=list/For each=] |user context id| of |input user context ids|:
+
+ 1. Let |user context| be [=get user context=] with |user context id|.
+
+ 1. If |user context| is null, return [=error=] with [=error code=] [=invalid argument=].
+
+ 1. [=list/For each=] |top-level traversable| in the list of all [=/top-level traversables=]
+ whose [=associated user context=] is |user context|:
+
+ 1. [=list/Append=] |top-level traversable| to |subscription navigables|.
+
1. Otherwise, set |subscription navigables| to a [=/set=] of all [=navigable/top-level traversables=] in the [=remote end=].
1. Let |subscription| be a [=subscription=] with
[=subscription/subscription id=] set to the string representation of a [[!RFC9562|UUID]],
- [=subscription/event names=] set to |event names|, and
- [=subscription/top-level traversable ids=] set to |top-level traversable context ids|.
+ [=subscription/event names=] set to |event names|,
+ [=subscription/top-level traversable ids=] set to |top-level traversable context ids| and
+ [=subscription/user context ids=] set to |input user context ids|.
1. Let |subscribe step events| be a new [=/map=].
@@ -2098,6 +2162,8 @@ The [=remote end steps=] with |session| and |command parameters| are:
1. [=list/append=] |subscription| to |new subscriptions|.
+ 1. Otherwise, if |subscription|'s [=subscription/user context ids=] is not empty, [=continue=].
+
1. Otherwise:
Note: unsubscribe by contexts is deprecated and will be removed in the future versions.