@@ -291,40 +291,21 @@ removed from the <a>list of notifications</a>.
291
291
"notification center" (if available).
292
292
293
293
294
- <h3 id=permission-model>Permission model</h3>
295
-
296
- <p> <a>Notifications</a> can only be displayed if the
297
- user (or user agent on behalf of the user) has granted <dfn>permission</dfn> .
298
- The <a>permission</a> to show <a>notifications</a>
299
- for a given <a for=/>origin</a> is one of three strings:
300
-
301
- <dl>
302
- <dt> "<code> default</code> "
303
- <dd><p> This is equivalent to "<code> denied</code> ", but the user has made no
304
- explicit choice thus far.
305
-
306
- <dt> "<code> denied</code> "
307
- <dd><p> This means the user does not want
308
- <a>notifications</a> .
294
+ <h3 id="permissions-integration">Permissions integration</h3>
309
295
310
- <dt> "<code> granted</code> "
311
- <dd><p> This means <a>notifications</a> can be
312
- displayed.
313
- </dl>
296
+ <p> The Notifications API is a <a>powerful feature</a> which is identified by the
297
+ <a for="powerful feature">name</a> "{{PermissionName/notifications}} ". [[!Permissions]]
314
298
315
- <p class=note> There is no equivalent to "<code> default</code> "
316
- meaning "<code> granted</code> ". In that case
317
- "<code> granted</code> " is simply returned as there would be no reason
318
- for the application to ask for <a>permission</a> .
299
+ <p> To <dfn>get the notifications permission state</dfn> , run these steps:
319
300
320
- <h3 id="permissions-integration">Permissions integration</h3>
301
+ <ol>
302
+ <li><p> Let <var> permissionState</var> be the result of <a>getting the current permission state</a>
303
+ with "{{PermissionName/notifications}} ".
321
304
322
- <p> The Notifications API is a <a>powerful feature</a> which is identified by the string
323
- "notifications" and has its <a for="powerful feature">allowed in non-secure contexts</a> flag set.
324
- [[!Permissions]]
305
+ <li><p> If <var> permissionState</var> is "<code> prompt</code> ", then return "<code> default</code> ".
325
306
326
- <p class="note"> This specification's " <code> default </code> " <a>permission</a>
327
- state maps to the [=permission/prompt=] permission state in the Permissions API.
307
+ <li><p> Return <var> permissionState </var> .
308
+ </ol>
328
309
329
310
330
311
<h3 id=direction>Direction</h3>
@@ -721,9 +702,9 @@ constructor steps are:
721
702
<p> Run these steps <a>in parallel</a> :
722
703
723
704
<ol>
724
- <li><p> If <a>permission</a> for <var> notification </var> 's <a for=notification>origin </a> is not
725
- "<code> granted</code> ", then <a>queue a task</a> to <a>fire an event</a> named <code> error </code>
726
- on <a>this</a> , and abort these steps.
705
+ <li><p> If the result of <a>getting the notifications permission state </a> is not
706
+ "<code> granted</code> ", then <a>queue a task</a> to <a>fire an event</a> named
707
+ <code> error </code> on <a>this</a> , and abort these steps.
727
708
728
709
<li><p> Run the <a>fetch steps</a> for <var> notification</var> .
729
710
@@ -735,8 +716,7 @@ constructor steps are:
735
716
<h3 id=static-members>Static members</h3>
736
717
737
718
<p> The static <dfn attribute for=Notification><code>permission</code></dfn> getter steps are to
738
- return the <a>permission</a> for the <a>current settings object</a> 's
739
- <a for="environment settings object">origin</a> .
719
+ return the result of <a>getting the notifications permission state</a> .
740
720
741
721
<div class=note>
742
722
<p> If you edit standards please refrain from copying the above. Synchronous permissions are like
@@ -760,27 +740,14 @@ method steps are:
760
740
<ol>
761
741
<li><p> Let <var> global</var> be the <a>current global object</a> .
762
742
763
- <li><p> Let <var> permissionDescriptor</var> be the {{PermissionDescriptor}} with
764
- {{PermissionDescriptor/name}} set to "<code> notifications</code> ".
765
-
766
- <li><p> Let <var> permissionStatus</var> be the result of
767
- <a lt="create a PermissionStatus">creating a `PermissionStatus`</a> for
768
- <var> permissionDescriptor</var> .
769
-
770
743
<li><p> Let <var> promise</var> be <a for=/>a new promise</a> in <a>this</a> 's <a>relevant Realm</a> .
771
744
772
745
<li>
773
746
<p> Run these steps <a>in parallel</a> :
774
747
775
748
<ol>
776
- <li><p> Run the <a for="powerful feature">permission query algorithm</a> with
777
- <var> permissionDescriptor</var> and <var> permissionStatus</var> .
778
-
779
- <li><p> Let <var> permissionState</var> be <var> permissionStatus</var> 's
780
- {{PermissionStatus/state}} .
781
-
782
- <li><p> If <var> permissionState</var> is {{PermissionState/"prompt"}} , then set
783
- <var> permissionState</var> to "<code> default</code> ".
749
+ <li><p> Let <var> permissionState</var> be the result of
750
+ <a>requesting permission to use</a> "{{PermissionName/notifications}} ".
784
751
785
752
<li>
786
753
<p> <a>Queue a global task</a> on the <a>DOM manipulation task source</a> given <var> global</var>
@@ -1083,7 +1050,7 @@ method steps are:
1083
1050
<p> Run these steps <a>in parallel</a> :
1084
1051
1085
1052
<ol>
1086
- <li><p> If <a>permission</a> for <var> notification </var> 's <a for=notification>origin </a> is not
1053
+ <li><p> If the result of <a>getting the notifications permission state </a> is not
1087
1054
"<code> granted</code> ", then <a>queue a global task</a> on the
1088
1055
<a>DOM manipulation task source</a> given <var> global</var> to <a for=/>reject</a>
1089
1056
<var> promise</var> with a {{TypeError}} , and abort these steps.
0 commit comments