Overview.src.html
author Anne van Kesteren <annevk@opera.com>
Thu, 07 Jun 2012 12:58:20 +0200
changeset 5 ce7609323bc7
parent 4 efe6a33eaa55
child 6 2fb089113c31
permissions -rw-r--r--
bidi: http://lists.w3.org/Archives/Public/public-web-notification/2012Jun/0003.html
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>
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
<html lang=en-US>
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
<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
     4
<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
     5
<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
     6
 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
     7
 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
     8
 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
     9
 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
    10
 .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
    11
 .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
    12
 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
    13
 .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
    14
 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
    15
 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
    16
 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
    17
 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
    18
 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
    19
 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
    20
 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
    21
 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
    22
 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
    23
 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
    24
 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
    25
 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
    26
 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
    27
 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
    28
 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
    29
 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
    30
 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
    31
 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
    32
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 { 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
    34
 .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
    35
 .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
    36
 .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
    37
 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
    38
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
 @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
    40
   [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
    41
 }
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
</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
    43
<link rel=stylesheet href="http://www.w3.org/StyleSheets/TR/W3C-[STATUS]">
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
<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
    45
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
<!-- 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
    47
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
<h1>Web Notifications</h1>
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
<h2 class="no-num no-toc">[LONGSTATUS] [DATE: 01 Jan 1901]</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
    50
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
<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
    52
 <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
    53
 <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
    54
 <dd class=publish><a href="[VERSION]">[VERSION]</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
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
 <dt class=publish>Latest 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
    57
 <dd class=publish><a href="[LATEST]">[LATEST]</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
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
 <dt class=publish>Latest Editors Draft:
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
 <dd class=publish><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
    61
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
 <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
    63
 <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
    64
  <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
    65
  (<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
    66
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
 <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
    68
 <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
    69
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
 <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
    71
 <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
    72
 (<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
    73
 &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
    74
 <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
    75
 &lt;<a href="mailto:johnnyg@google.com">johnnyg@google.com</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
    76
</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
    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
<!-- 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
    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
</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
    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
<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
    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">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
    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 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
    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="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
    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
<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
    91
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
<h2 class="no-num no-toc">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
    93
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
<!-- 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
    95
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
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
<h2>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
    98
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
<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
   100
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
   101
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
   102
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
   103
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
   104
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
   105
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
   106
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
<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
   108
 <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
   109
 <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
   110
 <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
   111
</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
   112
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   113
<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
   114
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
   115
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
   116
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
<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
   118
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
   119
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
   120
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
   121
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
   122
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
   123
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
   124
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
   125
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
<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
   127
<code>Notification</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
   128
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
   129
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
   130
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
   131
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
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
<h2>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
   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>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
   136
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
   137
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
   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>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
   140
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
   141
"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
   142
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
   143
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
   144
<span data-anolis-ref>RFC2119</span>
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
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
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
<h3>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
   149
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
<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
   151
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
   152
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
   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>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
   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>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
   158
<span data-anolis-ref>DOM</span>
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
<span data-anolis-ref>HTML</span>
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
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
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
<h2>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
   164
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
<p>A <dfn title=concept-notification>notification</dfn> allows alerting 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
   166
user outside a the context of a web page of an occurrence, such as 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
   167
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
   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
<p>Each <span title=concept-notification>notification</span> 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
   170
<dfn>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
   171
<span title=concept-notification>notification</span> 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
   172
<dfn>title direction</dfn> and <dfn>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
   173
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
   174
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
<p>Each <span title=concept-notification>notification</span> <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
   176
have an associated <dfn>body</dfn>, <dfn>tag</dfn>, and <dfn>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
   177
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
<h3>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
   180
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
<p><span title=concept-notification>Notifications</span> 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
   182
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
   183
<dfn>permission</dfn>. The <span>permission</span> 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
   184
<span title=concept-notification>notifications</span> 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
   185
<span data-anolis-spec=origin>origin</span> 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
   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
<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
   188
 <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
   189
 <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
   190
 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
   191
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
 <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
   193
 <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
   194
 <span title=concept-notification>notifications</span>.
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
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
 <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
   197
 <dd><p>This means <span title=concept-notification>notifications</span> 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
   198
 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
   199
</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
   200
2
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   201
<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
   202
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
   203
"<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
   204
for the application to ask for <span>permission</span>.
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
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
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
<h3>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
   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
<p>The user agent must keep a <dfn>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
   210
a <dfn>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
   211
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
<h3>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
   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
<p>The <dfn>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
   215
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
<ol>
2
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   217
 <li><p>If <span>permission</span> for the current
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   218
 <span data-anolis-spec=origin>origin</span> is not
1693fc18292c fix grammar
Anne van Kesteren <annevk@opera.com>
parents: 1
diff changeset
   219
 "<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
   220
 <span data-anolis-spec=html>fetch</span> 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
   221
 <var title>notification</var>'s <span>icon URL</span>,
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
 <span data-anolis-spec=html>queue a task</span> 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
   223
 <span data-anolis-spec=dom title=concept-event-fire>fire an event</span> 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
   224
 <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
   225
 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
   226
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
 <li><p>If there is a <span title=concept-notification>notification</span>
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
 in the <span>list of pending notifications</span> 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
   229
 <span>list of active notifications</span> whose <span>tag</span> 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
   230
 <var title>notification</var>'s <span>tag</span>, 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
   231
 <span>replace steps</span> 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
   232
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
 <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
   234
 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
   235
 the <span>display steps</span> 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
   236
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
 <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
   238
 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
   239
 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
   240
 <span>list of pending notifications</span>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   241
</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
   242
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
<h3>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
   244
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
<p>When a <span title=concept-notification>notification</span> 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
   246
either by the underlying notifications platform or by the user, the
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   247
<span>close steps</span> 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
   248
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   249
<p>The <dfn>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
   250
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
<ol>
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   252
 <li><p>If <var title>notification</var> is neither in the
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   253
 <span>list of pending notifications</span> 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
   254
 <span>list of active notifications</span>, 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
   255
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
 <li><p><span data-anolis-spec=html>Queue a task</span> to remove
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   257
 <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
   258
 <span>list of pending notifications</span> 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
   259
 <span>list of active notifications</span>, 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
   260
 <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
3
Anne van Kesteren <annevk@opera.com>
parents: 2
diff changeset
   261
 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
   262
</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
   263
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
<h3>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
   265
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
<p>Whenever the <span>list of pending notifications</span> 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
   267
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
   268
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
   269
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
<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
   271
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
   272
being dismissed, the user agent should run the <span>display steps</span>
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
for the first <span title=concept-notification>notification</span> 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
   274
<span>list of pending notifications</span> 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
   275
<span>list of pending notifications</span>.
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
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
<h3>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
   278
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   279
<p>The <dfn>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
   280
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
   281
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
<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
   283
 <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
   284
 <var title>notification</var>'s <span>icon URL</span> 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
   285
 <span data-anolis-spec=html title=fetch>fetched</span>,
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
 <span data-anolis-spec=html>fetch</span> 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
   287
 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
   288
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
 <li><p>If <span data-anolis-spec=html title=fetch>fetching</span>
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
 <var title>notification</var>'s <span>icon URL</span> 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
   291
 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
   292
 <span data-anolis-spec=html>queue a task</span> 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
   293
 <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
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
 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
   295
 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
   296
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
 <li><p><span data-anolis-spec=html>Queue a task</span> 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
   298
 <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
   299
 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
   300
 <span>list of active notifications</span>, 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
   301
 <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
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
 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
   303
</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
   304
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
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
<h3>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
   307
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
<p>The <dfn>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
   309
<span title=concept-notification>notification</span> 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
   310
<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
   311
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
<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
   313
 <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
   314
 <var title>new</var>'s <span>icon URL</span> 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
   315
 <span data-anolis-spec=html title=fetch>fetched</span>,
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
 <span data-anolis-spec=html>fetch</span> 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
   317
 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
   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>If <span data-anolis-spec=html title=fetch>fetching</span>
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>new</var>'s <span>icon URL</span> 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
   321
 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
   322
 <span data-anolis-spec=html>queue a task</span> 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
   323
 <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
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>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
   325
 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
   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
 <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
   328
 <span>list of pending notifications</span>,
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
 <span data-anolis-spec=html>queue a task</span> 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
   330
 <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
   331
 the <span>list of pending notifications</span>, 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
   332
 <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
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
 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
   334
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>
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
  <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
   337
  <span data-anolis-spec=html>queue a task</span> 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
   338
  <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
   339
  the <span>list of active notifications</span>,
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
  <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
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
  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
   342
  <span data-anolis-spec=dom title=concept-event-fire>fire an event</span>
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
  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
   344
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
  <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
   346
  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
   347
</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
   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
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
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
<h2>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
   352
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
<p>A <span title=concept-notification>notification</span> 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
   354
a <code>Notification</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
   355
<span title=dom-Notification>constructor</span>.
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
<pre class="idl">[<span title=dom-Notification>Constructor</span>(DOMString <var title>title</var>, optional <span>NotificationOptions</span> <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
   358
interface <dfn>Notification</dfn> : <span data-anolis-spec=dom>EventTarget</span> {
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
  static readonly attribute <span>NotificationPermission</span> <span title=dom-Notification-permission>permission</span>;
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
  static void <span title=dom-Notification-requestPermission>requestPermission</span>(<span>NotificationPermissionCallback</span> <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
   361
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
  [TreatNonCallableAsNull] attribute <span data-anolis-spec=html>Function</span>? <span title=handler-onclick>onclick</span>;
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
  [TreatNonCallableAsNull] attribute <span data-anolis-spec=html>Function</span>? <span title=handler-onshow>onshow</span>;
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
  [TreatNonCallableAsNull] attribute <span data-anolis-spec=html>Function</span>? <span title=handler-onerror>onerror</span>;
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
  [TreatNonCallableAsNull] attribute <span data-anolis-spec=html>Function</span>? <span title=handler-onclose>onclose</span>;
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
  void <span title=dom-Notification-close>close</span>();
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
};
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
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
dictionary <dfn>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
   371
  <span>NotificationDirection</span> 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
   372
  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
   373
  <span>NotificationDirection</span> 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
   374
  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
   375
  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
   376
};
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
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
enum <dfn>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
   379
  "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
   380
  "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
   381
  "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
   382
};
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
callback <dfn>NotificationPermissionCallback</dfn> = void (<span>NotificationPermission</span> <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
   385
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
enum <dfn>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
   387
  "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
   388
  "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
   389
  "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
   390
};</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
   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
<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
   393
<dfn 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
   394
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
   395
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
<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
   397
 <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
   398
 <span title=concept-notification>notification</span> 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
   399
 <code>Notification</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
   400
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
 <li><p>Set <var title>notification</var>'s <span>title</span> 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
   402
 <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
   403
 <span data-anolis-spec=webidl title="convert a DOMString to a sequence of Unicode characters">converted to Unicode</span>.
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
 <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
   406
 <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
   407
 <var title>notification</var>'s <span>title direction</span> 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
   408
 <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
   409
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
 <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
   411
 <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
   412
 <span>body</span> 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
   413
 <span data-anolis-spec=webidl title="convert a DOMString to a sequence of Unicode characters">converted to Unicode</span>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   414
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   415
 <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
   416
 <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
   417
 <var title>notification</var>'s <span>body direction</span> 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
   418
 <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
   419
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
 <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
   421
 <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
   422
 <span>tag</span> 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
   423
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
 <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
   425
 <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
   426
 <span>icon URL</span> 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
   427
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
 <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
   429
 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
   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 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
   432
 start <span data-anolis-spec=html title=fetch>fetching</span>
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 <span>icon URL</span> 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
   434
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
 <li><p>Run the <span>show steps</span> 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
   436
</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
   437
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
<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
   439
<dfn 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
   440
attribute must return <span>permission</span>.
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
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
<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
   443
<dfn 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
   444
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
   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
<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
   447
 <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
   448
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
 <li><p>Let <var title>permission</var> be <span>permission</span>.
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
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
 <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
   452
 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
   453
 <span data-anolis-spec=origin>origin</span> 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
   454
 <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
   455
 "<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
   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><span data-anolis-spec=html>Queue a task</span> to 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
   458
 <code title=dom-Notification-permission>permission</code> 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
   459
 <var title>permission</var> and invoke <var title>callback</var> 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
   460
 <var title>permission</var> as single argument.
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
</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
   462
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
<p>The following are the <span data-anolis-spec=html>event handlers</span>
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
(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
   465
<span data-anolis-spec=html title="event handler event type">event handler event types</span>)
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
that must be supported as attributes by the <code>Notification</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
   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
<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
   469
 <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
   470
  <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
   471
   <th><span data-anolis-spec=html title="event handlers">event handler</span>
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
   <th><span data-anolis-spec=html>event handler event type</span>
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
 <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
   474
  <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
   475
   <td><dfn 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
   476
   <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
   477
  <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
   478
   <td><dfn 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
   479
   <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
   480
  <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
   481
   <td><dfn 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
   482
   <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
   483
  <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
   484
   <td><dfn 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
   485
   <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
   486
</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
   487
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
<p>The <dfn title=dom-Notification-close><code>close()</code></dfn> 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
   489
must run the <span>close steps</span> 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
   490
<span title=concept-notification>notification</span>.
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   491
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   492
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   493
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
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
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
<h2>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
   497
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   498
<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
   499
Rendering section of HTML. <span data-anolis-ref>HTML</span>
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   500
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   501
<!-- keep this in sync with
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   502
     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
   503
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   504
<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
   505
<span title=concept-notification>notification</span>'s <span>title</span>
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
   506
and <span>body</span>. 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
   507
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
   508
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
   509
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
   510
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
   511
<span>title</span> and <span>body</span>, the
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   512
<span title=concept-notification>notification</span>'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
   513
<span>title direction</span> and <span>body direction</span> 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
   514
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
   515
other than "<code title>auto</code>".
4
efe6a33eaa55 add some shaky text on bidi
Anne van Kesteren <annevk@opera.com>
parents: 3
diff changeset
   516
<span data-anolis-ref>BIDI</span>
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
   517
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
<h2>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
   520
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
<h3>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
   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
<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
   524
	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
   525
	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
   526
      </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
   527
      <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
   528
	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
   529
	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
   530
	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
   531
      </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
   532
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   533
      <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
   534
	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
   535
	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
   536
      </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
   537
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   538
<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
   539
                 { 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
   540
                   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
   541
                 });</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
   542
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   543
<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
   544
	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
   545
0f513d43130e alternative Anolis draft with a few text improvements as well as the permission model
Anne van Kesteren <annevk@opera.com>
parents:
diff changeset
   546
<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
   547
	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
   548
	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
   549
      </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
   550
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
<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
   552
                 { 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
   553
                   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
   554
                   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
   555
                 });</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
   556
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
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
<h3 id="tags-example">Using the tag attribute for multiple instances</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
   559
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
<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
   561
	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
   562
	resource, Web Notifications provides a way for these instances to easily coordinate, 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
   563
	using the <code>tag</code> attribute.
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
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
<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
   566
	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
   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" 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
   570
                                             |
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
// 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
   572
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
   573
                 { 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
   574
                                             |
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
                                             |  // 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
   576
                                             |  // 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
   577
                                             |  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
   578
                                             |                   { 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
   579
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
	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
   582
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
<h3>Using the tag attribute for a single instance</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
   584
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
<p>The tag attribute can also be used by a single instance of an application to keep 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
   586
	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
   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
<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
   589
	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
   590
	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
   591
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
<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
   593
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
   594
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
// 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
   596
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
   597
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>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
   599
	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
   600
	(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
   601
	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
   602
	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
   603
	<code title=dom-Notification-close>close()</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
   604
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
<h2 class=no-num>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
   606
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
<div id=anolis-references></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
   608
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
<h2 class=no-num>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
   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>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
   612
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
   613
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
   614
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
   615
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
   616
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
   617
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
   618
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
   619
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
   620
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
   621
for being awesome.