@@ -60,6 +60,9 @@ or "<code>rtl</code>").
60
60
<p> A <a for=/>notification</a> has an associated <dfn for=notification id=body>body</dfn> (a
61
61
string).
62
62
63
+ <p> A <a for=/>notification</a> has an associated <dfn for=notification>URL</dfn> (null or a
64
+ <a for=/>URL</a> ). It is initially null.
65
+
63
66
<p> A <a for=/>notification</a> has an associated <dfn for=notification id=tag>tag</dfn> (a string).
64
67
65
68
<p> A <a for=/>notification</a> has an associated <dfn for=notification id=data>data</dfn> (a
@@ -136,6 +139,9 @@ for an end user. Each <a for=/>action</a> has an associated:
136
139
<dt> <dfn for=action id=action-title>title</dfn>
137
140
<dd> A string.
138
141
142
+ <dt> <dfn for=action>URL</dfn>
143
+ <dd> Null or a <a for=/>URL</a> . It is initially null.
144
+
139
145
<dt> <dfn for=action>icon URL</dfn>
140
146
<dd> Null or a <a for=/>URL</a> . It is initially null.
141
147
@@ -219,6 +225,11 @@ clipped corners.
219
225
<li><p> Set <var> notification</var> 's <a for=notification>body</a> to
220
226
<var> options</var> ["{{NotificationOptions/body}}"] .
221
227
228
+ <li><p> If <var> options</var> ["{{NotificationOptions/url}}"] <a for=map>exists</a> , then
229
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure, set
230
+ <var> notification</var> 's <a for=notification>URL</a> to the return value. (Otherwise
231
+ <var> notification</var> 's <a for=notification>URL</a> remains null.)
232
+
222
233
<li><p> Set <var> notification</var> 's <a for=notification>tag</a> to
223
234
<var> options</var> ["{{NotificationOptions/tag}}"] .
224
235
@@ -269,6 +280,11 @@ clipped corners.
269
280
<li><p> Set <var> action</var> 's <a for=action>title</a> to
270
281
<var> entry</var> ["{{NotificationAction/title}}"] .
271
282
283
+ <li><p> If <var> entry</var> ["{{NotificationAction/url}}"] <a for=map>exists</a> , then
284
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
285
+ set <var> action</var> 's <a for=action>URL</a> to the return value. (Otherwise <var>action</var>' s
286
+ <a for=action>URL</a> remains null.)
287
+
272
288
<li><p> If <var> entry</var> ["{{NotificationAction/icon}}"] <a for=map>exists</a> , then
273
289
<a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
274
290
set <var> action</var> 's <a for=action>icon URL</a> to the return value. (Otherwise
@@ -539,14 +555,39 @@ interpreted as a language tag. Validity or well-formedness are not enforced. [[!
539
555
platform supports activation, the user agent must (unless otherwise specified) run these steps:
540
556
541
557
<ol>
558
+ <li><p> Let <var> action</var> be null.
559
+
560
+ <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the end
561
+ user, then set <var> action</var> to that <a for=/>action</a> .
562
+
563
+ <li><p> Let <var> url</var> be <var> notification</var> 's <a for=notification>URL</a> .
564
+
565
+ <li>
566
+ <p> If <var> action</var> is non-null, then set <var> url</var> to <var> action</var> 's
567
+ <a for=action>URL</a> .
568
+
569
+ <p class=note> This intentionally makes it so that when an <a for=/>action</a> 's
570
+ <a for=action>URL</a> is null, it falls through to the <code> click</code> event, providing more
571
+ flexibility to the web developer.
572
+
573
+ <li>
574
+ <p> If <var> url</var> is non-null:
575
+
576
+ <ol>
577
+ <li><p> <a>Create a fresh top-level traversable</a> given <var> url</var> .
578
+ <!-- Should maybe set userInvolvement correctly here, even though it doesn't do anything today. -->
579
+
580
+ <li><p> Return.
581
+ </ol>
582
+
542
583
<li>
543
584
<p> If <var> notification</var> is a <a>persistent notification</a> , then:
544
585
545
586
<ol>
546
- <li><p> Let <var> action </var> be the empty string.
587
+ <li><p> Let <var> actionName </var> be the empty string.
547
588
548
- <li><p> If one of <var> notification </var> 's <a for=notification>actions</a> was activated by the
549
- user, then set <var> action </var> to that <a for=/>action</a> 's <a for=action>name</a> .
589
+ <li><p> If <var> action </var> is non-null, then set <var> actionName </var> to <var> action </var> 's
590
+ <a for=action>name</a> .
550
591
551
592
<li> <a>Fire a service worker notification event</a> named "<code> notificationclick</code> " given
552
593
<var> notification</var> and <var> action</var> .
@@ -640,6 +681,7 @@ interface Notification : EventTarget {
640
681
readonly attribute NotificationDirection dir;
641
682
readonly attribute DOMString lang;
642
683
readonly attribute DOMString body;
684
+ readonly attribute USVString url;
643
685
readonly attribute DOMString tag;
644
686
readonly attribute USVString image;
645
687
readonly attribute USVString icon;
@@ -659,6 +701,7 @@ dictionary NotificationOptions {
659
701
NotificationDirection dir = "auto";
660
702
DOMString lang = "";
661
703
DOMString body = "";
704
+ USVString url;
662
705
DOMString tag = "";
663
706
USVString image;
664
707
USVString icon;
@@ -687,6 +730,7 @@ enum NotificationDirection {
687
730
dictionary NotificationAction {
688
731
required DOMString action;
689
732
required DOMString title;
733
+ USVString url;
690
734
USVString icon;
691
735
};
692
736
@@ -850,6 +894,16 @@ return the <a>maximum number of actions</a> supported.
850
894
<p> The <dfn attribute for=Notification><code>body</code></dfn> getter steps are to return
851
895
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>body</a> .
852
896
897
+ <p> The <dfn attribute for=Notification><code>url</code></dfn> getter steps are:
898
+
899
+ <ol>
900
+ <li><p> If <a>this</a> 's <a>notification</a>' s <a for=notification>URL</a> is null, then return the
901
+ empty string.
902
+
903
+ <li><p> Return <a>this</a> 's <a>notification</a>' s <a for=notification>URL</a> ,
904
+ <a lt="URL serializer">serialized</a> .
905
+ </ol>
906
+
853
907
<p> The <dfn attribute for=Notification><code>tag</code></dfn> getter steps are to return
854
908
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>tag</a> .
855
909
@@ -922,6 +976,10 @@ then return null.
922
976
<li><p> Set <var> action</var> ["{{NotificationAction/title}}"] to <var> entry</var> 's
923
977
<a for=action>title</a> .
924
978
979
+ <li><p> If <var> entry</var> 's <a for=action>URL</a> is non-null, then set
980
+ <var> action</var> ["{{NotificationAction/url}}"] to <var> entry</var> 's <a for=action>URL</a> ,
981
+ <a lt="URL serializer">serialized</a> .
982
+
925
983
<li><p> If <var> entry</var> 's <a for=action>icon URL</a> is non-null, then set
926
984
<var> action</var> ["{{NotificationAction/icon}}"] to <var> entry</var> 's
927
985
<a for=action>icon URL</a> , <a lt="URL serializer">serialized</a> .
0 commit comments