@@ -59,6 +59,9 @@ representing either a valid BCP 47 language tag or the empty string.
59
59
<p> A <a>notification</a> has an associated <dfn for=notification id=body>body</dfn> which is a
60
60
string.
61
61
62
+ <p> A <a>notification</a> has an associated <dfn for=notification>URL</dfn> which is null or a
63
+ <a for=/>URL</a> . It is initially null.
64
+
62
65
<p> A <a>notification</a> has an associated
63
66
<dfn for=notification id=tag>tag</dfn> which is a string.
64
67
@@ -135,6 +138,9 @@ for an end user. Each <a for=/>action</a> has an associated:
135
138
<dt> <dfn for=action id=action-title>title</dfn>
136
139
<dd> A string.
137
140
141
+ <dt> <dfn for=action>URL</dfn>
142
+ <dd> Null or a <a for=/>URL</a> . It is initially null.
143
+
138
144
<dt> <dfn for=action>icon URL</dfn>
139
145
<dd> Null or a <a for=/>URL</a> . It is initially null.
140
146
@@ -211,6 +217,11 @@ string <var>title</var>, {{NotificationOptions}} <a for=/>dictionary</a> <var>op
211
217
<li><p> Set <var> notification</var> 's <a for=notification>body</a> to
212
218
<var> options</var> ["{{NotificationOptions/body}}"] .
213
219
220
+ <li><p> If <var> options</var> ["{{NotificationOptions/url}}"] <a for=map>exists</a> , then
221
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure, set
222
+ <var> notification</var> 's <a for=notification>URL</a> to the return value. (Otherwise
223
+ <var> notification</var> 's <a for=notification>URL</a> remains null.)
224
+
214
225
<li><p> Set <var> notification</var> 's <a for=notification>tag</a> to
215
226
<var> options</var> ["{{NotificationOptions/tag}}"] .
216
227
@@ -266,6 +277,11 @@ string <var>title</var>, {{NotificationOptions}} <a for=/>dictionary</a> <var>op
266
277
<li><p> Set <var> action</var> 's <a for=action>title</a> to
267
278
<var> entry</var> ["{{NotificationAction/title}}"] .
268
279
280
+ <li><p> If <var> entry</var> ["{{NotificationAction/url}}"] <a for=map>exists</a> , then
281
+ <a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
282
+ set <var> action</var> 's <a for=action>URL</a> to the return value. (Otherwise <var>action</var>' s
283
+ <a for=action>URL</a> remains null.)
284
+
269
285
<li><p> If <var> entry</var> ["{{NotificationAction/icon}}"] <a for=map>exists</a> , then
270
286
<a lt="URL parser">parse</a> it using <var> baseURL</var> , and if that does not return failure,
271
287
set <var> action</var> 's <a for=action>icon URL</a> to the return value. (Otherwise
@@ -527,14 +543,39 @@ interpreted as a language tag. Validity or well-formedness are not enforced. [[!
527
543
platform supports activation, the user agent must (unless otherwise specified) run these steps:
528
544
529
545
<ol>
546
+ <li><p> Let <var> action</var> be null.
547
+
548
+ <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the end
549
+ user, then set <var> action</var> to that <a for=/>action</a> .
550
+
551
+ <li><p> Let <var> url</var> be <var> notification</var> 's <a for=notification>URL</a> .
552
+
553
+ <li>
554
+ <p> If <var> action</var> is non-null, then set <var> url</var> to <var> action</var> 's
555
+ <a for=action>URL</a> .
556
+
557
+ <p class=note> This intentionally makes it so that when an <a for=/>action</a> 's
558
+ <a for=action>URL</a> is null, it falls through to the <code> click</code> event, providing more
559
+ flexibility to the web developer.
560
+
561
+ <li>
562
+ <p> If <var> url</var> is non-null:
563
+
564
+ <ol>
565
+ <li><p> <a>Create a fresh top-level traversable</a> given <var> url</var> .
566
+ <!-- Should maybe set userInvolvement correctly here, even though it doesn't do anything today. -->
567
+
568
+ <li><p> Return.
569
+ </ol>
570
+
530
571
<li>
531
572
<p> If <var> notification</var> is a <a>persistent notification</a> , then:
532
573
533
574
<ol>
534
- <li><p> Let <var> action </var> be the empty string.
575
+ <li><p> Let <var> actionName </var> be the empty string.
535
576
536
- <li><p> If one of <var> notification </var> 's <a for=notification>actions</a> was activated by the
537
- user, then set <var> action </var> to that <a for=/>action</a> 's <a for=action>name</a> .
577
+ <li><p> If <var> action </var> is non-null, then set <var> actionName </var> to <var> action </var> 's
578
+ <a for=action>name</a> .
538
579
539
580
<li> <a>Fire a service worker notification event</a> named "<code> notificationclick</code> " given
540
581
<var> notification</var> and <var> action</var> .
@@ -620,6 +661,7 @@ interface Notification : EventTarget {
620
661
readonly attribute NotificationDirection dir;
621
662
readonly attribute DOMString lang;
622
663
readonly attribute DOMString body;
664
+ readonly attribute USVString url;
623
665
readonly attribute DOMString tag;
624
666
readonly attribute USVString image;
625
667
readonly attribute USVString icon;
@@ -639,6 +681,7 @@ dictionary NotificationOptions {
639
681
NotificationDirection dir = "auto";
640
682
DOMString lang = "";
641
683
DOMString body = "";
684
+ USVString url;
642
685
DOMString tag = "";
643
686
USVString image;
644
687
USVString icon;
@@ -667,6 +710,7 @@ enum NotificationDirection {
667
710
dictionary NotificationAction {
668
711
required DOMString action;
669
712
required DOMString title;
713
+ USVString url;
670
714
USVString icon;
671
715
};
672
716
@@ -820,6 +864,16 @@ return the <a>maximum number of actions</a> supported.
820
864
<p> The <dfn attribute for=Notification><code>body</code></dfn> getter steps are to return
821
865
<a>this</a> 's <a>notification</a>' s <a for=notification>body</a> .
822
866
867
+ <p> The <dfn attribute for=Notification><code>url</code></dfn> getter steps are:
868
+
869
+ <ol>
870
+ <li><p> If <a>this</a> 's <a>notification</a>' s <a for=notification>URL</a> is null, then return the
871
+ empty string.
872
+
873
+ <li><p> Return <a>this</a> 's <a>notification</a>' s <a for=notification>URL</a> ,
874
+ <a lt="URL serializer">serialized</a> .
875
+ </ol>
876
+
823
877
<p> The <dfn attribute for=Notification><code>tag</code></dfn> getter steps are to return
824
878
<a>this</a> 's <a>notification</a>' s <a for=notification>tag</a> .
825
879
@@ -892,6 +946,10 @@ then return null.
892
946
<li><p> Set <var> action</var> ["{{NotificationAction/title}}"] to <var> entry</var> 's
893
947
<a for=action>title</a> .
894
948
949
+ <li><p> If <var> entry</var> 's <a for=action>URL</a> is non-null, then set
950
+ <var> action</var> ["{{NotificationAction/url}}"] to <var> entry</var> 's <a for=action>URL</a> ,
951
+ <a lt="URL serializer">serialized</a> .
952
+
895
953
<li><p> If <var> entry</var> 's <a for=action>icon URL</a> is non-null, then set
896
954
<var> action</var> ["{{NotificationAction/icon}}"] to <var> entry</var> 's
897
955
<a for=action>icon URL</a> , <a lt="URL serializer">serialized</a> .
0 commit comments