292
292
</ dt >
293
293
< dd >
294
294
< p >
295
- A boolean. When true causes a < code > pushnotification</ code > to be dispatched to
296
- a service worker (if any).
295
+ A boolean. When true causes a < code > push</ code > event to be dispatched to a
296
+ service worker (if any) containing the {{Notification}} object described by the
297
+ < a > declarative push message</ a > .
297
298
</ p >
298
299
</ dd >
299
300
</ dl >
@@ -1347,7 +1348,17 @@ <h2>
1347
1348
interface PushEvent : ExtendableEvent {
1348
1349
constructor(DOMString type, optional PushEventInit eventInitDict = {});
1349
1350
readonly attribute PushMessageData? data;
1351
+ readonly attribute Notification? notification;
1352
+ readonly attribute unsigned long long? appBadge;
1353
+ };
1354
+
1355
+ dictionary PushEventInit : ExtendableEventInit {
1356
+ PushMessageDataInit? data = null;
1357
+ Notification? notification = null;
1358
+ unsigned long long? appBadge = null;
1350
1359
};
1360
+
1361
+ typedef (BufferSource or USVString) PushMessageDataInit;
1351
1362
</ pre >
1352
1363
< p >
1353
1364
When a < dfn > constructor</ dfn > of the < a > PushEvent</ a > interface, or of an interface that
@@ -1368,41 +1379,6 @@ <h2>
1368
1379
< p >
1369
1380
The < dfn > data</ dfn > , when getting, returns the value it was initialized with.
1370
1381
</ p >
1371
- </ section >
1372
- < section data-dfn-for ="PushEventInit ">
1373
- < h2 >
1374
- < dfn > PushEventInit</ dfn > dictionary
1375
- </ h2 >
1376
- < pre class ="idl " data-cite ="service-workers ">
1377
- typedef (BufferSource or USVString) PushMessageDataInit;
1378
-
1379
- dictionary PushEventInit : ExtendableEventInit {
1380
- PushMessageDataInit data;
1381
- };
1382
- </ pre >
1383
- < p >
1384
- The < dfn > data</ dfn > member contains the data included in the < a > push message</ a > when
1385
- included and the < a > user agent</ a > verified its authenticity. The value will be set to
1386
- `null` in all other cases.
1387
- </ p >
1388
- </ section >
1389
- < section data-dfn-for ="PushNotificationEvent ">
1390
- < h2 >
1391
- < dfn > PushNotificationEvent</ dfn > Interface
1392
- </ h2 >
1393
- < pre class ="idl " data-cite ="service-workers ">
1394
- [Exposed=ServiceWorker, SecureContext]
1395
- interface PushNotificationEvent : ExtendableEvent {
1396
- constructor(DOMString type, optional PushNotificationEventInit eventInitDict = {});
1397
- readonly attribute Notification notification;
1398
- readonly attribute unsigned long long? appBadge;
1399
- };
1400
-
1401
- dictionary PushNotificationEventInit : ExtendableEventInit {
1402
- required Notification notification;
1403
- unsigned long long? appBadge = null;
1404
- };
1405
- </ pre >
1406
1382
< p >
1407
1383
The < dfn > notification</ dfn > attribute must return the value it was initialized with.
1408
1384
</ p >
@@ -1506,19 +1482,23 @@ <h2>
1506
1482
< ol >
1507
1483
< li >
1508
1484
< p >
1509
- [=/Fire a functional event=] named "`pushnotification `" using
1510
- {{PushNotificationEvent }} on |registration| with the following
1485
+ [=/Fire a functional event=] named "`push `" using
1486
+ {{PushEvent }} on |registration| with the following
1511
1487
properties:
1512
1488
</ p >
1513
1489
< dl >
1514
1490
< dt >
1515
- `notification`
1491
+ {{PushEvent/data}}
1492
+ < dd >
1493
+ null
1494
+ < dt >
1495
+ {{PushEvent/notification}}
1516
1496
</ dt >
1517
1497
< dd >
1518
1498
|notification|
1519
1499
</ dd >
1520
1500
< dt >
1521
- ` appBadge`
1501
+ {{PushEvent/ appBadge}}
1522
1502
</ dt >
1523
1503
< dd >
1524
1504
|declarativeResult|'s [=declarative push message parser result/app
@@ -1566,11 +1546,16 @@ <h2>
1566
1546
</ p >
1567
1547
< dl >
1568
1548
< dt >
1569
- ` data`
1549
+ {{PushEvent// data}}
1570
1550
</ dt >
1571
1551
< dd >
1572
1552
A new < a > PushMessageData</ a > instance whose [=PushMessageData/bytes=] is |bytes|.
1573
1553
</ dd >
1554
+ < dt >
1555
+ {{PushEvent/notification}}
1556
+ < dd > null
1557
+ < dt > {{PushEvent/appBadge}}
1558
+ < dd > null
1574
1559
</ dl >
1575
1560
< p >
1576
1561
Then run the following steps in parallel, with |dispatchedEvent|:
0 commit comments