discovery-api/Overview.src.html
author Rich Tibbett <richt@opera.com>
Thu, 29 Aug 2013 11:01:15 +0200
changeset 447 5e36d90b8960
parent 441 b4b2569b4e9b
child 448 865b6f93faac
permissions -rw-r--r--
Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
     1
<!DOCTYPE html>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     2
<!--
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     3
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     4
  THIS IS THE WORKING VERSION OF THE CURRENT SPECIFICATION!
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     5
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     6
  This specification is built using ReSpec.js <http://dev.w3.org/2009/dap/ReSpec.js/documentation.html>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     7
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     8
  From time to time it's necessary to HTML5 Tidy this document using the tool @ <http://w3c.github.com/tidy-html5/>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
     9
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    10
  The command used to format this document (Overview.src.html) is as follows (replacing all = signs with - signs!):
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    11
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    12
  @> tidy ==new-blocklevel-tags section ==char-encoding utf8 ==tidy-mark no ==indent yes ==indent-spaces 2 ==indent-attributes yes ==wrap 120 ==fix-bad-comments yes -m Overview.src.html
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    13
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    14
  To publish a new compiled version (Overview.html), we need to open this file (Overview.src.html) in any web browser.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    15
  Once it has loaded we press 'Ctrl + Shift + S' (or 'Cmd' + 'Shift' + 'S' on Mac) and then select
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    16
  'Save as HTML (Source)' from the resulting menu.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    17
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    18
  We then replace Overview.html with the produced HTML source of this process.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    19
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    20
  Next we run HTML5 Tidy over our new Overview.html file with the following command (replacing all = signs with - signs!):
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    21
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    22
  @> tidy ==new-blocklevel-tags section ==char-encoding utf8 ==tidy-mark no ==indent yes ==indent-spaces 2 ==indent-attributes yes ==wrap 120 ==hide-comments yes -m Overview.html
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    23
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    24
  Now the specification is ready to be published :)
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    25
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    26
-->
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    27
<html>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    28
  <head>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    29
    <title>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    30
      Network Service Discovery
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    31
    </title>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    32
    <meta http-equiv='Content-Type'
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    33
          content='text/html; charset=utf-8'>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    34
    <script type="text/javascript"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    35
          class='remove'>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    36
var respecConfig = {
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    37
          specStatus:   "ED",
402
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    38
          //publishDate:  "2013-03-29",
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    39
          shortName:    "discovery-api",
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
    40
          edDraftURI:   "http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html",
241
985e203d74f7 Prepare Working Draft for NSD
Rich Tibbett <richt@opera.com>
parents: 240
diff changeset
    41
          previousMaturity: "FPWD",
402
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    42
          previousPublishDate: "2012-10-04",
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    43
          editors: [
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    44
            {
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    45
              name:       "Rich Tibbett",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    46
              //url:        "http://richt.me/",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    47
              company:    "Opera Software ASA",
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    48
              companyURL: "http://opera.com/"
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
    49
            }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    50
          ],
398
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
    51
241
985e203d74f7 Prepare Working Draft for NSD
Rich Tibbett <richt@opera.com>
parents: 240
diff changeset
    52
          wg:           "Device APIs Working Group",
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    53
          wgURI:        "http://www.w3.org/2009/dap/",
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    54
          wgPublicList: "public-device-apis",
398
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
    55
          wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/43696/status",
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
    56
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    57
    //          extraCSS:     ["http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/css/respec.nsd.css"],
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    58
    //          inlineCSS:    true,
398
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
    59
          noIDLIn:      true
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
    60
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    61
      };
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    62
    </script>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    63
    <script src='http://www.w3.org/Tools/respec/respec-w3c-common'
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    64
          type="text/javascript"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    65
          class='remove'
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    66
          async="">
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    67
</script>
402
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    68
    <style>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    69
