@@ -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
@@ -536,14 +552,39 @@ interpreted as a language tag. Validity or well-formedness are not enforced. [[!
536
552
platform supports activation, the user agent must (unless otherwise specified) run these steps:
537
553
538
554
<ol>
555
+ <li><p> Let <var> action</var> be null.
556
+
557
+ <li><p> If one of <var> notification</var> 's <a for=notification>actions</a> was activated by the end
558
+ user, then set <var> action</var> to that <a for=/>action</a> .
559
+
560
+ <li><p> Let <var> url</var> be <var> notification</var> 's <a for=notification>URL</a> .
561
+
562
+ <li>
563
+ <p> If <var> action</var> is non-null, then set <var> url</var> to <var> action</var> 's
564
+ <a for=action>URL</a> .
565
+
566
+ <p class=note> This intentionally makes it so that when an <a for=/>action</a> 's
567
+ <a for=action>URL</a> is null, it falls through to the <code> click</code> event, providing more
568
+ flexibility to the web developer.
569
+
570
+ <li>
571
+ <p> If <var> url</var> is non-null:
572
+
573
+ <ol>
574
+ <li><p> <a>Create a fresh top-level traversable</a> given <var> url</var> .
575
+ <!-- Should maybe set userInvolvement correctly here, even though it doesn't do anything today. -->
576
+
577
+ <li><p> Return.
578
+ </ol>
579
+
539
580
<li>
540
581
<p> If <var> notification</var> is a <a>persistent notification</a> , then:
541
582
542
583
<ol>
543
- <li><p> Let <var> action </var> be the empty string.
584
+ <li><p> Let <var> actionName </var> be the empty string.
544
585
545
- <li><p> If one of <var> notification </var> 's <a for=notification>actions</a> was activated by the
546
- user, then set <var> action </var> to that <a for=/>action</a> 's <a for=action>name</a> .
586
+ <li><p> If <var> action </var> is non-null, then set <var> actionName </var> to <var> action </var> 's
587
+ <a for=action>name</a> .
547
588
548
589
<li> <a>Fire a service worker notification event</a> named "<code> notificationclick</code> " given
549
590
<var> notification</var> and <var> action</var> .
@@ -637,6 +678,7 @@ interface Notification : EventTarget {
637
678
readonly attribute NotificationDirection dir;
638
679
readonly attribute DOMString lang;
639
680
readonly attribute DOMString body;
681
+ readonly attribute USVString url;
640
682
readonly attribute DOMString tag;
641
683
readonly attribute USVString image;
642
684
readonly attribute USVString icon;
@@ -656,6 +698,7 @@ dictionary NotificationOptions {
656
698
NotificationDirection dir = "auto";
657
699
DOMString lang = "";
658
700
DOMString body = "";
701
+ USVString url;
659
702
DOMString tag = "";
660
703
USVString image;
661
704
USVString icon;
@@ -684,6 +727,7 @@ enum NotificationDirection {
684
727
dictionary NotificationAction {
685
728
required DOMString action;
686
729
required DOMString title;
730
+ USVString url;
687
731
USVString icon;
688
732
};
689
733
@@ -849,6 +893,16 @@ return the <a>maximum number of actions</a> supported.
849
893
<p> The <dfn attribute for=Notification><code>body</code></dfn> getter steps are to return
850
894
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>body</a> .
851
895
896
+ <p> The <dfn attribute for=Notification><code>url</code></dfn> getter steps are:
897
+
898
+ <ol>
899
+ <li><p> If <a>this</a> 's <a>notification</a>' s <a for=notification>URL</a> is null, then return the
900
+ empty string.
901
+
902
+ <li><p> Return <a>this</a> 's <a>notification</a>' s <a for=notification>URL</a> ,
903
+ <a lt="URL serializer">serialized</a> .
904
+ </ol>
905
+
852
906
<p> The <dfn attribute for=Notification><code>tag</code></dfn> getter steps are to return
853
907
<a>this</a> 's <a for=/>notification</a>' s <a for=notification>tag</a> .
854
908
@@ -921,6 +975,10 @@ then return null.
921
975
<li><p> Set <var> action</var> ["{{NotificationAction/title}}"] to <var> entry</var> 's
922
976
<a for=action>title</a> .
923
977
978
+ <li><p> If <var> entry</var> 's <a for=action>URL</a> is non-null, then set
979
+ <var> action</var> ["{{NotificationAction/url}}"] to <var> entry</var> 's <a for=action>URL</a> ,
980
+ <a lt="URL serializer">serialized</a> .
981
+
924
982
<li><p> If <var> entry</var> 's <a for=action>icon URL</a> is non-null, then set
925
983
<var> action</var> ["{{NotificationAction/icon}}"] to <var> entry</var> 's
926
984
<a for=action>icon URL</a> , <a lt="URL serializer">serialized</a> .
0 commit comments