Skip to content

Commit f89fa4f

Browse files
committed
event bits
1 parent 05e040f commit f89fa4f

File tree

1 file changed

+27
-42
lines changed

1 file changed

+27
-42
lines changed

index.html

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ <h3>
292292
</dt>
293293
<dd>
294294
<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>.
297298
</p>
298299
</dd>
299300
</dl>
@@ -1347,7 +1348,17 @@ <h2>
13471348
interface PushEvent : ExtendableEvent {
13481349
constructor(DOMString type, optional PushEventInit eventInitDict = {});
13491350
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;
13501359
};
1360+
1361+
typedef (BufferSource or USVString) PushMessageDataInit;
13511362
</pre>
13521363
<p>
13531364
When a <dfn>constructor</dfn> of the <a>PushEvent</a> interface, or of an interface that
@@ -1368,41 +1379,6 @@ <h2>
13681379
<p>
13691380
The <dfn>data</dfn>, when getting, returns the value it was initialized with.
13701381
</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>
14061382
<p>
14071383
The <dfn>notification</dfn> attribute must return the value it was initialized with.
14081384
</p>
@@ -1506,19 +1482,23 @@ <h2>
15061482
<ol>
15071483
<li>
15081484
<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
15111487
properties:
15121488
</p>
15131489
<dl>
15141490
<dt>
1515-
`notification`
1491+
{{PushEvent/data}}
1492+
<dd>
1493+
null
1494+
<dt>
1495+
{{PushEvent/notification}}
15161496
</dt>
15171497
<dd>
15181498
|notification|
15191499
</dd>
15201500
<dt>
1521-
`appBadge`
1501+
{{PushEvent/appBadge}}
15221502
</dt>
15231503
<dd>
15241504
|declarativeResult|'s [=declarative push message parser result/app
@@ -1566,11 +1546,16 @@ <h2>
15661546
</p>
15671547
<dl>
15681548
<dt>
1569-
`data`
1549+
{{PushEvent//data}}
15701550
</dt>
15711551
<dd>
15721552
A new <a>PushMessageData</a> instance whose [=PushMessageData/bytes=] is |bytes|.
15731553
</dd>
1554+
<dt>
1555+
{{PushEvent/notification}}
1556+
<dd>null
1557+
<dt>{{PushEvent/appBadge}}
1558+
<dd>null
15741559
</dl>
15751560
<p>
15761561
Then run the following steps in parallel, with |dispatchedEvent|:

0 commit comments

Comments
 (0)