discovery-api/Overview.src.html
author Rich Tibbett <richt@opera.com>
Wed, 03 Oct 2012 14:47:11 +0200
changeset 254 f29ec967fb3b
parent 250 8b912f2bb9c7
child 288 ec6f8e4f894e
permissions -rw-r--r--
Editorial updates to NSD 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",
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
    38
          //publishDate:  "2012-10-04",
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",
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
    42
          previousPublishDate: "2012-08-07",
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
            },
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
    50
            {
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
    51
              name:       "Clarke Stevens",
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
    52
              //url:      "",
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
    53
              company:    "CableLabs",
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
    54
              companyURL: "http://cablelabs.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
    55
            }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    56
          ],
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
    57
          noIDLIn:      true,
241
985e203d74f7 Prepare Working Draft for NSD
Rich Tibbett <richt@opera.com>
parents: 240
diff changeset
    58
          wg:           "Device APIs Working Group",
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    59
          wgURI:        "http://www.w3.org/2009/dap/",
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    60
          wgPublicList: "public-device-apis",
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
    61
          wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/43696/status"
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    62
      };
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    63
    </script>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    64
    <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
    65
          type="text/javascript"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    66
          class='remove'
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    67
          async="">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    68
</script>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    69
    <style type="text/css">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
    70
/* Custom ReSpec CSS (by Rich Tibbett) */
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    71
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    72
      /* Add better spacing to sections */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    73
      section, .section { margin-bottom: 2em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    74
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    75
      /* Reduce note & issue render size */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    76
      .note, .issue { font-size:0.8em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    77
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    78
      /* Add addition spacing to <ol> and <ul> for rule definition */
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    79
      ol.rule li, ul.rule li { padding:0.6em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    80
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    81
      pre.widl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; position: relative; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    82
      pre.widl :link, pre.widl :visited { color: #000; background: transparent; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    83
      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 }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    84
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    85
      div.example { border: solid thin red; background: #F7DFE5; color: black; padding: 0.5em 1em; position: relative; margin: 1em 0 1em 4.6em; width: auto; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    86
      div.example:before { content: "EXAMPLE"; font: bold small sans-serif; padding: 0.5em; background: red; color: white; position: absolute; top: 0; margin: -1px 0 0 -7.6em; width: 5em; border: thin solid red; border-radius: 0 0 0 0.5em }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    87
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    88
      dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    89
      hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    90
      dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    91
      dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    92
      dl.domintro dd p { margin: 0.5em 0; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    93
      dl.domintro code {font-size: inherit; font-style: italic; }
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
    94
      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; }
238
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    95
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    96
      table { border-collapse:collapse; border-style:hidden hidden none hidden }
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    97
      table thead { border-bottom:solid }
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    98
      table tbody th:first-child { border-left:solid }
65e14f8dc95d Editorial changes to Service Discovery spec
Rich Tibbett <richt@opera.com>
parents: 232
diff changeset
    99
      table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   100
    </style>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   101
  </head>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   102
  <body>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   103
    <section id='abstract'>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   104
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   105
        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
   106
        <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
   107
        within the current network.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   108
      </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   109
    </section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   110
    <section id='sotd'>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   111
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   112
        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
   113
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   114
    </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   115
    <section class="informative">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   116
      <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   117
        Introduction
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   118
      </h3>
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
        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
   121
        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
   122
        interface.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   123
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   124
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   125
        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
   126
        service type, known by developers and advertised by Local-networked Devices. User authorization, where the user
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   127
        connects the web page to discovered services, is expected before the web page is able to interact
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   128
        with any Local-networked Services.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   129
      </p>
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
        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
   132
        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
   133
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   134
      <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
   135
        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
   136
        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
   137
        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
   138
      </p>
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
        If a service connectivity request is successful then the Web page is provided with the necessary information to
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   141
        communicate with the authorized Local-networked Service. If the request fails then the Web page will receive an
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   142
        error callback containing an error code describing the cause of Local-networked Service connectivity failure.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   143
      </p>
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
        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
   146
        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
   147
        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
   148
        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
   149
        by the connected Local-networked Service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   150
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   151
      <div class="example">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   152
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   153
          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
   154
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   155
        <hr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   156
        <pre class="highlight">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   157
function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   158
  // 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
   159
  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
   160
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   161
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   162
navigator.getNetworkServices('zeroconf:_boxee-jsonrpc._tcp', showServices);
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   163
</pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   164
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   165
      <div class="example">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   166
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   167
          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
   168
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   169
        <hr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   170
        <pre class="highlight">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   171
function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   172
  // 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
   173
  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
   174
}
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
function error( e ) {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   177
  console.log( "Error occurred: " + e.code );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   178
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   179
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   180
navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1', showServices, error);
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   181
</pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   182
      </div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   183
      <div class="example">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   184
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   185
          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
   186
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   187
        <hr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   188
        <pre class="highlight">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   189
function showServices( services ) {
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   190
  // 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
   191
  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
   192
     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
   193
}
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   194
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   195
navigator.getNetworkServices([
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   196
  'zeroconf:_boxee-jsonrpc._tcp',
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   197
  'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   198
], showServices);
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   199
</pre>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   200
      </div>
239
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
        For more detailed examples see the <a href="#examples">Examples</a> section.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   203
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   204
    </section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   205
    <section id='conformance'>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   206
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   207
        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
   208
        "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
   209
        "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
   210
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   211
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   212
        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
   213
        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
   214
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   215
      <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
   216
        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
   217
        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
   218
        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
   219
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   220
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   221
        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
   222
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   223
      <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
   224
        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
   225
        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
   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
        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
   229
        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
   230
        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
   231
        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
   232
        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
   233
        exception is insufficient.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   234
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   235
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   236
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   237
          Dependencies
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   238
        </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
   239
        <dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   240
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   241
            HTML
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   242
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   243
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   244
            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
   245
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   246
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   247
            WebIDL
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   248
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   249
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   250
            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
   251
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   252
        </dl>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   253
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   254
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   255
    <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   256
      <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   257
        Terminology
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   258
      </h3>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   259
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   260
        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
   261
        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
   262
      </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
   263
      <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   264
        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
   265
        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
   266
        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
   267
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   268
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   269
        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
   270
        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
   271
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   272
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   273
        A <dfn>valid service type</dfn> is a string that begins with <code>upnp:</code> or <code>zeroconf:</code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   274
        followed by one or more characters in the ranges U+0021, U+0023 to U+0027, U+002A to U+002B, U+002D to U+002E,
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   275
        U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   276
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   277
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   278
        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
   279
        "#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
   280
        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
   281
        defined in this specification.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   282
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   283
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   284
        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
   285
        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
   286
        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
   287
      </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   288
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   289
    <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   290
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   291
        Requesting networked services
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   292
      </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   293
      <pre class="widl">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   294
[Supplemental, NoInterfaceObject]
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   295
interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   296
  // Obtain a Local-networked Service
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   297
  void <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type,
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   298
                           in <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   299
"#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   300
                           in optional <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   301
"#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   302
};
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   303
<a class="externalDFN"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   304
     href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   305
     "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
   306
     "#navigatornetworkservice">NavigatorNetworkService</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   307
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   308
[Callback=FunctionOnly, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   309
interface <dfn id="navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   310
  void handleEvent( in <a href="#networkservices">NetworkServices</a> services );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   311
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   312
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   313
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   314
interface <dfn id="navigatornetworkserviceerror">NavigatorNetworkServiceError</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   315
  const unsigned short <a href="#dom-navigatornetworkserviceerror-permission_denied">PERMISSION_DENIED_ERR</a> = 1;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   316
  const unsigned short <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix">UNKNOWN_TYPE_PREFIX_ERR</a> = 2;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   317
  readonly attribute unsigned short <a href="#dom-navigatornetworkserviceerror-code">code</a>;
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   318
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   319
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   320
[Callback=FunctionOnly, NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   321
interface <dfn id="navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   322
  void handleEvent( in <a href="#navigatornetworkserviceerror">NavigatorNetworkServiceError</a> error );
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   323
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   324
</pre>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   325
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   326
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   327
          Methods
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   328
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   329
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   330
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   331
            <var title="">window</var> . <code title="dom-navigator"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   332
            "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
   333
            <code title="dom-navigator-getNetworkServices"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   334
            "#dom-navigator-getnetworkservices">getNetworkServices</a></code> ( <var title="">type</var> , <var title=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   335
            "">successCallback</var> [, <var title="">errorCallback</var> ] )
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   336
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   337
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   338
            <p>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   339
              Prompts the user to select discovered network services that have advertised support for the
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   340
              requested service type.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   341
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   342
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   343
              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
   344
              page would like to interact with.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   345
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   346
            <p>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   347
              If the user accepts, the <var title="">successCallback</var> is invoked, with zero or more <a href=
240
4bb39c70f008 Minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 239
diff changeset
   348
              "#networkservice"><code>NetworkService</code></a> objects as its argument.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   349
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   350
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   351
              If the user declines, the <var title="">errorCallback</var> (if any) is invoked.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   352
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   353
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   354
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   355
        <div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   356
          <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   357
            When the <dfn id="dom-navigator-getnetworkservices"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   358
               title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
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
   359
               errorCallback])</code></dfn> method is called, 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
   360
          </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   361
          <ol class="rule">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   362
            <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
   363
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   364
            <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
   365
            <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
   366
            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
   367
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   368
            <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
   369
            <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
   370
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   371
            <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
   372
            "valid service type">valid service type</a> tokens then continue to the step labeled <em>process</em>
240
4bb39c70f008 Minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 239
diff changeset
   373
            below. Otherwise, the <a>user agent</a> MUST <a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   374
            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   375
                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   376
                  object of type <code>Function</code>, with a new <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   377
                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   378
                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   379
                  (<a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   380
                  "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   381
                  its argument, abort any remaining steps and return.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   382
            </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   383
            <li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   384
              <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
   385
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   386
            <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
   387
            steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   388
              <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   389
                <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
   390
                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
   391
                  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
   392
                  labeled <var>attach</var> below.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   393
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   394
                <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
   395
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   396
                <li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   397
                  <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
   398
                  <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   399
                    <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
   400
                    "#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
   401
                    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
   402
                    </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   403
                    <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
   404
                    </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   405
                  </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   406
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   407
              </ol>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   408
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   409
            <li>Return, and run the remaining steps asynchronously.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   410
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   411
            <li>Optionally, e.g. based on a previously-established user preference, for security reasons, or due to
240
4bb39c70f008 Minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 239
diff changeset
   412
            platform limitations, the <a>user agent</a> MAY <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/webappapis.html#queue-a-task"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   414
                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   415
                  object of type <code>Function</code>, with a new <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   416
                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   417
                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   418
                  (<a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   419
                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   420
                  argument, abort any remaining steps and return.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   421
            </li>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   422
            <li>If <var>services found</var> is not an empty array then the <a>user agent</a> MUST prompt the user in a
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   423
              user-agent-specific manner for permission to provide
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
   424
            the <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   425
                  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
   426
                  "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
   427
                  class="externalDFN">origin</a> with an array of <a href=
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   428
                  "#networkservice"><code>NetworkService</code></a> objects representing the <a>user-authorized</a> subset
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   429
                  of <var>services found</var>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   430
              <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   431
                If the user grants permission to access one or more networked services then the <a>user agent</a>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   432
                SHOULD include an "ongoing local-network communication" indicator.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   433
              </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   434
              <p>
240
4bb39c70f008 Minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 239
diff changeset
   435
                If the user denies permission, then the <a>user agent</a> MUST <a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   436
                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   437
                   class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   438
                   object of type <code>Function</code>, with a new <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   439
                   "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   440
                   "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   441
                   (<a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   442
                   "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   443
                   argument, abort any remaining steps and return.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   444
              </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   445
              <p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   446
                If the user never responds, this algorithm stalls on this step.
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   447
              </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   448
            </li>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   449
            <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
   450
            </li>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   451
            <li>
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   452
               If <var>services found</var> is not an empty array then set <var>services</var> to be an array of one or more <a href=
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   453
            "#networkservice"><code>NetworkService</code></a> objects for which the user granted permission above - known as the
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   454
            current objects <dfn>user-authorized</dfn> services.
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   455
            </li>
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   456
            <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
   457
              <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   458
                <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
   459
                  <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
   460
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   461
                <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
   462
                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
   463
                Subscription</a> for <var>service</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   464
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   465
              </ol>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   466
            </li>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   467
            <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
   468
            object.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   469
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   470
            <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
   471
            "#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
   472
            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
   473
            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
   474
            </li>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   475
            <li>Add <var>services</var>, if any, to the <var>services manager</var> object as its collection of <a>indexed
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   476
            properties</a>. If <var>services</var> is an empty array then the <var>services manager</var> does not have any
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   477
            <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
   478
            </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
   479
            <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
   480
            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
   481
            </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
   482
            <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
   483
            </li>
240
4bb39c70f008 Minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 239
diff changeset
   484
            <li>The <a>user agent</a> MUST <a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   485
            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   486
                  class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with <var>services
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   487
                  manager</var> as its argument.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   488
            </li>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   489
          </ol>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   490
          <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   491
            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
   492
               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
   493
               "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
   494
               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
   495
               "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
   496
               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
   497
          </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   498
          <p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   499
            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, 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
   500
            <a>user agent</a> MUST add the <code>url</code> property to the <dfn>entry script origin's URL
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
   501
            whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource requests
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
   502
            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
   503
            "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
   504
               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
   505
               "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
   506
               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
   507
               Web Messaging, XMLHttpRequest).
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   508
          </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   509
          <p>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   510
            If the user navigates away from the
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   511
            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   512
                  class="externalDFN">entry script</a>'s <a href=
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   513
                  "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   514
                  class="externalDFN">origin</a> then the <a>user agent</a> <em class=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   515
            "ct">MUST</em> remove all previously whitelisted urls from 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
   516
            There is no persistence to network service selections provided to a web page. It is not possible to access
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   517
            a previously white-listed networked service without the necessary user authorization in all of the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   518
            following cases:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   519
          </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   520
          <ul>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   521
            <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
   522
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   523
            <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
   524
            "#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
   525
            execution.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   526
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   527
            <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
   528
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   529
            <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
   530
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   531
          </ul>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   532
        </div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   533
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   534
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   535
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   536
          Error Handling
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   537
        </h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   538
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   539
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   540
            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   541
            "#dom-navigatornetworkserviceerror-code">code</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   542
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   543
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   544
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   545
              Returns the current error's error code. At the current time, this will be <code>1</code> or
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   546
              <code>2</code>, for which the corresponding error constants <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   547
              "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   548
              "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   549
              defined.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   550
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   551
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   552
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   553
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   554
          The <dfn id="dom-navigatornetworkserviceerror-code"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   555
             title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   556
             "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   557
             "ct">MUST</em> return the code for the error, which will be one of the following:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   558
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   559
        <dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   560
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   561
            <dfn id="dom-navigatornetworkserviceerror-permission_denied"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   562
                title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   563
                (numeric value 1)
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   564
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   565
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   566
            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
   567
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   568
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   569
            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   570
                title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   571
                (numeric value 2)
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   572
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   573
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   574
            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
   575
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   576
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   577
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   578
    </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   579
    <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   580
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   581
        Obtaining networked services
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   582
      </h2>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   583
      <p>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   584
        The <a href="#networkservices"><code>NetworkServices</code></a> interface represents a collection of zero
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   585
        or more <dfn>indexed properties</dfn> that are
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   586
        each a <a>user-authorized</a> <a href="#networkservice"><code>NetworkService</code></a> object.
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   587
      </p>
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   588
      <p>
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   589
        A <a href="#networkservices"><code>NetworkServices</code></a> object is the top level success callback
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   590
        parameter from a call to
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   591
        <a href="#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
   592
      </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   593
      <pre class="widl">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   594
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   595
interface <dfn id="networkservices">NetworkServices</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   596
  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
   597
  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
   598
  <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
   599
"#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
   600
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   601
  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
   602
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   603
  // event handler attributes
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   604
           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
   605
     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
   606
           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
   607
     class="externalDFN">EventHandler</a>     <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   608
     "#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   609
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   610
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   611
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   612
<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
   613
"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
   614
     class="externalDFN">EventTarget</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   615
</pre>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   616
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   617
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   618
          Attributes
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   619
        </h2>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   620
        <dl class="domintro">
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   621
          <dt>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   622
            <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
   623
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   624
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   625
            <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
   626
              Returns the current number of items in the current object's collection of <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
   627
              "#networkservice"><code>NetworkService</code></a> objects.
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   628
            </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   629
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   630
          <dt>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   631
            <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
   632
            "#dom-networkservices-servicesavailable">servicesAvailable</a></code>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   633
          </dt>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   634
          <dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   635
            <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
   636
              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
   637
              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
   638
            </p>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   639
          </dd>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   640
        </dl>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   641
        <div>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   642
          <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
   643
            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
   644
            <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
   645
          </p>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   646
          <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
   647
            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
   648
            return the number of services in the <a>list of available service records</a> whose <code>type</code>
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
   649
            attribute matches any of the <a>valid service type</a> tokens that was initially used to create the current
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
   650
            <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
   651
          </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   652
        </div>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   653
      </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   654
      <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   655
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   656
          Methods
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   657
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   658
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   659
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   660
            <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
   661
            "">index</var> ]
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   662
          </dt>
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
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   665
              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
   666
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   667
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   668
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   669
            <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
   670
            "dom-networkservices-getservicebyid"><a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   671
            "#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
   672
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   673
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   674
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   675
              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
   676
              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
   677
            </p>
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
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   680
        <p>
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   681
          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current collection of zero
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   682
          or more <a href="#networkservice"><code>NetworkService</code></a> objects - its <a>indexed properties</a>. A <a href=
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   683
          "#networkservices"><code>NetworkServices</code></a> object is <span>immutable</span> meaning that
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   684
          <a>indexed properties</a> cannot be added and <a>indexed properties</a> cannot be removed for the lifetime of
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   685
          a <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
   686
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   687
        <p class="note">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   688
          Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   689
          first has the index 0, and each subsequent service is numbered one higher than the previous one.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   690
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   691
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   692
          The <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   693
          "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
   694
             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
   695
             "#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
   696
             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
   697
             minus one.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   698
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   699
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   700
          To <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   701
          "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
   702
             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
   703
             <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
   704
             "#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
   705
             the collection.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   706
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   707
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   708
          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
   709
          "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
   710
          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
   711
          <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
   712
          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
   713
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   714
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   715
          Services available within the local network can connect and disconnect at different times during the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   716
          execution of a web page. A <a>user agent</a> can inform a web page when the state of networked services
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   717
          matching the requested <a>valid service type</a> change. Web pages can use this information to enable in-page
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   718
          experiences for communicating the state of networked services with the ability to change the particular
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   719
          service or set of services the page is connected to by re-invoking the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   720
          "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   721
        </p>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   722
      </section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   723
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   724
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   725
          Events
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   726
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   727
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   728
          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
   729
          "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
   730
          "#networkservices"><code>NetworkServices</code></a> interface:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   731
        </p>
243
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
   732
        <table border="1">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   733
          <thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   734
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   735
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   736
                <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
   737
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   738
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   739
                <span>Event handler event type</span>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   740
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   741
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   742
          </thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   743
          <tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   744
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   745
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   746
                <dfn id="dom-networkservices-onserviceavailable"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   747
                    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
   748
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   749
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   750
                <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
   751
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   752
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   753
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   754
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   755
                <dfn id="dom-networkservices-onserviceunavailable"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   756
                    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
   757
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   758
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   759
                <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
   760
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   761
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   762
          </tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   763
        </table>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   764
      </section>
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   765
    </section>
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   766
    <section>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   767
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   768
        Communicating with a networked service
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   769
      </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   770
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   771
        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
   772
        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
   773
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   774
      <pre class="widl">
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   775
[NoInterfaceObject]
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   776
interface <dfn id="networkservice">NetworkService</dfn> {
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   777
  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
   778
  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
   779
  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
   780
  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
   781
  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
   782
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
   783
  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
   784
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   785
  // event handler attributes
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   786
           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
   787
     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
   788
           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
   789
     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
   790
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   791
           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
   792
     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
   793
};
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   794
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   795
<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
   796
"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
   797
     class="externalDFN">EventTarget</a>;
180
ee3a89da06e1 First draft of Networked Service Discovery and Messaging
Rich Tibbett <richt@opera.com>
parents:
diff changeset
   798
</pre>
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   799
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   800
        <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   801
          Attributes
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   802
        </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   803
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   804
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   805
            <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
   806
            "#dom-networkservice-id">id</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   807
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   808
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   809
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   810
              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
   811
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   812
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   813
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   814
            <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
   815
            "#dom-networkservice-name">name</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   816
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   817
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   818
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   819
              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
   820
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   821
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   822
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   823
            <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
   824
            "#dom-networkservice-type">type</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   825
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   826
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   827
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   828
              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
   829
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   830
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   831
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   832
            <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
   833
            "#dom-networkservice-url">url</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   834
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   835
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   836
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   837
              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
   838
              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
   839
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   840
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   841
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   842
            <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
   843
            "#dom-networkservice-config">config</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   844
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   845
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   846
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   847
              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
   848
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   849
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   850
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   851
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   852
          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
   853
          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
   854
          "#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
   855
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   856
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   857
          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
   858
          the service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   859
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   860
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   861
          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
   862
          service type</a> of the service.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   863
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   864
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   865
          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
   866
          "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
   867
             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
   868
             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
   869
             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
   870
             Web Messaging, XMLHttpRequest).
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   871
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   872
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   873
          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
   874
          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
   875
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   876
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   877
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   878
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   879
          States
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   880
        </h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   881
        <dl class="domintro">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   882
          <dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   883
            <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
   884
            "#dom-networkservice-online">online</a></code>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   885
          </dt>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   886
          <dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   887
            <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   888
              Returns <code>true</code> if the service is reporting that it is accessible on the local network or
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   889
              <code>false</code> if the service is reporting that it is no longer accessible (temporarily or
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   890
              permanently) on the local network.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   891
            </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   892
          </dd>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   893
        </dl>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   894
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   895
          The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   896
          reporting itself as being either <var>online</var>, and therefore accessible on the local network, in which
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   897
          case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   898
          local network, either temporarily or permanently, in which case this attribute will return
240
4bb39c70f008 Minor editorial updates
Rich Tibbett <richt@opera.com>
parents: 239
diff changeset
   899
          <code>false</code>. This attribute MUST default to <code>true</code>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   900
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   901
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   902
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   903
        <h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   904
          Events
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   905
        </h3>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   906
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   907
          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
   908
          "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
   909
          "#networkservice"><code>NetworkService</code></a> interface:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   910
        </p>
243
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
   911
        <table border="1">
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   912
          <thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   913
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   914
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   915
                <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
   916
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   917
              <th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   918
                <span>Event handler event type</span>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   919
              </th>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   920
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   921
          </thead>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   922
          <tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   923
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   924
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   925
                <dfn id="dom-networkservice-onnotify"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   926
                    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
   927
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   928
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   929
                <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
   930
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   931
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   932
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   933
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   934
                <dfn id="dom-networkservice-onserviceonline"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   935
                    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
   936
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   937
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   938
                <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
   939
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   940
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   941
            <tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   942
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   943
                <dfn id="dom-networkservice-onserviceoffline"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   944
                    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
   945
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   946
              <td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   947
                <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
   948
              </td>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   949
            </tr>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   950
          </tbody>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   951
        </table>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   952
      </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   953
    </section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   954
    <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   955
      <h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   956
        Service Discovery
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   957
      </h2>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   958
      <p>
243
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
   959
        A <a>user agent</a> conforming to this specification MAY implement <abbr title=
220f3226b2a1 Apply pub rules to proposed Working Draft update
Rich Tibbett <richt@opera.com>
parents: 241
diff changeset
   960
        "Simple Service Discovery Protocol">SSDP</abbr> [[!UPNP-DEVICEARCH11]] and Zeroconf [[!DNS-SD]] + [[!MDNS]]
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
   961
        <dfn>service discovery mechanisms</dfn> - the requirements detailed in this section of the specification - to
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
   962
        enable Web pages to request and connect with HTTP services running on networked devices, discovered via either
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
   963
        mechanism, through this API. When a <a>user agent</a> implements either of these <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
   964
        mechanisms</a>, then it MUST conform to the corresponding algorithms provided in this section 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
   965
        specification.
239
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
      <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
   968
        This section presents how the results of these two <a>service discovery mechanisms</a> will be matched to
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   969
        requested service types, how the user agent stores available and active services and how their properties are
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
   970
        applied to 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
   971
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   972
      <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
   973
        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
   974
        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
   975
        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
   976
        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
   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>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
   980
        that is used to track all the services that have been discovered and are available in the current network at
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
   981
        any given time. At any point during the running of either of the two <a>service discovery mechanisms</a> then
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
   982
        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
   983
        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
   984
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   985
      <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
   986
        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
   987
        <a href="#networkservices"><code>NetworkServices</code></a> objects currently being shared with any web pages
254
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   988
        at the current time within the user agent. Each <a href="#networkservices"><code>NetworkServices</code></a> object
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   989
        in the <a>list of
f29ec967fb3b Editorial updates to NSD spec
Rich Tibbett <richt@opera.com>
parents: 250
diff changeset
   990
        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
   991
        "#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
   992
        <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
   993
        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
   994
        "#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
   995
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   996
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   997
        The rule for <dfn>adding an available service</dfn> is the process of adding a new service or updating an
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   998
        existing service in the <a>list of available service records</a> that is generally available on the user's
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
   999
        current network. This rule takes one argument, <var>network service record</var>, and consists of running the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1000
        following steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1001
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1002
      <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1003
        <li>Let <var>new service registration flag</var> be <code>true</code>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1004
        </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1005
        <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
  1006
        the following sub-steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1007
          <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1008
            <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
  1009
            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
  1010
            available <var>existing service record</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1011
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1012
            <li>Set <var>new service registration flag</var> to <code>false</code>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1013
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1014
            <li>Replace the value of <var>existing service record</var> in the current <a>list of available service
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1015
            records</a> with the value of <var>network service record</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1016
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1017
          </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1018
        </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1019
        <li>If <var>new service registration flag</var> is set to <code>true</code> then add <var>network 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
  1020
        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
  1021
        </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
  1022
        <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
  1023
          <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
  1024
            <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1025
            </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
  1026
            <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
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
  1027
              <ol class="rule">
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
  1028
                <li>If <var>network service record</var>'s <code>type</code> property does not equal <var>active
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
  1029
                service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this <var>active
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
  1030
                service</var> and continue at the next available <var>active service</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
  1031
                </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
  1032
                <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
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
  1033
                </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
  1034
                <li>If the <var>new service registration flag</var> is set to <code>false</code>, the <var>network
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
  1035
                service record</var>'s <code>id</code> property equals the <var>active service</var>'s <code>id</code>
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
  1036
                attribute and <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</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
  1037
                attribute is currently set to <code>false</code> then set <var>active service</var>'s <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
  1038
                "#dom-networkservice-online"><code>online</code></a> attribute to <code>true</code> and then <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
  1039
                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
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
  1040
                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <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
  1041
                      "#event-serviceonline"><code>serviceonline</code></a> that uses 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
  1042
                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
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
  1043
                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
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
  1044
                      and has no default action, at the current <var>active service</var> object.
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
  1045
                </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
  1046
              </ol>
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
  1047
            </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
  1048
            <li>If the <var>new service registration flag</var> is set to <code>true</code> and the <var>service type
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
  1049
            in current service manager flag</var> is also set to <code>true</code> then increment <var>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
  1050
            manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</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
  1051
            attribute by <code>1</code> and then <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
  1052
            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1053
                  class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1054
                  "#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1055
                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1056
                  class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
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
  1057
                  has no default action, at the current <var>service manager</var> object.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1058
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1059
          </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1060
        </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1061
      </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1062
      <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1063
        The rule for <dfn>removing an available service</dfn> is the general process of removing a service from the
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1064
        <a>list of available service records</a> that has left the user's current network or has otherwise expired.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1065
        This rule takes one argument, <var>service identifier</var>, and consists of running the following steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1066
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1067
      <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1068
        <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
  1069
        the following sub-steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1070
          <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1071
            <li>If the <var>existing service record</var>'s <code>id</code> property does not match <var>service
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1072
            identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1073
            continue at the next available <var>existing service record</var>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1074
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1075
            <li>If the <var>existing service record</var>'s <code>type</code> property begins with the DOMString
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1076
            "<code>upnp:</code>" and <var>existing service record</var>'s <code>eventsURL</code> property is set then
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1077
            run the rule to <a>terminate an existing UPnP Events Subscription</a>, if one is currently active (as a
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1078
            result of having previously called <a>setup a UPnP Events Subscription</a> against the current
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1079
            <var>existing service record</var>).
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1080
            </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
  1081
            <li>For each <var>service manager</var> in the <a>list of active service managers</a> run the following
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1082
            steps:
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1083
              <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
  1084
                <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1085
                </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
  1086
                <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
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
  1087
                  <ol class="rule">
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
  1088
                    <li>If <var>existing service record</var>'s <code>type</code> property does not equal 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
  1089
                    <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
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
                    <var>active service</var> and continue at the next available <var>active service</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
  1091
                    </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
  1092
                    <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
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
  1093
                    </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
  1094
                    <li>If <var>existing service record</var>'s <code>id</code> property equals the <var>active
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
                    service</var>'s <code>id</code> attribute and <var>active service</var>'s <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
  1096
                    "#dom-networkservice-online"><code>online</code></a> attribute is currently set to
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
  1097
                    <code>true</code> then set <var>active service</var>'s <a href="#dom-networkservice-online"><code>
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
                      online</code></a> attribute to <code>false</code> and then <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
  1099
                      "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
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
                          class="externalDFN">queue a task</a> to dispatch a newly created event with the name <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
  1101
                          "#event-serviceoffline"><code>serviceoffline</code></a> that uses 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
  1102
                          "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
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
  1103
                          class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not
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
  1104
                          cancellable, and has no default action, at the current <var>active service</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
  1105
                    </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
  1106
                  </ol>
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
  1107
                </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
  1108
                <li>If the <var>service type in current service manager flag</var> is set to <code>true</code> then
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
  1109
                decrement <var>service manager</var>'s <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
  1110
                "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute by <code>1</code>
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
  1111
                and then <a href=
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1112
                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1113
                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1114
                      "#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the <a href=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1115
                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1116
                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
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
  1117
                      and has no default action, at the current <var>service manager</var> object.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1118
                </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1119
              </ol>
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
            <li>Remove <var>existing service record</var> from the current <a>list of available service records</a>.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1122
            </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1123
          </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1124
        </li>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1125
      </ol>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1126
      <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
  1127
        User agents SHOULD expire a service record from the <a>list of available service records</a> when its
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
  1128
        <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this condition is met 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
  1129
        <a>user agent</a> SHOULD run the rule for <a>removing an available service</a>, passing in the expired 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
  1130
        record's <code>id</code> attribute as the only argument.
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1131
      </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1132
      <section>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1133
        <h4>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1134
          Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1135
          "Service Discovery">SD</abbr>)
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1136
        </h4>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1137
        <p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1138
          For each DNS response received from a user-agent-initiated Multicast DNS Browse for <abbr title=
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1139
          "DNS Pointer Record">PTR</abbr> records with the name <code>_services._dns-sd._udp</code> on the resolved
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
  1140
          recommended automatic browsing domain [[!MDNS]], the <a>user agent</a> MUST run the following steps:
239
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1141
        </p>
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1142
        <ol class="rule">
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1143
          <li>Let <var>service mDNS responses</var> be an array of PTR records received by issuing a Multicast DNS
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup
Rich Tibbett <richt@opera.com>
parents: 238
diff changeset
  1144
          Browse for PTR records with the name of the current discovered service type.
7e34654692fc HTML5 Tidy on Network Service Discovery spec markup