@@ -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 export for=notification>navigation URL</dfn>
64
+ (null or a <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
@@ -137,6 +140,9 @@ support these features might ignore them.
137
140
<dt> <dfn for="notification action" id=action-title>title</dfn>
138
141
<dd> A string.
139
142
143
+ <dt> <dfn export for="notification action">navigation URL</dfn>
144
+ <dd> Null or a <a for=/>URL</a> . It is initially null.
145
+
140
146
<dt> <dfn for="notification action" id=action-icon-url>icon URL</dfn>
141
147
<dd> Null or a <a for=/>URL</a> . It is initially null.
142
148
@@ -220,6 +226,11 @@ important information through, e.g., loss of color or clipped corners.
220
226
<li><p> Set <var> notification</var> 's <a for=notification>body</a> to
221
227
<var> options</var> ["{{NotificationOptions/body}}"] .
222
228
229
+ <li><p> If <var> options</var> ["{{NotificationOptions/navigate}}"] <a for=map>exists</a> , then
230
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure, set
231
+ <var> notification</var> 's <a for=notification>navigation URL</a> to the return value. (Otherwise
232
+ <var> notification</var> 's <a for=notification>navigation URL</a> remains null.)
233
+
223
234
<li><p> Set <var> notification</var> 's <a for=notification>tag</a> to
224
235
<var> options</var> ["{{NotificationOptions/tag}}"] .
225
236
@@ -270,6 +281,11 @@ important information through, e.g., loss of color or clipped corners.
270
281
<li><p> Set <var> action</var> 's <a for="notification action">title</a> to
271
282
<var> entry</var> ["{{NotificationAction/title}}"] .
272
283
284
+ <li><p> If <var> entry</var> ["{{NotificationAction/navigate}}"] <a for=map>exists</a> , then
285
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
286
+ set <var> action</var> 's <a for="notification action">navigation URL</a> to the return value.
287
+ (Otherwise <var> action</var> 's <a for="notification action">navigation URL</a> remains null.)
288
+
273
289
<li><p> If <var> entry</var> ["{{NotificationAction/icon}}"] <a for=map>exists</a> , then
274
290
<a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
275
291
set <var> action</var> 's <a for="notification action">icon URL</a> to the return value. (Otherwise
@@ -541,18 +557,51 @@ interpreted as a language tag. Validity or well-formedness are not enforced. [[!
541
557
platform supports activation, the user agent must (unless otherwise specified) run these steps:
542
558
543
559
<ol>
560
+ <li><p> Let <var> action</var> be null.
561
+
562
+ <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the end
563
+ user, then set <var> action</var> to that <a for=/>action</a> .
564
+
565
+ <li><p> Let <var> navigationURL</var> be <var> notification</var> 's
566
+ <a for=notification>navigation URL</a> .
567
+
568
+ <li>
569
+ <p> If <var> action</var> is non-null, then set <var> navigationURL</var> to <var> action</var> 's
570
+ <a for="notification action">navigation URL</a> .
571
+
572
+ <p class=note> This intentionally makes it so that when an <a for=/>action</a> 's
573
+ <a for="notification action">navigation URL</a> is null, it falls through to the
574
+ <code> click</code> event, providing more flexibility to the web developer.
575
+
576
+ <li>
577
+ <p> If <var> navigationURL</var> is non-null:
578
+
579
+ <ol>
580
+ <li><p> If there is an existing <a for=/>top-level traversable</a> <var> traversable</var> within
581
+ the user agent's <a for="user agent">top-level traversable set</a> whose
582
+ <a for="navigable">active document</a> 's <a for=Document>URL</a> <a for=url>equals</a>
583
+ <var> navigationURL</var> with <a for=url/equals><i>exclude fragments</i></a> set to true, then
584
+ <a for=/>navigate</a> <var> traversable</var> to <var> navigationURL</var> and return. If there are
585
+ multiple <a for=/>top-level traversables</a> that satisfy the condition the user agent has to
586
+ pick one in an <a>implementation-defined</a> manner.
587
+ <!-- Should maybe set userInvolvement correctly here and below. -->
588
+
589
+ <li><p> <a>Create a fresh top-level traversable</a> given <var> navigationURL</var> .
590
+
591
+ <li><p> Return.
592
+ </ol>
593
+
544
594
<li>
545
595
<p> If <var> notification</var> is a <a>persistent notification</a> , then:
546
596
547
597
<ol>
548
- <li><p> Let <var> action </var> be the empty string.
598
+ <li><p> Let <var> actionName </var> be the empty string.
549
599
550
- <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the
551
- user, then set <var> action</var> to that <a for=/>notification action</a> 's
600
+ <li><p> If <var> action</var> is non-null, then set <var> actionName</var> to <var> action</var> 's
552
601
<a for="notification action">name</a> .
553
602
554
603
<li> <a>Fire a service worker notification event</a> named "<code> notificationclick</code> " given
555
- <var> notification</var> and <var> action </var> .
604
+ <var> notification</var> and <var> actionName </var> .
556
605
</ol>
557
606
558
607
<li>
@@ -643,6 +692,7 @@ interface Notification : EventTarget {
643
692
readonly attribute NotificationDirection dir;
644
693
readonly attribute DOMString lang;
645
694
readonly attribute DOMString body;
695
+ readonly attribute USVString navigate;
646
696
readonly attribute DOMString tag;
647
697
readonly attribute USVString image;
648
698
readonly attribute USVString icon;
@@ -662,6 +712,7 @@ dictionary NotificationOptions {
662
712
NotificationDirection dir = "auto";
663
713
DOMString lang = "";
664
714
DOMString body = "";
715
+ USVString navigate;
665
716
DOMString tag = "";
666
717
USVString image;
667
718
USVString icon;
@@ -690,6 +741,7 @@ enum NotificationDirection {
690
741
dictionary NotificationAction {
691
742
required DOMString action;
692
743
required DOMString title;
744
+ USVString navigate;
693
745
USVString icon;
694
746
};
695
747
@@ -853,6 +905,16 @@ return the <a>maximum number of actions</a> supported.
853
905
<p> The <dfn attribute for=Notification><code>body</code></dfn> getter steps are to return
854
906
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>body</a> .
855
907
908
+ <p> The <dfn attribute for=Notification><code>navigate</code></dfn> getter steps are:
909
+
910
+ <ol>
911
+ <li><p> If <a>this</a> 's <a>notification</a>' s <a for=notification>navigation URL</a> is null, then
912
+ return the empty string.
913
+
914
+ <li><p> Return <a>this</a> 's <a>notification</a>' s <a for=notification>navigation URL</a> ,
915
+ <a lt="URL serializer">serialized</a> .
916
+ </ol>
917
+
856
918
<p> The <dfn attribute for=Notification><code>tag</code></dfn> getter steps are to return
857
919
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>tag</a> .
858
920
@@ -925,6 +987,10 @@ then return null.
925
987
<li><p> Set <var> action</var> ["{{NotificationAction/title}}"] to <var> entry</var> 's
926
988
<a for="notification action">title</a> .
927
989
990
+ <li><p> If <var> entry</var> 's <a for="notification action">navigation URL</a> is non-null, then
991
+ set <var> action</var> ["{{NotificationAction/navigate}}"] to <var> entry</var> 's
992
+ <a for="notification action">navigation URL</a> , <a lt="URL serializer">serialized</a> .
993
+
928
994
<li><p> If <var> entry</var> 's <a for="notification action">icon URL</a> is non-null, then set
929
995
<var> action</var> ["{{NotificationAction/icon}}"] to <var> entry</var> 's
930
996
<a for="notification action">icon URL</a> , <a lt="URL serializer">serialized</a> .
0 commit comments