Skip to content

Commit a94c9d5

Browse files
clarify session.subscribe and session.unsubscribe
1 parent 19a7921 commit a94c9d5

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

index.bs

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,8 +1643,8 @@ session.SystemProxyConfiguration = (
16431643

16441644
<pre class="cddl remote-cddl">
16451645
session.SubscriptionRequest = {
1646-
events: [*text],
1647-
? contexts: [*browsingContext.BrowsingContext],
1646+
events: [+text],
1647+
? contexts: [+browsingContext.BrowsingContext],
16481648
}
16491649
</pre>
16501650

@@ -1832,8 +1832,8 @@ Issue: This needs to be generalized to work with realms too
18321832
<dd>
18331833
<pre class="cddl remote-cddl">
18341834
session.Subscribe = (
1835-
method: "session.subscribe",
1836-
params: session.SubscriptionRequest
1835+
method: "session.subscribe",
1836+
params: session.SubscriptionRequest
18371837
)
18381838
</pre>
18391839
</dd>
@@ -1848,14 +1848,20 @@ Issue: This needs to be generalized to work with realms too
18481848
<div algorithm="remote end steps for session.subscribe">
18491849
The [=remote end steps=] with |session| and |command parameters| are:
18501850

1851-
1. Let the |list of event names| be the value of the <code>events</code> field of
1852-
|command parameters|
1851+
1. Let the |set of event names| be empty [=set=].
18531852

1854-
1. Let the |list of contexts| be the value of the <code>contexts</code>
1855-
field of |command parameters| if it is present or null if it isn't.
1853+
1. For each |event| of <code>command parameters</code>["events"], append |event| to |set of event names|.
1854+
1855+
1. Let |set of contexts| be null.
1856+
1857+
1. If the value of the <code>contexts</code> field of |command parameters| is not null.
1858+
1859+
1. Set |set of contexts| to empty [=set=].
1860+
1861+
1. For each |event| of <code>command parameters</code>["contexts"], append |event| to |set of contexts|.
18561862

18571863
1. Let |enabled events| be the result of [=trying=] to [=update the event map=]
1858-
with |session|, |list of event names| , |list of contexts| and
1864+
with |session|, |set of event names| , |set of contexts| and
18591865
enabled true.
18601866

18611867
1. Let |subscribe step events| be a new [=/map=].
@@ -1898,12 +1904,12 @@ Issue: This needs to be generalised to work with realms too
18981904
<dl>
18991905
<dt>Command Type</dt>
19001906
<dd>
1901-
<pre class="cddl remote-cddl">
1902-
session.Unsubscribe = (
1903-
method: "session.unsubscribe",
1904-
params: session.SubscriptionRequest
1905-
)
1906-
</pre>
1907+
<pre class="cddl remote-cddl">
1908+
session.Unsubscribe = (
1909+
method: "session.unsubscribe",
1910+
params: session.SubscriptionRequest
1911+
)
1912+
</pre>
19071913
</dd>
19081914
<dt>Result Type</dt>
19091915
<dd>
@@ -1916,14 +1922,20 @@ Issue: This needs to be generalised to work with realms too
19161922
<div algorithm="remote end steps for session.unsubscribe">
19171923
The [=remote end steps=] with |session| and |command parameters| are:
19181924

1919-
1. Let the |list of event names| be the value of the <code>events</code> field of
1920-
|command parameters|.
1925+
1. Let the |set of event names| be empty [=set=].
1926+
1927+
1. For each |event| of <code>command parameters</code>["events"], append |event| to |set of event names|.
1928+
1929+
1. Let |set of contexts| be null.
1930+
1931+
1. If the value of the <code>contexts</code> field of |command parameters| is not null.
1932+
1933+
1. Set |set of contexts| to empty [=set=].
19211934

1922-
1. Let the |list of contexts| be the value of the <code>contexts</code>
1923-
field of |command parameters| if it is present or null if it isn't.
1935+
1. For each |event| of <code>command parameters</code>["contexts"], append |event| to |set of contexts|.
19241936

19251937
1. [=Try=] to [=update the event map=] with |session|,
1926-
|list of event names|, |list of contexts| and enabled false.
1938+
|set of event names|, |list of contexts| and enabled false.
19271939

19281940
1. Return [=success=] with data null.
19291941

0 commit comments

Comments
 (0)