/* Custom ReSpec CSS (by Rich Tibbett) */
402
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    70
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    71
     /* Add better spacing to sections */
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    72
     section, .section { margin-bottom: 2em; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    73
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    74
     /* Add addition spacing to <ol> and <ul> for rule definition */
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    75
     ol.rule li, ul.rule li { padding:0.6em; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    76
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    77
     pre.widl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; position: relative; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    78
     pre.widl :link, pre.widl :visited { color: #000; background: transparent; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    79
     pre.widl:before { content: "IDL"; font: bold small sans-serif; padding: 0.5em; background: white; position: absolute; top: 0; margin: -1px 0 0 -4em; width: 1.5em; border: thin solid; border-radius: 0 0 0 0.5em }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    80
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    81
     div.example { border: solid thin black; background: #FFFFF0; color: black; padding: 0.5em 1em; position: relative; margin: 1em 0 1em 4.6em; width: auto; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    82
     div.example:before { content: "EXAMPLE"; font: bold small sans-serif; padding: 0.5em; background: white; color: black; position: absolute; top: 0; margin: -1px 0 0 -7.6em; width: 5em; border: thin solid black; border-radius: 0 0 0 0.5em }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    83
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    84
     dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    85
     hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    86
     dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    87
     dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    88
     dl.domintro dd p { margin: 0.5em 0; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    89
     dl.domintro code {font-size: inherit; font-style: italic; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    90
     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; font-size:0.8em; }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    91
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    92
     table { border-collapse:collapse; border-style:hidden hidden none hidden }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    93
     table thead { border-bottom:solid }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    94
     table tbody th:first-child { border-left:solid }
a3626e492d27 Add WD (29th March 2013) for Network Service Discovery API
Rich Tibbett <richt@opera.com>
parents: 399
diff changeset
    95
     table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    96
    </style>
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    97
    <script type="text/javascript"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    98
          class="remove">
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
    99
// RESPEC DEFINITIONS STYLE OVERLOAD
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   100
        window.addEventListener('load', function() {
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   101
          var overrideStyleEl = document.createElement('style');
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   102
          overrideStyleEl.textContent += "\n  a.externalDFN { color: #00C; border-bottom: 1px dashed #00C; }";
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   103
          overrideStyleEl.textContent += "\n  a.internalDFN { color: #00C; text-decoration: solid; }";
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   104
          document.querySelector('body').appendChild(overrideStyleEl);
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   105
        }, false);
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   106
    </script>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   107
  </head>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   108
  <body>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   109
    <section id='abstract'>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   110
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   111
        This specification defines a mechanism for an HTML document to discover and subsequently communicate with
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   112
        <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services advertised via common discovery protocols
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   113
        within the current network.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   114
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   115
    </section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   116
    <section id='sotd'>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   117
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   118
        This document represents the early consensus of the group on the scope and features of the proposed API.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   119
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   120
    </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   121
    <section class="informative">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   122
      <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   123
        Introduction
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   124
      </h3>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   125
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   126
        To enable Web pages to connect and communicate with Local-networked Services provided over HTTP, this
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   127
        specification introduces the <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   128
        interface.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   129
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   130
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   131
        Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   132
        service type, known by developers and advertised by Local-networked Devices. User authorization, where the user
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   133
        connects the web page to discovered services, is expected before the web page is able to interact with any
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   134
        Local-networked Services.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   135
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   136
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   137
        A web page creates a request to obtain connectivity to services running in the network by specifying a
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   138
        well-known discovery service type that it wishes to interact with.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   139
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   140
      <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   141
        The user agent, having captured all advertised services on the network from the <a>service discovery
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   142
        mechanisms</a> included in this recommendation, attempts to match the requested service type to a discovered
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   143
        service according to the processing described herein.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   144
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   145
      <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   146
        If a service connectivity request is successful then the Web page is provided with a promise-based success
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   147
        callback with the all necessary information to communicate with the authorized Local-networked Service. If the
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   148
        request fails then the Web page will receive a promise-based error callback containing an error string
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   149
        describing the cause of Local-networked Service connectivity failure.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   150
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   151
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   152
        Once connected to a Local-networked Service the Web page can send requests and receive responses to the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   153
        Local-networked Service via the messaging format and appropriate channel inferred from the service type
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   154
        authorized via the provided API. The Web page, once connected, can also receive service-pushed events, in the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   155
        messaging format supported by the Local-networked Device, if such event subscription functionality is provided
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   156
        by the connected Local-networked Service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   157
      </p>
397
7d43f1efc56f Move informative text introducing NSD events to Introduction section
Rich Tibbett <richt@opera.com>
parents: 392
diff changeset
   158
      <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   159
        Services available within the local network can connect and disconnect at different times during the execution
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   160
        of a web page. The user agent can inform a web page when the state of networked services matching any of the
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   161
        requested valid service types change. Web pages can use this information to enable in-page experiences for
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   162
        communicating the state of networked services with the ability to change the particular service or set of
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   163
        services the page is connected to (by re-invoking the <a href=
397
7d43f1efc56f Move informative text introducing NSD events to Introduction section
Rich Tibbett <richt@opera.com>
parents: 392
diff changeset
   164
        "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method defined herein).
7d43f1efc56f Move informative text introducing NSD events to Introduction section
Rich Tibbett <richt@opera.com>
parents: 392
diff changeset
   165
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   166
      <div class="example">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   167
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   168
          Example of requesting a DNS-SD advertised service:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   169
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   170
        <hr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   171
        <pre class="highlight">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   172
function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   173
  // Show a list of all the services provided to the web page
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   174
  for(var i = 0, l = services.length; i &lt; l; i++) console.log( services[i].name );
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   175
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   176
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   177
navigator.getNetworkServices('zeroconf:_boxee-jsonrpc._tcp').then(showServices);
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   178
</pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   179
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   180
      <div class="example">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   181
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   182
          Example of requesting a UPnP advertised service, also handling error conditions:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   183
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   184
        <hr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   185
        <pre class="highlight">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   186
function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   187
  // Show a list of all the services provided to the web page
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   188
  for(var i = 0, l = services.length; i &lt; l; i++) console.log( services[i].name );
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   189
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   190
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   191
function error( e ) {
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   192
  console.log( "Error occurred: " + e.name );
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   193
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   194
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   195
navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1').then(showServices, error);
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   196
</pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   197
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   198
      <div class="example">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   199
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   200
          Example of requesting either a DNS-SD or UPnP advertised service:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   201
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   202
        <hr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   203
        <pre class="highlight">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   204
function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   205
  // Show a list of all the services provided to the web page (+ service type)
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   206
  for(var i = 0, l = services.length; i &lt; l; i++)
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   207
     console.log( services[i].name + '(' + services[i].type + ')' );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   208
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   209
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   210
navigator.getNetworkServices([
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   211
  'zeroconf:_boxee-jsonrpc._tcp',
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   212
  'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   213
]).then(showServices);
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   214
</pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   215
      </div>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   216
      <p>
440
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   217
        For more detailed examples, including examples of communicating with obtained networked services, see the
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   218
        <a href="#examples">Examples</a> section.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   219
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   220
    </section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   221
    <section id='conformance'>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   222
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   223
        Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   224
        "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should",
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   225
        "may", etc) used in introducing the algorithm.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   226
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   227
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   228
        Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   229
        are to be interpreted as requirements on user agents.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   230
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   231
      <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   232
        Conformance requirements phrased as algorithms or specific steps MAY be implemented in any manner, so long as
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   233
        the end result is equivalent. (In particular, the algorithms defined in this specification are intended to be
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   234
        easy to follow, and not intended to be performant.)
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   235
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   236
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   237
        The only conformance class defined by this specification is a <dfn>user agent</dfn>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   238
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   239
      <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   240
        User agents MAY impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   241
        of service attacks, to guard against running out of memory, or to work around platform-specific limitations.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   242
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   243
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   244
        When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   245
        in development, or for performance reasons), user agents MUST act as if they had no support for the feature
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   246
        whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   247
        is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted from the objects
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   248
        that implement that interface - leaving the attribute on the object but making it return null or throw an
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   249
        exception is insufficient.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   250
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   251
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   252
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   253
          Dependencies
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   254
        </h3>This specification relies on several other underlying specifications.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   255
        <dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   256
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   257
            HTML
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   258
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   259
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   260
            Many fundamental concepts from HTML are used by this specification. [[!HTML5]]
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   261
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   262
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   263
            WebIDL
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   264
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   265
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   266
            The IDL blocks in this specification use the semantics of the WebIDL specification. [[!WEBIDL]]
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   267
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   268
        </dl>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   269
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   270
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   271
    <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   272
      <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   273
        Terminology
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   274
      </h3>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   275
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   276
        The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   277
        used instead of the more accurate "an object implementing the interface <code>Foo</code>".
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   278
      </p>
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   279
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   280
        The term DOM is used to refer to the API set made available to scripts in Web applications, and does not
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   281
        necessarily imply the existence of an actual <code>Document</code> object or of any other <code>Node</code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   282
        objects as defined in the DOM Core specifications. [[!DOM4]]
230
3c13dc93cfb1 Re-write of Section 7: Service Discovery according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0017.html
Rich Tibbett <richt@opera.com>
parents: 216
diff changeset
   283
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   284
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   285
        An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   286
        is said to be <em>setting</em> when a new value is assigned to it.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   287
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   288
      <p>
330
78129450e57a Added DIAL support
Daniel Danciu <danieldanciu@google.com>
parents: 288
diff changeset
   289
        A <dfn>valid service type</dfn> is any of the following:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   290
      </p>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   291
      <ul>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   292
        <li>a string that begins with <code>upnp:</code> or <code>zeroconf:</code> followed by one or more characters
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   293
        in the ranges U+0021, U+0023 to U+0027, U+002A to U+002B, U+002D to U+002E, U+0030 to U+0039, U+0041 to U+005A,
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   294
        U+005E to U+007E.
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   295
        </li>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   296
        <li>a string that begins with <code>dial:</code> followed by an integer version.
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   297
        </li>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   298
      </ul>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   299
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   300
        A <a>valid service type</a> provided in the <code>type</code> attribute of the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   301
        "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   302
        services currently contained in the <a>list of available service records</a> according to the algorithms
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   303
        defined in this specification.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   304
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   305
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   306
        A <dfn>user-agent generated callback url</dfn> is a Local-network accessible URL endpoint that a <a>user
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   307
        agent</a> generates and maintains for receiving HTTP NOTIFY requests from UPnP Event sources. It is only
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   308
        required when the user agent implements UPnP Service Discovery as defined in this specification.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   309
      </p>
387
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   310
      <p>
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   311
        In this specification we use the following terms to describe the processes required for Local-networked
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   312
        Services management:
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   313
      </p>
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   314
      <ul>
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   315
        <li>A <dfn>new service</dfn> is a Local-networked Service that has not previously been discovered or registered
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   316
        in the <a>list of available service records</a>.
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   317
        </li>
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   318
        <li>An <dfn>existing service</dfn> is a Local-networked Service that has previously been discovered and is
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   319
        registered in the <a>list of available service records</a>.
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   320
        </li>
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   321
        <li>A <dfn>current service</dfn> is a Local-networked Service, represented by a <a href=
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   322
        "#networkservice"><code>NetworkService</code></a> object, that is currently being shared with a web page via a
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   323
        <a href="#networkservices"><code>NetworkServices</code></a> object registered in the <a>list of active service
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   324
        managers</a>.
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   325
        </li>
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
   326
      </ul>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   327
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   328
    <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   329
      <h2>
440
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   330
        Security and privacy considerations
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   331
      </h2>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   332
      <p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   333
        The API defined in this specification can be used to find and connect to devices and services within a user's
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   334
        current network. This discloses information related to a user's network: devices available on their network and
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   335
        the publicly-accessible services ("networked services") currently running and available on those devices. The
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   336
        distribution of this information could potentially compromise the user's privacy. A conforming implementation
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   337
        of this specification MUST provide a mechanism that protects the user's privacy. This mechanism MUST ensure
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   338
        that no networked service information is retrievable without the user's express permission.
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   339
      </p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   340
      <section>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   341
        <h3>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   342
          Privacy considerations for API implementations
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   343
        </h3>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   344
        <p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   345
          A <a>user agent</a> MUST NOT provide networked service information to web sites without the express
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   346
          permission of the user. A user agent MUST acquire permission through a user interface, unless they have
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   347
          prearranged trust relationships with users, as described below. The user interface MUST include the document
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   348
          base URL. Those permissions that are acquired through the user interface and that are preserved beyond the
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   349
          current browsing session (i.e. beyond the time when the browsing context is navigated to another URL) MUST be
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   350
          revocable and a user agent MUST respect revoked permissions.
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   351
        </p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   352
        <p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   353
          Obtaining the user's express permission to access one API method does not imply the user has granted
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   354
          permission for the same web site to access any other methods that may be provided by this API, or to access
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   355
          the same method with a different set of arguments, as part of the same permission context. If a user has
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   356
          expressed permission for an implementation to, e.g. find a set of existing networked services, the
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   357
          implementation MUST seek the user's express permission if and when any subsequent functions are called on
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   358
          this API.
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   359
        </p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   360
        <p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   361
          A user agent MAY have prearranged trust relationships that do not require such user interfaces. For example,
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   362
          while a web browser will present a user interface when a web site performs a networked service lookup, a
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   363
          different runtime may have a prearranged, delegated security relationship with the user and, as such, a
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   364
          suitable alternative security and privacy mechanism with which to authorise the retrieval of networked
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   365
          service information.
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   366
        </p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   367
      </section>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   368
      <section class="informative">
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   369
        <h3>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   370
          Additional API implementation considerations
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   371
        </h3>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   372
        <p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   373
          Further to the requirements listed in the previous section, implementors of the Network Service Discovery API
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   374
          are also advised to consider the following aspects that can negatively affect the privacy of their users: in
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   375
          certain cases, users can inadvertently grant permission to the user agent to disclose networked services to
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   376
          Web sites. In other cases, the content hosted at a certain URL changes in such a way that previously granted
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   377
          networked service permissions no longer apply as far as the user is concerned. Or the users might simply
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   378
          change their minds.
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   379
        </p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   380
        <p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   381
          Predicting or preventing these situations is inherently difficult. Mitigation and in-depth defensive measures
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   382
          are an implementation responsibility and not prescribed by this specification. However, in designing these
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   383
          measures, implementers are advised to enable user awareness of networked service sharing, and to provide easy
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   384
          access to interfaces that enable revocation of permissions that web applications have for accessing networked
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   385
          services via this API.
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   386
        </p>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   387
      </section>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   388
    </section>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   389
    <section>
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
   390
      <h2>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   391
        Requesting networked services
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   392
      </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   393
      <pre class="widl">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   394
[Supplemental, NoInterfaceObject]
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   395
interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   396
  <a class="externalDFN"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   397
     href="http://dom.spec.whatwg.org/#promise">Promise</a> <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   398
     "#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type );
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   399
};
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   400
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   401
<a class="externalDFN"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   402
     href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   403
     "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   404
     "#navigatornetworkservice">NavigatorNetworkService</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   405
</pre>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   406
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   407
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   408
          Methods
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   409
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   410
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   411
          <dt>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   412
            <var title="">promise</var> = <var title="">window</var> . <code title="dom-navigator"><a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   413
            "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a></code> .
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   414
            <code title="dom-navigator-getNetworkServices"><a href=
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   415
            "#dom-navigator-getnetworkservices">getNetworkServices</a></code> ( <var title="">type</var> )
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   416
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   417
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   418
            <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   419
              Immediately returns a new <a href="http://dom.spec.whatwg.org/#promise"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   420
                 class="externalDFN">Promise</a> object and then the user is prompted to select discovered network
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   421
                 services that have advertised support for the requested service type(s).
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   422
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   423
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   424
              The <var title="">type</var> argument contains one or more <a>valid service type</a> tokens that the web
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   425
              page would like to interact with.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   426
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   427
            <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   428
              If the user accepts, the <var title="">promise</var> object is <a class="externalDFN"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   429
                 href="http://dom.spec.whatwg.org/#concept-resolver-resolve">resolved</a>, with a <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   430
                 "#networkservices"><code>NetworkServices</code></a> object as its argument.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   431
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   432
            <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   433
              If the user declines, or an error occurs, the <var title="">promise</var> object is <a class=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   434
              "externalDFN"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   435
                 href="http://dom.spec.whatwg.org/#concept-resolver-reject">rejected</a>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   436
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   437
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   438
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   439
        <div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   440
          <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   441
            When the <dfn id="dom-navigator-getnetworkservices"
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   442
               title="dom-navigator-getnetworkservices"><code>getNetworkServices(type)</code></dfn> method is called,
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   443
               the <a>user agent</a> MUST run the following steps:
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   444
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   445
          <ol class="rule">
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   446
            <li>Let <var>Network Service Promise</var> be a new <a href="http://dom.spec.whatwg.org/#promise"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   447
                  class="externalDFN"><code>Promise</code></a> object.
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   448
            </li>
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   449
            <li>Let <var>Network Service Promise's Resolver</var> be the default <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   450
            "http://dom.spec.whatwg.org/#concept-resolver"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   451
                  class="externalDFN">resolver</a> of <var>Network Service Promise</var>.
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   452
            </li>
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   453
            <li>Return <var>Network Service Promise</var>, and run the remaining steps asynchronously.
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   454
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   455
            <li>Let <var>requested control types</var> be initially set to an empty array.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   456
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   457
            <li>If <var>type</var> is an array consisting of one or more <a>valid service type</a> tokens, then let
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   458
            <var>requested control types</var> by the value of <var>type</var>, removing any non-<a>valid service
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   459
            type</a> tokens from the resulting array.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   460
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   461
            <li>If <var>type</var> is a string consisting of one <a>valid service type</a> token, then let
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   462
            <var>requested control types</var> be an array containing one item with a value of <var>type</var>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   463
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   464
            <li>If <var>requested control types</var> is an array that contains at least one or more <a title=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   465
            "valid service type">valid service type</a> tokens then continue to the step labeled <em>process</em>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   466
            below. Otherwise, reject <var>Network Service Promise</var> by running the <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   467
            "http://dom.spec.whatwg.org/#concept-resolver-reject"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   468
                  class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   469
                  Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   470
                  class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the string
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   471
                  value "UnknownTypePrefixError" (<a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   472
                  "#dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) and whose
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   473
                  <code>message</code> attribute has a helpful implementation-dependent message that explains this
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   474
                  error, abort any remaining steps and return.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   475
            </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   476
            <li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   477
              <em>Process</em>: Let <var>services found</var> be an empty array.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   478
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   479
            <li>For each <var>available service</var> in the <a>list of available service records</a> run the following
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   480
            steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   481
              <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   482
                <li>For each <var>requested control type</var> in <var>requested control types</var>: If <var>available
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   483
                service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   484
                  matched service</var> equal the value of <var>available service</var> and continue at the step
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   485
                  labeled <var>attach</var> below.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   486
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   487
                <li>Continue at the next <var>available service</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   488
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   489
                <li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   490
                  <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   491
                  <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   492
                    <li>Let <var>new service object</var> be a new <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   493
                    "#networkservice"><code>NetworkService</code></a> object, mapping the parameters of <var>matched
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   494
                    service</var> to this new object where possible.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   495
                    </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   496
                    <li>Append <var>new service object</var> to the <var>services found</var> array.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   497
                    </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   498
                  </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   499
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   500
              </ol>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   501
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   502
            <li>Optionally, e.g. based on a previously-established user preference, for security reasons, or due to
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   503
            platform limitations, the <a>user agent</a> MAY reject <var>Network Service Promise</var> by running the
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   504
            <a href="http://dom.spec.whatwg.org/#concept-resolver-reject"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   505
                  class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   506
                  Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   507
                  class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the string
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   508
                  value "PermissionDeniedError" (<a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   509
                  "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) and whose
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   510
                  <code>message</code> attribute has a helpful implementation-dependent message that explains this
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   511
                  error, abort any remaining steps and return.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   512
            </li>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   513
            <li>The user agent MUST NOT provide the entry script's origin with a <a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   514
            "#networkservices"><code>NetworkServices</code></a> object without prior permission given by the user.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   515
              <p>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   516
                If <var>services found</var> is not an empty array then the <a>user agent</a> MAY choose to prompt the
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   517
                user in a user-agent-specific manner for permission to provide the <a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   518
                "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   519
                   class="externalDFN">entry script</a>'s <a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   520
                   "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   521
                   class="externalDFN">origin</a> with a <a href="#networkservices"><code>NetworkServices</code></a>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   522
                   object representing the <a>user-authorized</a> subset of <var>services found</var>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   523
              </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   524
              <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   525
                Alternatively, the user agent MAY wish to skip this user opt-in step and choose to fulfill <var>Network
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   526
                Service Promise</var> immediately based on a previously-established user preference, for security
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   527
                reasons, or due to platform limitations. In such an implementation, if <var>Network Service
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   528
                Promise</var> is to be fulfilled as a result of a previously-established user preference then the
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   529
                <a>user agent</a> MUST continue at the next step of this algorithm.
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   530
              </p>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   531
              <p>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   532
                If permission has been granted by the user to access one or more networked services then the <a>user
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   533
                agent</a> SHOULD include an "ongoing local-network communication" indicator.
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   534
              </p>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   535
              <p>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   536
                If permission has been denied by the user, <a>user agent</a> or platform, then the <a>user agent</a>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   537
                MUST reject <var>Network Service Promise</var> by running the <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   538
                "http://dom.spec.whatwg.org/#concept-resolver-reject"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   539
                   class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   540
                   Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   541
                   class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   542
                   string value "PermissionDeniedError" (<a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   543
                   "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) and whose
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   544
                   <code>message</code> attribute has a helpful implementation-dependent message that explains this
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   545
                   error, abort any remaining steps and return.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   546
              </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   547
              <p>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   548
                If the user never responds or no previously-established user preference has been met, this algorithm
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   549
                stalls on this step.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   550
              </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   551
            </li>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   552
            <li>Let <var>services</var> be an empty array.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   553
            </li>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   554
            <li>If <var>services found</var> is not an empty array then set <var>services</var> to be an array of one
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   555
            or more <a href="#networkservice"><code>NetworkService</code></a> objects for which the user granted
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   556
            permission above - known as the current objects <dfn>user-authorized</dfn> services.
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   557
            </li>
377
a311e7fe116c Add removal of entry script origin's URL whitelist urls during the getNetworkServices() algorithm.
Rich Tibbett <richt@opera.com>
parents: 376
diff changeset
   558
            <li>Remove all previously whitelisted urls from the <a>entry script origin's URL whitelist</a> granted in
a311e7fe116c Add removal of entry script origin's URL whitelist urls during the getNetworkServices() algorithm.
Rich Tibbett <richt@opera.com>
parents: 376
diff changeset
   559
            the current <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
a311e7fe116c Add removal of entry script origin's URL whitelist urls during the getNetworkServices() algorithm.
Rich Tibbett <richt@opera.com>
parents: 376
diff changeset
   560
                  class="externalDFN">entry script</a>'s <a href=
a311e7fe116c Add removal of entry script origin's URL whitelist urls during the getNetworkServices() algorithm.
Rich Tibbett <richt@opera.com>
parents: 376
diff changeset
   561
                  "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
a311e7fe116c Add removal of entry script origin's URL whitelist urls during the getNetworkServices() algorithm.
Rich Tibbett <richt@opera.com>
parents: 376
diff changeset
   562
                  class="externalDFN">origin</a>.
a311e7fe116c Add removal of entry script origin's URL whitelist urls during the getNetworkServices() algorithm.
Rich Tibbett <richt@opera.com>
parents: 376
diff changeset
   563
            </li>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   564
            <li>For each Object <var>service</var> in <var>services</var>, if any, run the following sub-steps:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   565
              <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   566
                <li>Add the <var>service</var>'s <code>url</code> parameter to the <a>entry script origin's
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   567
                  <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   568
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   569
                <li>If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   570
                and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a>setup a UPnP Events
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   571
                Subscription</a> for <var>service</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   572
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   573
              </ol>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   574
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   575
            <li>Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   576
            object.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   577
            </li>
375
f290bbd84426 Increment/decrement servicesAvailable in rules for 'adding an available service' and 'removing an available service' based on the original requested control types provided in the original getNetworkServices() call (from: http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html)
Rich Tibbett <richt@opera.com>
parents: 374
diff changeset
   578
            <li>Store <var>requested control types</var> against <var>services manager</var> as an internal variable.
f290bbd84426 Increment/decrement servicesAvailable in rules for 'adding an available service' and 'removing an available service' based on the original requested control types provided in the original getNetworkServices() call (from: http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html)
Rich Tibbett <richt@opera.com>
parents: 374
diff changeset
   579
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   580
            <li>Set <var>services manager</var>'s <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   581
            "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   582
            items currently found in the <a>list of available service records</a> whose <code>type</code> property
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   583
            matches any of the tokens requested in <var>requested control types</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   584
            </li>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   585
            <li>Add <var>services</var>, if any, to the <var>services manager</var> object as its collection of
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   586
            <a>indexed properties</a>. If <var>services</var> is an empty array then the <var>services manager</var>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   587
            does not have any <var>indexed properties</var>.
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   588
            </li>
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   589
            <li>Set <var>services manager</var>'s <a href="#dom-networkservices-length"><code>length</code></a>
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   590
            attribute to the number of items in <var>services</var>.
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   591
            </li>
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   592
            <li>Add <var>services manager</var> to the <a>list of active service managers</a>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   593
            </li>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   594
            <li>The <a>user agent</a> MUST fulfill <var>Network Service Promise</var> by running the <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   595
            "http://dom.spec.whatwg.org/#concept-resolver-fulfill"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   596
                  class="externalDFN">resolver fulfill algorithm</a> against the <var>Network Service Promise's
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   597
                  Resolver</var>, passing in <var>services manager</var> as its argument.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   598
            </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   599
          </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   600
          <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   601
            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   602
               class="externalDFN">task source</a> for these <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   603
               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   604
               class="externalDFN">tasks</a> is the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   605
               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   606
               class="externalDFN">user interaction task source</a>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   607
          </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   608
          <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   609
            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the
441
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   610
            <a>user agent</a> MUST add its <a href="#dom-networkservice-url"><code>url</code></a> to the <dfn>entry
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   611
            script origin's URL whitelist</dfn>. This list enables the Web page to override and initiate cross-site
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   612
            resource requests towards these URLs, and any sub-resources of these URLs, within the current <a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   613
            "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   614
               class="externalDFN">entry script</a>'s <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   615
               "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   616
               class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   617
               Web Messaging, XMLHttpRequest).
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   618
          </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   619
          <p>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   620
            If the user navigates away from the <a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   621
            "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   622
               class="externalDFN">entry script</a>'s <a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   623
               "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
441
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   624
               class="externalDFN">origin</a> or permission to access a given networked service is revoked at any time
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   625
               by the platform or user then the <a>user agent</a> <em class="ct">MUST</em> remove its previously
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   626
               whitelisted urls from the <a>entry script origin's URL whitelist</a>.
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   627
          </p>
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   628
          <p>
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   629
            There is no implied persistence to networked service sharing provided to a web page. It MUST NOT be
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   630
            possible to access a previously white-listed networked service without user authorization in all of the
b4b2569b4e9b Fix [DAP-ISSUE-136]: Issues related to garbage collection
Rich Tibbett <richt@opera.com>
parents: 440
diff changeset
   631
            following cases:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   632
          </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   633
          <ul>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   634
            <li>If the current script is reloaded at any point in the same or different window.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   635
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   636
            <li>if the current script reinvokes the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   637
            "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   638
            execution.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   639
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   640
            <li>If the user navigates forward or back in their history to reload the current page.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   641
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   642
            <li>If a script is running in a different origin.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   643
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   644
          </ul>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   645
        </div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   646
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   647
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   648
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   649
          Error Handling
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   650
        </h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   651
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   652
          <dt>
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   653
            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-name"><a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   654
            "#dom-domerror-extensions-name">name</a></code>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   655
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   656
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   657
            <p>
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   658
              Returns the current error's error name. At the current time, this will be "PermissionDeniedError" or
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   659
              "UnknownTypePrefixError", for which the corresponding error constants <a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   660
              "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   661
              "#dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are defined.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   662
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   663
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   664
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   665
        <p>
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   666
          The <dfn id="dom-domerror-extensions-name"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   667
             title="dom-domerror-extensions-name"><code>name</code></dfn> attribute of a <a href=
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   668
             "http://dom.spec.whatwg.org/#domerror"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   669
             class="externalDFN"><code>DOMError</code></a> object returned from this API <em class="ct">MUST</em>
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   670
             return the name for the error, which will be one of the following:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   671
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   672
        <dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   673
          <dt>
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   674
            <dfn id="dom-domerror-extensions-permission_denied"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   675
                title="dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (DOMString
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   676
                value "PermissionDeniedError")
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   677
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   678
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   679
            The user or user agent denied the page permission to access any services.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   680
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   681
          <dt>
447
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   682
            <dfn id="dom-domerror-extensions-unknown_type_prefix"
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   683
                title="dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
5e36d90b8960 Replace numeric error codes with string-based error types and fold the NavigatorNetworkServiceError interface in to DOMError (therefore, removing NavigatorNetworkServiceError from spec)
Rich Tibbett <richt@opera.com>
parents: 441
diff changeset
   684
                (DOMString value "UnknownTypePrefixError")
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   685
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   686
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   687
            No <a>valid service type</a> tokens were provided in the method invocation.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   688
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   689
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   690
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   691
    </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   692
    <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   693
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   694
        Obtaining networked services
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   695
      </h2>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   696
      <p>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   697
        The <a href="#networkservices"><code>NetworkServices</code></a> interface represents a collection of zero or
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   698
        more <dfn>indexed properties</dfn> that are each a <a>user-authorized</a> <a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   699
        "#networkservice"><code>NetworkService</code></a> object.
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   700
      </p>
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   701
      <p>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   702
        A <a href="#networkservices"><code>NetworkServices</code></a> object is the <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   703
        "http://dom.spec.whatwg.org/#concept-promise-result"
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   704
           class="externalDFN">promise result</a> from a call to <a href=
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   705
           "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   706
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   707
      <pre class="widl">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   708
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   709
interface <dfn id="networkservices">NetworkServices</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   710
  readonly attribute unsigned long    <a href="#dom-networkservices-length">length</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   711
  getter <a href="#networkservice">NetworkService</a> (unsigned long index);
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   712
  <a href="#networkservice">NetworkService</a>? <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   713
"#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   714
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   715
  readonly attribute unsigned long    <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   716
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   717
  // event handler attributes
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   718
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   719
     class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   720
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   721
     class="externalDFN">EventHandler</a>     <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   722
     "#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   723
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   724
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   725
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   726
<a href="#networkservices">NetworkServices</a> implements <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   727
"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   728
     class="externalDFN">EventTarget</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   729
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   730
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   731
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   732
          Attributes
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   733
        </h2>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   734
        <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   735
          <dt>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   736
            <code title="dom-networkservices-length"><a href="#dom-networkservices-length">length</a></code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   737
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   738
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   739
            <p>
398
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
   740
              Returns the current number of <a>indexed properties</a> in the current object's collection.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   741
            </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   742
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   743
          <dt>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   744
            <code title="dom-networkservices-servicesavailable"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   745
            "#dom-networkservices-servicesavailable">servicesAvailable</a></code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   746
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   747
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   748
            <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   749
              Returns the current number of items matching one of the app-requested <a>valid service type</a> tokens in
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   750
              the <a>list of available service records</a>.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   751
            </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   752
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   753
        </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   754
        <div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   755
          <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   756
            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute MUST return the number of
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   757
            <a href="#networkservice"><code>NetworkService</code></a> objects represented by the collection.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   758
          </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   759
          <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   760
            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute MUST
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   761
            return the number of services in the <a>list of available service records</a> whose <code>type</code>
437
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   762
            attribute matches any of the <a>valid service type</a> tokens that were initially used to create the
d25229263a68 Change getNetworkServices API + associated algorithms to use DOM Promises
Rich Tibbett <richt@opera.com>
parents: 402
diff changeset
   763
            current <a href="#networkservices"><code>NetworkServices</code></a> object.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   764
          </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   765
        </div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   766
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   767
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   768
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   769
          Methods
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   770
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   771
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   772
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   773
            <code title="networkservices-getter"><a href="#networkservices">services</a></code> [ <var title=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   774
            "">index</var> ]
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   775
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   776
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   777
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   778
              Returns the specified <a href="#networkservice"><code>NetworkService</code></a> object.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   779
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   780
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   781
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   782
            <code title="networkservices-getter"><a href="#networkservices">services</a></code> . <code title=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   783
            "dom-networkservices-getservicebyid"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   784
            "#dom-networkservices-getservicebyid">getServiceById</a></code> ( <var title="">id</var> )
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   785
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   786
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   787
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   788
              Returns the <a href="#networkservice"><code>NetworkService</code></a> object with the given identifier,
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   789
              or null if no service has that identifier.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   790
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   791
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   792
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   793
        <p>
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   794
          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current collection of
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
   795
          zero or more <a href="#networkservice"><code>NetworkService</code></a> objects - its <a>indexed
388
f6ad389be556 Update immutability defintion to clarify that only indexed properties of a NetworkServices object are immutable.
Rich Tibbett <richt@opera.com>
parents: 387
diff changeset
   796
          properties</a>. The <a>indexed properties</a> of a <a href=
f6ad389be556 Update immutability defintion to clarify that only indexed properties of a NetworkServices object are immutable.
Rich Tibbett <richt@opera.com>
parents: 387
diff changeset
   797
          "#networkservices"><code>NetworkServices</code></a> object are <span>immutable</span> meaning that <a>indexed
f6ad389be556 Update immutability defintion to clarify that only indexed properties of a NetworkServices object are immutable.
Rich Tibbett <richt@opera.com>
parents: 387
diff changeset
   798
          properties</a> cannot be added and <a>indexed properties</a> cannot be removed for the lifetime of a <a href=
f6ad389be556 Update immutability defintion to clarify that only indexed properties of a NetworkServices object are immutable.
Rich Tibbett <richt@opera.com>
parents: 387
diff changeset
   799
          "#networkservices"><code>NetworkServices</code></a> object.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   800
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   801
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   802
          The <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   803
          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   804
             class="externalDFN">supported property indices</a> of <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   805
             "#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   806
             the number of the <a href="#networkservice"><code>NetworkService</code></a> objects in the collection
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   807
             minus one.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   808
        </p>
398
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
   809
        <p class="note">
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
   810
          Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
   811
          first has the index 0, and each subsequent service is numbered one higher than the previous one.
19eb703af1c9 Minor editorial changes to NSD spec
Rich Tibbett <richt@opera.com>
parents: 397
diff changeset
   812
        </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   813
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   814
          To <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   815
          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   816
             class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   817
             <a href="#networkservices"><code>NetworkServices</code></a> object the user agent MUST return the <a href=
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   818
             "#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th item in
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   819
             the collection.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   820
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   821
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   822
          The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   823
          "ct">MUST</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   824
          collection whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   825
          <var>id</var> argument provided. When no <a href="#networkservice"><code>NetworkService</code></a> objects
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   826
          match the given argument, the method MUST return null.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   827
        </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   828
      </section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   829
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   830
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   831
          Events
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   832
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   833
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   834
          The following are the event handlers (and their corresponding event handler event types) that <em class=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   835
          "ct">MUST</em> be supported, as IDL attributes, by all objects implementing the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   836
          "#networkservices"><code>NetworkServices</code></a> interface:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   837
        </p>
243
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
   838
        <table border="1">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   839
          <thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   840
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   841
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   842
                <span title="event handlers">Event handler</span>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   843
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   844
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   845
                <span>Event handler event type</span>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   846
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   847
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   848
          </thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   849
          <tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   850
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   851
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   852
                <dfn id="dom-networkservices-onserviceavailable"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   853
                    title="dom-NetworkServices-onserviceavailable"><code>onserviceavailable</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   854
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   855
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   856
                <a href="#event-serviceavailable"><code>serviceavailable</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   857
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   858
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   859
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   860
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   861
                <dfn id="dom-networkservices-onserviceunavailable"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   862
                    title="dom-NetworkServices-onserviceunavailable"><code>onserviceunavailable</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   863
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   864
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   865
                <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   866
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   867
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   868
          </tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   869
        </table>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   870
      </section>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   871
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   872
    <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   873
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   874
        Communicating with a networked service
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   875
      </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   876
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   877
        The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   878
        information for an HTTP service endpoint and if available, service events, running on a networked device.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   879
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   880
      <pre class="widl">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   881
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   882
interface <dfn id="networkservice">NetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   883
  readonly attribute DOMString        <a href="#dom-networkservice-id">id</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   884
  readonly attribute DOMString        <a href="#dom-networkservice-name">name</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   885
  readonly attribute DOMString        <a href="#dom-networkservice-type">type</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   886
  readonly attribute DOMString        <a href="#dom-networkservice-url">url</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   887
  readonly attribute DOMString        <a href="#dom-networkservice-config">config</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   888
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   889
  readonly attribute boolean          <a href="#dom-networkservice-online">online</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   890
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   891
  // event handler attributes
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   892
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   893
     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceonline">onserviceonline</a>;
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   894
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   895
     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceoffline">onserviceoffline</a>;
191
5e0da09685f7 Discovery API updates following feedback from http://lists.w3.org/Archives/Public/public-device-apis/2012Aug/0016.html
Rich Tibbett <richt@opera.com>
parents: 180
diff changeset
   896
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   897
           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   898
     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onnotify">onnotify</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   899
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   900
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   901
<a href="#networkservice">NetworkService</a> implements <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   902
"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   903
     class="externalDFN">EventTarget</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   904
</pre>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   905
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   906
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   907
          Attributes
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   908
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   909
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   910
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   911
            <var title="">service</var> . <code title="dom-networkservice-id"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   912
            "#dom-networkservice-id">id</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   913
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   914
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   915
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   916
              A unique identifier for the given user-selected service instance.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   917
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   918
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   919
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   920
            <var title="">service</var> . <code title="dom-networkservice-name"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   921
            "#dom-networkservice-name">name</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   922
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   923
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   924
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   925
              The name of the user-selected service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   926
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   927
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   928
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   929
            <var title="">service</var> . <code title="dom-networkservice-type"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   930
            "#dom-networkservice-type">type</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   931
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   932
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   933
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   934
              The <a>valid service type</a> token value of the user-selected service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   935
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   936
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   937
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   938
            <var title="">service</var> . <code title="dom-networkservice-url"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   939
            "#dom-networkservice-url">url</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   940
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   941
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   942
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   943
              The control URL endpoint (including any required port information) of the user-selected control service
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   944
              that has been added to the <a>entry script origin's URL whitelist</a>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   945
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   946
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   947
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   948
            <var title="">service</var> . <code title="dom-networkservice-config"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   949
            "#dom-networkservice-config">config</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   950
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   951
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   952
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   953
              The configuration information associated with the service depending on the requested service type.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   954
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   955
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   956
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   957
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   958
          The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service.
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   959
          The same service provided at different times or on different objects MUST have the same <a href=
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
   960
          "#dom-networkservice-id"><code>id</code></a> value.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   961
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   962
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   963
          The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   964
          the service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   965
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   966
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   967
          The <dfn id="dom-networkservice-type"><code>type</code></dfn> attribute reflects the value of the <a>valid
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   968
          service type</a> of the service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   969
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   970
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   971
          The <dfn id="dom-networkservice-url"><code>url</code></dfn> attribute is an <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   972
          "http://www.w3.org/TR/html5/urls.html#absolute-url"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   973
             class="externalDFN">absolute URL</a> pointing to the root HTTP endpoint for the service that has been
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   974
             added to the <a>entry script origin's URL whitelist</a>. Web pages can subsequently use this value for
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   975
             implicit cross-document messaging via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   976
             Web Messaging, XMLHttpRequest).
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   977
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   978
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   979
          The <dfn id="dom-networkservice-config"><code>config</code></dfn> attribute provides the raw configuration
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   980
          information extracted from the given network service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   981
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   982
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   983
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   984
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   985
          States
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   986
        </h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   987
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   988
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   989
            <var title="">service</var> . <code title="dom-networkservice-online"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   990
            "#dom-networkservice-online">online</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   991
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   992
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   993
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   994
              Returns <code>true</code> if the service is reporting that it is accessible on the local network or
390
6211d232766d Update spec to clarify that devices don't (necessarily) report themselves as offline
Rich Tibbett <richt@opera.com>
parents: 388
diff changeset
   995
              <code>false</code> if the service is no longer accessible (temporarily or permanently) on the local
6211d232766d Update spec to clarify that devices don't (necessarily) report themselves as offline
Rich Tibbett <richt@opera.com>
parents: 388
diff changeset
   996
              network.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   997
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   998
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   999
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1000
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1001
          The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is
390
6211d232766d Update spec to clarify that devices don't (necessarily) report themselves as offline
Rich Tibbett <richt@opera.com>
parents: 388
diff changeset
  1002
          either <var>online</var>, and therefore accessible on the local network, in which case this attribute will
6211d232766d Update spec to clarify that devices don't (necessarily) report themselves as offline
Rich Tibbett <richt@opera.com>
parents: 388
diff changeset
  1003
          return <code>true</code> or, <var>offline</var>, and therefore not accessible on the local network, either
6211d232766d Update spec to clarify that devices don't (necessarily) report themselves as offline
Rich Tibbett <richt@opera.com>
parents: 388
diff changeset
  1004
          temporarily or permanently, in which case this attribute will return <code>false</code>. This attribute MUST
6211d232766d Update spec to clarify that devices don't (necessarily) report themselves as offline
Rich Tibbett <richt@opera.com>
parents: 388
diff changeset
  1005
          default to <code>true</code>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1006
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1007
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1008
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1009
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1010
          Events
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1011
        </h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1012
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1013
          The following are the event handlers (and their corresponding event handler event types) that <em class=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1014
          "ct">MUST</em> be supported, as IDL attributes, by all objects implementing the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1015
          "#networkservice"><code>NetworkService</code></a> interface:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1016
        </p>
243
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
  1017
        <table border="1">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1018
          <thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1019
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1020
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1021
                <span title="event handlers">Event handler</span>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1022
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1023
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1024
                <span>Event handler event type</span>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1025
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1026
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1027
          </thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1028
          <tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1029
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1030
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1031
                <dfn id="dom-networkservice-onnotify"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1032
                    title="dom-NetworkService-onnotify"><code>onnotify</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1033
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1034
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1035
                <a href="#event-notify"><code>notify</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1036
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1037
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1038
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1039
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1040
                <dfn id="dom-networkservice-onserviceonline"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1041
                    title="dom-NetworkService-onserviceonline"><code>onserviceonline</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1042
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1043
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1044
                <a href="#event-serviceonline"><code>serviceonline</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1045
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1046
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1047
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1048
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1049
                <dfn id="dom-networkservice-onserviceoffline"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1050
                    title="dom-NetworkService-onserviceoffline"><code>onserviceoffline</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1051
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1052
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1053
                <a href="#event-serviceoffline"><code>serviceoffline</code></a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1054
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1055
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1056
          </tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1057
        </table>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1058
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1059
    </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1060
    <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1061
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1062
        Service Discovery
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1063
      </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1064
      <p>
243
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
  1065
        A <a>user agent</a> conforming to this specification MAY implement <abbr title=
373
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1066
        "Simple Service Discovery Protocol">SSDP</abbr> [[!UPNP-DEVICEARCH11]], Zeroconf [[!DNS-SD]] + [[!MDNS]] and/or
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
  1067
        <abbr title="Discovery and Launch Protocol">DIAL</abbr> [<a href=
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
  1068
        "https://sites.google.com/a/dial-multiscreen.org/dial/dial-protocol-specification">DIAL</a>] <dfn>service
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
  1069
        discovery mechanisms</dfn> - the requirements detailed in this section of the specification - to enable Web
373
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1070
        pages to request and connect with HTTP services running on networked devices, discovered via any of these
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1071
        mechanisms, through this API. When a <a>user agent</a> implements any of these <a>service discovery
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1072
        mechanisms</a>, then it MUST conform to the corresponding algorithms provided in this section of the
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1073
        specification.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1074
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1075
      <p>
373
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1076
        This section presents how the results of these <a>service discovery mechanisms</a> will be matched to requested
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1077
        service types, how the user agent stores available and active services and how their properties are applied to
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1078
        any resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1079
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1080
      <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1081
        It is expected that user agents will perform these <a>service discovery mechanisms</a> asynchronously and
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1082
        periodically update the <a>list of available service records</a> as required. The timing of any <a>service
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1083
        discovery mechanisms</a> is an implementation detail left to the discretion of the implementer (e.g. by
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1084
        continuously monitoring the network as a background process or on invocation of this API from a Web page).
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1085
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1086
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1087
        The <dfn>list of available service records</dfn> is a single dynamic internal lookup table within user agents
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1088
        that is used to track all the services that have been discovered and are available in the current network at
440
fcbaadc4fd54 Fix [DAP-ISSUE-135]: Add security and privacy considerations section [Network Service Discovery]
Rich Tibbett <richt@opera.com>
parents: 438
diff changeset
  1089
        the current time. At any point during the running of any of the <a>service discovery mechanisms</a> then
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1090
        existing entries within this table can be updated, entries can be added and entries can be removed as the
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1091
        status of networked services changes according to the rules defined in this specification.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1092
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1093
      <p>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1094
        The <dfn>list of active service managers</dfn> is an internal list within user agents that is used to track all
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1095
        <a href="#networkservices"><code>NetworkServices</code></a> objects currently being shared with any web pages
371
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
  1096
        at the current time within the user agent. Each <a href="#networkservices"><code>NetworkServices</code></a>
8b03e17da083 Rewrite Step 9 of getNetworkService algorithm following feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Sep/0141.html
Rich Tibbett <richt@opera.com>
parents: 332
diff changeset
  1097
        object in the <a>list of active service managers</a> represents a collection of zero or more <a href=
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1098
        "#networkservice"><code>NetworkService</code></a> objects - known as its <dfn>indexed properties</dfn>.
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1099
        <a href="#networkservice"><code>NetworkService</code></a> objects are attached as the <a>indexed properties</a>
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1100
        of a <a href="#networkservices"><code>NetworkServices</code></a> object as part of the <a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1101
        "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1102
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1103
      <p>
387
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
  1104
        The rule for <dfn>adding an available service</dfn> is the process of adding a <a>new service</a> or updating
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
  1105
        an <a>existing service</a> that is generally available on the user's current network in the <a>list of
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
  1106
        available service records</a>. This rule takes one argument, <var>network service record</var>, and consists of
abb49f62a775 Clarify the terms 'new service', 'existing service' and 'current service'
Rich Tibbett <richt@opera.com>
parents: 378
diff changeset
  1107
        running the following steps:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1108
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1109
      <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1110
        <li>For each <var>existing service record</var> in the current <a>list of available service records</a>, run
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1111
        the following sub-steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1112
          <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1113
            <li>If the <var>existing service record</var>'s <code>id</code> property does not equal <var>network
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1114
            service record</var>'s <code>id</code> property then abort any remaining sub-steps and continue at the next
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1115
            available <var>existing service record</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1116
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1117
            <li>Replace the value of <var>existing service record</var> in the current <a>list of available service
373
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1118
            records</a> with the value of <var>network service record</var>, aborting any remaining steps in this
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1119
            algorithm and return.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1120
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1121
          </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1122
        </li>
373
bc1d9819cad3 Clarify rules for 'adding an available service' and 'removing an available service' from http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0020.html
Rich Tibbett <richt@opera.com>
parents: 372
diff changeset
  1123
        <li>Add <var>network service record</var> to the <a>list of available service records</a> as a new item.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1124
        </li>
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
  1125
        <li>For each <var>service manager</var> in the <a>list of active service managers</a> run the following steps:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1126
          <ol class="rule">
250
8b912f2bb9c7 Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
Rich Tibbett <richt@opera.com>
parents: 243
diff changeset
<