49
49
sotdAfterWGinfo : true ,
50
50
group : 'secondscreen' ,
51
51
github : 'https://github.com/w3c/presentation-api' ,
52
- xref : [ 'dom' , 'fileapi' , 'secure-contexts' , 'html' , 'url' , 'webidl' , 'webrtc' , 'websockets' ] ,
52
+ xref : [ 'dom' , 'fileapi' , 'secure-contexts' , 'html' , 'url' , 'webidl' , 'webrtc' , 'websockets' , 'infra' ] ,
53
53
localBiblio : {
54
54
DIAL : {
55
55
title : 'DIscovery And Launch Protocol Specification' ,
291
291
context of {{Promise}} objects are used as defined in [[!ECMASCRIPT]].
292
292
</ p >
293
293
< p >
294
- The terms < dfn data-cite ="rfc9110#field.accept-language "> Accept-Language</ dfn >
295
- and < dfn data-cite ="rfc9110#authentication "> HTTP authentication</ dfn > are
294
+ The terms < dfn data-cite =
295
+ "rfc9110#field.accept-language "> Accept-Language</ dfn > and
296
+ < dfn data-cite ="rfc9110#authentication "> HTTP authentication</ dfn > are
296
297
used as defined in [[!RFC9110]].
297
298
</ p >
298
299
< p >
@@ -835,7 +836,14 @@ <h3>
835
836
</ p >
836
837
< p >
837
838
The < a > task source</ a > for the tasks mentioned in this specification
838
- is the < var > presentation task source</ var > .
839
+ is the < dfn > presentation task source</ dfn > .
840
+ </ p >
841
+ < p >
842
+ When an algorithm < dfn data-lt ="queue a Presentation API task "> queues
843
+ a Presentation API task</ dfn > < var > T</ var > , the < a > user agent</ a >
844
+ MUST < a > queue a global task</ a > < var > T</ var > on the < a > presentation
845
+ task source</ a > using the < a > global object</ a > of the < a > current
846
+ realm</ a > .
839
847
</ p >
840
848
< p >
841
849
Unless otherwise specified, the < a > JavaScript realm</ a > for script
@@ -1104,16 +1112,16 @@ <h4>
1104
1112
</ ol > Then run the following steps:
1105
1113
< ol >
1106
1114
< li >
1107
- < a > Reject </ a > < var > P </ var > with a {{NotFoundError}}
1108
- exception.
1115
+ < a > Queue a Presentation API task </ a > to < a > reject </ a >
1116
+ < var > P </ var > with a {{NotFoundError}} exception.
1109
1117
</ li >
1110
1118
< li > Abort all remaining steps.
1111
1119
</ li >
1112
1120
</ ol >
1113
1121
</ li >
1114
- < li > If the user < em > denies permission</ em > to use a display, reject
1115
- < var > P</ var > with an {{NotAllowedError}} exception, and abort all
1116
- remaining steps.
1122
+ < li > If the user < em > denies permission</ em > to use a display,
1123
+ < a > queue a Presentation API task </ a > to reject < var > P</ var > with an
1124
+ {{NotAllowedError}} exception, and abort all remaining steps.
1117
1125
</ li >
1118
1126
< li > Otherwise, the user < em > grants permission</ em > to use a
1119
1127
display; let < var > D</ var > be that display.
@@ -1175,6 +1183,8 @@ <h4>
1175
1183
</ dd >
1176
1184
</ dl >
1177
1185
< ol >
1186
+ < li > Run the following steps < a > in parallel</ a > .
1187
+ </ li >
1178
1188
< li > Let < var > presentationUrls</ var > be the < a > presentation request
1179
1189
URLs</ a > of < var > presentationRequest</ var > .
1180
1190
</ li >
@@ -1221,6 +1231,9 @@ <h4>
1221
1231
</ dd >
1222
1232
</ dl >
1223
1233
< ol >
1234
+ < li >
1235
+ < a > Assert</ a > : this is running < a > in parallel</ a > .
1236
+ </ li >
1224
1237
< li > Let < var > I</ var > be a new < a > valid presentation identifier</ a >
1225
1238
unique among all < a > presentation identifiers</ a > for known
1226
1239
< a > presentation connections</ a > in the < a > set of controlled
@@ -1246,14 +1259,14 @@ <h4>
1246
1259
</ li >
1247
1260
< li > Add < var > S</ var > to the < a > set of controlled presentations</ a > .
1248
1261
</ li >
1249
- < li > If < var > P</ var > is provided, < a > resolve </ a > < var > P </ var > with
1250
- < var > S</ var > .
1262
+ < li > If < var > P</ var > is provided, < a > queue a Presentation API
1263
+ task </ a > to < a > resolve </ a > < var > P </ var > with < var > S</ var > .
1251
1264
</ li >
1252
1265
< li >
1253
- < a > Queue a task</ a > to [=fire an event=] named < a data-link-for =
1254
- "PresentationRequest "> connectionavailable</ a > , that uses the
1255
- < a > PresentationConnectionAvailableEvent</ a > interface, with the
1256
- < a data-link-for =
1266
+ < a > Queue a Presentation API task</ a > to [=fire an event=] named
1267
+ < a data-link-for = "PresentationRequest "> connectionavailable</ a > ,
1268
+ that uses the < a > PresentationConnectionAvailableEvent</ a >
1269
+ interface, with the < a data-link-for =
1257
1270
"PresentationConnectionAvailableEvent "> connection</ a > attribute
1258
1271
initialized to < var > S</ var > , at < var > presentationRequest</ var > .
1259
1272
The event must not bubble and must not be cancelable.
@@ -1313,8 +1326,8 @@ <h4>
1313
1326
< ol >
1314
1327
< li > Let < var > P</ var > be a new {{Promise}}.
1315
1328
</ li >
1316
- < li > Return < var > P</ var > , but continue running these steps in
1317
- parallel.
1329
+ < li > Return < var > P</ var > , but continue running these steps < a > in
1330
+ parallel</ a > .
1318
1331
</ li >
1319
1332
< li > Search the < a > set of controlled presentations</ a > for a
1320
1333
< a > PresentationConnection</ a > that meets the following criteria:
@@ -1341,8 +1354,8 @@ <h4>
1341
1354
< a > PresentationConnection</ a > .
1342
1355
</ li >
1343
1356
< li >
1344
- < a > Resolve </ a > < var > P </ var > with
1345
- < var > existingConnection</ var > .
1357
+ < a > Queue a Presentation API task </ a > to < a > resolve </ a >
1358
+ < var > P </ var > with < var > existingConnection</ var > .
1346
1359
</ li >
1347
1360
< li > If the < a > presentation connection state</ a > of
1348
1361
< var > existingConnection</ var > is < a data-link-for =
@@ -1404,11 +1417,12 @@ <h4>
1404
1417
presentations</ a > .
1405
1418
</ li >
1406
1419
< li >
1407
- < a > Resolve</ a > < var > P</ var > with < var > newConnection</ var > .
1420
+ < a > Queue a Presentation API task</ a > to < a > resolve</ a >
1421
+ < var > P</ var > with < var > newConnection</ var > .
1408
1422
</ li >
1409
1423
< li >
1410
- < a > Queue a task</ a > to [=fire an event=] named
1411
- < a data-link-for =
1424
+ < a > Queue a Presentation API task</ a > to [=fire an event=]
1425
+ named < a data-link-for =
1412
1426
"PresentationRequest "> connectionavailable</ a > , that uses the
1413
1427
< a > PresentationConnectionAvailableEvent</ a > interface, with
1414
1428
the < a data-link-for =
@@ -1426,7 +1440,8 @@ <h4>
1426
1440
</ ol >
1427
1441
</ li >
1428
1442
< li >
1429
- < a > Reject</ a > < var > P</ var > with a {{NotFoundError}} exception.
1443
+ < a > Queue a Presentation API task</ a > to < a > reject</ a >
1444
+ < var > P</ var > with a {{NotFoundError}} exception.
1430
1445
</ li >
1431
1446
</ ol >
1432
1447
</ section >
@@ -1620,8 +1635,8 @@ <h4>
1620
1635
then:
1621
1636
< ol >
1622
1637
< li >
1623
- < a > Reject </ a > < var > P </ var > with a {{NotSupportedError}}
1624
- exception.
1638
+ < a > Queue a Presentation API task </ a > to < a > reject </ a >
1639
+ < var > P </ var > with a {{NotSupportedError}} exception.
1625
1640
</ li >
1626
1641
< li > Abort all the remaining steps.
1627
1642
</ li >
@@ -1631,8 +1646,9 @@ <h4>
1631
1646
< var > presentationRequest</ var > is not < code > null</ code > , then:
1632
1647
< ol >
1633
1648
< li >
1634
- < a > Resolve</ a > < var > P</ var > with the request's
1635
- < a > presentation display availability</ a > .
1649
+ < a > Queue a Presentation API task</ a > to < a > resolve</ a >
1650
+ < var > P</ var > with the request's < a > presentation display
1651
+ availability</ a > .
1636
1652
</ li >
1637
1653
< li > Abort all the remaining steps.
1638
1654
</ li >
@@ -1657,7 +1673,8 @@ <h4>
1657
1673
</ div >
1658
1674
</ li >
1659
1675
< li >
1660
- < a > Resolve</ a > < var > P</ var > with < var > A</ var > .
1676
+ < a > Queue a Presentation API task</ a > to < a > resolve</ a >
1677
+ < var > P</ var > with < var > A</ var > .
1661
1678
</ li >
1662
1679
</ ol >
1663
1680
</ section >
@@ -1674,6 +1691,9 @@ <h4>
1674
1691
steps:
1675
1692
</ p >
1676
1693
< ol >
1694
+ < li >
1695
+ < a > Assert</ a > : this is running < a > in parallel</ a > .
1696
+ </ li >
1677
1697
< li > Let < var > availabilitySet</ var > be a shallow copy of the < a > set
1678
1698
of presentation availability objects</ a > .
1679
1699
</ li >
@@ -1741,8 +1761,8 @@ <h4>
1741
1761
< var > newAvailability</ var > and skip the following step.
1742
1762
</ li >
1743
1763
< li > If < var > previousAvailability</ var > is not equal to
1744
- < var > newAvailability</ var > , then < a > queue a task </ a > to run the
1745
- following steps:
1764
+ < var > newAvailability</ var > , then < a > queue a Presentation API
1765
+ task </ a > to run the following steps:
1746
1766
< ol >
1747
1767
< li > Set < var > A</ var > 's < a > value</ a > property to
1748
1768
< var > newAvailability</ var > .
@@ -2025,6 +2045,9 @@ <h4>
2025
2045
</ dd >
2026
2046
</ dl >
2027
2047
< ol >
2048
+ < li >
2049
+ < a > Assert</ a > : this is running < a > in parallel</ a > .
2050
+ </ li >
2028
2051
< li > If the < a > presentation connection state</ a > of
2029
2052
< var > presentationConnection</ var > is not < a data-link-for =
2030
2053
"PresentationConnectionState "> connecting</ a > , then abort all
@@ -2035,8 +2058,8 @@ <h4>
2035
2058
identifier</ a > of < var > presentationConnection</ var > MUST be sent
2036
2059
with this request.
2037
2060
</ li >
2038
- < li > If connection completes successfully, < a > queue a task </ a > to
2039
- run the following steps:
2061
+ < li > If connection completes successfully, < a > queue a Presentation
2062
+ API task </ a > to run the following steps:
2040
2063
< ol >
2041
2064
< li > Set the < a > presentation connection state</ a > of
2042
2065
< var > presentationConnection</ var > to < a data-link-for =
@@ -2191,6 +2214,9 @@ <h4>
2191
2214
</ dd >
2192
2215
</ dl >
2193
2216
< ol data-link-for ="PresentationConnection ">
2217
+ < li >
2218
+ < a > Assert</ a > : this is running < a > in parallel</ a > .
2219
+ </ li >
2194
2220
< li > If the < a > state</ a > property of
2195
2221
< var > presentationConnection</ var > is not < a data-link-for =
2196
2222
"PresentationConnectionState "> connected</ a > , abort these steps.
@@ -2220,8 +2246,8 @@ <h4>
2220
2246
</ ol >
2221
2247
</ li >
2222
2248
< li >
2223
- < a > Queue a task</ a > to [=fire an event|fire=] < var > event </ var > at
2224
- < var > presentationConnection</ var > .
2249
+ < a > Queue a Presentation API task</ a > to [=fire an event|fire=]
2250
+ < var > event </ var > at < var > presentationConnection</ var > .
2225
2251
</ li >
2226
2252
</ ol >
2227
2253
< p >
@@ -2386,7 +2412,7 @@ <h4>
2386
2412
< var > presentationConnection</ var > , then abort the remaining steps.
2387
2413
</ li >
2388
2414
< li >
2389
- < a > Queue a task</ a > to run the following steps:
2415
+ < a > Queue a Presentation API task</ a > to run the following steps:
2390
2416
< ol >
2391
2417
< li > If the < a > presentation connection state</ a > of
2392
2418
< var > presentationConnection</ var > is not < a data-link-for =
@@ -2453,7 +2479,9 @@ <h4>
2453
2479
connection</ var > is < a data-link-for =
2454
2480
"PresentationConnectionState "> connected</ a > or
2455
2481
< a data-link-for ="PresentationConnectionState "> connecting</ a > ,
2456
- then < a > queue a task</ a > to run the following steps:
2482
+ then < a > queue a global task</ a > on the < a > presentation task
2483
+ source</ a > given < var > known connection</ var > 's < a > relevant
2484
+ global object</ a > to run the following steps:
2457
2485
< ol >
2458
2486
< li > Set the < a > presentation connection state</ a > of
2459
2487
< var > known connection</ var > to < a data-link-for =
@@ -2467,9 +2495,9 @@ <h4>
2467
2495
</ ol >
2468
2496
</ li >
2469
2497
< li >
2470
- < dfn > Send a termination request</ dfn > for the presentation to its
2471
- < a > receiving user agent</ a > using an implementation specific
2472
- mechanism.
2498
+ < a > In parallel </ a > , < dfn > send a termination request</ dfn > for the
2499
+ presentation to its < a > receiving user agent</ a > using an
2500
+ implementation specific mechanism.
2473
2501
</ li >
2474
2502
</ ol >
2475
2503
</ section >
@@ -2535,10 +2563,10 @@ <h4>
2535
2563
the user interface and discard it.
2536
2564
</ li >
2537
2565
< li > For each < var > connection</ var > in
2538
- < var > connectedControllers</ var > , < a > queue a task </ a > to send a
2539
- termination confirmation for < var > P</ var > using an implementation
2540
- specific mechanism to the < a > controlling user agent</ a > that owns
2541
- the < a > destination browsing context</ a > for < var > connection</ var > .
2566
+ < var > connectedControllers</ var > , send a termination confirmation
2567
+ for < var > P</ var > using an implementation specific mechanism to the
2568
+ < a > controlling user agent</ a > that owns the < a > destination browsing
2569
+ context</ a > for < var > connection</ var > .
2542
2570
< p class ="note ">
2543
2571
Only one termination confirmation needs to be sent per
2544
2572
< a > controlling user agent</ a > .
@@ -2559,7 +2587,9 @@ <h4>
2559
2587
< ol >
2560
2588
< li > For each < var > connection</ var > in the < a > set of controlled
2561
2589
presentations</ a > that was connected to < var > P</ var > , < a > queue a
2562
- task</ a > to run the following steps:
2590
+ global task</ a > on the < a > presentation task source</ a > given < var >
2591
+ connection</ var > 's < a > relevant global object</ a > to run the
2592
+ following steps:
2563
2593
< ol >
2564
2594
< li > If the < a > presentation connection state</ a > of
2565
2595
< var > connection</ var > is not < a data-link-for =
@@ -2883,6 +2913,9 @@ <h4>
2883
2913
</ dd >
2884
2914
</ dl >
2885
2915
< ol >
2916
+ < li >
2917
+ < a > Assert</ a > : this is running < a > in parallel</ a > .
2918
+ </ li >
2886
2919
< li > If < var > presentationId</ var > and < var > I</ var > are not equal,
2887
2920
refuse the connection and abort all remaining steps.
2888
2921
</ li >
@@ -2920,9 +2953,9 @@ <h4>
2920
2953
the < a > set of presentation controllers</ a > .
2921
2954
</ li >
2922
2955
< li > If the < a > presentation controllers promise</ a > is not
2923
- < code > null</ code > , < a > resolve </ a > the < a > presentation
2924
- controllers promise </ a > with the < a > presentation controllers
2925
- monitor</ a > .
2956
+ < code > null</ code > , < a > queue a Presentation API task </ a > to < a >
2957
+ resolve </ a > the < a > presentation controllers promise </ a > with
2958
+ the < a > presentation controllers monitor</ a > .
2926
2959
</ li >
2927
2960
< li > Abort all remaining steps.
2928
2961
</ li >
@@ -2934,8 +2967,8 @@ <h4>
2934
2967
the < a > set of presentation controllers</ a > .
2935
2968
</ li >
2936
2969
< li >
2937
- < a > Queue a task</ a > to [=fire an event=] named
2938
- < a data-link-for =
2970
+ < a > Queue a Presentation API task</ a > to [=fire an event=]
2971
+ named < a data-link-for =
2939
2972
"PresentationConnectionList "> connectionavailable</ a > , that
2940
2973
uses the < a > PresentationConnectionAvailableEvent</ a >
2941
2974
interface, with the < a data-link-for =
0 commit comments