Overview.html
author Anne van Kesteren <annevk@opera.com>
Tue, 12 Jun 2012 10:04:02 +0200
changeset 9 13eb4cb483c5
parent 8 f06ff848e6c0
child 10 9d74ad61c3c8
permissions -rw-r--r--
use permission concept
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     1
<!DOCTYPE html><html lang="en-US"><meta charset="utf-8">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     2
<title>Web Notifications</title>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     3
<style>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     4
 pre.idl { border:solid thin; background:#eee; color:#000; padding:0.5em 1em }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     5
 pre.idl :link, pre.idl :visited { color:inherit; background:transparent }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     6
 pre code { color:inherit; background:transparent }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     7
 pre.css { border: solid 0.0625em; background: #FFFFEE; color: black; padding: 0.5em 1em; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     8
 .example { margin-left:1em; padding-left:1em; border-left:double; color:#222; background:#fcfcfc }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
     9
 .note { margin-left:2em; font-weight:bold; font-style:italic; color:#008000 }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    10
 p.note::before { content:"Note: " }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    11
 .XXX { padding:.5em; border:solid #f00 }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    12
 p.XXX::before { content:"Issue: " }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    13
 dl.switch { padding-left:2em }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    14
 dl.switch > dt { text-indent:-1.5em }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    15
 dl.switch > dt:before { content:'\21AA'; padding:0 0.5em 0 0; display:inline-block; width:1em; text-align:right; line-height:0.5em }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    16
 dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    17
 dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    18
 dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    19
 dl.domintro dd p { margin: 0.5em 0; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    20
 dl.domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: red; border: solid 2px; background: white; padding: 0 0.25em; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    21
 em.ct { text-transform:lowercase; font-variant:small-caps; font-style:normal }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    22
 dfn { font-weight:bold; font-style:normal }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    23
 code { color:orangered }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    24
 code :link, code :visited { color:inherit }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    25
 hr:not(.top) { display:block; background:none; border:none; padding:0; margin:2em 0; height:auto }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    26
 table { border-collapse:collapse; border-style:hidden hidden none hidden }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    27
 table thead { border-bottom:solid }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    28
 table tbody th:first-child { border-left:solid }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    29
 table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    30
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    31
 .warning { color: red; background: transparent; font-weight: bolder; font-style: italic; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    32
 .warning p:first-child { margin-top: 0; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    33
 .warning p:last-child { margin-bottom: 0; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    34
 .warning:before { font-style: normal; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    35
 p.warning:before { content: '\26A0 Warning! '; }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    36
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    37
 @media print {
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    38
   [data-anolis-spec]::after { content:"[" attr(data-anolis-spec) "]"; font-size:.6em; vertical-align:super; text-transform:uppercase }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    39
 }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    40
</style>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    41
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    42
<div class="head">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    43
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    44
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    45
<!--begin-logo-->
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    46
<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    47
<!--end-logo-->
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    48
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    49
<h1>Web Notifications</h1>
7
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
    50
<h2 class="no-num no-toc" id="editor's-draft-12-june-2012">Editor's Draft 12 June 2012</h2>
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    51
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    52
<dl>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    53
 <dt>This Version:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    54
 <dd class="dontpublish"><a href="http://dvcs.w3.org/hg/notifications/raw-file/tip/Overview.html">http://dvcs.w3.org/hg/notifications/raw-file/tip/Overview.html</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    55
 <dt class="dontpublish">Participate:</dt>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    56
 <dd class="dontpublish">Send feedback to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    57
  <a href="mailto:public-web-notification@w3.org">public-web-notification@w3.org</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    58
  (<a href="http://lists.w3.org/Archives/Public/public-web-notification/">archives</a>)
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    59
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    60
 <dt>Version History:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    61
 <dd><a href="http://dvcs.w3.org/hg/notifications/shortlog">http://dvcs.w3.org/hg/notifications/shortlog</a></dd>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    62
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    63
 <dt>Editor:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    64
 <dd><a href="http://annevankesteren.nl/">Anne van Kesteren</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    65
 (<a href="http://www.opera.com/">Opera Software ASA</a>)
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    66
 &lt;<a href="mailto:annevk@annevk.nl">annevk@annevk.nl</a>&gt;</dd>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    67
 <dd>John Gregg (<a href="http://www.google.com/">Google</a>)
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    68
 &lt;<a href="mailto:johnnyg@google.com">johnnyg@google.com</a>&gt;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    69
</dl>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    70
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    71
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    72
<!--begin-copyright-->
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    73
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2012 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    74
<!--end-copyright-->
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    75
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    76
</div>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    77
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    78
<hr>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    79
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    80
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    81
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    82
<p>This document defines an API for displaying simple notifications to the user.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    83
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    84
<h2 class="no-num no-toc" id="sotd">Status of this document</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    85
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    86
<p>This document is an Editor's Draft and is not suitable for purposes other than reviewing the specification being developed.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    87
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    88
<h2 class="no-num no-toc" id="table-of-contents">Table of contents</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    89
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    90
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    91
<!--begin-toc-->
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    92
<ol class="toc">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    93
 <li><a href="#introduction"><span class="secno">1 </span>Introduction</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    94
 <li><a href="#conformance"><span class="secno">2 </span>Conformance</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    95
  <ol class="toc">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    96
   <li><a href="#security"><span class="secno">2.1 </span>Security</a></ol></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    97
 <li><a href="#terminology"><span class="secno">3 </span>Terminology</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    98
 <li><a href="#model"><span class="secno">4 </span>Model</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
    99
  <ol class="toc">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   100
   <li><a href="#permission"><span class="secno">4.1 </span>Permission</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   101
   <li><a href="#notification-lists"><span class="secno">4.2 </span>Notification lists</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   102
   <li><a href="#showing-a-notification"><span class="secno">4.3 </span>Showing a notification</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   103
   <li><a href="#closing-a-notification"><span class="secno">4.4 </span>Closing a notification</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   104
   <li><a href="#pending-notifications"><span class="secno">4.5 </span>Pending notifications</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   105
   <li><a href="#displaying-notifications"><span class="secno">4.6 </span>Displaying notifications</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   106
   <li><a href="#replacing-a-notification"><span class="secno">4.7 </span>Replacing a notification</a></ol></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   107
 <li><a href="#api"><span class="secno">5 </span>API</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   108
 <li><a href="#rendering"><span class="secno">6 </span>Rendering</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   109
 <li><a href="#examples"><span class="secno">7 </span>Examples</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   110
  <ol class="toc">
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   111
   <li><a href="#using-events"><span class="secno">7.1 </span>Using events</a></li>
7
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
   112
   <li><a href="#tags-example"><span class="secno">7.2 </span>Using the <code title="">tag</code> member for multiple instances</a></li>
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
   113
   <li><a href="#using-the-tag-member-for-a-single-instance"><span class="secno">7.3 </span>Using the <code title="">tag</code> member for a single instance</a></ol></li>
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   114
 <li><a class="no-num" href="#references">References</a></li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   115
 <li><a class="no-num" href="#acknowledgments">Acknowledgments</a></ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   116
<!--end-toc-->
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   117
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   118
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   119
<h2 id="introduction"><span class="secno">1 </span>Introduction</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   120
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   121
<p>This specification provides an API to display notifications to alert
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   122
users outside the context of a web page. It does not specify exactly how a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   123
user agent should display these notifications; the best presentation depends
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   124
on the device where the user agent is run. When this specification refers
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   125
to displaying notifications on the "desktop", it generally refers to some
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   126
static display area outside the web page, but may take several forms,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   127
including:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   128
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   129
<ul>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   130
 <li>A corner of the user's display.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   131
 <li>An area within the chrome of the user agent.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   132
 <li>The "home" screen of a mobile device.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   133
</ul>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   134
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   135
<p>This specification does not define exactly how the user agent should
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   136
display the notification, and the API is designed to be flexible with
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   137
respect to presentation options.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   138
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   139
<p>This specification is designed to be compatible with existing
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   140
notification platforms as much as possible, but also to be
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   141
platform-independent. Since the common platforms do not provide the same
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   142
functionality, this spec will indicate what events are guaranteed and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   143
which are not. In particular, notifications as specified here only can
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   144
contain text and icon content. In the future, notifications generated from
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   145
web content may wish to contain web content themselves, but that is outside
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   146
the scope of this document.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   147
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   148
<p>In general, the event model for notifications is best-effort; while the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   149
<code><a href="#notification">Notification</a></code> object offers a <code title="">click</code> event,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   150
applications may enhance their functionality by listening for that event,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   151
but <em>must not depend on receiving it</em>, in case the underlying
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   152
notification platform does not provide that capability.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   153
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   154
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   155
<h2 id="conformance"><span class="secno">2 </span>Conformance</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   156
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   157
<p>All diagrams, examples, and notes in this specification are
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   158
non-normative, as are all sections explicitly marked non-normative.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   159
Everything else in this specification is normative.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   160
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   161
<p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   162
NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   163
"OPTIONAL" in the normative parts of this specification are to be
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   164
interpreted as described in RFC2119. For readability, these words do
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   165
not appear in all uppercase letters in this specification.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   166
<a href="#refsRFC2119">[RFC2119]</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   167
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   168
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   169
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   170
<h3 id="security"><span class="secno">2.1 </span>Security</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   171
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   172
<p>Notifications should only be presented when the user has indicated they
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   173
are desired; without this they could create a negative experience for the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   174
user.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   175
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   176
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   177
<h2 id="terminology"><span class="secno">3 </span>Terminology</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   178
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   179
<p>Most terminology used in this specification is from DOM and HTML.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   180
<a href="#refsDOM">[DOM]</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   181
<a href="#refsHTML">[HTML]</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   182
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   183
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   184
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   185
<h2 id="model"><span class="secno">4 </span>Model</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   186
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   187
<p>A <dfn id="concept-notification" title="concept-notification">notification</dfn> allows alerting the
6
Anne van Kesteren <annevk@opera.com>
parents: 5
diff changeset
   188
user outside the context of a web page of an occurrence, such as the
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   189
delivery of email.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   190
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   191
<p>Each <a href="#concept-notification" title="concept-notification">notification</a> has a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   192
<dfn id="title">title</dfn>. For specification simplicity each
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   193
<a href="#concept-notification" title="concept-notification">notification</a> also has a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   194
<dfn id="title-direction">title direction</dfn> and <dfn id="body-direction">body direction</dfn>, both of which are
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   195
initially "<code title="">auto</code>".
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   196
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   197
<p>Each <a href="#concept-notification" title="concept-notification">notification</a> <em>can</em>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   198
have an associated <dfn id="body">body</dfn>, <dfn id="tag">tag</dfn>, and <dfn id="icon-url">icon URL</dfn>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   199
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   200
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   201
<h3 id="permission"><span class="secno">4.1 </span>Permission</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   202
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   203
<p><a href="#concept-notification" title="concept-notification">Notifications</a> can only be
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   204
displayed if the user (or user agent on behalf of the user) has granted
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   205
<dfn id="permission-0">permission</dfn>. The <a href="#permission-0">permission</a> to display
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   206
<a href="#concept-notification" title="concept-notification">notifications</a> for a given
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   207
<a class="external" href="http://tools.ietf.org/html/rfc6454#section-4">origin</a> can be one of three strings:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   208
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   209
<dl>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   210
 <dt>"<code title="">default</code>"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   211
 <dd><p>This is equivalent to "<code title="">denied</code>", but the user has
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   212
 made no explicit choice thus far.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   213
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   214
 <dt>"<code title="">denied</code>"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   215
 <dd><p>This means the user does not want
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   216
 <a href="#concept-notification" title="concept-notification">notifications</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   217
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   218
 <dt>"<code title="">granted</code>"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   219
 <dd><p>This means <a href="#concept-notification" title="concept-notification">notifications</a> can
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   220
 be displayed.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   221
</dl>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   222
2
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   223
<p class="note">There is no equivalent to "<code title="">default</code>"
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   224
meaning "<code title="">granted</code>". In that case
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   225
"<code title="">granted</code>" is simply returned as there would be no reason
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   226
for the application to ask for <a href="#permission-0">permission</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   227
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   228
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   229
<h3 id="notification-lists"><span class="secno">4.2 </span>Notification lists</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   230
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   231
<p>The user agent must keep a <dfn id="list-of-pending-notifications">list of pending notifications</dfn> and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   232
a <dfn id="list-of-active-notifications">list of active notifications</dfn>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   233
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   234
<h3 id="showing-a-notification"><span class="secno">4.3 </span>Showing a notification</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   235
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   236
<p>The <dfn id="show-steps">show steps</dfn> for a given <var title="">notification</var> are:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   237
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   238
<ol>
2
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   239
 <li><p>If <a href="#permission-0">permission</a> for the current
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   240
 <a class="external" href="http://tools.ietf.org/html/rfc6454#section-4">origin</a> is not
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   241
 "<code title="">granted</code>", cancel any ongoing
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   242
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> for
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   243
 <var title="">notification</var>'s <a href="#icon-url">icon URL</a>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   244
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   245
 <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a> named
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   246
 <code title="">error</code> on <var title="">notification</var>, and terminate
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   247
 these steps.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   248
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   249
 <li><p>If there is a <a href="#concept-notification" title="concept-notification">notification</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   250
 in the <a href="#list-of-pending-notifications">list of pending notifications</a> or the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   251
 <a href="#list-of-active-notifications">list of active notifications</a> whose <a href="#tag">tag</a> equals
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   252
 <var title="">notification</var>'s <a href="#tag">tag</a>, run the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   253
 <a href="#replace-steps">replace steps</a> and terminate these steps.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   254
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   255
 <li><p>If the device allows notifications to be displayed immediately
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   256
 without limitations on the number of concurrent notifications, run
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   257
 the <a href="#display-steps">display steps</a> and terminate these steps.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   258
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   259
 <li><p>If the device has limitations on the number of concurrent
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   260
 notifications, either immediately call to a notifications platform which
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   261
 natively supports queueing, or append <var title="">notification</var> to the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   262
 <a href="#list-of-pending-notifications">list of pending notifications</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   263
</ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   264
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   265
<h3 id="closing-a-notification"><span class="secno">4.4 </span>Closing a notification</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   266
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   267
<p>When a <a href="#concept-notification" title="concept-notification">notification</a> is closed,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   268
either by the underlying notifications platform or by the user, the
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   269
<a href="#close-steps">close steps</a> for it must be run.
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   270
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   271
<p>The <dfn id="close-steps">close steps</dfn> for a given <var title="">notification</var> are:
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   272
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   273
<ol>
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   274
 <li><p>If <var title="">notification</var> is neither in the
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   275
 <a href="#list-of-pending-notifications">list of pending notifications</a> nor in the
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   276
 <a href="#list-of-active-notifications">list of active notifications</a>, terminate these steps.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   277
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   278
 <li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">Queue a task</a> to remove
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   279
 <var title="">notification</var> from either the
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   280
 <a href="#list-of-pending-notifications">list of pending notifications</a> or the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   281
 <a href="#list-of-active-notifications">list of active notifications</a>, and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   282
 <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   283
 named <code title="">close</code> on <var title="">notification</var>.
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   284
</ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   285
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   286
<h3 id="pending-notifications"><span class="secno">4.5 </span>Pending notifications</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   287
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   288
<p>Whenever the <a href="#list-of-pending-notifications">list of pending notifications</a> is not empty, the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   289
user agent must wait and monitor changes in the available notification space
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   290
on the device.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   291
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   292
<p>When the available display space changes on the device such that a new
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   293
notification can be displayed, for example due to a previous notification
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   294
being dismissed, the user agent should run the <a href="#display-steps">display steps</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   295
for the first <a href="#concept-notification" title="concept-notification">notification</a> in the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   296
<a href="#list-of-pending-notifications">list of pending notifications</a> and then remove it from the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   297
<a href="#list-of-pending-notifications">list of pending notifications</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   298
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   299
<h3 id="displaying-notifications"><span class="secno">4.6 </span>Displaying notifications</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   300
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   301
<p>The <dfn id="display-steps">display steps</dfn> for a given <var title="">notification</var>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   302
are:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   303
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   304
<ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   305
 <li><p>If the notification platform supports icons and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   306
 <var title="">notification</var>'s <a href="#icon-url">icon URL</a> has not yet been
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   307
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   308
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it and wait for the resource to be
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   309
 fully downloaded.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   310
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   311
 <li><p>If <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   312
 <var title="">notification</var>'s <a href="#icon-url">icon URL</a> failed for some
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   313
 reason or the image format is not supported,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   314
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   315
 <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   316
 named <code title="">error</code> on <var title="">notification</var> and terminate
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   317
 these steps.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   318
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   319
 <li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">Queue a task</a> to display
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   320
 <var title="">notification</var> on the device (e.g. by calling the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   321
 appropriate notification platform), append <var title="">notification</var> to the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   322
 <a href="#list-of-active-notifications">list of active notifications</a>, and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   323
 <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   324
 named <code title="">show</code> on <var title="">notification</var>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   325
</ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   326
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   327
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   328
<h3 id="replacing-a-notification"><span class="secno">4.7 </span>Replacing a notification</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   329
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   330
<p>The <dfn id="replace-steps">replace steps</dfn> for replacing an <var title="">old</var>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   331
<a href="#concept-notification" title="concept-notification">notification</a> with a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   332
<var title="">new</var> one are:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   333
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   334
<ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   335
 <li><p>If the notification platform supports icons and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   336
 <var title="">new</var>'s <a href="#icon-url">icon URL</a> has not yet been
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   337
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetched</a>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   338
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it and wait for the resource to be
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   339
 fully downloaded.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   340
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   341
 <li><p>If <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   342
 <var title="">new</var>'s <a href="#icon-url">icon URL</a> failed for some
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   343
 reason or the image format is not supported,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   344
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   345
 <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   346
 named <code title="">error</code> on <var title="">new</var> and terminate
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   347
 these steps.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   348
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   349
 <li><p>If <var title="">old</var> is in the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   350
 <a href="#list-of-pending-notifications">list of pending notifications</a>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   351
 <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to replace
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   352
 <var title="">old</var> with <var title="">new</var>, in the same position, in
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   353
 the <a href="#list-of-pending-notifications">list of pending notifications</a>, and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   354
 <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   355
 named <code title="">close</code> on <var title="">old</var>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   356
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   357
 <li>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   358
  <p>Otherwise,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   359
  <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to replace
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   360
  <var title="">old</var> with <var title="">new</var>, in the same position, in
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   361
  the <a href="#list-of-active-notifications">list of active notifications</a>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   362
  <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   363
  named <code title="">close</code> on <var title="">old</var>, and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   364
  <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-fire" title="concept-event-fire">fire an event</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   365
  named <code title="">show</code> on <var title="">new</var>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   366
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   367
  <p>If the notification platform does not support replacement this
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   368
  requirement may be addressed by removal and addition instead.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   369
</ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   370
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   371
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   372
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   373
<h2 id="api"><span class="secno">5 </span>API</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   374
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   375
<p>A <a href="#concept-notification" title="concept-notification">notification</a> is represented by
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   376
a <code><a href="#notification">Notification</a></code> object and can be created by its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   377
<a href="#dom-notification" title="dom-Notification">constructor</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   378
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   379
<pre class="idl">[<a href="#dom-notification" title="dom-Notification">Constructor</a>(DOMString <var title="">title</var>, optional <a href="#notificationoptions">NotificationOptions</a> <var title="">options</var>)]
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   380
interface <dfn id="notification">Notification</dfn> : <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#eventtarget">EventTarget</a> {
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   381
  static readonly attribute <a href="#notificationpermission">NotificationPermission</a> <a href="#dom-notification-permission" title="dom-Notification-permission">permission</a>;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   382
  static void <a href="#dom-notification-requestpermission" title="dom-Notification-requestPermission">requestPermission</a>(<a href="#notificationpermissioncallback">NotificationPermissionCallback</a> <var title="">callback</var>);
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   383
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   384
  [TreatNonCallableAsNull] attribute <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#function">Function</a>? <a href="#handler-onclick" title="handler-onclick">onclick</a>;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   385
  [TreatNonCallableAsNull] attribute <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#function">Function</a>? <a href="#handler-onshow" title="handler-onshow">onshow</a>;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   386
  [TreatNonCallableAsNull] attribute <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#function">Function</a>? <a href="#handler-onerror" title="handler-onerror">onerror</a>;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   387
  [TreatNonCallableAsNull] attribute <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#function">Function</a>? <a href="#handler-onclose" title="handler-onclose">onclose</a>;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   388
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   389
  void <a href="#dom-notification-close" title="dom-Notification-close">close</a>();
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   390
};
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   391
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   392
dictionary <dfn id="notificationoptions">NotificationOptions</dfn> {
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   393
  <a href="#notificationdirection">NotificationDirection</a> titleDir;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   394
  DOMString body;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   395
  <a href="#notificationdirection">NotificationDirection</a> bodyDir;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   396
  DOMString tag;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   397
  DOMString iconUrl;
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   398
};
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   399
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   400
enum <dfn id="notificationpermission">NotificationPermission</dfn> {
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   401
  "default",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   402
  "denied",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   403
  "granted"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   404
};
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   405
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   406
callback <dfn id="notificationpermissioncallback">NotificationPermissionCallback</dfn> = void (<a href="#notificationpermission">NotificationPermission</a> <var title="">permission</var>);
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   407
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   408
enum <dfn id="notificationdirection">NotificationDirection</dfn> {
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   409
  "auto",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   410
  "ltr",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   411
  "rtl"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   412
};</pre>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   413
8
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   414
<p class="XXX">Web IDL is
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   415
<a href="http://lists.w3.org/Archives/Public/public-script-coord/2012AprJun/0222.html">not yet updated</a>
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   416
to allow for static attributes.
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   417
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   418
<p>The
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   419
<dfn id="dom-notification" title="dom-Notification"><code>Notification(<var title="">title</var>, <var title="">options</var>)</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   420
constructor must run these steps:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   421
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   422
<ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   423
 <li><p>Let <var title="">notification</var> be a new
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   424
 <a href="#concept-notification" title="concept-notification">notification</a> represented by a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   425
 <code><a href="#notification">Notification</a></code> object.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   426
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   427
 <li><p>Set <var title="">notification</var>'s <a href="#title">title</a> to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   428
 <var title="">title</var>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   429
 <a class="external" href="http://dev.w3.org/2006/webapi/WebIDL/#dfn-obtain-unicode" title="convert a DOMString to a sequence of Unicode characters">converted to Unicode</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   430
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   431
 <li><p>If <var title="">options</var> is not omitted and its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   432
 <code title="">titleDir</code> member is not null, set
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   433
 <var title="">notification</var>'s <a href="#title-direction">title direction</a> to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   434
 <code title="">titleDir</code>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   435
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   436
 <li><p>If <var title="">options</var> is not omitted and its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   437
 <code title="">body</code> is not null, set <var title="">notification</var>'s
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   438
 <a href="#body">body</a> to <code title="">body</code>,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   439
 <a class="external" href="http://dev.w3.org/2006/webapi/WebIDL/#dfn-obtain-unicode" title="convert a DOMString to a sequence of Unicode characters">converted to Unicode</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   440
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   441
 <li><p>If <var title="">options</var> is not omitted and its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   442
 <code title="">bodyDir</code> member is not null, set
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   443
 <var title="">notification</var>'s <a href="#body-direction">body direction</a> to
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   444
 <code title="">bodyDir</code>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   445
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   446
 <li><p>If <var title="">options</var> is not omitted and its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   447
 <code title="">tag</code> is not null, set <var title="">notification</var>'s
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   448
 <a href="#tag">tag</a> to <code title="">tag</code>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   449
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   450
 <li><p>If <var title="">options</var> is not omitted and its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   451
 <code title="">iconUrl</code> is not null, set <var title="">notification</var>'s
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   452
 <a href="#icon-url">icon URL</a> to <code title="">iconUrl</code>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   453
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   454
 <li><p>Return <var title="">notification</var>, but continue running these
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   455
 steps asynchronouusly.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   456
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   457
 <li><p>If the notification platform supports icons, the user agent may
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   458
 start <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   459
 <var title="">notification</var>'s <a href="#icon-url">icon URL</a> at this point.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   460
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   461
 <li><p>Run the <a href="#show-steps">show steps</a> for <var title="">notification</var>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   462
</ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   463
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   464
<p>The static
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   465
<dfn id="dom-notification-permission" title="dom-Notification-permission"><code>permission</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   466
attribute must return <a href="#permission-0">permission</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   467
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   468
<p>The static
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   469
<dfn id="dom-notification-requestpermission" title="dom-Notification-requestPermission"><code>requestPermission(<var title="">callback</var>)</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   470
method must run these steps:
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   471
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   472
<ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   473
 <li><p>Return, but continue running these steps asynchronously.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   474
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   475
 <li><p>Let <var title="">permission</var> be <a href="#permission-0">permission</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   476
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   477
 <li><p>If <var title="">permission</var> is "<code title="">default</code>",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   478
 ask the user whether showing notifications for the current
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   479
 <a class="external" href="http://tools.ietf.org/html/rfc6454#section-4">origin</a> is acceptable. If it is, set
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   480
 <var title="">permission</var> to "<code title="">granted</code>", or
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   481
 "<code title="">denied</code>" otherwise.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   482
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   483
 <li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">Queue a task</a> to set
9
13eb4cb483c5 use permission concept
Anne van Kesteren <annevk@opera.com>
parents: 8
diff changeset
   484
 <a href="#permission-0">permission</a> to <var title="">permission</var> and invoke
13eb4cb483c5 use permission concept
Anne van Kesteren <annevk@opera.com>
parents: 8
diff changeset
   485
 <var title="">callback</var> with <var title="">permission</var> as single
13eb4cb483c5 use permission concept
Anne van Kesteren <annevk@opera.com>
parents: 8
diff changeset
   486
 argument.
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   487
</ol>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   488
8
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   489
<p class="warning">In designing the platform notifications are the one
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   490
instance thus far where asking the user upfront makes sense. Specifications
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   491
for other APIs should not use this pattern and instead employ one of the
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   492
<a href="http://robert.ocallahan.org/2011/06/permissions-for-web-applications_30.html">many more suitable alternatives</a>.
f06ff848e6c0 mention the problem with the permission model used; mention the static attribute problem
Anne van Kesteren <annevk@opera.com>
parents: 7
diff changeset
   493
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   494
<p>The following are the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers">event handlers</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   495
(and their corresponding
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   496
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handler-event-type" title="event handler event type">event handler event types</a>)
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   497
that must be supported as attributes by the <code><a href="#notification">Notification</a></code> object.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   498
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   499
<table>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   500
 <thead>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   501
  <tr>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   502
   <th><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers" title="event handlers">event handler</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   503
   <th><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handler-event-type">event handler event type</a>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   504
 <tbody>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   505
  <tr>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   506
   <td><dfn id="handler-onclick" title="handler-onclick"><code>onclick</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   507
   <td><code title="event-click">click</code>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   508
  <tr>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   509
   <td><dfn id="handler-onshow" title="handler-onshow"><code>onshow</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   510
   <td><code title="event-show">show</code>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   511
  <tr>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   512
   <td><dfn id="handler-onerror" title="handler-onerror"><code>onerror</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   513
   <td><code title="event-error">error</code>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   514
  <tr>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   515
   <td><dfn id="handler-onclose" title="handler-onclose"><code>onclose</code></dfn>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   516
   <td><code title="event-close">close</code>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   517
</table>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   518
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   519
<p>The <dfn id="dom-notification-close" title="dom-Notification-close"><code>close()</code></dfn> method
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   520
must run the <a href="#close-steps">close steps</a> for the
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   521
<a href="#concept-notification" title="concept-notification">notification</a>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   522
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   523
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   524
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   525
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   526
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   527
<h2 id="rendering"><span class="secno">6 </span>Rendering</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   528
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   529
<p>This section is written in terms equivalent to those used in the
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   530
Rendering section of HTML. <a href="#refsHTML">[HTML]</a>
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   531
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   532
<!-- keep this in sync with
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   533
     http://www.whatwg.org/specs/web-apps/current-work/#text-rendered-in-native-user-interfaces -->
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   534
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   535
<p>User agents are expected to honor the Unicode semantics of the text of a
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   536
<a href="#concept-notification" title="concept-notification">notification</a>'s <a href="#title">title</a>
5
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   537
and <a href="#body">body</a>. Each is expected to be treated as an independent set
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   538
of one or more bidirectional algorithm paragraphs when displayed, as defined
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   539
by the bidirectional algorithm's rules P1, P2, and P3, including, for
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   540
instance, supporting the paragraph-breaking behaviour of
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   541
U+000A LINE FEED (LF) characters. For each paragraph of the
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   542
<a href="#title">title</a> and <a href="#body">body</a>, the
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   543
<a href="#concept-notification" title="concept-notification">notification</a>'s
5
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   544
<a href="#title-direction">title direction</a> and <a href="#body-direction">body direction</a> respectively
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   545
provide the higher-level override of rules P2 and P3 if they have a value
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   546
other than "<code title="">auto</code>".
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   547
<a href="#refsBIDI">[BIDI]</a>
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   548
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   549
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   550
<h2 id="examples"><span class="secno">7 </span>Examples</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   551
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   552
<h3 id="using-events"><span class="secno">7.1 </span>Using events</h3>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   553
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   554
<p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   555
	Notification objects dispatch events during their lifecycle, which authors can use
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   556
	to generate desired behaviors.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   557
      </p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   558
      <p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   559
	The <code>show</code> event occurs when the notification is shown to the user --
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   560
	this may be at some time after the notification is created in the case
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   561
	of limited display space and a queue.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   562
      </p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   563
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   564
      <p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   565
	In the following example, this event is used to guarantee that regardless of when
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   566
	the notification is shown, it is displayed for only 15 seconds.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   567
      </p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   568
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   569
<pre class="example">new Notification("New Email Received",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   570
                 { iconUrl: "mail.png",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   571
                   onshow: function() { setTimeout(notification.close(), 15000); }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   572
                 });</pre>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   573
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   574
<p>The <code>close</code> events occurs when the notification is dismissed by the user.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   575
	Authors may use this event to perform actions when notifications are acknowledged.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   576
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   577
<p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   578
	In the following example, when a meeting reminder notification is acknowledged, the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   579
	application suppresses other forms of reminders.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   580
      </p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   581
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   582
<pre class="example">new Notification("Meeting about to begin",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   583
                 { iconUrl: "calendar.gif",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   584
                   body: "Room 101",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   585
                   onclose: function() { cancelReminders(event); }
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   586
                 });</pre>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   587
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   588
7
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
   589
<h3 id="tags-example"><span class="secno">7.2 </span>Using the <code title="">tag</code> member for multiple instances</h3>
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   590
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   591
<p>Web applications frequently operate concurrently in multiple instances, such as when a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   592
	user opens a mail application in multiple browser tabs.  Since the desktop is a shared
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   593
	resource, Web Notifications provides a way for these instances to easily coordinate, by
7
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
   594
	using the <code title="">tag</code> member.
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   595
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   596
<p>Notifications which represent the same conceptual event can be tagged in the same way,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   597
	and when both are shown, the user will only receive one notification.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   598
      </p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   599
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   600
<pre class="example" title="">Instance 1                                   | Instance 2
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   601
                                             |
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   602
// Instance notices there is new mail.       |
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   603
new Notification("New mail from John Doe",   |
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   604
                 { tag: 'message1' });       |
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   605
                                             |
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   606
                                             |  // Slightly later, this instance notices
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   607
                                             |  // there is new mail.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   608
                                             |  new Notification("New mail from John Doe",
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   609
                                             |                   { tag: 'message1' });</pre>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   610
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   611
<p>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   612
	The result of this situation, if the user agent follows the algorithms here, is a <strong>single</strong> notification "New mail from John Doe".
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   613
7
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
   614
<h3 id="using-the-tag-member-for-a-single-instance"><span class="secno">7.3 </span>Using the <code title="">tag</code> member for a single instance</h3>
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   615
7
5f2b3a2f7c6c tag is not an attribute anymore, strictly speaking
Anne van Kesteren <annevk@opera.com>
parents: 6
diff changeset
   616
<p>The <code title="">tag</code> member can also be used by a single instance of an application to keep its
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   617
	notifications as current as possible as state changes.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   618
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   619
<p>For example, if Alice is using a chat application with Bob, and Bob sends multiple
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   620
	messages while Alice is idle, the application may prefer that Alice not see a
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   621
	desktop notification for each message.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   622
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   623
<pre class="example">// Bob says "Hi"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   624
new Notification("Bob: Hi", { tag: 'chat_Bob' });
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   625
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   626
// Bob says "Are you free this afternoon?"
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   627
new Notification("Bob: Hi / Are you free this afternoon?", { tag: 'chat_Bob' });</pre>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   628
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   629
<p>The result of this situation is a <em>single</em> notification; the second one
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   630
	replaces the first having the same tag.  In a platform that queues notifications
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   631
	(first-in-first-out), using the tag allows the notification to also maintain its
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   632
	position in the queue.  Platforms where the newest notifications are shown first,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   633
	a similar result could be achieved using the
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   634
	<code title="dom-Notification-close"><a href="#dom-notification-close">close()</a></code> method.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   635
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   636
<h2 class="no-num" id="references">References</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   637
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   638
<div id="anolis-references"><dl><dt id="refsBIDI">[BIDI]
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   639
<dd><cite><a href="http://www.unicode.org/reports/tr9/">Unicode Bidirectional Algorithm</a></cite>, Mark Davis. Unicode Consortium.
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   640
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   641
<dt id="refsDOM">[DOM]
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   642
<dd><cite><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html">DOM4</a></cite>, Anne van Kesteren, Aryeh Gregor and Ms2ger. W3C.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   643
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   644
<dt id="refsHTML">[HTML]
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   645
<dd><cite><a href="http://www.whatwg.org/C">HTML</a></cite>, Ian Hickson. WHATWG.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   646
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   647
<dt id="refsRFC2119">[RFC2119]
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   648
<dd><cite><a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></cite>, Scott Bradner. IETF.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   649
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   650
</dl></div>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   651
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   652
<h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   653
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   654
<p>Thanks to
5
ce7609323bc7 bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
Anne van Kesteren <annevk@opera.com>
parents: 4
diff changeset
   655
Aharon (Vladimir) Lanin,
1
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   656
Alex Russell,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   657
Doug Turner,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   658
Drew Wilson,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   659
Edward O'Connor,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   660
Ian Hickson,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   661
James Graham,
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   662
Jon Lee, and
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   663
Jonas Sicking
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   664
for being awesome.