HTML5 Tidy on Network Service Discovery spec markup
authorRich Tibbett <richt@opera.com>
Tue, 02 Oct 2012 16:32:06 +0200
changeset 2397e34654692fc
parent 238 65e14f8dc95d
child 240 4bb39c70f008
HTML5 Tidy on Network Service Discovery spec markup
discovery-api/Overview.html
discovery-api/Overview.src.html
     1.1 --- a/discovery-api/Overview.html	Tue Oct 02 14:51:33 2012 +0200
     1.2 +++ b/discovery-api/Overview.html	Tue Oct 02 16:32:06 2012 +0200
     1.3 @@ -1,13 +1,14 @@
     1.4  <!DOCTYPE html>
     1.5 -<html lang="en" dir="ltr">
     1.6 -<head>
     1.7 -    <title>Networked Service Discovery and Messaging</title>
     1.8 -    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
     1.9 -
    1.10 -
    1.11 -
    1.12 +<html lang="en"
    1.13 +      dir="ltr">
    1.14 +  <head>
    1.15 +    <title>
    1.16 +      Network Service Discovery
    1.17 +    </title>
    1.18 +    <meta http-equiv="Content-Type"
    1.19 +          content="text/html; charset=utf-8">
    1.20      <style type="text/css">
    1.21 -      /* Custom CSS optimizations (Richard Tibbett) */
    1.22 +/* Custom ReSpec CSS (by Rich Tibbett) */
    1.23  
    1.24        /* Add better spacing to sections */
    1.25        section, .section { margin-bottom: 2em; }
    1.26 @@ -38,463 +39,683 @@
    1.27        table tbody th:first-child { border-left:solid }
    1.28        table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
    1.29      </style>
    1.30 -  <style>/*****************************************************************
    1.31 - * ReSpec 3 CSS
    1.32 - * Robin Berjon - http://berjon.com/
    1.33 - *****************************************************************/
    1.34 +    <style type="text/css">
    1.35 +/*****************************************************************
    1.36 +    * ReSpec 3 CSS
    1.37 +    * Robin Berjon - http://berjon.com/
    1.38 +    *****************************************************************/
    1.39  
    1.40 -/* --- INLINES --- */
    1.41 -em.rfc2119 {
    1.42 +    /* --- INLINES --- */
    1.43 +    em.rfc2119 {
    1.44      text-transform:     lowercase;
    1.45      font-variant:       small-caps;
    1.46      font-style:         normal;
    1.47      color:              #900;
    1.48 -}
    1.49 +    }
    1.50  
    1.51 -h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
    1.52 -h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
    1.53 +    h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
    1.54 +    h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
    1.55      border: none;
    1.56 -}
    1.57 +    }
    1.58  
    1.59 -dfn {
    1.60 +    dfn {
    1.61      font-weight:    bold;
    1.62 -}
    1.63 +    }
    1.64  
    1.65 -a.internalDFN {
    1.66 +    a.internalDFN {
    1.67      color:  inherit;
    1.68      border-bottom:  1px solid #99c;
    1.69      text-decoration:    none;
    1.70 -}
    1.71 +    }
    1.72  
    1.73 -a.externalDFN {
    1.74 +    a.externalDFN {
    1.75      color:  inherit;
    1.76      border-bottom:  1px dotted #ccc;
    1.77      text-decoration:    none;
    1.78 -}
    1.79 +    }
    1.80  
    1.81 -a.bibref {
    1.82 +    a.bibref {
    1.83      text-decoration:    none;
    1.84 -}
    1.85 +    }
    1.86  
    1.87 -cite .bibref {
    1.88 +    cite .bibref {
    1.89      font-style: normal;
    1.90 -}
    1.91 +    }
    1.92  
    1.93 -code {
    1.94 +    code {
    1.95      color:  #ff4500;
    1.96 -}
    1.97 +    }
    1.98  
    1.99  
   1.100 -/* --- --- */
   1.101 -ol.algorithm { counter-reset:numsection; list-style-type: none; }
   1.102 -ol.algorithm li { margin: 0.5em 0; }
   1.103 -ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
   1.104 +    /* --- --- */
   1.105 +    ol.algorithm { counter-reset:numsection; list-style-type: none; }
   1.106 +    ol.algorithm li { margin: 0.5em 0; }
   1.107 +    ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
   1.108  
   1.109 -/* --- TOC --- */
   1.110 -.toc a, .tof a {
   1.111 +    /* --- TOC --- */
   1.112 +    .toc a, .tof a {
   1.113      text-decoration:    none;
   1.114 -}
   1.115 +    }
   1.116  
   1.117 -a .secno, a .figno {
   1.118 +    a .secno, a .figno {
   1.119      color:  #000;
   1.120 -}
   1.121 +    }
   1.122  
   1.123 -ul.tof, ol.tof {
   1.124 +    ul.tof, ol.tof {
   1.125      list-style: none outside none;
   1.126 -}
   1.127 +    }
   1.128  
   1.129 -.caption {
   1.130 +    .caption {
   1.131      margin-top: 0.5em;
   1.132      font-style:   italic;
   1.133 -}
   1.134 +    }
   1.135  
   1.136 -/* --- TABLE --- */
   1.137 -table.simple {
   1.138 +    /* --- TABLE --- */
   1.139 +    table.simple {
   1.140      border-spacing: 0;
   1.141      border-collapse:    collapse;
   1.142      border-bottom:  3px solid #005a9c;
   1.143 -}
   1.144 +    }
   1.145  
   1.146 -.simple th {
   1.147 +    .simple th {
   1.148      background: #005a9c;
   1.149      color:  #fff;
   1.150      padding:    3px 5px;
   1.151      text-align: left;
   1.152 -}
   1.153 +    }
   1.154  
   1.155 -.simple th[scope="row"] {
   1.156 +    .simple th[scope="row"] {
   1.157      background: inherit;
   1.158      color:  inherit;
   1.159      border-top: 1px solid #ddd;
   1.160 -}
   1.161 +    }
   1.162  
   1.163 -.simple td {
   1.164 +    .simple td {
   1.165      padding:    3px 10px;
   1.166      border-top: 1px solid #ddd;
   1.167 -}
   1.168 +    }
   1.169  
   1.170 -.simple tr:nth-child(even) {
   1.171 +    .simple tr:nth-child(even) {
   1.172      background: #f0f6ff;
   1.173 -}
   1.174 +    }
   1.175  
   1.176 -/* --- DL --- */
   1.177 -.section dd > p:first-child {
   1.178 +    /* --- DL --- */
   1.179 +    .section dd > p:first-child {
   1.180      margin-top: 0;
   1.181 -}
   1.182 +    }
   1.183  
   1.184 -.section dd > p:last-child {
   1.185 +    .section dd > p:last-child {
   1.186      margin-bottom: 0;
   1.187 -}
   1.188 +    }
   1.189  
   1.190 -.section dd {
   1.191 +    .section dd {
   1.192      margin-bottom:  1em;
   1.193 -}
   1.194 +    }
   1.195  
   1.196 -.section dl.attrs dd, .section dl.eldef dd {
   1.197 +    .section dl.attrs dd, .section dl.eldef dd {
   1.198      margin-bottom:  0;
   1.199 -}
   1.200 -</style><style>/* --- ISSUES/NOTES --- */
   1.201 -div.issue-title, div.note-title {
   1.202 +    }
   1.203 +    </style>
   1.204 +    <style type="text/css">
   1.205 +/* --- ISSUES/NOTES --- */
   1.206 +    div.issue-title, div.note-title {
   1.207      padding-right:  1em;
   1.208      min-width: 7.5em;
   1.209      color: #b9ab2d;
   1.210 -}
   1.211 -div.issue-title { color: #e05252; }
   1.212 -div.note-title { color: #52e052; }
   1.213 -div.issue-title span, div.note-title span {
   1.214 +    }
   1.215 +    div.issue-title { color: #e05252; }
   1.216 +    div.note-title { color: #52e052; }
   1.217 +    div.issue-title span, div.note-title span {
   1.218      text-transform: uppercase;
   1.219 -}
   1.220 -div.note, div.issue {
   1.221 +    }
   1.222 +    div.note, div.issue {
   1.223      margin-top: 1em;
   1.224      margin-bottom: 1em;
   1.225 -}
   1.226 -.note > p:first-child, .issue > p:first-child { margin-top: 0 }
   1.227 -.issue, .note {
   1.228 +    }
   1.229 +    .note > p:first-child, .issue > p:first-child { margin-top: 0 }
   1.230 +    .issue, .note {
   1.231      padding: .5em;
   1.232      border-left-width: .5em;
   1.233      border-left-style: solid;
   1.234 -}
   1.235 -div.issue, div.note {
   1.236 +    }
   1.237 +    div.issue, div.note {
   1.238      padding: 0.5em;
   1.239      margin: 1em 0;
   1.240      position: relative;
   1.241      clear: both;
   1.242 -}
   1.243 -span.note, span.issue { padding: .1em .5em .15em; }
   1.244 +    }
   1.245 +    span.note, span.issue { padding: .1em .5em .15em; }
   1.246  
   1.247 -.issue {
   1.248 +    .issue {
   1.249      border-color: #e05252;
   1.250      background: #fbe9e9;
   1.251 -}
   1.252 -.note {
   1.253 +    }
   1.254 +    .note {
   1.255      border-color: #52e052;
   1.256      background: #e9fbe9;
   1.257 -}
   1.258 +    }
   1.259  
   1.260  
   1.261 -</style><style>/* HIGHLIGHTS */
   1.262 -code.prettyprint {
   1.263 +    </style>
   1.264 +    <style type="text/css">
   1.265 +/* HIGHLIGHTS */
   1.266 +    code.prettyprint {
   1.267      color:  inherit;
   1.268 -}
   1.269 +    }
   1.270  
   1.271 -/* this from google-code-prettify */
   1.272 -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
   1.273 -</style><link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='undefined://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
   1.274 -
   1.275 -  <body><div class="head">
   1.276 -  <p>
   1.277 -
   1.278 -      <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
   1.279 -
   1.280 -  </p>
   1.281 -  <h1 class="title" id="title">Networked Service Discovery and Messaging</h1>
   1.282 -
   1.283 -  <h2 id="w3c-editor-s-draft-02-october-2012"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 02 October 2012</h2>
   1.284 -  <dl>
   1.285 -
   1.286 -      <dt>This version:</dt>
   1.287 -      <dd><a href="http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html">http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html</a></dd>
   1.288 -      <dt>Latest published version:</dt>
   1.289 -      <dd><a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a></dd>
   1.290 -
   1.291 -
   1.292 -      <dt>Latest editor's draft:</dt>
   1.293 -      <dd><a href="http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html">http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html</a></dd>
   1.294 -
   1.295 -
   1.296 -
   1.297 -
   1.298 -
   1.299 -
   1.300 -
   1.301 -
   1.302 -    <dt>Editors:</dt>
   1.303 -    <dd><span>Rich Tibbett</span>, <a href="http://opera.com/">Opera Software ASA</a></dd>
   1.304 -<dd><span>Clarke Stevens</span>, <a href="http://cablelabs.com/">CableLabs</a></dd>
   1.305 -
   1.306 -
   1.307 -  </dl>
   1.308 -
   1.309 -
   1.310 -
   1.311 -
   1.312 -
   1.313 +    /* this from google-code-prettify */
   1.314 +    .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
   1.315 +    </style>
   1.316 +    <link rel="stylesheet"
   1.317 +          href="http://www.w3.org/StyleSheets/TR/W3C-ED"
   1.318 +          type="text/css">
   1.319 +  </head>
   1.320 +  <body>
   1.321 +    <div class="head">
   1.322 +      <p>
   1.323 +        <a href="http://www.w3.org/"><img width="72"
   1.324 +             height="48"
   1.325 +             src="http://www.w3.org/Icons/w3c_home"
   1.326 +             alt="W3C"></a>
   1.327 +      </p>
   1.328 +      <h1 class="title"
   1.329 +          id="title">
   1.330 +        Network Service Discovery
   1.331 +      </h1>
   1.332 +      <h2 id="w3c-editor-s-draft-02-october-2012">
   1.333 +        <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 02 October 2012
   1.334 +      </h2>
   1.335 +      <dl>
   1.336 +        <dt>
   1.337 +          This version:
   1.338 +        </dt>
   1.339 +        <dd>
   1.340 +          <a href=
   1.341 +          "http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html">http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html</a>
   1.342 +        </dd>
   1.343 +        <dt>
   1.344 +          Latest published version:
   1.345 +        </dt>
   1.346 +        <dd>
   1.347 +          <a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a>
   1.348 +        </dd>
   1.349 +        <dt>
   1.350 +          Latest editor's draft:
   1.351 +        </dt>
   1.352 +        <dd>
   1.353 +          <a href=
   1.354 +          "http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html">http://dvcs.w3.org/hg/dap/raw-file/tip/discovery-api/Overview.html</a>
   1.355 +        </dd>
   1.356 +        <dt>
   1.357 +          Editors:
   1.358 +        </dt>
   1.359 +        <dd>
   1.360 +          <span>Rich Tibbett</span>, <a href="http://opera.com/">Opera Software ASA</a>
   1.361 +        </dd>
   1.362 +        <dd>
   1.363 +          <span>Clarke Stevens</span>, <a href="http://cablelabs.com/">CableLabs</a>
   1.364 +        </dd>
   1.365 +      </dl>
   1.366        <p class="copyright">
   1.367 -        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
   1.368 -        2012
   1.369 -
   1.370 -        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
   1.371 -        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
   1.372 -        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
   1.373 -        <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
   1.374 -        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
   1.375 -        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
   1.376 -        <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
   1.377 +        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2012 <a href=
   1.378 +        "http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=
   1.379 +        "http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=
   1.380 +        "http://www.ercim.eu/"><abbr title=
   1.381 +        "European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=
   1.382 +        "http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. <abbr title="World Wide Web Consortium">W3C</abbr>
   1.383 +        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href=
   1.384 +        "http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href=
   1.385 +        "http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
   1.386        </p>
   1.387 -
   1.388 -
   1.389 -  <hr>
   1.390 -</div>
   1.391 -    <section id="abstract" class="introductory"><h2>Abstract</h2>
   1.392 +      <hr>
   1.393 +    </div>
   1.394 +    <section id="abstract"
   1.395 +             class="introductory">
   1.396 +      <h2>
   1.397 +        Abstract
   1.398 +      </h2>
   1.399        <p>
   1.400 -        This specification defines a mechanism for an HTML document to discover and subsequently communicate with <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services
   1.401 -        advertised via common discovery protocols within a user's network.
   1.402 +        This specification defines a mechanism for an HTML document to discover and subsequently communicate with
   1.403 +        <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services advertised via common discovery protocols
   1.404 +        within the current network.
   1.405        </p>
   1.406 -    </section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
   1.407 -
   1.408 -
   1.409 -
   1.410 -        <p>
   1.411 -          <em>This section describes the status of this document at the time of its publication. Other
   1.412 -          documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
   1.413 -          of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
   1.414 -          index</a> at http://www.w3.org/TR/.</em>
   1.415 -        </p>
   1.416 -
   1.417 +    </section>
   1.418 +    <section id="sotd"
   1.419 +             class="introductory">
   1.420 +      <h2>
   1.421 +        Status of This Document
   1.422 +      </h2>
   1.423 +      <p>
   1.424 +        <em>This section describes the status of this document at the time of its publication. Other documents may
   1.425 +        supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and
   1.426 +        the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title=
   1.427 +        "World Wide Web Consortium">W3C</abbr> technical reports index</a> at http://www.w3.org/TR/.</em>
   1.428 +      </p>
   1.429        <p>
   1.430          This document represents the early consensus of the group on the scope and features of the proposed
   1.431          <abbr title="Application Programming Interface">API</abbr>.
   1.432        </p>
   1.433 -
   1.434 +      <p>
   1.435 +        This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs and Policy Working
   1.436 +        Group</a> as an Editor's Draft. If you wish to make comments regarding this document, please send them to
   1.437 +        <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a> (<a href=
   1.438 +        "mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>, <a href=
   1.439 +        "http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>). All feedback is welcome.
   1.440 +      </p>
   1.441 +      <p>
   1.442 +        Publication as an Editor's Draft does not imply endorsement by the <abbr title=
   1.443 +        "World Wide Web Consortium">W3C</abbr> Membership. This is a draft document and may be updated, replaced or
   1.444 +        obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in
   1.445 +        progress.
   1.446 +      </p>
   1.447 +      <p>
   1.448 +        This document was produced by a group operating under the <a href=
   1.449 +        "http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title=
   1.450 +        "World Wide Web Consortium">W3C</abbr> Patent Policy</a>. <abbr title="World Wide Web Consortium">W3C</abbr>
   1.451 +        maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status"
   1.452 +           rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the
   1.453 +           group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge
   1.454 +           of a patent which the individual believes contains <a href=
   1.455 +           "http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose
   1.456 +           the information in accordance with <a href=
   1.457 +           "http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the <abbr title=
   1.458 +           "World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
   1.459 +      </p>
   1.460 +    </section>
   1.461 +    <section id="toc">
   1.462 +      <h2 class="introductory">
   1.463 +        Table of Contents
   1.464 +      </h2>
   1.465 +      <ul class="toc">
   1.466 +        <li class="tocline">
   1.467 +          <a href="#introduction"
   1.468 +              class="tocxref"><span class="secno">1.</span> Introduction</a>
   1.469 +        </li>
   1.470 +        <li class="tocline">
   1.471 +          <a href="#conformance"
   1.472 +              class="tocxref"><span class="secno">2.</span> Conformance</a>
   1.473 +          <ul class="toc">
   1.474 +            <li class="tocline">
   1.475 +              <a href="#dependencies"
   1.476 +                  class="tocxref"><span class="secno">2.1</span> Dependencies</a>
   1.477 +            </li>
   1.478 +          </ul>
   1.479 +        </li>
   1.480 +        <li class="tocline">
   1.481 +          <a href="#terminology"
   1.482 +              class="tocxref"><span class="secno">3.</span> Terminology</a>
   1.483 +        </li>
   1.484 +        <li class="tocline">
   1.485 +          <a href="#requesting-networked-services"
   1.486 +              class="tocxref"><span class="secno">4.</span> Requesting networked services</a>
   1.487 +          <ul class="toc">
   1.488 +            <li class="tocline">
   1.489 +              <a href="#methods"
   1.490 +                  class="tocxref"><span class="secno">4.1</span> Methods</a>
   1.491 +            </li>
   1.492 +            <li class="tocline">
   1.493 +              <a href="#error-handling"
   1.494 +                  class="tocxref"><span class="secno">4.2</span> Error Handling</a>
   1.495 +            </li>
   1.496 +          </ul>
   1.497 +        </li>
   1.498 +        <li class="tocline">
   1.499 +          <a href="#obtaining-networked-services"
   1.500 +              class="tocxref"><span class="secno">5.</span> Obtaining networked services</a>
   1.501 +          <ul class="toc">
   1.502 +            <li class="tocline">
   1.503 +              <a href="#attributes"
   1.504 +                  class="tocxref"><span class="secno">5.1</span> Attributes</a>
   1.505 +            </li>
   1.506 +            <li class="tocline">
   1.507 +              <a href="#methods-1"
   1.508 +                  class="tocxref"><span class="secno">5.2</span> Methods</a>
   1.509 +            </li>
   1.510 +            <li class="tocline">
   1.511 +              <a href="#events"
   1.512 +                  class="tocxref"><span class="secno">5.3</span> Events</a>
   1.513 +            </li>
   1.514 +          </ul>
   1.515 +        </li>
   1.516 +        <li class="tocline">
   1.517 +          <a href="#communicating-with-a-networked-service"
   1.518 +              class="tocxref"><span class="secno">6.</span> Communicating with a networked service</a>
   1.519 +          <ul class="toc">
   1.520 +            <li class="tocline">
   1.521 +              <a href="#attributes-1"
   1.522 +                  class="tocxref"><span class="secno">6.1</span> Attributes</a>
   1.523 +            </li>
   1.524 +            <li class="tocline">
   1.525 +              <a href="#states"
   1.526 +                  class="tocxref"><span class="secno">6.2</span> States</a>
   1.527 +            </li>
   1.528 +            <li class="tocline">
   1.529 +              <a href="#events-1"
   1.530 +                  class="tocxref"><span class="secno">6.3</span> Events</a>
   1.531 +            </li>
   1.532 +          </ul>
   1.533 +        </li>
   1.534 +        <li class="tocline">
   1.535 +          <a href="#service-discovery"
   1.536 +              class="tocxref"><span class="secno">7.</span> Service Discovery</a>
   1.537 +          <ul class="toc">
   1.538 +            <li class="tocline">
   1.539 +              <a href="#zeroconf-mdns-dns-sd"
   1.540 +                  class="tocxref"><span class="secno">7.1</span> Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> +
   1.541 +                  <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</a>
   1.542 +            </li>
   1.543 +            <li class="tocline">
   1.544 +              <a href="#simple-service-discovery-protocol-ssdp"
   1.545 +                  class="tocxref"><span class="secno">7.2</span> Simple Service Discovery Protocol (<abbr title=
   1.546 +                  "Simple Service Discovery Protocol">SSDP</abbr>)</a>
   1.547 +            </li>
   1.548 +            <li class="tocline">
   1.549 +              <a href="#network-topology-monitoring"
   1.550 +                  class="tocxref"><span class="secno">7.3</span> Network Topology Monitoring</a>
   1.551 +            </li>
   1.552 +          </ul>
   1.553 +        </li>
   1.554 +        <li class="tocline">
   1.555 +          <a href="#events-summary"
   1.556 +              class="tocxref"><span class="secno">8.</span> Events Summary</a>
   1.557 +        </li>
   1.558 +        <li class="tocline">
   1.559 +          <a href="#garbage-collection"
   1.560 +              class="tocxref"><span class="secno">9.</span> Garbage collection</a>
   1.561 +        </li>
   1.562 +        <li class="tocline">
   1.563 +          <a href="#use-cases-and-requirements"
   1.564 +              class="tocxref"><span class="secno">10.</span> Use Cases and Requirements</a>
   1.565 +        </li>
   1.566 +        <li class="tocline">
   1.567 +          <a href="#examples"
   1.568 +              class="tocxref"><span class="secno">A.</span> Examples</a>
   1.569 +        </li>
   1.570 +        <li class="tocline">
   1.571 +          <a href="#acknowledgements"
   1.572 +              class="tocxref"><span class="secno">B.</span> Acknowledgements</a>
   1.573 +        </li>
   1.574 +        <li class="tocline">
   1.575 +          <a href="#references"
   1.576 +              class="tocxref"><span class="secno">C.</span> References</a>
   1.577 +          <ul class="toc">
   1.578 +            <li class="tocline">
   1.579 +              <a href="#normative-references"
   1.580 +                  class="tocxref"><span class="secno">C.1</span> Normative references</a>
   1.581 +            </li>
   1.582 +          </ul>
   1.583 +        </li>
   1.584 +      </ul>
   1.585 +    </section>
   1.586 +    <section class="informative"
   1.587 +             id="introduction">
   1.588 +      <h2>
   1.589 +        <span class="secno">1.</span> Introduction
   1.590 +      </h2>
   1.591 +      <p>
   1.592 +        <em>This section is non-normative.</em>
   1.593 +      </p>
   1.594 +      <p>
   1.595 +        To enable Web pages to connect and communicate with Local-networked Services provided over <abbr title=
   1.596 +        "Hypertext Transfer Protocol">HTTP</abbr>, this specification introduces the <a href=
   1.597 +        "#navigatornetworkservice"><code>NavigatorNetworkService</code></a> interface.
   1.598 +      </p>
   1.599 +      <p>
   1.600 +        Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known
   1.601 +        service type, known by developers and advertised by Local-networked Devices. User authorization, where the user
   1.602 +        connects the web page to one or more discovered services, is expected before the web page is able to interact
   1.603 +        with any Local-networked Services.
   1.604 +      </p>
   1.605 +      <p>
   1.606 +        A web page creates a request to obtain connectivity to services running in the network by specifying a
   1.607 +        well-known discovery service type that it wishes to interact with.
   1.608 +      </p>
   1.609 +      <p>
   1.610 +        The user agent, having captured all advertised services on the network from the Service Discovery mechanisms
   1.611 +        included in this recommendation, attempts to match the requested service type to a discovered service according
   1.612 +        to the processing described herein.
   1.613 +      </p>
   1.614 +      <p>
   1.615 +        If a service connectivity request is successful then the Web page is provided with the necessary information to
   1.616 +        communicate with the authorized Local-networked Service. If the request fails then the Web page will receive an
   1.617 +        error callback containing an error code describing the cause of Local-networked Service connectivity failure.
   1.618 +      </p>
   1.619 +      <p>
   1.620 +        Once connected to a Local-networked Service the Web page can send requests and receive responses to the
   1.621 +        Local-networked Service via the messaging format and appropriate channel inferred from the service type
   1.622 +        authorized via the provided <abbr title="Application Programming Interface">API</abbr>. The Web page, once
   1.623 +        connected, can also receive service-pushed events, in the messaging format supported by the Local-networked
   1.624 +        Device, if such event subscription functionality is provided by the connected Local-networked Service.
   1.625 +      </p>
   1.626 +      <div class="example">
   1.627          <p>
   1.628 -          This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs and Policy Working Group</a> as an Editor's Draft.
   1.629 -
   1.630 -          If you wish to make comments regarding this document, please send them to
   1.631 -          <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a>
   1.632 -          (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>,
   1.633 -          <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).
   1.634 -
   1.635 -
   1.636 -          All feedback is welcome.
   1.637 +          Example of requesting a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>
   1.638 +          advertised service:
   1.639          </p>
   1.640 -
   1.641 -          <p>
   1.642 -            Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
   1.643 -            This is a draft document and may be updated, replaced or obsoleted by other documents at
   1.644 -            any time. It is inappropriate to cite this document as other than work in progress.
   1.645 -          </p>
   1.646 -
   1.647 -
   1.648 -        <p>
   1.649 -
   1.650 -            This document was produced by a group operating under the
   1.651 -            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
   1.652 -
   1.653 -
   1.654 -
   1.655 -
   1.656 -              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent disclosures</a>
   1.657 -
   1.658 -            made in connection with the deliverables of the group; that page also includes instructions for
   1.659 -            disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
   1.660 -            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
   1.661 -            information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   1.662 -            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
   1.663 -
   1.664 -
   1.665 -        </p>
   1.666 -
   1.667 -
   1.668 -
   1.669 -
   1.670 -</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a><ul class="toc"><li class="tocline"><a href="#dependencies" class="tocxref"><span class="secno">2.1 </span>Dependencies</a></li></ul></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>Terminology</a></li><li class="tocline"><a href="#requesting-networked-services" class="tocxref"><span class="secno">4. </span>Requesting networked services</a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1 </span>Methods</a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno">4.2 </span>Error Handling</a></li></ul></li><li class="tocline"><a href="#obtaining-networked-services" class="tocxref"><span class="secno">5. </span>Obtaining networked services</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">5.2 </span>Methods</a></li><li class="tocline"><a href="#events" class="tocxref"><span class="secno">5.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#communicating-with-a-networked-service" class="tocxref"><span class="secno">6. </span>Communicating with a networked service</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">6.1 </span>Attributes</a></li><li class="tocline"><a href="#states" class="tocxref"><span class="secno">6.2 </span>States</a></li><li class="tocline"><a href="#events-1" class="tocxref"><span class="secno">6.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#service-discovery" class="tocxref"><span class="secno">7. </span>Service Discovery</a><ul class="toc"><li class="tocline"><a href="#zeroconf-mdns-dns-sd" class="tocxref"><span class="secno">7.1 </span>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</a></li><li class="tocline"><a href="#simple-service-discovery-protocol-ssdp" class="tocxref"><span class="secno">7.2 </span>Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)</a></li><li class="tocline"><a href="#network-topology-monitoring" class="tocxref"><span class="secno">7.3 </span>Network Topology Monitoring</a></li></ul></li><li class="tocline"><a href="#events-summary" class="tocxref"><span class="secno">8. </span>Events Summary</a></li><li class="tocline"><a href="#garbage-collection" class="tocxref"><span class="secno">9. </span>Garbage collection</a></li><li class="tocline"><a href="#use-cases-and-requirements" class="tocxref"><span class="secno">10. </span>Use Cases and Requirements</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">A. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">B. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">C. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">C.1 </span>Normative references</a></li></ul></li></ul></section>
   1.671 -
   1.672 -
   1.673 -
   1.674 -    <section class="informative" id="introduction">
   1.675 -      <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
   1.676 -
   1.677 -      <p>To enable Web pages to connect and communicate with Local-networked Services provided over <abbr title="Hypertext Transfer Protocol">HTTP</abbr>, this specification introduces the
   1.678 -      <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a> interface.</p>
   1.679 -
   1.680 -      <p>
   1.681 -         Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known service type, known by developers and advertised by Local-networked Devices. User authorization, where the user connects the web page to one or more discovered services,
   1.682 -         is expected before the web page is able to interact with any Local-networked Services.
   1.683 -      </p>
   1.684 -
   1.685 -      <p>
   1.686 -         A web page creates a request to obtain connectivity to services running in the network by specifying a well-known discovery service type that it wishes to interact with.
   1.687 -      </p>
   1.688 -
   1.689 -      <p>
   1.690 -         The user agent, having captured all advertised services on the network from the Service Discovery mechanisms included in this recommendation, attempts to match
   1.691 -      the requested service type to a discovered service according to the processing described herein.
   1.692 -      </p>
   1.693 -
   1.694 -      <p>
   1.695 -          If a service connectivity request is successful then the Web page is provided with the necessary information to communicate with the authorized Local-networked Service.
   1.696 -          If the request fails then the Web page will receive an error callback containing an error code describing the cause of Local-networked Service connectivity failure.
   1.697 -      </p>
   1.698 -
   1.699 -      <p>
   1.700 -         Once connected to a Local-networked Service the Web page can send requests and receive responses to the Local-networked Service via the messaging format and appropriate channel inferred from the service type
   1.701 -         authorized via the provided <abbr title="Application Programming Interface">API</abbr>.
   1.702 -         The Web page, once connected, can also receive service-pushed events, in the messaging format supported by the Local-networked Device, if such event subscription functionality is provided by the
   1.703 -         connected Local-networked Service.
   1.704 -      </p>
   1.705 -
   1.706 -      <div class="example">
   1.707 -       <p>Example of requesting a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> advertised service:</p>
   1.708 -       <hr>
   1.709 -       <pre class="highlight prettyprint"><span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.710 +        <hr>
   1.711 +        <pre class="highlight prettyprint">
   1.712 +<span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class=
   1.713 +"pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.714    </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
   1.715 -  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
   1.716 +  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
   1.717 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
   1.718 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class=
   1.719 +"pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
   1.720 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
   1.721 +"pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class=
   1.722 +"pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class=
   1.723 +"pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
   1.724  </span><span class="pun">}</span><span class="pln">
   1.725  
   1.726 -navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">(</span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln"> showServices</span><span class="pun">);</span></pre>
   1.727 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
   1.728 +"pun">(</span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class=
   1.729 +"pln"> showServices</span><span class="pun">);</span>
   1.730 +</pre>
   1.731        </div>
   1.732 -
   1.733        <div class="example">
   1.734 -        <p>Example of requesting a UPnP advertised service, also handling error conditions:</p>
   1.735 +        <p>
   1.736 +          Example of requesting a UPnP advertised service, also handling error conditions:
   1.737 +        </p>
   1.738          <hr>
   1.739 -        <pre class="highlight prettyprint"><span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.740 +        <pre class="highlight prettyprint">
   1.741 +<span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class=
   1.742 +"pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.743    </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
   1.744 -  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
   1.745 +  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
   1.746 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
   1.747 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class=
   1.748 +"pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
   1.749 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
   1.750 +"pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class=
   1.751 +"pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class=
   1.752 +"pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
   1.753  </span><span class="pun">}</span><span class="pln">
   1.754  
   1.755 -</span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class="pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.756 -  console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> </span><span class="str">"Error occurred: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> e</span><span class="pun">.</span><span class="pln">code </span><span class="pun">);</span><span class="pln">
   1.757 +</span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class=
   1.758 +"pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.759 +  console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class=
   1.760 +"pln"> </span><span class="str">"Error occurred: "</span><span class="pln"> </span><span class=
   1.761 +"pun">+</span><span class="pln"> e</span><span class="pun">.</span><span class="pln">code </span><span class=
   1.762 +"pun">);</span><span class="pln">
   1.763  </span><span class="pun">}</span><span class="pln">
   1.764  
   1.765 -navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">(</span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class="pun">,</span><span class="pln"> showServices</span><span class="pun">,</span><span class="pln"> error</span><span class="pun">);</span></pre>
   1.766 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
   1.767 +"pun">(</span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class=
   1.768 +"pun">,</span><span class="pln"> showServices</span><span class="pun">,</span><span class=
   1.769 +"pln"> error</span><span class="pun">);</span>
   1.770 +</pre>
   1.771        </div>
   1.772 -
   1.773        <div class="example">
   1.774 -        <p>Example of requesting either a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> or UPnP advertised service:</p>
   1.775 +        <p>
   1.776 +          Example of requesting either a <abbr title="Domain Name System">DNS</abbr>-<abbr title=
   1.777 +          "Service Discovery">SD</abbr> or UPnP advertised service:
   1.778 +        </p>
   1.779          <hr>
   1.780 -        <pre class="highlight prettyprint"><span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.781 -  </span><span class="com">// Show a list of all the services provided to the web page (+ service type)</span><span class="pln">
   1.782 -  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class="pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln">
   1.783 -     console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">'('</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class="pln">type </span><span class="pun">+</span><span class="pln"> </span><span class="str">')'</span><span class="pln"> </span><span class="pun">);</span><span class="pln">
   1.784 +        <pre class="highlight prettyprint">
   1.785 +<span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class=
   1.786 +"pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.787 +  </span><span class=
   1.788 +"com">// Show a list of all the services provided to the web page (+ service type)</span><span class="pln">
   1.789 +  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
   1.790 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
   1.791 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class=
   1.792 +"pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
   1.793 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
   1.794 +"pun">++)</span><span class="pln">
   1.795 +     console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class=
   1.796 +"pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class=
   1.797 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">'('</span><span class=
   1.798 +"pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class=
   1.799 +"pln">i</span><span class="pun">].</span><span class="pln">type </span><span class="pun">+</span><span class=
   1.800 +"pln"> </span><span class="str">')'</span><span class="pln"> </span><span class="pun">);</span><span class="pln">
   1.801  </span><span class="pun">}</span><span class="pln">
   1.802  
   1.803 -navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">([</span><span class="pln">
   1.804 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
   1.805 +"pun">([</span><span class="pln">
   1.806    </span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln">
   1.807    </span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class="pln">
   1.808 -</span><span class="pun">],</span><span class="pln"> showServices</span><span class="pun">);</span></pre>
   1.809 +</span><span class="pun">],</span><span class="pln"> showServices</span><span class="pun">);</span>
   1.810 +</pre>
   1.811        </div>
   1.812 -
   1.813 -      <p>For more detailed examples see the <a href="#examples">Examples</a> section.
   1.814 -    </p></section>
   1.815 -
   1.816 -    <section id="conformance"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2>
   1.817 -<p>
   1.818 -  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
   1.819 -  and notes in this specification are non-normative. Everything else in this specification is
   1.820 -  normative.
   1.821 -</p>
   1.822 -<p>
   1.823 -  The key words <em class="rfc2119" title="must">must</em>, <em class="rfc2119" title="must not">must not</em>, <em class="rfc2119" title="required">required</em>, <em class="rfc2119" title="should">should</em>, <em class="rfc2119" title="should not">should not</em>, <em class="rfc2119" title="recommended">recommended</em>, <em class="rfc2119" title="may">may</em>,
   1.824 -  and <em class="rfc2119" title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
   1.825 -</p>
   1.826 -
   1.827 -
   1.828 -     <p>Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the
   1.829 -     meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.</p>
   1.830 -
   1.831 -     <p>
   1.832 -      Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements are to be interpreted as requirements on user agents.
   1.833 -     </p>
   1.834 -
   1.835 -     <p>
   1.836 -      Conformance requirements phrased as algorithms or specific steps <em class="ct"><em class="rfc2119" title="may">may</em></em> be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in
   1.837 -      this specification are intended to be easy to follow, and not intended to be performant.)
   1.838 -     </p>
   1.839 -
   1.840 -     <p>
   1.841 -      The only conformance class defined by this specification is a <dfn id="dfn-user-agent">user agent</dfn>.
   1.842 -     </p>
   1.843 -
   1.844 -     <p>
   1.845 -      User agents <em class="ct"><em class="rfc2119" title="may">may</em></em> impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial of service attacks, to guard against running out of memory, or to work
   1.846 -      around platform-specific limitations.
   1.847 -     </p>
   1.848 -
   1.849 -     <p>
   1.850 -      When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid in development, or for performance reasons), user agents <em class="ct"><em class="rfc2119" title="must">must</em></em> act as if
   1.851 -      they had no support for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature is accessed via an attribute in a Web
   1.852 -      IDL interface, the attribute itself would be omitted from the objects that implement that interface - leaving the attribute on the object but making it return null or throw an exception
   1.853 -      is insufficient.
   1.854 -     </p>
   1.855 -
   1.856 +      <p>
   1.857 +        For more detailed examples see the <a href="#examples">Examples</a> section.
   1.858 +      </p>
   1.859 +    </section>
   1.860 +    <section id="conformance">
   1.861 +      <h2>
   1.862 +        <span class="secno">2.</span> Conformance
   1.863 +      </h2>
   1.864 +      <p>
   1.865 +        As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this
   1.866 +        specification are non-normative. Everything else in this specification is normative.
   1.867 +      </p>
   1.868 +      <p>
   1.869 +        The key words <em class="rfc2119"
   1.870 +           title="must">must</em>, <em class="rfc2119"
   1.871 +           title="must not">must not</em>, <em class="rfc2119"
   1.872 +           title="required">required</em>, <em class="rfc2119"
   1.873 +           title="should">should</em>, <em class="rfc2119"
   1.874 +           title="should not">should not</em>, <em class="rfc2119"
   1.875 +           title="recommended">recommended</em>, <em class="rfc2119"
   1.876 +           title="may">may</em>, and <em class="rfc2119"
   1.877 +           title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class=
   1.878 +           "bibref"
   1.879 +           href="#bib-RFC2119">RFC2119</a></cite>].
   1.880 +      </p>
   1.881 +      <p>
   1.882 +        Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or
   1.883 +        "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should",
   1.884 +        "may", etc) used in introducing the algorithm.
   1.885 +      </p>
   1.886 +      <p>
   1.887 +        Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements
   1.888 +        are to be interpreted as requirements on user agents.
   1.889 +      </p>
   1.890 +      <p>
   1.891 +        Conformance requirements phrased as algorithms or specific steps <em class="ct"><em class="rfc2119"
   1.892 +            title="may">may</em></em> be implemented in any manner, so long as the end result is equivalent. (In
   1.893 +            particular, the algorithms defined in this specification are intended to be easy to follow, and not
   1.894 +            intended to be performant.)
   1.895 +      </p>
   1.896 +      <p>
   1.897 +        The only conformance class defined by this specification is a <dfn id="dfn-user-agent">user agent</dfn>.
   1.898 +      </p>
   1.899 +      <p>
   1.900 +        User agents <em class="ct"><em class="rfc2119"
   1.901 +            title="may">may</em></em> impose implementation-specific limits on otherwise unconstrained inputs, e.g. to
   1.902 +            prevent denial of service attacks, to guard against running out of memory, or to work around
   1.903 +            platform-specific limitations.
   1.904 +      </p>
   1.905 +      <p>
   1.906 +        When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid
   1.907 +        in development, or for performance reasons), user agents <em class="ct"><em class="rfc2119"
   1.908 +            title="must">must</em></em> act as if they had no support for the feature whatsoever, and as if the feature
   1.909 +            was not mentioned in this specification. For example, if a particular feature is accessed via an attribute
   1.910 +            in a Web IDL interface, the attribute itself would be omitted from the objects that implement that
   1.911 +            interface - leaving the attribute on the object but making it return null or throw an exception is
   1.912 +            insufficient.
   1.913 +      </p>
   1.914        <section id="dependencies">
   1.915 -         <h3><span class="secno">2.1 </span>Dependencies</h3>
   1.916 -
   1.917 -         This specification relies on several other underlying specifications.
   1.918 -
   1.919 -         <dl>
   1.920 -            <dt>HTML</dt>
   1.921 -            <dd>Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>]</dd>
   1.922 -            <dt>WebIDL</dt>
   1.923 -            <dd>The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]</dd>
   1.924 -         </dl>
   1.925 +        <h3>
   1.926 +          <span class="secno">2.1</span> Dependencies
   1.927 +        </h3>This specification relies on several other underlying specifications.
   1.928 +        <dl>
   1.929 +          <dt>
   1.930 +            HTML
   1.931 +          </dt>
   1.932 +          <dd>
   1.933 +            Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref"
   1.934 +               href="#bib-HTML5">HTML5</a></cite>]
   1.935 +          </dd>
   1.936 +          <dt>
   1.937 +            WebIDL
   1.938 +          </dt>
   1.939 +          <dd>
   1.940 +            The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class=
   1.941 +            "bibref"
   1.942 +               href="#bib-WEBIDL">WEBIDL</a></cite>]
   1.943 +          </dd>
   1.944 +        </dl>
   1.945        </section>
   1.946      </section>
   1.947 -
   1.948      <section id="terminology">
   1.949 -      <!--OddPage--><h2><span class="secno">3. </span>Terminology</h2>
   1.950 -
   1.951 +      <h2>
   1.952 +        <span class="secno">3.</span> Terminology
   1.953 +      </h2>
   1.954        <p>
   1.955 -         The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes used instead of the more accurate "an object implementing the interface <code>Foo</code>".
   1.956 +        The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes
   1.957 +        used instead of the more accurate "an object implementing the interface <code>Foo</code>".
   1.958        </p>
   1.959 -
   1.960        <p>
   1.961 -         The term DOM is used to refer to the <abbr title="Application Programming Interface">API</abbr> set made available to scripts in Web applications, and does not necessarily imply the existence of an actual <code>Document</code> object or of any
   1.962 -         other <code>Node</code> objects as defined in the DOM Core specifications. [<cite><a class="bibref" href="#bib-DOM4">DOM4</a></cite>]
   1.963 +        The term DOM is used to refer to the <abbr title="Application Programming Interface">API</abbr> set made
   1.964 +        available to scripts in Web applications, and does not necessarily imply the existence of an actual
   1.965 +        <code>Document</code> object or of any other <code>Node</code> objects as defined in the DOM Core
   1.966 +        specifications. [<cite><a class="bibref"
   1.967 +           href="#bib-DOM4">DOM4</a></cite>]
   1.968        </p>
   1.969 -
   1.970        <p>
   1.971 -         An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and is said to be <em>setting</em> when a new value is assigned to it.
   1.972 +        An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and
   1.973 +        is said to be <em>setting</em> when a new value is assigned to it.
   1.974        </p>
   1.975 -
   1.976        <p>
   1.977 -        A <dfn id="dfn-valid-service-type">valid service type</dfn> is a string that begins with <code>upnp:</code> or <code>zeroconf:</code> 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, U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
   1.978 +        A <dfn id="dfn-valid-service-type">valid service type</dfn> is a string that begins with <code>upnp:</code> or
   1.979 +        <code>zeroconf:</code> followed by one or more characters in the ranges U+0021, U+0023 to U+0027, U+002A to
   1.980 +        U+002B, U+002D to U+002E, U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
   1.981        </p>
   1.982 -      <p></p>
   1.983 -
   1.984        <p>
   1.985 -        A <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> provided in the <code>type</code> attribute of the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the services currently contained in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> according to the algorithms defined in this specification.
   1.986 +        A <a href="#dfn-valid-service-type"
   1.987 +           class="internalDFN">valid service type</a> provided in the <code>type</code> attribute of the <a href=
   1.988 +           "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the
   1.989 +           services currently contained in the <a href="#dfn-list-of-available-service-records"
   1.990 +           class="internalDFN">list of available service records</a> according to the algorithms defined in this
   1.991 +           specification.
   1.992        </p>
   1.993 -
   1.994        <p>
   1.995 -        A <dfn id="dfn-user-agent-generated-callback-url">user-agent generated callback url</dfn> is a Local-network accessible <abbr title="Uniform Resource Locator">URL</abbr> endpoint that a <a href="#dfn-user-agent" class="internalDFN">user agent</a> generates and maintains for receiving <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY requests from UPnP Event sources. It is only required when the user agent implements UPnP Service Discovery as defined in
   1.996 -        this specification.
   1.997 +        A <dfn id="dfn-user-agent-generated-callback-url">user-agent generated callback url</dfn> is a Local-network
   1.998 +        accessible <abbr title="Uniform Resource Locator">URL</abbr> endpoint that a <a href="#dfn-user-agent"
   1.999 +           class="internalDFN">user agent</a> generates and maintains for receiving <abbr title=
  1.1000 +           "Hypertext Transfer Protocol">HTTP</abbr> NOTIFY requests from UPnP Event sources. It is only required when
  1.1001 +           the user agent implements UPnP Service Discovery as defined in this specification.
  1.1002        </p>
  1.1003 -
  1.1004      </section>
  1.1005 -
  1.1006      <section id="requesting-networked-services">
  1.1007 -     <!--OddPage--><h2><span class="secno">4. </span>Requesting networked services</h2>
  1.1008 -
  1.1009 -
  1.1010 -<pre class="widl">[Supplemental, NoInterfaceObject]
  1.1011 +      <h2>
  1.1012 +        <span class="secno">4.</span> Requesting networked services
  1.1013 +      </h2>
  1.1014 +      <pre class="widl">
  1.1015 +[Supplemental, NoInterfaceObject]
  1.1016  interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
  1.1017    // Obtain a Local-networked Service
  1.1018    void <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type,
  1.1019 -                           in <a href="#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
  1.1020 -                           in optional <a href="#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
  1.1021 +                           in <a href=
  1.1022 +"#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
  1.1023 +                           in optional <a href=
  1.1024 +"#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
  1.1025  };
  1.1026 -<a class="externalDFN" href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href="#navigatornetworkservice">NavigatorNetworkService</a>;
  1.1027 +<a class="externalDFN"
  1.1028 +     href=
  1.1029 +     "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href=
  1.1030 +     "#navigatornetworkservice">NavigatorNetworkService</a>;
  1.1031  
  1.1032  [Callback=FunctionOnly, NoInterfaceObject]
  1.1033  interface <dfn id="navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</dfn> {
  1.1034 @@ -513,440 +734,519 @@
  1.1035    void handleEvent( in <a href="#navigatornetworkserviceerror">NavigatorNetworkServiceError</a> error );
  1.1036  };
  1.1037  </pre>
  1.1038 -
  1.1039 -  <section id="methods">
  1.1040 -   <h3><span class="secno">4.1 </span>Methods</h3>
  1.1041 -
  1.1042 -      <dl class="domintro">
  1.1043 -        <dt>
  1.1044 -          <var title="">window</var>
  1.1045 -           .
  1.1046 -          <code title="dom-navigator">
  1.1047 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a>
  1.1048 -          </code>
  1.1049 -           .
  1.1050 -          <code title="dom-navigator-getNetworkServices">
  1.1051 -            <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>
  1.1052 -          </code>
  1.1053 -          (
  1.1054 -          <var title="">type</var>
  1.1055 -          ,
  1.1056 -          <var title="">successCallback</var>
  1.1057 -           [,
  1.1058 -          <var title="">errorCallback</var>
  1.1059 -           ] )
  1.1060 -        </dt>
  1.1061 -        <dd>
  1.1062 -          <p>Prompts the user to select one or more discovered network services that have advertised support for the requested service type.</p>
  1.1063 +      <section id="methods">
  1.1064 +        <h3>
  1.1065 +          <span class="secno">4.1</span> Methods
  1.1066 +        </h3>
  1.1067 +        <dl class="domintro">
  1.1068 +          <dt>
  1.1069 +            <var title="">window</var> . <code title="dom-navigator"><a href=
  1.1070 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a></code> .
  1.1071 +            <code title="dom-navigator-getNetworkServices"><a href=
  1.1072 +            "#dom-navigator-getnetworkservices">getNetworkServices</a></code> ( <var title="">type</var> , <var title=
  1.1073 +            "">successCallback</var> [, <var title="">errorCallback</var> ] )
  1.1074 +          </dt>
  1.1075 +          <dd>
  1.1076 +            <p>
  1.1077 +              Prompts the user to select one or more discovered network services that have advertised support for the
  1.1078 +              requested service type.
  1.1079 +            </p>
  1.1080 +            <p>
  1.1081 +              The <var title="">type</var> argument contains one or more <a href="#dfn-valid-service-type"
  1.1082 +                 class="internalDFN">valid service type</a> tokens that the web page would like to interact with.
  1.1083 +            </p>
  1.1084 +            <p>
  1.1085 +              If the user accepts, the <var title="">successCallback</var> is invoked, with one or more <code><a href=
  1.1086 +              "#networkservice"><code>NetworkService</code></a></code> objects as its argument.
  1.1087 +            </p>
  1.1088 +            <p>
  1.1089 +              If the user declines, the <var title="">errorCallback</var> (if any) is invoked.
  1.1090 +            </p>
  1.1091 +          </dd>
  1.1092 +        </dl>
  1.1093 +        <div>
  1.1094            <p>
  1.1095 -            The
  1.1096 -            <var title="">type</var>
  1.1097 -             argument contains one or more <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens that the web page would like to interact with.
  1.1098 +            When the <dfn id="dom-navigator-getnetworkservices"
  1.1099 +               title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
  1.1100 +               errorCallback])</code></dfn> method is called, the <a href="#dfn-user-agent"
  1.1101 +               class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1102 +                title="must">must</em></em> run the following steps:
  1.1103            </p>
  1.1104 -          <p>
  1.1105 -            If the user accepts, the
  1.1106 -            <var title="">successCallback</var>
  1.1107 -             is
  1.1108 -          invoked, with one or more
  1.1109 -            <code>
  1.1110 -              <a href="#networkservice"><code>NetworkService</code></a>
  1.1111 -            </code>
  1.1112 -             objects as
  1.1113 -          its argument.
  1.1114 -          </p>
  1.1115 -          <p>
  1.1116 -            If the user declines, the
  1.1117 -            <var title="">errorCallback</var>
  1.1118 -             (if
  1.1119 -          any) is invoked.
  1.1120 -          </p>
  1.1121 -        </dd>
  1.1122 -      </dl>
  1.1123 -
  1.1124 -       <div>
  1.1125 -          <p>
  1.1126 -            When the <dfn id="dom-navigator-getnetworkservices" title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[, errorCallback])</code></dfn> method is called, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> run the following steps:
  1.1127 -          </p>
  1.1128 -
  1.1129            <ol class="rule">
  1.1130 -
  1.1131 +            <li>Let <var>requested control types</var> be initially set to an empty array.
  1.1132 +            </li>
  1.1133 +            <li>If <var>type</var> is an array consisting of one or more <a href="#dfn-valid-service-type"
  1.1134 +                  class="internalDFN">valid service type</a> tokens, then let <var>requested control types</var> by the
  1.1135 +                  value of <var>type</var>, removing any non-<a href="#dfn-valid-service-type"
  1.1136 +                  class="internalDFN">valid service type</a> tokens from the resulting array.
  1.1137 +            </li>
  1.1138 +            <li>If <var>type</var> is a string consisting of one <a href="#dfn-valid-service-type"
  1.1139 +                  class="internalDFN">valid service type</a> token, then let <var>requested control types</var> be an
  1.1140 +                  array containing one item with a value of <var>type</var>.
  1.1141 +            </li>
  1.1142 +            <li>If <var>requested control types</var> is an array that contains at least one or more <a title=
  1.1143 +            "valid service type"
  1.1144 +                  href="#dfn-valid-service-type"
  1.1145 +                  class="internalDFN">valid service type</a> tokens then continue to the step labeled <em>process</em>
  1.1146 +                  below. Otherwise, the <a href="#dfn-user-agent"
  1.1147 +                  class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1148 +                  title="must">must</em></em> <a href=
  1.1149 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1150 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1151 +                  object of type <code>Function</code>, with a new <a href=
  1.1152 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1153 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
  1.1154 +                  (<a href=
  1.1155 +                  "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
  1.1156 +                  its argument, abort any remaining steps and return.
  1.1157 +            </li>
  1.1158              <li>
  1.1159 -              Let <var>requested control types</var> be initially set to an empty array.
  1.1160 +              <em>Process</em>: Let <var>services found</var> be an empty array.
  1.1161              </li>
  1.1162 -
  1.1163 -            <li>
  1.1164 -               If <var>type</var> is an array consisting of one or more <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens, then let <var>requested control types</var> by the value of <var>type</var>, removing any non-<a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens from the resulting array.
  1.1165 +            <li>For each <var>available service</var> in the <a href="#dfn-list-of-available-service-records"
  1.1166 +                  class="internalDFN">list of available service records</a> run the following steps:
  1.1167 +              <ol class="rule">
  1.1168 +                <li>For each <var>requested control type</var> in <var>requested control types</var>: If <var>available
  1.1169 +                service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>
  1.1170 +                  matched service</var> equal the value of <var>available service</var> and continue at the step
  1.1171 +                  labeled <var>attach</var> below.
  1.1172 +                </li>
  1.1173 +                <li>Continue at the next <var>available service</var>.
  1.1174 +                </li>
  1.1175 +                <li>
  1.1176 +                  <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
  1.1177 +                  <ol class="rule">
  1.1178 +                    <li>Let <var>new service object</var> be a new <a href=
  1.1179 +                    "#networkservice"><code>NetworkService</code></a> object, mapping the parameters of <var>matched
  1.1180 +                    service</var> to this new object where possible.
  1.1181 +                    </li>
  1.1182 +                    <li>Append <var>new service object</var> to the <var>services found</var> array.
  1.1183 +                    </li>
  1.1184 +                  </ol>
  1.1185 +                </li>
  1.1186 +              </ol>
  1.1187              </li>
  1.1188 -
  1.1189 -            <li>
  1.1190 -               If <var>type</var> is a string consisting of one <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> token, then let <var>requested control types</var> be an array containing one item with a value of <var>type</var>.
  1.1191 +            <li>If <var>services found</var> is an empty array, then the <a href="#dfn-user-agent"
  1.1192 +                  class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1193 +                  title="must">must</em></em> <a href=
  1.1194 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1195 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1196 +                  object of type <code>Function</code>, with a new <a href=
  1.1197 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1198 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1199 +                  (<a href=
  1.1200 +                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1201 +                  argument, abort any remaining steps and return.
  1.1202              </li>
  1.1203 -
  1.1204 -            <li>
  1.1205 -               If <var>requested control types</var> is an array that contains at least one or more <a title="valid service type" href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens then continue to the step labeled <em>process</em> below. Otherwise, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
  1.1206 -                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
  1.1207 -                  (<a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as its argument,
  1.1208 -                   abort any remaining steps and return.
  1.1209 +            <li>Return, and run the remaining steps asynchronously.
  1.1210              </li>
  1.1211 -
  1.1212 -            <li>
  1.1213 -               <em>Process</em>: Let <var>services found</var> be an empty array.
  1.1214 +            <li>Optionally, e.g. based on a previously-established user preference, for security reasons, or due to
  1.1215 +            platform limitations, the <a href="#dfn-user-agent"
  1.1216 +                  class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1217 +                  title="may">may</em></em> <a href=
  1.1218 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1219 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1220 +                  object of type <code>Function</code>, with a new <a href=
  1.1221 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1222 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1223 +                  (<a href=
  1.1224 +                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1225 +                  argument, abort any remaining steps and return.
  1.1226              </li>
  1.1227 -
  1.1228 -            <li>
  1.1229 -               For each <var>available service</var> in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> run the following steps:
  1.1230 -               <ol class="rule">
  1.1231 -                  <li>
  1.1232 -                    For each <var>requested control type</var> in <var>requested control types</var>: If <var>available service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>matched service</var> equal the value of <var>available service</var> and continue at the step labeled <var>attach</var> below.
  1.1233 -                  </li>
  1.1234 -                  <li>
  1.1235 -                     Continue at the next <var>available service</var>.
  1.1236 -                  </li>
  1.1237 -                  <li>
  1.1238 -                     <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
  1.1239 -
  1.1240 -                     <ol class="rule">
  1.1241 -                        <li>
  1.1242 -                           Let <var>new service object</var> be a new <a href="#networkservice"><code>NetworkService</code></a> object, mapping the parameters of
  1.1243 -                     <var>matched service</var> to this new object where possible.
  1.1244 -                        </li>
  1.1245 -                        <li>
  1.1246 -                           Append <var>new service object</var> to the <var>services found</var> array.
  1.1247 -                        </li>
  1.1248 -                     </ol>
  1.1249 -                  </li>
  1.1250 -               </ol>
  1.1251 -            </li>
  1.1252 -
  1.1253 -            <li>
  1.1254 -               If <var>services found</var> is an empty array, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
  1.1255 -                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1256 -                 (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
  1.1257 -            </li>
  1.1258 -
  1.1259 -            <li>
  1.1260 -               Return, and run the remaining steps asynchronously.
  1.1261 -            </li>
  1.1262 -
  1.1263 -            <li>
  1.1264 -               Optionally, e.g. based on a previously-established user preference, for security reasons, or due to platform limitations, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="may">may</em></em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
  1.1265 -                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1266 -                 (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
  1.1267 -            </li>
  1.1268 -
  1.1269 -            <li>
  1.1270 -                  The <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> prompt the user in a user-agent-specific manner for permission to provide the
  1.1271 -                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
  1.1272 -                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> with an array of
  1.1273 -                  <a href="#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of <var>services found</var>.
  1.1274 -
  1.1275 -               <p>
  1.1276 -                  If the user grants permission to access one or more networked services then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="should">should</em> include an
  1.1277 -                  "ongoing local-network communication" indicator.
  1.1278 -               </p>
  1.1279 -
  1.1280 -               <p>If the user denies permission, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
  1.1281 -                <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1282 -                (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
  1.1283 +            <li>The <a href="#dfn-user-agent"
  1.1284 +                  class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1285 +                  title="must">must</em></em> prompt the user in a user-agent-specific manner for permission to provide
  1.1286 +                  the <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
  1.1287 +                  class="externalDFN">entry script</a>'s <a href=
  1.1288 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
  1.1289 +                  class="externalDFN">origin</a> with an array of <a href=
  1.1290 +                  "#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of
  1.1291 +                  <var>services found</var>.
  1.1292 +              <p>
  1.1293 +                If the user grants permission to access one or more networked services then the <a href=
  1.1294 +                "#dfn-user-agent"
  1.1295 +                   class="internalDFN">user agent</a> <em class="rfc2119"
  1.1296 +                   title="should">should</em> include an "ongoing local-network communication" indicator.
  1.1297                </p>
  1.1298 -
  1.1299 +              <p>
  1.1300 +                If the user denies permission, then the <a href="#dfn-user-agent"
  1.1301 +                   class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1302 +                    title="must">must</em></em> <a href=
  1.1303 +                    "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1304 +                   class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1305 +                   object of type <code>Function</code>, with a new <a href=
  1.1306 +                   "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1307 +                   "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1308 +                   (<a href=
  1.1309 +                   "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1310 +                   argument, abort any remaining steps and return.
  1.1311 +              </p>
  1.1312                <p>
  1.1313                  If the user never responds, this algorithm stalls on this step.
  1.1314                </p>
  1.1315 -
  1.1316              </li>
  1.1317 -
  1.1318 -            <li>
  1.1319 -               Let <var>services</var> be the array of one or more <a href="#networkservice"><code>NetworkService</code></a> objects for which the user granted permission.
  1.1320 +            <li>Let <var>services</var> be the array of one or more <a href=
  1.1321 +            "#networkservice"><code>NetworkService</code></a> objects for which the user granted permission.
  1.1322              </li>
  1.1323 -
  1.1324 -            <li>
  1.1325 -               For each Object <var>service</var> in <var>services</var>, run the following substeps:
  1.1326 -
  1.1327 -               <ol class="rule">
  1.1328 -                  <li>
  1.1329 -                     Add the <var>service</var>'s <code>url</code> parameter to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.1330 -                  </li>
  1.1331 -                  <li>
  1.1332 -                    If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>" and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a UPnP Events Subscription</a> for <var>service</var>.
  1.1333 -                  </li>
  1.1334 -               </ol>
  1.1335 +            <li>For each Object <var>service</var> in <var>services</var>, run the following substeps:
  1.1336 +              <ol class="rule">
  1.1337 +                <li>Add the <var>service</var>'s <code>url</code> parameter to the <a href=
  1.1338 +                "#dfn-entry-script-origin-s-url-whitelist"
  1.1339 +                      class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr>
  1.1340 +                      whitelist</a>.
  1.1341 +                </li>
  1.1342 +                <li>If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>"
  1.1343 +                and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a href=
  1.1344 +                "#dfn-setup-a-upnp-events-subscription"
  1.1345 +                      class="internalDFN">setup a UPnP Events Subscription</a> for <var>service</var>.
  1.1346 +                </li>
  1.1347 +              </ol>
  1.1348              </li>
  1.1349 -
  1.1350 -            <li>
  1.1351 -               Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a> object.
  1.1352 +            <li>Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a>
  1.1353 +            object.
  1.1354              </li>
  1.1355 -
  1.1356 -            <li>
  1.1357 -               Set <var>services manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of services currently found in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> whose <code>type</code> property matches any of the tokens requested in <var>requested control types</var>.
  1.1358 +            <li>Set <var>services manager</var>'s <a href=
  1.1359 +            "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
  1.1360 +            services currently found in the <a href="#dfn-list-of-available-service-records"
  1.1361 +                  class="internalDFN">list of available service records</a> whose <code>type</code> property matches
  1.1362 +                  any of the tokens requested in <var>requested control types</var>.
  1.1363              </li>
  1.1364 -
  1.1365 -            <li>
  1.1366 -              Add the set of <var>services</var> to the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> internally against the newly created <var>services manager</var> object.
  1.1367 +            <li>Add the set of <var>services</var> to the <a href="#dfn-list-of-authorized-service-records"
  1.1368 +                  class="internalDFN">list of authorized service records</a> internally against the newly created
  1.1369 +                  <var>services manager</var> object.
  1.1370              </li>
  1.1371 -
  1.1372 -            <li>
  1.1373 -               The <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with
  1.1374 -               <var>services manager</var> as its argument.
  1.1375 +            <li>The <a href="#dfn-user-agent"
  1.1376 +                  class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1377 +                  title="must">must</em></em> <a href=
  1.1378 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1379 +                  class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with <var>services
  1.1380 +                  manager</var> as its argument.
  1.1381              </li>
  1.1382 -
  1.1383            </ol>
  1.1384 -
  1.1385            <p>
  1.1386 -            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source" class="externalDFN">task source</a> for these
  1.1387 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task" class="externalDFN">tasks</a> is the
  1.1388 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source" class="externalDFN">user interaction task source</a>.
  1.1389 +            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source"
  1.1390 +               class="externalDFN">task source</a> for these <a href=
  1.1391 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task"
  1.1392 +               class="externalDFN">tasks</a> is the <a href=
  1.1393 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source"
  1.1394 +               class="externalDFN">user interaction task source</a>.
  1.1395            </p>
  1.1396 -
  1.1397            <p>
  1.1398 -            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> add the <code>url</code> property
  1.1399 -             to the <dfn id="dfn-entry-script-origin-s-url-whitelist">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</dfn>. This list enables the
  1.1400 -            Web page to override and initiate cross-site resource requests towards these URLs, and any sub-resources of these URLs, within the current
  1.1401 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
  1.1402 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
  1.1403 -            Web Messaging, XMLHttpRequest).
  1.1404 -         </p>
  1.1405 -
  1.1406 -         <p>
  1.1407 -            If the user navigates away from the current browsing context, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> remove all previously whitelisted urls from the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.1408 -            There is no persistence to network service selections provided to a web page. It is not possible to access a previously white-listed networked service without the necessary user authorization in all of the following cases:
  1.1409 -            </p><ul>
  1.1410 -              <li>If the current script is reloaded at any point in the same or different window.</li>
  1.1411 -              <li>if the current script reinvokes the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its execution.</li>
  1.1412 -              <li>If the user navigates forward or back in their history to reload the current page.</li>
  1.1413 -              <li>If a script is running in a different origin.</li>
  1.1414 -            </ul>
  1.1415 -         <p></p>
  1.1416 -
  1.1417 -      </div>
  1.1418 +            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the
  1.1419 +            <a href="#dfn-user-agent"
  1.1420 +               class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1421 +                title="must">must</em></em> add the <code>url</code> property to the <dfn id=
  1.1422 +                "dfn-entry-script-origin-s-url-whitelist">entry script origin's <abbr title=
  1.1423 +                "Uniform Resource Locator">URL</abbr> whitelist</dfn>. This list enables the Web page to override and
  1.1424 +                initiate cross-site resource requests towards these URLs, and any sub-resources of these URLs, within
  1.1425 +                the current <a href=
  1.1426 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
  1.1427 +               class="externalDFN">entry script</a>'s <a href=
  1.1428 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
  1.1429 +               class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
  1.1430 +               Web Messaging, XMLHttpRequest).
  1.1431 +          </p>
  1.1432 +          <p>
  1.1433 +            If the user navigates away from the current browsing context, the <a href="#dfn-user-agent"
  1.1434 +               class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1435 +                title="must">must</em></em> remove all previously whitelisted urls from the <a href=
  1.1436 +                "#dfn-entry-script-origin-s-url-whitelist"
  1.1437 +               class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr>
  1.1438 +               whitelist</a>. There is no persistence to network service selections provided to a web page. It is not
  1.1439 +               possible to access a previously white-listed networked service without the necessary user authorization
  1.1440 +               in all of the following cases:
  1.1441 +          </p>
  1.1442 +          <ul>
  1.1443 +            <li>If the current script is reloaded at any point in the same or different window.
  1.1444 +            </li>
  1.1445 +            <li>if the current script reinvokes the <a href=
  1.1446 +            "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its
  1.1447 +            execution.
  1.1448 +            </li>
  1.1449 +            <li>If the user navigates forward or back in their history to reload the current page.
  1.1450 +            </li>
  1.1451 +            <li>If a script is running in a different origin.
  1.1452 +            </li>
  1.1453 +          </ul>
  1.1454 +        </div>
  1.1455        </section>
  1.1456 -
  1.1457        <section id="error-handling">
  1.1458 -         <h3><span class="secno">4.2 </span>Error Handling</h3>
  1.1459 -
  1.1460 -      <dl class="domintro">
  1.1461 -        <dt>
  1.1462 -          <var title="">error</var>
  1.1463 -           .
  1.1464 -          <code title="dom-NavigatorNetworkServiceError-code">
  1.1465 -            <a href="#dom-navigatornetworkserviceerror-code">code</a>
  1.1466 -          </code>
  1.1467 -        </dt>
  1.1468 -        <dd>
  1.1469 -          <p>
  1.1470 -            Returns the current error's error code. At the current time, this will be <code>1</code> or <code>2</code>, for which the
  1.1471 -            corresponding error constants
  1.1472 -            <a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and
  1.1473 -            <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are defined.
  1.1474 -          </p>
  1.1475 -        </dd>
  1.1476 -      </dl>
  1.1477 -
  1.1478 -         <p>
  1.1479 -            The <dfn id="dom-navigatornetworkserviceerror-code" title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a
  1.1480 -            <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class="ct"><em class="rfc2119" title="must">must</em></em> return the code for the error, which will be one of the following:
  1.1481 -         </p>
  1.1482 -
  1.1483 -         <dl>
  1.1484 -            <dt>
  1.1485 -               <dfn id="dom-navigatornetworkserviceerror-permission_denied" title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (numeric value 1)
  1.1486 -            </dt>
  1.1487 -            <dd>
  1.1488 -               The user or user agent denied the page permission to access any services.
  1.1489 -            </dd>
  1.1490 -            <dt>
  1.1491 -               <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix" title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn> (numeric value 2)
  1.1492 -            </dt>
  1.1493 -            <dd>
  1.1494 -               No <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens were provided in the method invocation.
  1.1495 -            </dd>
  1.1496 -         </dl>
  1.1497 -
  1.1498 +        <h3>
  1.1499 +          <span class="secno">4.2</span> Error Handling
  1.1500 +        </h3>
  1.1501 +        <dl class="domintro">
  1.1502 +          <dt>
  1.1503 +            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href=
  1.1504 +            "#dom-navigatornetworkserviceerror-code">code</a></code>
  1.1505 +          </dt>
  1.1506 +          <dd>
  1.1507 +            <p>
  1.1508 +              Returns the current error's error code. At the current time, this will be <code>1</code> or
  1.1509 +              <code>2</code>, for which the corresponding error constants <a href=
  1.1510 +              "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
  1.1511 +              "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
  1.1512 +              defined.
  1.1513 +            </p>
  1.1514 +          </dd>
  1.1515 +        </dl>
  1.1516 +        <p>
  1.1517 +          The <dfn id="dom-navigatornetworkserviceerror-code"
  1.1518 +             title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <a href=
  1.1519 +             "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class=
  1.1520 +             "ct"><em class="rfc2119"
  1.1521 +              title="must">must</em></em> return the code for the error, which will be one of the following:
  1.1522 +        </p>
  1.1523 +        <dl>
  1.1524 +          <dt>
  1.1525 +            <dfn id="dom-navigatornetworkserviceerror-permission_denied"
  1.1526 +                title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
  1.1527 +                (numeric value 1)
  1.1528 +          </dt>
  1.1529 +          <dd>
  1.1530 +            The user or user agent denied the page permission to access any services.
  1.1531 +          </dd>
  1.1532 +          <dt>
  1.1533 +            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix"
  1.1534 +                title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
  1.1535 +                (numeric value 2)
  1.1536 +          </dt>
  1.1537 +          <dd>
  1.1538 +            No <a href="#dfn-valid-service-type"
  1.1539 +                class="internalDFN">valid service type</a> tokens were provided in the method invocation.
  1.1540 +          </dd>
  1.1541 +        </dl>
  1.1542        </section>
  1.1543 -
  1.1544 -      </section>
  1.1545 -      <section id="obtaining-networked-services">
  1.1546 -      <!--OddPage--><h2><span class="secno">5. </span>Obtaining networked services</h2>
  1.1547 -
  1.1548 +    </section>
  1.1549 +    <section id="obtaining-networked-services">
  1.1550 +      <h2>
  1.1551 +        <span class="secno">5.</span> Obtaining networked services
  1.1552 +      </h2>
  1.1553        <p>
  1.1554 -         The <a href="#networkservices"><code>NetworkServices</code></a> interface is the top-level response object from a call to <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> and provides access to a set of user-authorized <a href="#networkservice"><code>NetworkService</code></a> objects for the given request.
  1.1555 +        The <a href="#networkservices"><code>NetworkServices</code></a> interface is the top-level response object from
  1.1556 +        a call to <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> and provides access
  1.1557 +        to a set of user-authorized <a href="#networkservice"><code>NetworkService</code></a> objects for the given
  1.1558 +        request.
  1.1559        </p>
  1.1560 -
  1.1561 -<pre class="widl">[NoInterfaceObject]
  1.1562 +      <pre class="widl">
  1.1563 +[NoInterfaceObject]
  1.1564  interface <dfn id="networkservices">NetworkServices</dfn> {
  1.1565    readonly attribute unsigned long    <a href="#dom-networkservices-length">length</a>;
  1.1566    getter <a href="#networkservice">NetworkService</a> (unsigned long index);
  1.1567 -  <a href="#networkservice">NetworkService</a>? <a href="#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
  1.1568 +  <a href="#networkservice">NetworkService</a>? <a href=
  1.1569 +"#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
  1.1570  
  1.1571    readonly attribute unsigned long    <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>;
  1.1572  
  1.1573    // event handler attributes
  1.1574 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
  1.1575 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
  1.1576 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1577 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
  1.1578 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1579 +     class="externalDFN">EventHandler</a>     <a href=
  1.1580 +     "#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
  1.1581  
  1.1582  };
  1.1583  
  1.1584 -<a href="#networkservices">NetworkServices</a> implements <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget" class="externalDFN">EventTarget</a>;
  1.1585 +<a href="#networkservices">NetworkServices</a> implements <a href=
  1.1586 +"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
  1.1587 +     class="externalDFN">EventTarget</a>;
  1.1588  </pre>
  1.1589 -
  1.1590        <section id="attributes">
  1.1591 -      <h3><span class="secno">5.1 </span>Attributes</h3>
  1.1592 -
  1.1593 +        <h3>
  1.1594 +          <span class="secno">5.1</span> Attributes
  1.1595 +        </h3>
  1.1596          <dl class="domintro">
  1.1597            <dt>
  1.1598 -            <code title="dom-networkservices-length">
  1.1599 -              <a href="#dom-networkservices-length">length</a>
  1.1600 -            </code>
  1.1601 +            <code title="dom-networkservices-length"><a href="#dom-networkservices-length">length</a></code>
  1.1602            </dt>
  1.1603            <dd>
  1.1604              <p>
  1.1605 -              Returns the current number of services belonging in the respective object's <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a>.
  1.1606 +              Returns the current number of services belonging in the respective object's <a href=
  1.1607 +              "#dfn-list-of-authorized-service-records"
  1.1608 +                 class="internalDFN">list of authorized service records</a>.
  1.1609              </p>
  1.1610            </dd>
  1.1611            <dt>
  1.1612 -            <code title="dom-networkservices-servicesavailable">
  1.1613 -              <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>
  1.1614 -            </code>
  1.1615 +            <code title="dom-networkservices-servicesavailable"><a href=
  1.1616 +            "#dom-networkservices-servicesavailable">servicesAvailable</a></code>
  1.1617            </dt>
  1.1618            <dd>
  1.1619              <p>
  1.1620 -              Returns the current number of services matching one of the app-requested <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens in the
  1.1621 -              <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>.
  1.1622 +              Returns the current number of services matching one of the app-requested <a href=
  1.1623 +              "#dfn-valid-service-type"
  1.1624 +                 class="internalDFN">valid service type</a> tokens in the <a href=
  1.1625 +                 "#dfn-list-of-available-service-records"
  1.1626 +                 class="internalDFN">list of available service records</a>.
  1.1627              </p>
  1.1628            </dd>
  1.1629          </dl>
  1.1630 -
  1.1631          <div>
  1.1632 -           <p>
  1.1633 -              The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="ct"><em class="rfc2119" title="must">must</em></em> return the number of services represented in the object's corresponding <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> at the time of getting.
  1.1634 -           </p>
  1.1635 -
  1.1636 -           <p>
  1.1637 -              The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute <em class="ct"><em class="rfc2119" title="must">must</em></em> return the number of services in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> whose <code>type</code> attribute matches any of the <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens that was initially used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
  1.1638 -           </p>
  1.1639 -
  1.1640 +          <p>
  1.1641 +            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="ct"><em class=
  1.1642 +            "rfc2119"
  1.1643 +                title="must">must</em></em> return the number of services represented in the object's corresponding
  1.1644 +                <a href="#dfn-list-of-authorized-service-records"
  1.1645 +               class="internalDFN">list of authorized service records</a> at the time of getting.
  1.1646 +          </p>
  1.1647 +          <p>
  1.1648 +            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute
  1.1649 +            <em class="ct"><em class="rfc2119"
  1.1650 +                title="must">must</em></em> return the number of services in the <a href=
  1.1651 +                "#dfn-list-of-available-service-records"
  1.1652 +               class="internalDFN">list of available service records</a> whose <code>type</code> attribute matches any
  1.1653 +               of the <a href="#dfn-valid-service-type"
  1.1654 +               class="internalDFN">valid service type</a> tokens that was initially used to create the current <a href=
  1.1655 +               "#networkservices"><code>NetworkServices</code></a> object.
  1.1656 +          </p>
  1.1657          </div>
  1.1658 -
  1.1659        </section>
  1.1660 -
  1.1661        <section id="methods-1">
  1.1662 -      <h3><span class="secno">5.2 </span>Methods</h3>
  1.1663 +        <h3>
  1.1664 +          <span class="secno">5.2</span> Methods
  1.1665 +        </h3>
  1.1666          <dl class="domintro">
  1.1667 -        <dt>
  1.1668 -          <code title="networkservices-getter">
  1.1669 -            <a href="#networkservices">services</a>
  1.1670 -          </code>
  1.1671 -          [
  1.1672 -          <var title="">index</var>
  1.1673 -          ]
  1.1674 -        </dt>
  1.1675 -        <dd>
  1.1676 -          <p>
  1.1677 -            Returns the specified <a href="#networkservice"><code>NetworkService</code></a> object.
  1.1678 +          <dt>
  1.1679 +            <code title="networkservices-getter"><a href="#networkservices">services</a></code> [ <var title=
  1.1680 +            "">index</var> ]
  1.1681 +          </dt>
  1.1682 +          <dd>
  1.1683 +            <p>
  1.1684 +              Returns the specified <a href="#networkservice"><code>NetworkService</code></a> object.
  1.1685 +            </p>
  1.1686 +          </dd>
  1.1687 +          <dt>
  1.1688 +            <code title="networkservices-getter"><a href="#networkservices">services</a></code> . <code title=
  1.1689 +            "dom-networkservices-getservicebyid"><a href=
  1.1690 +            "#dom-networkservices-getservicebyid">getServiceById</a></code> ( <var title="">id</var> )
  1.1691 +          </dt>
  1.1692 +          <dd>
  1.1693 +            <p>
  1.1694 +              Returns the <a href="#networkservice"><code>NetworkService</code></a> object with the given identifier,
  1.1695 +              or null if no service has that identifier.
  1.1696 +            </p>
  1.1697 +          </dd>
  1.1698 +        </dl>
  1.1699 +        <p>
  1.1700 +          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or
  1.1701 +          more current authorized services - the <a href="#dfn-list-of-authorized-service-records"
  1.1702 +             class="internalDFN">list of authorized service records</a>. Each item in the <a href=
  1.1703 +             "#dfn-list-of-authorized-service-records"
  1.1704 +             class="internalDFN">list of authorized service records</a> is represented by a <a href=
  1.1705 +             "#networkservice"><code>NetworkService</code></a> object. The <a href=
  1.1706 +             "#dfn-list-of-authorized-service-records"
  1.1707 +             class="internalDFN">list of authorized service records</a> is <span>immutable</span> meaning that it
  1.1708 +             cannot be modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a>
  1.1709 +             object.
  1.1710 +        </p>
  1.1711 +        <div class="note">
  1.1712 +          <div class="note-title">
  1.1713 +            <span>Note</span>
  1.1714 +          </div>
  1.1715 +          <p class="">
  1.1716 +            Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
  1.1717 +            first has the index 0, and each subsequent service is numbered one higher than the previous one.
  1.1718            </p>
  1.1719 -        </dd>
  1.1720 -        <dt>
  1.1721 -          <code title="networkservices-getter">
  1.1722 -            <a href="#networkservices">services</a>
  1.1723 -          </code>
  1.1724 -          .
  1.1725 -          <code title="dom-networkservices-getservicebyid">
  1.1726 -            <a href="#dom-networkservices-getservicebyid">getServiceById</a>
  1.1727 -          </code>
  1.1728 -          (
  1.1729 -          <var title="">id</var>
  1.1730 -          )
  1.1731 -        </dt>
  1.1732 -        <dd>
  1.1733 -          <p>
  1.1734 -            Returns the <a href="#networkservice"><code>NetworkService</code></a> object with the given identifier, or null if no
  1.1735 -            service has that identifier.
  1.1736 -          </p>
  1.1737 -        </dd>
  1.1738 -      </dl>
  1.1739 -
  1.1740 -      <p>
  1.1741 -        A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or more current authorized services - the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a>. Each item in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a> object. The <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> is <span>immutable</span> meaning that it cannot be modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
  1.1742 -      </p>
  1.1743 -
  1.1744 -      <div class="note"><div class="note-title"><span>Note</span></div><p class="">
  1.1745 -        Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the first has the index 0, and each subsequent service is numbered one higher than the previous one.
  1.1746 -      </p></div>
  1.1747 -
  1.1748 -      <p>
  1.1749 -        The <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices" class="externalDFN">supported property indices</a> of <a href="#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to the number of items in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> represented by the respective object minus one, if any services are represented in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a>.
  1.1750 -      </p>
  1.1751 -
  1.1752 -      <p>
  1.1753 -        To <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property" class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a <a href="#networkservices"><code>NetworkServices</code></a> object's <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a>, the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> return the <a href="#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a>.
  1.1754 -      </p>
  1.1755 -
  1.1756 -      <p>
  1.1757 -        The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class="ct"><em class="rfc2119" title="must">must</em></em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> represented by the respective object whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var> argument.
  1.1758 -        When no services in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> match the given argument, the method <em class="ct"><em class="rfc2119" title="must">must</em></em> return null.
  1.1759 -      </p>
  1.1760 -
  1.1761 -      <p>
  1.1762 -         Services available within the local network can connect and disconnect at different times during the execution of a web page. A <a href="#dfn-user-agent" class="internalDFN">user agent</a> can
  1.1763 -         inform a web page when the state of networked services matching the requested <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> change. Web pages can use this information to enable in-page experiences for communicating the state of networked services
  1.1764 -         with the ability to change the particular service or set of services the page is connected to by re-invoking the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
  1.1765 -      </p>
  1.1766 -
  1.1767 +        </div>
  1.1768 +        <p>
  1.1769 +          The <a href=
  1.1770 +          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices"
  1.1771 +             class="externalDFN">supported property indices</a> of <a href=
  1.1772 +             "#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to
  1.1773 +             the number of items in the <a href="#dfn-list-of-authorized-service-records"
  1.1774 +             class="internalDFN">list of authorized service records</a> represented by the respective object minus one,
  1.1775 +             if any services are represented in the <a href="#dfn-list-of-authorized-service-records"
  1.1776 +             class="internalDFN">list of authorized service records</a>.
  1.1777 +        </p>
  1.1778 +        <p>
  1.1779 +          To <a href=
  1.1780 +          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property"
  1.1781 +             class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a
  1.1782 +             <a href="#networkservices"><code>NetworkServices</code></a> object's <a href=
  1.1783 +             "#dfn-list-of-authorized-service-records"
  1.1784 +             class="internalDFN">list of authorized service records</a>, the user agent <em class="ct"><em class=
  1.1785 +             "rfc2119"
  1.1786 +              title="must">must</em></em> return the <a href="#networkservice"><code>NetworkService</code></a> object
  1.1787 +              that represents the <var>index</var>th service in the <a href="#dfn-list-of-authorized-service-records"
  1.1788 +             class="internalDFN">list of authorized service records</a>.
  1.1789 +        </p>
  1.1790 +        <p>
  1.1791 +          The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class=
  1.1792 +          "ct"><em class="rfc2119"
  1.1793 +              title="must">must</em></em> return the first <a href="#networkservice"><code>NetworkService</code></a>
  1.1794 +              object in the <a href="#dfn-list-of-authorized-service-records"
  1.1795 +             class="internalDFN">list of authorized service records</a> represented by the respective object whose
  1.1796 +             <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var>
  1.1797 +             argument. When no services in the <a href="#dfn-list-of-authorized-service-records"
  1.1798 +             class="internalDFN">list of authorized service records</a> match the given argument, the method <em class=
  1.1799 +             "ct"><em class="rfc2119"
  1.1800 +              title="must">must</em></em> return null.
  1.1801 +        </p>
  1.1802 +        <p>
  1.1803 +          Services available within the local network can connect and disconnect at different times during the
  1.1804 +          execution of a web page. A <a href="#dfn-user-agent"
  1.1805 +             class="internalDFN">user agent</a> can inform a web page when the state of networked services matching the
  1.1806 +             requested <a href="#dfn-valid-service-type"
  1.1807 +             class="internalDFN">valid service type</a> change. Web pages can use this information to enable in-page
  1.1808 +             experiences for communicating the state of networked services with the ability to change the particular
  1.1809 +             service or set of services the page is connected to by re-invoking the <a href=
  1.1810 +             "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
  1.1811 +        </p>
  1.1812        </section>
  1.1813 -
  1.1814        <section id="events">
  1.1815 -      <h3><span class="secno">5.3 </span>Events</h3>
  1.1816 -
  1.1817 -      <p>
  1.1818 -         The following are the event handlers (and their corresponding event handler event types) that <em class="ct"><em class="rfc2119" title="must">must</em></em> be supported, as IDL attributes, by all objects implementing the <a href="#networkservices"><code>NetworkServices</code></a> interface:
  1.1819 -       </p>
  1.1820 -
  1.1821 -       <table border="1">
  1.1822 -        <thead>
  1.1823 -          <tr>
  1.1824 -            <th>
  1.1825 -              <span title="event handlers">Event handler</span>
  1.1826 -            </th>
  1.1827 -            <th>
  1.1828 -              <span>Event handler event type</span>
  1.1829 -            </th>
  1.1830 -          </tr>
  1.1831 -        </thead>
  1.1832 -        <tbody>
  1.1833 -          <tr>
  1.1834 -            <td>
  1.1835 -              <dfn id="dom-networkservices-onserviceavailable" title="dom-NetworkServices-onserviceavailable">
  1.1836 -                <code>onserviceavailable</code>
  1.1837 -              </dfn>
  1.1838 -            </td>
  1.1839 -            <td>
  1.1840 -              <a href="#event-serviceavailable"><code>serviceavailable</code>
  1.1841 -            </a></td>
  1.1842 -          </tr>
  1.1843 -          <tr>
  1.1844 -            <td>
  1.1845 -              <dfn id="dom-networkservices-onserviceunavailable" title="dom-NetworkServices-onserviceunavailable">
  1.1846 -                <code>onserviceunavailable</code>
  1.1847 -              </dfn>
  1.1848 -            </td>
  1.1849 -            <td>
  1.1850 -              <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
  1.1851 -            </td>
  1.1852 -          </tr>
  1.1853 -        </tbody>
  1.1854 -      </table>
  1.1855 -
  1.1856 +        <h3>
  1.1857 +          <span class="secno">5.3</span> Events
  1.1858 +        </h3>
  1.1859 +        <p>
  1.1860 +          The following are the event handlers (and their corresponding event handler event types) that <em class=
  1.1861 +          "ct"><em class="rfc2119"
  1.1862 +              title="must">must</em></em> be supported, as IDL attributes, by all objects implementing the <a href=
  1.1863 +              "#networkservices"><code>NetworkServices</code></a> interface:
  1.1864 +        </p>
  1.1865 +        <table border="1"
  1.1866 +               summary="Event handlers for NetworkServices objects">
  1.1867 +          <thead>
  1.1868 +            <tr>
  1.1869 +              <th>
  1.1870 +                <span title="event handlers">Event handler</span>
  1.1871 +              </th>
  1.1872 +              <th>
  1.1873 +                <span>Event handler event type</span>
  1.1874 +              </th>
  1.1875 +            </tr>
  1.1876 +          </thead>
  1.1877 +          <tbody>
  1.1878 +            <tr>
  1.1879 +              <td>
  1.1880 +                <dfn id="dom-networkservices-onserviceavailable"
  1.1881 +                    title="dom-NetworkServices-onserviceavailable"><code>onserviceavailable</code></dfn>
  1.1882 +              </td>
  1.1883 +              <td>
  1.1884 +                <a href="#event-serviceavailable"><code>serviceavailable</code></a>
  1.1885 +              </td>
  1.1886 +            </tr>
  1.1887 +            <tr>
  1.1888 +              <td>
  1.1889 +                <dfn id="dom-networkservices-onserviceunavailable"
  1.1890 +                    title="dom-NetworkServices-onserviceunavailable"><code>onserviceunavailable</code></dfn>
  1.1891 +              </td>
  1.1892 +              <td>
  1.1893 +                <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
  1.1894 +              </td>
  1.1895 +            </tr>
  1.1896 +          </tbody>
  1.1897 +        </table>
  1.1898        </section>
  1.1899 -
  1.1900      </section>
  1.1901      <section id="communicating-with-a-networked-service">
  1.1902 -    <!--OddPage--><h2><span class="secno">6. </span>Communicating with a networked service</h2>
  1.1903 -
  1.1904 -<p>
  1.1905 -   The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection information for an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> service endpoint and if available, service events, running on a networked device.
  1.1906 -</p>
  1.1907 -
  1.1908 -<pre class="widl">[NoInterfaceObject]
  1.1909 +      <h2>
  1.1910 +        <span class="secno">6.</span> Communicating with a networked service
  1.1911 +      </h2>
  1.1912 +      <p>
  1.1913 +        The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection
  1.1914 +        information for an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> service endpoint and if available,
  1.1915 +        service events, running on a networked device.
  1.1916 +      </p>
  1.1917 +      <pre class="widl">
  1.1918 +[NoInterfaceObject]
  1.1919  interface <dfn id="networkservice">NetworkService</dfn> {
  1.1920    readonly attribute DOMString        <a href="#dom-networkservice-id">id</a>;
  1.1921    readonly attribute DOMString        <a href="#dom-networkservice-name">name</a>;
  1.1922 @@ -957,713 +1257,835 @@
  1.1923    readonly attribute boolean          <a href="#dom-networkservice-online">online</a>;
  1.1924  
  1.1925    // event handler attributes
  1.1926 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceonline">onserviceonline</a>;
  1.1927 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceoffline">onserviceoffline</a>;
  1.1928 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1929 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceonline">onserviceonline</a>;
  1.1930 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1931 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceoffline">onserviceoffline</a>;
  1.1932  
  1.1933 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onnotify">onnotify</a>;
  1.1934 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1935 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onnotify">onnotify</a>;
  1.1936  };
  1.1937  
  1.1938 -<a href="#networkservice">NetworkService</a> implements <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget" class="externalDFN">EventTarget</a>;
  1.1939 +<a href="#networkservice">NetworkService</a> implements <a href=
  1.1940 +"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
  1.1941 +     class="externalDFN">EventTarget</a>;
  1.1942  </pre>
  1.1943 -
  1.1944 -<section id="attributes-1">
  1.1945 -  <h3><span class="secno">6.1 </span>Attributes</h3>
  1.1946 -
  1.1947 -      <dl class="domintro">
  1.1948 -        <dt>
  1.1949 -          <var title="">service</var>
  1.1950 -           .
  1.1951 -          <code title="dom-networkservice-id">
  1.1952 -            <a href="#dom-networkservice-id">id</a>
  1.1953 -          </code>
  1.1954 -        </dt>
  1.1955 -        <dd>
  1.1956 +      <section id="attributes-1">
  1.1957 +        <h3>
  1.1958 +          <span class="secno">6.1</span> Attributes
  1.1959 +        </h3>
  1.1960 +        <dl class="domintro">
  1.1961 +          <dt>
  1.1962 +            <var title="">service</var> . <code title="dom-networkservice-id"><a href=
  1.1963 +            "#dom-networkservice-id">id</a></code>
  1.1964 +          </dt>
  1.1965 +          <dd>
  1.1966 +            <p>
  1.1967 +              A unique identifier for the given user-selected service instance.
  1.1968 +            </p>
  1.1969 +          </dd>
  1.1970 +          <dt>
  1.1971 +            <var title="">service</var> . <code title="dom-networkservice-name"><a href=
  1.1972 +            "#dom-networkservice-name">name</a></code>
  1.1973 +          </dt>
  1.1974 +          <dd>
  1.1975 +            <p>
  1.1976 +              The name of the user-selected service.
  1.1977 +            </p>
  1.1978 +          </dd>
  1.1979 +          <dt>
  1.1980 +            <var title="">service</var> . <code title="dom-networkservice-type"><a href=
  1.1981 +            "#dom-networkservice-type">type</a></code>
  1.1982 +          </dt>
  1.1983 +          <dd>
  1.1984 +            <p>
  1.1985 +              The <a href="#dfn-valid-service-type"
  1.1986 +                 class="internalDFN">valid service type</a> token value of the user-selected service.
  1.1987 +            </p>
  1.1988 +          </dd>
  1.1989 +          <dt>
  1.1990 +            <var title="">service</var> . <code title="dom-networkservice-url"><a href=
  1.1991 +            "#dom-networkservice-url">url</a></code>
  1.1992 +          </dt>
  1.1993 +          <dd>
  1.1994 +            <p>
  1.1995 +              The control <abbr title="Uniform Resource Locator">URL</abbr> endpoint (including any required port
  1.1996 +              information) of the user-selected control service that has been added to the <a href=
  1.1997 +              "#dfn-entry-script-origin-s-url-whitelist"
  1.1998 +                 class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr>
  1.1999 +                 whitelist</a>.
  1.2000 +            </p>
  1.2001 +          </dd>
  1.2002 +          <dt>
  1.2003 +            <var title="">service</var> . <code title="dom-networkservice-config"><a href=
  1.2004 +            "#dom-networkservice-config">config</a></code>
  1.2005 +          </dt>
  1.2006 +          <dd>
  1.2007 +            <p>
  1.2008 +              The configuration information associated with the service depending on the requested service type.
  1.2009 +            </p>
  1.2010 +          </dd>
  1.2011 +        </dl>
  1.2012 +        <p>
  1.2013 +          The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service.
  1.2014 +          The same service provided at different times or on different objects <em class="ct"><em class="rfc2119"
  1.2015 +              title="must">must</em></em> have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
  1.2016 +        </p>
  1.2017 +        <p>
  1.2018 +          The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for
  1.2019 +          the service.
  1.2020 +        </p>
  1.2021 +        <p>
  1.2022 +          The <dfn id="dom-networkservice-type"><code>type</code></dfn> attribute reflects the value of the <a href=
  1.2023 +          "#dfn-valid-service-type"
  1.2024 +             class="internalDFN">valid service type</a> of the service.
  1.2025 +        </p>
  1.2026 +        <p>
  1.2027 +          The <dfn id="dom-networkservice-url"><code>url</code></dfn> attribute is an <a href=
  1.2028 +          "http://www.w3.org/TR/html5/urls.html#absolute-url"
  1.2029 +             class="externalDFN">absolute <abbr title="Uniform Resource Locator">URL</abbr></a> pointing to the root
  1.2030 +             <abbr title="Hypertext Transfer Protocol">HTTP</abbr> endpoint for the service that has been added to the
  1.2031 +             <a href="#dfn-entry-script-origin-s-url-whitelist"
  1.2032 +             class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.2033 +             Web pages can subsequently use this value for implicit cross-document messaging via various existing
  1.2034 +             mechanisms (e.g. Web Sockets, Server-Sent Events, Web Messaging, XMLHttpRequest).
  1.2035 +        </p>
  1.2036 +        <p>
  1.2037 +          The <dfn id="dom-networkservice-config"><code>config</code></dfn> attribute provides the raw configuration
  1.2038 +          information extracted from the given network service.
  1.2039 +        </p>
  1.2040 +      </section>
  1.2041 +      <section id="states">
  1.2042 +        <h3>
  1.2043 +          <span class="secno">6.2</span> States
  1.2044 +        </h3>
  1.2045 +        <dl class="domintro">
  1.2046 +          <dt>
  1.2047 +            <var title="">service</var> . <code title="dom-networkservice-online"><a href=
  1.2048 +            "#dom-networkservice-online">online</a></code>
  1.2049 +          </dt>
  1.2050 +          <dd>
  1.2051 +            <p>
  1.2052 +              Returns <code>true</code> if the service is reporting that it is accessible on the local network or
  1.2053 +              <code>false</code> if the service is reporting that it is no longer accessible (temporarily or
  1.2054 +              permanently) on the local network.
  1.2055 +            </p>
  1.2056 +          </dd>
  1.2057 +        </dl>
  1.2058 +        <p>
  1.2059 +          The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is
  1.2060 +          reporting itself as being either <var>online</var>, and therefore accessible on the local network, in which
  1.2061 +          case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the
  1.2062 +          local network, either temporarily or permanently, in which case this attribute will return
  1.2063 +          <code>false</code>. This attribute <em class="ct"><em class="rfc2119"
  1.2064 +              title="must">must</em></em> default to <code>true</code>.
  1.2065 +        </p>
  1.2066 +      </section>
  1.2067 +      <section id="events-1">
  1.2068 +        <h3>
  1.2069 +          <span class="secno">6.3</span> Events
  1.2070 +        </h3>
  1.2071 +        <p>
  1.2072 +          The following are the event handlers (and their corresponding event handler event types) that <em class=
  1.2073 +          "ct"><em class="rfc2119"
  1.2074 +              title="must">must</em></em> be supported, as IDL attributes, by all objects implementing the <a href=
  1.2075 +              "#networkservice"><code>NetworkService</code></a> interface:
  1.2076 +        </p>
  1.2077 +        <table border="1"
  1.2078 +               summary="Event handlers for NetworkService objects">
  1.2079 +          <thead>
  1.2080 +            <tr>
  1.2081 +              <th>
  1.2082 +                <span title="event handlers">Event handler</span>
  1.2083 +              </th>
  1.2084 +              <th>
  1.2085 +                <span>Event handler event type</span>
  1.2086 +              </th>
  1.2087 +            </tr>
  1.2088 +          </thead>
  1.2089 +          <tbody>
  1.2090 +            <tr>
  1.2091 +              <td>
  1.2092 +                <dfn id="dom-networkservice-onnotify"
  1.2093 +                    title="dom-NetworkService-onnotify"><code>onnotify</code></dfn>
  1.2094 +              </td>
  1.2095 +              <td>
  1.2096 +                <a href="#event-notify"><code>notify</code></a>
  1.2097 +              </td>
  1.2098 +            </tr>
  1.2099 +            <tr>
  1.2100 +              <td>
  1.2101 +                <dfn id="dom-networkservice-onserviceonline"
  1.2102 +                    title="dom-NetworkService-onserviceonline"><code>onserviceonline</code></dfn>
  1.2103 +              </td>
  1.2104 +              <td>
  1.2105 +                <a href="#event-serviceonline"><code>serviceonline</code></a>
  1.2106 +              </td>
  1.2107 +            </tr>
  1.2108 +            <tr>
  1.2109 +              <td>
  1.2110 +                <dfn id="dom-networkservice-onserviceoffline"
  1.2111 +                    title="dom-NetworkService-onserviceoffline"><code>onserviceoffline</code></dfn>
  1.2112 +              </td>
  1.2113 +              <td>
  1.2114 +                <a href="#event-serviceoffline"><code>serviceoffline</code></a>
  1.2115 +              </td>
  1.2116 +            </tr>
  1.2117 +          </tbody>
  1.2118 +        </table>
  1.2119 +      </section>
  1.2120 +    </section>
  1.2121 +    <section id="service-discovery">
  1.2122 +      <h2>
  1.2123 +        <span class="secno">7.</span> Service Discovery
  1.2124 +      </h2>
  1.2125 +      <p>
  1.2126 +        A <a href="#dfn-user-agent"
  1.2127 +           class="internalDFN">user agent</a> conforming to this specification <em class="ct"><em class="rfc2119"
  1.2128 +            title="may">may</em></em> implement <acronym title="Simple Service Discovery Protocol"><abbr title=
  1.2129 +            "Simple Service Discovery Protocol">SSDP</abbr></acronym> [<cite><a class="bibref"
  1.2130 +           href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and Zeroconf [<cite><a class="bibref"
  1.2131 +           href="#bib-DNS-SD">DNS-SD</a></cite>] + [<cite><a class="bibref"
  1.2132 +           href="#bib-MDNS">MDNS</a></cite>] service discovery mechanisms to enable Web pages to request and connect
  1.2133 +           with <abbr title="Hypertext Transfer Protocol">HTTP</abbr> services running on networked devices, discovered
  1.2134 +           via either mechanism, through this <abbr title="Application Programming Interface">API</abbr>. When a
  1.2135 +           <a href="#dfn-user-agent"
  1.2136 +           class="internalDFN">user agent</a> implements either of these service discovery mechanisms, then it
  1.2137 +           <em class="ct"><em class="rfc2119"
  1.2138 +            title="must">must</em></em> conform to the corresponding algorithms provided in this section of the
  1.2139 +            specification.
  1.2140 +      </p>
  1.2141 +      <p>
  1.2142 +        This section presents how the results of these two service discovery mechanisms will be matched to requested
  1.2143 +        service types, how the user agent stores available and active services, how their properties are applied to any
  1.2144 +        resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
  1.2145 +      </p>
  1.2146 +      <p>
  1.2147 +        It is expected that user agents will perform these service discovery mechansisms asynchronously and
  1.2148 +        periodically update the <a>list of networked devices</a> as required. The timing of any service discovery
  1.2149 +        mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent
  1.2150 +        start-up, every X seconds during user agent execution or on invocation of this <abbr title=
  1.2151 +        "Application Programming Interface">API</abbr> from a Web page).
  1.2152 +      </p>
  1.2153 +      <p>
  1.2154 +        The <dfn id="dfn-list-of-available-service-records">list of available service records</dfn> is a single dynamic
  1.2155 +        internal lookup table within user agents that is used to track all the services that have been discovered and
  1.2156 +        are available in the current network at any given time. At any point during the running of either of the two
  1.2157 +        service discovery mechanisms then existing entries within this table can be updated, entries can be added and
  1.2158 +        entries can be removed as the status of networked services changes according to the rules defined in this
  1.2159 +        specification.
  1.2160 +      </p>
  1.2161 +      <p>
  1.2162 +        The <dfn id="dfn-list-of-authorized-service-records">list of authorized service records</dfn> is a single
  1.2163 +        dynamic internal lookup table within user agents that is used to track the current services that are being
  1.2164 +        shared with web pages at any given time from the <a href="#dfn-list-of-available-service-records"
  1.2165 +           class="internalDFN">list of available service records</a>. Each record in the <a href=
  1.2166 +           "#dfn-list-of-authorized-service-records"
  1.2167 +           class="internalDFN">list of authorized service records</a> is associated with a <var>services manager</var>
  1.2168 +           object that is assigned as part of the <a href=
  1.2169 +           "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
  1.2170 +      </p>
  1.2171 +      <p>
  1.2172 +        The rule for <dfn id="dfn-adding-an-available-service">adding an available service</dfn> is the process of
  1.2173 +        adding a new service or updating an existing service in the <a href="#dfn-list-of-available-service-records"
  1.2174 +           class="internalDFN">list of available service records</a> that is generally available on the user's current
  1.2175 +           network. This rule takes one argument, <var>network service record</var>, and consists of running the
  1.2176 +           following steps:
  1.2177 +      </p>
  1.2178 +      <ol class="rule">
  1.2179 +        <li>Let <var>new service registration flag</var> be <code>true</code>.
  1.2180 +        </li>
  1.2181 +        <li>For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records"
  1.2182 +              class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.2183 +          <ol class="rule">
  1.2184 +            <li>If the <var>existing service record</var>'s <code>id</code> property does not equal <var>network
  1.2185 +            service record</var>'s <code>id</code> property then abort any remaining sub-steps and continue at the next
  1.2186 +            available <var>existing service record</var>.
  1.2187 +            </li>
  1.2188 +            <li>Set <var>new service registration flag</var> to <code>false</code>.
  1.2189 +            </li>
  1.2190 +            <li>Replace the value of <var>existing service record</var> in the current <a href=
  1.2191 +            "#dfn-list-of-available-service-records"
  1.2192 +                  class="internalDFN">list of available service records</a> with the value of <var>network service
  1.2193 +                  record</var>.
  1.2194 +            </li>
  1.2195 +          </ol>
  1.2196 +        </li>
  1.2197 +        <li>If <var>new service registration flag</var> is set to <code>true</code> then add <var>network service
  1.2198 +        record</var> to the <a href="#dfn-list-of-available-service-records"
  1.2199 +              class="internalDFN">list of available service records</a> as a new entry.
  1.2200 +        </li>
  1.2201 +        <li>For each <var>active service</var> in the <a href="#dfn-list-of-authorized-service-records"
  1.2202 +              class="internalDFN">list of authorized service records</a> run the following steps:
  1.2203 +          <ol class="rule">
  1.2204 +            <li>If <var>network service record</var>'s <code>type</code> property does not equal the current
  1.2205 +            <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
  1.2206 +            <var>active service</var> and continue at the next available <var>active service</var>.
  1.2207 +            </li>
  1.2208 +            <li>If the <var>new service registration flag</var> is set to <code>true</code> then increment the
  1.2209 +              <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the
  1.2210 +              <var>services manager</var> associated with the current <var>active service</var> object by
  1.2211 +              <code>1</code> and then <a href=
  1.2212 +              "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2213 +                  class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.2214 +                  "#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href=
  1.2215 +                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2216 +                  class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
  1.2217 +                  has no default action, at the <var>services manager</var> associated with the current <var>active
  1.2218 +                  service</var> object.
  1.2219 +            </li>
  1.2220 +            <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute
  1.2221 +            to <code>true</code> and then <a href=
  1.2222 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2223 +                  class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.2224 +                  "#event-serviceonline"><code>serviceonline</code></a> that uses the <a href=
  1.2225 +                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2226 +                  class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
  1.2227 +                  has no default action, at the current <var>active service</var> object.
  1.2228 +            </li>
  1.2229 +          </ol>
  1.2230 +        </li>
  1.2231 +      </ol>
  1.2232 +      <p>
  1.2233 +        The rule for <dfn id="dfn-removing-an-available-service">removing an available service</dfn> is the general
  1.2234 +        process of removing a service from the <a href="#dfn-list-of-available-service-records"
  1.2235 +           class="internalDFN">list of available service records</a> that has left the user's current network or has
  1.2236 +           otherwise expired. This rule takes one argument, <var>service identifier</var>, and consists of running the
  1.2237 +           following steps:
  1.2238 +      </p>
  1.2239 +      <ol class="rule">
  1.2240 +        <li>For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records"
  1.2241 +              class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.2242 +          <ol class="rule">
  1.2243 +            <li>If the <var>existing service record</var>'s <code>id</code> property does not match <var>service
  1.2244 +            identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and
  1.2245 +            continue at the next available <var>existing service record</var>.
  1.2246 +            </li>
  1.2247 +            <li>If the <var>existing service record</var>'s <code>type</code> property begins with the DOMString
  1.2248 +            "<code>upnp:</code>" and <var>existing service record</var>'s <code>eventsURL</code> property is set then
  1.2249 +            run the rule to <a href="#dfn-terminate-an-existing-upnp-events-subscription"
  1.2250 +                  class="internalDFN">terminate an existing UPnP Events Subscription</a>, if one is currently active
  1.2251 +                  (as a result of having previously called <a href="#dfn-setup-a-upnp-events-subscription"
  1.2252 +                  class="internalDFN">setup a UPnP Events Subscription</a> against the current <var>existing service
  1.2253 +                  record</var>).
  1.2254 +            </li>
  1.2255 +            <li>For each <var>active service</var> in <a href="#dfn-list-of-authorized-service-records"
  1.2256 +                  class="internalDFN">list of authorized service records</a> run the following steps:
  1.2257 +              <ol class="rule">
  1.2258 +                <li>If <var>existing service record</var>'s <code>type</code> property does not equal the current <var>
  1.2259 +                  active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
  1.2260 +                  <var>active service</var> and continue at the next available <var>active service</var>.
  1.2261 +                </li>
  1.2262 +                <li>Decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
  1.2263 +                attribute of the <var>services manager</var> associated with the current <var>active service</var>
  1.2264 +                object by <code>1</code> and then <a href=
  1.2265 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2266 +                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.2267 +                      "#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the <a href=
  1.2268 +                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2269 +                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
  1.2270 +                      and has no default action, at the <var>services manager</var> associated with the current
  1.2271 +                      <var>active service</var> object.
  1.2272 +                </li>
  1.2273 +                <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
  1.2274 +                attribute to <code>false</code> and then <a href=
  1.2275 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2276 +                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.2277 +                      "#event-serviceoffline"><code>serviceoffline</code></a> that uses the <a href=
  1.2278 +                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2279 +                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
  1.2280 +                      and has no default action, at the current <var>active service</var> object.
  1.2281 +                </li>
  1.2282 +              </ol>
  1.2283 +            </li>
  1.2284 +            <li>Remove <var>existing service record</var> from the current <a href=
  1.2285 +            "#dfn-list-of-available-service-records"
  1.2286 +                  class="internalDFN">list of available service records</a>.
  1.2287 +            </li>
  1.2288 +          </ol>
  1.2289 +        </li>
  1.2290 +      </ol>
  1.2291 +      <p>
  1.2292 +        User agents <em class="ct"><em class="rfc2119"
  1.2293 +            title="should">should</em></em> expire a service record from the <a href=
  1.2294 +            "#dfn-list-of-available-service-records"
  1.2295 +           class="internalDFN">list of available service records</a> when its <code>expiryTimestamp</code> attribute
  1.2296 +           exceeds the current UTC timestamp. When this condition is met the <a href="#dfn-user-agent"
  1.2297 +           class="internalDFN">user agent</a> <em class="rfc2119"
  1.2298 +           title="should">should</em> run the rule for <a href="#dfn-removing-an-available-service"
  1.2299 +           class="internalDFN">removing an available service</a>, passing in the expired service record's
  1.2300 +           <code>id</code> attribute as the only argument.
  1.2301 +      </p>
  1.2302 +      <section id="zeroconf-mdns-dns-sd">
  1.2303 +        <h3>
  1.2304 +          <span class="secno">7.1</span> Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title=
  1.2305 +          "Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)
  1.2306 +        </h3>
  1.2307 +        <p>
  1.2308 +          For each <abbr title="Domain Name System">DNS</abbr> response received from a user-agent-initiated Multicast
  1.2309 +          <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records
  1.2310 +          with the name <code>_services._dns-sd._udp</code> on the resolved recommended automatic browsing domain
  1.2311 +          [<cite><a class="bibref"
  1.2312 +             href="#bib-MDNS">MDNS</a></cite>], the <a href="#dfn-user-agent"
  1.2313 +             class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2314 +              title="must">must</em></em> run the following steps:
  1.2315 +        </p>
  1.2316 +        <ol class="rule">
  1.2317 +          <li>Let <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var> be an array of <abbr title=
  1.2318 +          "DNS Pointer Record">PTR</abbr> records received by issuing a Multicast <abbr title=
  1.2319 +          "Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name
  1.2320 +          of the current discovered service type.
  1.2321 +          </li>
  1.2322 +          <li>For each Object <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> in <var>service
  1.2323 +          <abbr title="Multicast DNS">mDNS</abbr> responses</var>, run the following steps:
  1.2324 +            <ol>
  1.2325 +              <li>Let <var>network service record</var> be an Object consisting of the following empty properties:
  1.2326 +              <code>id</code>, <code>name</code>, <code>type</code>, <code>url</code>, <code>config</code>,
  1.2327 +              <code>expiryTimestamp</code>.
  1.2328 +              </li>
  1.2329 +              <li>Set <var>network service record</var>'s <code>id</code> property to the value of the full
  1.2330 +                <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name [<cite><a class="bibref"
  1.2331 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2332 +              </li>
  1.2333 +              <li>Set <var>network service record</var>'s <code>name</code> property to the value of the <abbr title=
  1.2334 +              "DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Instance</var> component [<cite><a class=
  1.2335 +              "bibref"
  1.2336 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2337 +              </li>
  1.2338 +              <li>Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string
  1.2339 +              <code>zeroconf:</code> followed be the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service
  1.2340 +              Instance Name's <var>Service</var> component [<cite><a class="bibref"
  1.2341 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2342 +              </li>
  1.2343 +              <li>Set <var>network service record</var>'s <code>url</code> property to the resolvable Service
  1.2344 +              <abbr title="Uniform Resource Locator">URL</abbr> obtained from performing an <abbr title=
  1.2345 +              "Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> Lookup [<cite><a class="bibref"
  1.2346 +                   href="#bib-DNS-SD">DNS-SD</a></cite>] of the current service from the <abbr title=
  1.2347 +                   "DNS Pointer Record">PTR</abbr> record provided [<cite><a class="bibref"
  1.2348 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2349 +              </li>
  1.2350 +              <li>Set <var>network service record</var>'s <code>config</code> property to the string value of the
  1.2351 +              contents of the first <abbr title="Domain Name System">DNS</abbr>-<abbr title=
  1.2352 +              "Service Discovery">SD</abbr> TXT record associated with the <var>service <abbr title=
  1.2353 +              "Multicast DNS">mDNS</abbr> response</var> as defined in [<cite><a class="bibref"
  1.2354 +                   href="#bib-DNS-SD">DNS-SD</a></cite>].
  1.2355 +              </li>
  1.2356 +              <li>Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the
  1.2357 +              current date, in UTC timestamp format, plus a value of <code>120</code> seconds.
  1.2358 +              </li>
  1.2359 +              <li>Run the general rule for <a href="#dfn-adding-an-available-service"
  1.2360 +                    class="internalDFN">adding an available service</a>, passing in the current <var>network service
  1.2361 +                    record</var> as the only argument.
  1.2362 +              </li>
  1.2363 +            </ol>
  1.2364 +          </li>
  1.2365 +        </ol>
  1.2366 +      </section>
  1.2367 +      <section id="simple-service-discovery-protocol-ssdp">
  1.2368 +        <h3>
  1.2369 +          <span class="secno">7.2</span> Simple Service Discovery Protocol (<abbr title=
  1.2370 +          "Simple Service Discovery Protocol">SSDP</abbr>)
  1.2371 +        </h3>
  1.2372 +        <p>
  1.2373 +          A user agent that implements UPnP service discovery <em class="ct"><em class="rfc2119"
  1.2374 +              title="must">must</em></em> issue an <dfn id="dfn-advertisement-for-upnp-root-devices">advertisement for
  1.2375 +              UPnP root devices</dfn> against the user's current local network according to the full normative text and
  1.2376 +              timing provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [<cite><a class="bibref"
  1.2377 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2378 +        </p>
  1.2379 +        <p>
  1.2380 +          The user agent <em class="ct"><em class="rfc2119"
  1.2381 +              title="must">must</em></em> issue all <a title="advertisement for UPnP root devices"
  1.2382 +             href="#dfn-advertisement-for-upnp-root-devices"
  1.2383 +             class="internalDFN">advertisements for UPnP root devices</a> with a <abbr title=
  1.2384 +             "Hypertext Transfer Protocol">HTTP</abbr> request line equal to <code>M-SEARCH * <abbr title=
  1.2385 +             "Hypertext Transfer Protocol">HTTP</abbr>/1.1</code>, with a HOST header equal to the reserved multicast
  1.2386 +             address and port of <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>,
  1.2387 +             an ST header equal to <code>upnp:rootdevice</code> and a user-agent defined MX header equal to a <dfn id=
  1.2388 +             "dfn-maximum-upnp-advertisement-response-wait-time">maximum UPnP advertisement response wait time</dfn>
  1.2389 +             value between <code>1</code> and <code>5</code> seconds.
  1.2390 +        </p>
  1.2391 +        <p>
  1.2392 +          The user agent <em class="ct"><em class="rfc2119"
  1.2393 +              title="must">must</em></em> listen for incoming requests and process any incoming responses to any
  1.2394 +              <a href="#dfn-advertisement-for-upnp-root-devices"
  1.2395 +             class="internalDFN">advertisement for UPnP root devices</a> on the <dfn id=
  1.2396 +             "dfn-standard-upnp-address-and-port">standard UPnP address and port</dfn>, on all current local network
  1.2397 +             interface addresses with the port <code>1900</code>, according to the rules defined in this section.
  1.2398 +        </p>
  1.2399 +        <p>
  1.2400 +          For each <dfn id="dfn-http-response"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</dfn>
  1.2401 +          following an initial <a href="#dfn-advertisement-for-upnp-root-devices"
  1.2402 +             class="internalDFN">advertisement for UPnP root devices</a> sent on a <a href=
  1.2403 +             "#dfn-standard-upnp-address-and-port"
  1.2404 +             class="internalDFN">standard UPnP address and port</a> the user agent <em class="ct"><em class="rfc2119"
  1.2405 +              title="must">must</em></em> run the following steps:
  1.2406 +        </p>
  1.2407 +        <ol class="rule">
  1.2408 +          <li>If the <a href="#dfn-http-response"
  1.2409 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is not a
  1.2410 +                <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK response then this response is invalid and
  1.2411 +                the user agent <em class="ct"><em class="rfc2119"
  1.2412 +                title="must">must</em></em> discard this response, abort any remaining steps and return. The user agent
  1.2413 +                <em class="ct"><em class="rfc2119"
  1.2414 +                title="may">may</em></em> issue a new <a href="#dfn-advertisement-for-upnp-root-devices"
  1.2415 +                class="internalDFN">advertisement for UPnP root devices</a> as a result of this error occurring.
  1.2416 +          </li>
  1.2417 +          <li>If the <a href="#dfn-maximum-upnp-advertisement-response-wait-time"
  1.2418 +                class="internalDFN">maximum UPnP advertisement response wait time</a> has been exceeded since the
  1.2419 +                initial <a href="#dfn-advertisement-for-upnp-root-devices"
  1.2420 +                class="internalDFN">advertisement for UPnP root devices</a> was sent then the <a href=
  1.2421 +                "#dfn-http-response"
  1.2422 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is invalid and
  1.2423 +                the user agent <em class="ct"><em class="rfc2119"
  1.2424 +                title="must">must</em></em> discard this response, abort any remaining steps and return.
  1.2425 +          </li>
  1.2426 +          <li>Let <var>ssdp device</var> be an Object with a property for each <abbr title=
  1.2427 +          "Hypertext Transfer Protocol">HTTP</abbr> header received in the <a href="#dfn-http-response"
  1.2428 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a>, with each key
  1.2429 +                being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> response header and each
  1.2430 +                value being that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> response header's value.
  1.2431 +          </li>
  1.2432 +          <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
  1.2433 +          <var>USN</var> entry, at least one <var>ST</var> entry and at least one <var>LOCATION</var> entry or the
  1.2434 +          value of its <var>ST</var> entry is not <code>upnp:rootdevice</code>, then the <a href="#dfn-http-response"
  1.2435 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is invalid and
  1.2436 +                the <a href="#dfn-user-agent"
  1.2437 +                class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2438 +                title="must">must</em></em> discard this response, abort any remaining steps and return.
  1.2439 +          </li>
  1.2440 +          <li>The user agent <em class="ct"><em class="rfc2119"
  1.2441 +                title="must">must</em></em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file"
  1.2442 +                class="internalDFN">obtaining a UPnP Device Description File</a> passing in the first occurrence of
  1.2443 +                <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor <abbr title=
  1.2444 +                "Uniform Resource Locator">URL</abbr></var> argument and the first occurrence of <var>USN</var> from
  1.2445 +                <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
  1.2446 +                <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var> argument.
  1.2447 +          </li>
  1.2448 +        </ol>
  1.2449 +        <p>
  1.2450 +          For each <dfn id="dfn-http-request"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</dfn>
  1.2451 +          received on a <a href="#dfn-standard-upnp-address-and-port"
  1.2452 +             class="internalDFN">standard UPnP address and port</a> the user agent <em class="ct"><em class="rfc2119"
  1.2453 +              title="must">must</em></em> run the following steps:
  1.2454 +        </p>
  1.2455 +        <ol class="rule">
  1.2456 +          <li>If the <a href="#dfn-http-request"
  1.2457 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a> is not a
  1.2458 +                <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request then it is not a valid UPnP
  1.2459 +                Request and the user agent <em class="ct"><em class="rfc2119"
  1.2460 +                title="must">must</em></em> return a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK
  1.2461 +                response, discard this request, abort any remaining steps and return.
  1.2462 +          </li>
  1.2463 +          <li>Let <var>ssdp device</var> be an Object with a property for each <abbr title=
  1.2464 +          "Hypertext Transfer Protocol">HTTP</abbr> header received in the <a href="#dfn-http-request"
  1.2465 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a>, with each key
  1.2466 +                being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header and each value being
  1.2467 +                that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header's value.
  1.2468 +          </li>
  1.2469 +          <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
  1.2470 +          <var>USN</var> entry, at least one <var>NT</var> entry, at least one <var>NTS</var> entry and at least one
  1.2471 +          <var>LOCATION</var> entry or the value of its <var>NT</var> entry is not <code>upnp:rootdevice</code>, then
  1.2472 +          the <a href="#dfn-http-request"
  1.2473 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a> is a malformed
  1.2474 +                UPnP Request and the <a href="#dfn-user-agent"
  1.2475 +                class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2476 +                title="must">must</em></em> return a 400 Bad Request response, discard this request, abort any
  1.2477 +                remaining steps and return.
  1.2478 +          </li>
  1.2479 +          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> or
  1.2480 +          <code>ssdp:update</code> then the user agent <em class="ct"><em class="rfc2119"
  1.2481 +                title="must">must</em></em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file"
  1.2482 +                class="internalDFN">obtaining a UPnP Device Description File</a> passing in the first occurrence of
  1.2483 +                <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor <abbr title=
  1.2484 +                "Uniform Resource Locator">URL</abbr></var> argument and the first occurrence of <var>USN</var> from
  1.2485 +                <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
  1.2486 +                <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var>.<br>
  1.2487 +            <br>
  1.2488 +            Otherwise, if <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:byebye</code> then the
  1.2489 +            user agent <em class="ct"><em class="rfc2119"
  1.2490 +                title="must">must</em></em> run the rule for <a href=
  1.2491 +                "#dfn-removing-all-services-from-a-registered-upnp-device"
  1.2492 +                class="internalDFN">removing all services from a registered UPnP Device</a> passing in the first
  1.2493 +                occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument.
  1.2494 +          </li>
  1.2495 +        </ol>
  1.2496 +        <p>
  1.2497 +          The rule for <dfn id="dfn-obtaining-a-upnp-device-description-file">obtaining a UPnP Device Description
  1.2498 +          File</dfn> is the process of obtaining the contents of a standard UPnP Device Description [<cite><a class=
  1.2499 +          "bibref"
  1.2500 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] from a <abbr title=
  1.2501 +             "Uniform Resource Locator">URL</abbr>-based resource. This rule takes three arguments - <var>device
  1.2502 +             descriptor <abbr title="Uniform Resource Locator">URL</abbr></var>, <var>device identifier</var> and
  1.2503 +             <var>device expiry</var> - and when called the user agent <em class="ct"><em class="rfc2119"
  1.2504 +              title="must">must</em></em> run the following steps:
  1.2505 +        </p>
  1.2506 +        <ol class="rule">
  1.2507 +          <li>Let <var>device descriptor file</var> contain the contents of the file located at the <abbr title=
  1.2508 +          "Uniform Resource Locator">URL</abbr> provided in <var>device descriptor <abbr title=
  1.2509 +          "Uniform Resource Locator">URL</abbr></var> obtained according to the rules defined in 'Section 2.11:
  1.2510 +          Retrieving a description using <abbr title="Hypertext Transfer Protocol">HTTP</abbr>' in [<cite><a class=
  1.2511 +          "bibref"
  1.2512 +               href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2513 +          </li>
  1.2514 +          <li>If the value provided in <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var>
  1.2515 +          cannot be resolved as a reachable <abbr title="Uniform Resource Locator">URL</abbr> on the current network or
  1.2516 +          the <var>root device descriptor file</var> remains empty then it is invalid and the <a href="#dfn-user-agent"
  1.2517 +                class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2518 +                title="must">must</em></em> abort any remaining steps and return.
  1.2519 +          </li>
  1.2520 +          <li>Run the rule for <a href="#dfn-processing-a-upnp-device-description-file"
  1.2521 +                class="internalDFN">processing a UPnP Device Description File</a>, passing in the current <var>device
  1.2522 +                descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> arguments.
  1.2523 +          </li>
  1.2524 +          <li>If the current <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then
  1.2525 +          for each <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an
  1.2526 +          <var>embedded device descriptor file</var> - the user agent <em class="ct"><em class="rfc2119"
  1.2527 +                title="must">must</em></em> run the rule for <a href="#dfn-processing-a-upnp-device-description-file"
  1.2528 +                class="internalDFN">processing a UPnP Device Description File</a>, passing in the current <var>embedded
  1.2529 +                device descriptor file</var> as the <var>device descriptor file</var> argument, along with the common
  1.2530 +                <var>device identifier</var> and <var>device expiry</var> arguments.
  1.2531 +          </li>
  1.2532 +        </ol>
  1.2533 +        <p>
  1.2534 +          The rule for <dfn id="dfn-processing-a-upnp-device-description-file">processing a UPnP Device Description
  1.2535 +          File</dfn> is the process of parsing the contents of a standard UPnP Device Description [<cite><a class=
  1.2536 +          "bibref"
  1.2537 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and registering the UPnP services contained
  1.2538 +             therein within the <a href="#dfn-list-of-available-service-records"
  1.2539 +             class="internalDFN">list of available service records</a>.
  1.2540 +        </p>
  1.2541 +        <p>
  1.2542 +          The rule for <a href="#dfn-processing-a-upnp-device-description-file"
  1.2543 +             class="internalDFN">processing a UPnP Device Description File</a> takes three arguments - <var>device
  1.2544 +             descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the
  1.2545 +             user agent <em class="ct"><em class="rfc2119"
  1.2546 +              title="must">must</em></em> run the following steps:
  1.2547 +        </p>
  1.2548 +        <ol class="rule">
  1.2549 +          <li>Let <var>advertised services</var> be a list of all advertised services obtained from the <var>device
  1.2550 +          descriptor file</var> containing the value of the first occurrence of the <code>&lt;serviceList&gt;</code>
  1.2551 +          element as it is defined in 'Section 2.3: Device Description' in [<cite><a class="bibref"
  1.2552 +               href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2553 +          </li>
  1.2554 +          <li>For each <code>&lt;service&gt;</code> element - known as an <var>advertised service</var> - in
  1.2555 +          <var>advertised services</var> run the following steps:
  1.2556 +            <ol class="rule">
  1.2557 +              <li>Let <var>network service record</var> be a new Object consisting of the following empty properties:
  1.2558 +              <code>id</code>, <code>deviceId</code>, <code>name</code>, <code>type</code>, <code>url</code>,
  1.2559 +              <code>eventsUrl</code>, <code>config</code>, <code>expiryTimestamp</code>.
  1.2560 +              </li>
  1.2561 +              <li>Set <var>network service record</var>'s <code>id</code> property to the concatenated string value of
  1.2562 +              <var>device identifier</var> with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code>
  1.2563 +              sub-element.
  1.2564 +              </li>
  1.2565 +              <li>Set <var>network service record</var>'s <code>deviceId</code> property to the value of <var>device
  1.2566 +              identifier</var>.
  1.2567 +              </li>
  1.2568 +              <li>Set <var>network service record</var>'s <code>name</code> property to the string value of the first
  1.2569 +              occurrence of the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code> sub-element.
  1.2570 +              </li>
  1.2571 +              <li>Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string
  1.2572 +              <code>upnp:</code> followed by the string value of the first occurrence of the <var>advertised
  1.2573 +              service</var>'s <code>&lt;serviceType&gt;</code> sub-element.
  1.2574 +              </li>
  1.2575 +              <li>Set <var>network service record</var>'s <code>url</code> property to the string value of the first
  1.2576 +              occurrence of the <var>advertised service</var>'s <code>&lt;controlURL&gt;</code> sub-element.
  1.2577 +              </li>
  1.2578 +              <li>Set <var>network service record</var>'s <code>config</code> property to the string value of the
  1.2579 +              contents of the first occurrence of the <code>&lt;device&gt;</code> element in the <var>device descriptor
  1.2580 +              file</var>.
  1.2581 +              </li>
  1.2582 +              <li>If <var>advertised service</var>'s <code>&lt;eventSubURL&gt;</code> sub-element is not empty, then
  1.2583 +              set <var>network service record</var>'s <code>eventsUrl</code> property to the string value of the first
  1.2584 +              occurrence of the <var>advertised service</var>'s <code>&lt;eventSubURL&gt;</code> sub-element.
  1.2585 +              Otherwise, do not set <var>network service record</var>'s <code>eventsUrl</code> property.
  1.2586 +              </li>
  1.2587 +              <li>Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the
  1.2588 +              current date, in UTC timestamp format, plus the value of <var>device expiry</var>.
  1.2589 +              </li>
  1.2590 +              <li>Run the general rule for <a href="#dfn-adding-an-available-service"
  1.2591 +                    class="internalDFN">adding an available service</a>, passing in the current <var>network service
  1.2592 +                    record</var> as the only argument.
  1.2593 +              </li>
  1.2594 +            </ol>
  1.2595 +          </li>
  1.2596 +        </ol>
  1.2597 +        <p>
  1.2598 +          The rule for <dfn id="dfn-removing-all-services-from-a-registered-upnp-device">removing all services from a
  1.2599 +          registered UPnP Device</dfn> is the process of removing all services associated with a device from the
  1.2600 +          <a href="#dfn-list-of-available-service-records"
  1.2601 +             class="internalDFN">list of available service records</a> that has left the user's current network or has
  1.2602 +             otherwise timed out or expired. This rule takes one argument, <var>device identifier</var>, and consists
  1.2603 +             of running the following steps:
  1.2604 +        </p>
  1.2605 +        <ol class="rule">
  1.2606 +          <li>For each <var>existing service record</var> in the current <a href=
  1.2607 +          "#dfn-list-of-available-service-records"
  1.2608 +                class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.2609 +            <ol class="rule">
  1.2610 +              <li>If the <var>existing service record</var>'s <code>deviceId</code> property does not match <var>device
  1.2611 +              identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and
  1.2612 +              continue at the next available <var>existing service record</var>.
  1.2613 +              </li>
  1.2614 +              <li>Run the general rule for <a href="#dfn-removing-an-available-service"
  1.2615 +                    class="internalDFN">removing an available service</a> passing in <var>existing service
  1.2616 +                    record</var>'s <code>id</code> property as the only argument.
  1.2617 +              </li>
  1.2618 +            </ol>
  1.2619 +          </li>
  1.2620 +        </ol>
  1.2621 +        <p>
  1.2622 +          When the <a href="#dfn-user-agent"
  1.2623 +             class="internalDFN">user agent</a> is to <dfn id="dfn-setup-a-upnp-events-subscription">setup a UPnP
  1.2624 +             Events Subscription</dfn>, it is to run the following steps with the current <var>network service
  1.2625 +             record</var> object as defined in 'Section 4.1.2: SUBSCRIBE with NT and CALLBACK' in [<cite><a class=
  1.2626 +             "bibref"
  1.2627 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>]:
  1.2628 +        </p>
  1.2629 +        <ol class="rule">
  1.2630 +          <li>If <var>network service record</var>'s <code>eventsUrl</code> property is empty then the <a href=
  1.2631 +          "#dfn-user-agent"
  1.2632 +                class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2633 +                title="must">must</em></em> abort these steps.
  1.2634 +          </li>
  1.2635 +          <li>Let <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> be the value of creating a new
  1.2636 +          <a href="#dfn-user-agent-generated-callback-url"
  1.2637 +                class="internalDFN">user-agent generated callback url</a>.
  1.2638 +          </li>
  1.2639 +          <li>Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>NT</em> header
  1.2640 +          with a string value of <code>upnp:event</code>, a <em>TIMEOUT</em> header with a user-agent defined timeout
  1.2641 +          value (in the form <code>Second-XX</code> where <code>XX</code> is the user-agent defined timeout value in
  1.2642 +          seconds) and a <em>CALLBACK</em> header with a string value of <var>callback <abbr title=
  1.2643 +          "Uniform Resource Locator">URL</abbr></var> towards the <var>network service record</var>'s
  1.2644 +          <code>eventsUrl</code> property.
  1.2645 +          </li>
  1.2646 +          <li>If a non-200 OK response is received from the <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
  1.2647 +          SUBSCRIBE request then the <a href="#dfn-user-agent"
  1.2648 +                class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2649 +                title="must">must</em></em> abort these steps.
  1.2650 +          </li>
  1.2651 +          <li>On receiving a valid 200 OK response, run the following steps:
  1.2652 +            <ol class="rule">
  1.2653 +              <li>Let <var>callback ID</var> equal the string value of the first included <em>SID</em> header, if it
  1.2654 +              exists.
  1.2655 +              </li>
  1.2656 +              <li>Let <var>timeout date</var> equal the sum of the current UTC date value plus the integer value of the
  1.2657 +              first included <em>TIMEOUT</em> header (minus the leading string of <code>Second-</code>), if it exists.
  1.2658 +              </li>
  1.2659 +              <li>Run the following steps aynchronously and continue to the step labeled <em>listen</em> below.
  1.2660 +              </li>
  1.2661 +              <li>
  1.2662 +                <em>Refresh Subscription</em>: Run the following steps at a set interval (X) within the <a href=
  1.2663 +                "#dfn-user-agent"
  1.2664 +                    class="internalDFN">user agent</a>:
  1.2665 +                <ol class="rule">
  1.2666 +                  <li>Let <var>current date</var> equal the current UTC date.
  1.2667 +                  </li>
  1.2668 +                  <li>If <var>current date</var> is less than the <var>timeout date</var> then continue to the step
  1.2669 +                  labeled <em>refresh subscription</em> above.
  1.2670 +                  </li>
  1.2671 +                  <li>Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a
  1.2672 +                  <em>SID</em> header with the string value of <var>callback ID</var> and a user-agent defined
  1.2673 +                  <em>TIMEOUT</em> header (in the form <code>Second-XX</code> where <code>XX</code> is the user-agent
  1.2674 +                  defined timeout value in seconds) towards the <var>network service record</var>'s
  1.2675 +                  <code>eventsUrl</code> property.
  1.2676 +                  </li>
  1.2677 +                  <li>On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first
  1.2678 +                  included <em>SID</em> header, if it exists. All other <abbr title=
  1.2679 +                  "Hypertext Transfer Protocol">HTTP</abbr> responses should cause the <a href="#dfn-user-agent"
  1.2680 +                        class="internalDFN">user agent</a> to continue from the step labeled <em>refresh
  1.2681 +                        subscription</em> above.
  1.2682 +                  </li>
  1.2683 +                </ol>
  1.2684 +              </li>
  1.2685 +              <li>
  1.2686 +                <em>Listen</em>: For each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request received
  1.2687 +                at the <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> the <a href=
  1.2688 +                "#dfn-user-agent"
  1.2689 +                    class="internalDFN">user agent</a> is to run the following steps:
  1.2690 +                <ol class="rule">
  1.2691 +                  <li>Let <var>content clone</var> be the result of obtaining the message body of the <abbr title=
  1.2692 +                  "Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request. If <var>content clone</var> is empty, then
  1.2693 +                  the <a href="#dfn-user-agent"
  1.2694 +                        class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.2695 +                        title="must">must</em></em> abort these steps.
  1.2696 +                  </li>
  1.2697 +                  <li>Let <var>notification event</var> be a new simple event that uses the <a href=
  1.2698 +                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2699 +                        class="externalDFN"><code>Event</code></a> interface with the name <a href=
  1.2700 +                        "#event-notify"><code>notify</code></a>, which does not bubble, is not cancellable, and has no
  1.2701 +                        default action.
  1.2702 +                  </li>
  1.2703 +                  <li>Let the <code>data</code> attribute of <var>notification event</var> have the DOMString value of
  1.2704 +                  <var>content clone</var>.
  1.2705 +                  </li>
  1.2706 +                  <li>
  1.2707 +                    <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2708 +                        class="externalDFN">Queue a task</a> to dispatch <var>notification event</var> at the current
  1.2709 +                        <a href="#networkservice"
  1.2710 +                        class="internalDFN"><code>NetworkService</code></a> object.
  1.2711 +                  </li>
  1.2712 +                </ol>
  1.2713 +              </li>
  1.2714 +            </ol>
  1.2715 +          </li>
  1.2716 +        </ol>
  1.2717 +        <p>
  1.2718 +          A <a href="#dfn-user-agent"
  1.2719 +             class="internalDFN">user agent</a> can <dfn id=
  1.2720 +             "dfn-terminate-an-existing-upnp-events-subscription">terminate an existing UPnP Events Subscription</dfn>
  1.2721 +             at any time for any <var>active service</var> in the <a href="#dfn-list-of-authorized-service-records"
  1.2722 +             class="internalDFN">list of authorized service records</a> by sending an <abbr title=
  1.2723 +             "Hypertext Transfer Protocol">HTTP</abbr> UNSUBSCRIBE request - as defined in 'Section 4.1.4: Canceling a
  1.2724 +             subscription with UNSUBSCRIBE' in [<cite><a class="bibref"
  1.2725 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] - with a HOST header set to that <var>active
  1.2726 +             service</var>'s <code>eventsUrl</code> property and a SID header set to the <var>callback ID</var>
  1.2727 +             obtained when the initial <a href="#dfn-setup-a-upnp-events-subscription"
  1.2728 +             class="internalDFN">setup a UPnP Events Subscription</a> action occurred.
  1.2729 +        </p>
  1.2730 +      </section>
  1.2731 +      <section id="network-topology-monitoring">
  1.2732 +        <h3>
  1.2733 +          <span class="secno">7.3</span> Network Topology Monitoring
  1.2734 +        </h3>
  1.2735 +        <div>
  1.2736            <p>
  1.2737 -            A unique identifier for the given user-selected service instance.
  1.2738 +            When the <a href="#dfn-user-agent"
  1.2739 +               class="internalDFN">user agent</a> detects that the user has dropped from their connected network then,
  1.2740 +               for each <var>existing service record</var> in the <a href="#dfn-list-of-available-service-records"
  1.2741 +               class="internalDFN">list of available service records</a>, the user agent <em class="ct"><em class=
  1.2742 +               "rfc2119"
  1.2743 +                title="must">must</em></em> run the general rule for <a href="#dfn-removing-an-available-service"
  1.2744 +               class="internalDFN">removing an available service</a> passing in each <var>existing service
  1.2745 +               record</var>'s <code>id</code> property as the only argument for each call.
  1.2746            </p>
  1.2747 -        </dd>
  1.2748 -        <dt>
  1.2749 -          <var title="">service</var>
  1.2750 -           .
  1.2751 -          <code title="dom-networkservice-name">
  1.2752 -            <a href="#dom-networkservice-name">name</a>
  1.2753 -          </code>
  1.2754 -        </dt>
  1.2755 -        <dd>
  1.2756            <p>
  1.2757 -            The name of the user-selected service.
  1.2758 +            When the <a href="#dfn-user-agent"
  1.2759 +               class="internalDFN">user agent</a> detects that the user has connected to a new network or reconnected
  1.2760 +               to an existing network, then it <em class="ct"><em class="rfc2119"
  1.2761 +                title="should">should</em></em> restart its discovery mechanisms as defined in the <a href=
  1.2762 +                "#service-discovery">Service Discovery</a> section of this specification, maintaining the existing
  1.2763 +                <a href="#dfn-list-of-authorized-service-records"
  1.2764 +               class="internalDFN">list of authorized service records</a> currently in use.
  1.2765            </p>
  1.2766 -        </dd>
  1.2767 -        <dt>
  1.2768 -          <var title="">service</var>
  1.2769 -           .
  1.2770 -          <code title="dom-networkservice-type">
  1.2771 -            <a href="#dom-networkservice-type">type</a>
  1.2772 -          </code>
  1.2773 -        </dt>
  1.2774 -        <dd>
  1.2775 -          <p>
  1.2776 -            The <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> token value of the user-selected service.
  1.2777 -          </p>
  1.2778 -        </dd>
  1.2779 -        <dt>
  1.2780 -          <var title="">service</var>
  1.2781 -           .
  1.2782 -          <code title="dom-networkservice-url">
  1.2783 -            <a href="#dom-networkservice-url">url</a>
  1.2784 -          </code>
  1.2785 -        </dt>
  1.2786 -        <dd>
  1.2787 -          <p>
  1.2788 -            The control <abbr title="Uniform Resource Locator">URL</abbr> endpoint (including any required port information) of the user-selected control service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.2789 -          </p>
  1.2790 -        </dd>
  1.2791 -        <dt>
  1.2792 -          <var title="">service</var>
  1.2793 -           .
  1.2794 -          <code title="dom-networkservice-config">
  1.2795 -            <a href="#dom-networkservice-config">config</a>
  1.2796 -          </code>
  1.2797 -        </dt>
  1.2798 -        <dd>
  1.2799 -          <p>
  1.2800 -            The configuration information associated with the service depending on the requested service type.
  1.2801 -          </p>
  1.2802 -        </dd>
  1.2803 -      </dl>
  1.2804 -
  1.2805 -          <p>
  1.2806 -            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service. The same service provided at different times or on different objects <em class="ct"><em class="rfc2119" title="must">must</em></em> have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
  1.2807 -         </p>
  1.2808 -
  1.2809 -         <p>
  1.2810 -            The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for the service.
  1.2811 -         </p>
  1.2812 -
  1.2813 -         <p>
  1.2814 -             The <dfn id="dom-networkservice-type"><code>type</code></dfn> attribute reflects the value of the <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> of the service.
  1.2815 -          </p>
  1.2816 -
  1.2817 -         <p>
  1.2818 -            The <dfn id="dom-networkservice-url"><code>url</code></dfn> attribute is an <a href="http://www.w3.org/TR/html5/urls.html#absolute-url" class="externalDFN">absolute <abbr title="Uniform Resource Locator">URL</abbr></a> pointing to the root <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
  1.2819 -            endpoint for the service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>. Web pages can subsequently use this value for implicit cross-document messaging via various existing mechanisms (e.g. Web Sockets, Server-Sent Events, Web Messaging, XMLHttpRequest).
  1.2820 -         </p>
  1.2821 -
  1.2822 -         <p>
  1.2823 -            The <dfn id="dom-networkservice-config"><code>config</code></dfn> attribute provides the raw configuration information extracted from the given network service.
  1.2824 -         </p>
  1.2825 -
  1.2826 +        </div>
  1.2827        </section>
  1.2828 -
  1.2829 -      <section id="states">
  1.2830 -         <h3><span class="secno">6.2 </span>States</h3>
  1.2831 -
  1.2832 -      <dl class="domintro">
  1.2833 -        <dt>
  1.2834 -          <var title="">service</var>
  1.2835 -           .
  1.2836 -          <code title="dom-networkservice-online">
  1.2837 -            <a href="#dom-networkservice-online">online</a>
  1.2838 -          </code>
  1.2839 -        </dt>
  1.2840 -        <dd>
  1.2841 -          <p>
  1.2842 -            Returns <code>true</code> if the service is reporting that it is accessible on the local network or <code>false</code> if the service is reporting that it is no longer accessible (temporarily or permanently) on the local network.
  1.2843 -          </p>
  1.2844 -        </dd>
  1.2845 -      </dl>
  1.2846 -
  1.2847 +    </section>
  1.2848 +    <section id="events-summary">
  1.2849 +      <h2>
  1.2850 +        <span class="secno">8.</span> Events Summary
  1.2851 +      </h2>
  1.2852        <p>
  1.2853 -        The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
  1.2854 -        either <var>online</var>, and therefore accessible on the local network, in which case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the local network, either temporarily or permanently, in which case this attribute will return <code>false</code>. This attribute <em class="ct"><em class="rfc2119" title="must">must</em></em> default to <code>true</code>.
  1.2855 +        The following events are dispatched on the <a href="#networkservices"><code>NetworkServices</code></a> and/or
  1.2856 +        <a href="#networkservice"><code>NetworkService</code></a> objects:
  1.2857        </p>
  1.2858 -
  1.2859 -      </section>
  1.2860 -
  1.2861 -      <section id="events-1">
  1.2862 -         <h3><span class="secno">6.3 </span>Events</h3>
  1.2863 -
  1.2864 -      <p>
  1.2865 -         The following are the event handlers (and their corresponding event handler event types) that <em class="ct"><em class="rfc2119" title="must">must</em></em> be supported, as IDL attributes, by all objects implementing the
  1.2866 -         <a href="#networkservice"><code>NetworkService</code></a> interface:
  1.2867 -       </p>
  1.2868 -
  1.2869 -       <table border="1">
  1.2870 +      <table border="1"
  1.2871 +             summary="Events Summary table">
  1.2872          <thead>
  1.2873            <tr>
  1.2874              <th>
  1.2875 -              <span title="event handlers">Event handler</span>
  1.2876 -            </th>
  1.2877 -            <th>
  1.2878 -              <span>Event handler event type</span>
  1.2879 -            </th>
  1.2880 -          </tr>
  1.2881 -        </thead>
  1.2882 -        <tbody>
  1.2883 -          <tr>
  1.2884 -            <td>
  1.2885 -              <dfn id="dom-networkservice-onnotify" title="dom-NetworkService-onnotify">
  1.2886 -                <code>onnotify</code>
  1.2887 -              </dfn>
  1.2888 -            </td>
  1.2889 -            <td>
  1.2890 -              <a href="#event-notify"><code>notify</code></a>
  1.2891 -            </td>
  1.2892 -          </tr>
  1.2893 -          <tr>
  1.2894 -            <td>
  1.2895 -              <dfn id="dom-networkservice-onserviceonline" title="dom-NetworkService-onserviceonline">
  1.2896 -                <code>onserviceonline</code>
  1.2897 -              </dfn>
  1.2898 -            </td>
  1.2899 -            <td>
  1.2900 -              <a href="#event-serviceonline"><code>serviceonline</code></a>
  1.2901 -            </td>
  1.2902 -          </tr>
  1.2903 -          <tr>
  1.2904 -            <td>
  1.2905 -              <dfn id="dom-networkservice-onserviceoffline" title="dom-NetworkService-onserviceoffline">
  1.2906 -                <code>onserviceoffline</code>
  1.2907 -              </dfn>
  1.2908 -            </td>
  1.2909 -            <td>
  1.2910 -              <a href="#event-serviceoffline"><code>serviceoffline</code></a>
  1.2911 -            </td>
  1.2912 -          </tr>
  1.2913 -        </tbody>
  1.2914 -      </table>
  1.2915 -
  1.2916 -      </section>
  1.2917 -   </section>
  1.2918 -
  1.2919 -      <section id="service-discovery">
  1.2920 -            <!--OddPage--><h2><span class="secno">7. </span>Service Discovery</h2>
  1.2921 -
  1.2922 -      <p>
  1.2923 -         A <a href="#dfn-user-agent" class="internalDFN">user agent</a> conforming to this specification <em class="ct"><em class="rfc2119" title="may">may</em></em> implement <acronym title="Simple Service Discovery Protocol"><abbr title="Simple Service Discovery Protocol">SSDP</abbr></acronym> [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and Zeroconf [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>] + [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>] service discovery mechanisms
  1.2924 -         to enable Web pages to request and connect with <abbr title="Hypertext Transfer Protocol">HTTP</abbr> services running on networked devices, discovered via either mechanism, through this <abbr title="Application Programming Interface">API</abbr>. When a <a href="#dfn-user-agent" class="internalDFN">user agent</a> implements either of these service discovery mechanisms, then it <em class="ct"><em class="rfc2119" title="must">must</em></em> conform to the corresponding algorithms provided in this section of the specification.
  1.2925 -      </p>
  1.2926 -      <p>
  1.2927 -         This section presents how the results of these two service discovery
  1.2928 -         mechanisms will be matched to requested service types, how the user agent stores available and active services, how their properties are applied to any resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
  1.2929 -      </p>
  1.2930 -
  1.2931 -      <p>
  1.2932 -         It is expected that user agents will perform these service discovery mechansisms asynchronously and periodically update the <a>list of networked devices</a> as required. The timing of any
  1.2933 -         service discovery mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent start-up, every X seconds during user agent execution or on
  1.2934 -         invocation of this <abbr title="Application Programming Interface">API</abbr> from a Web page).
  1.2935 -      </p>
  1.2936 -
  1.2937 -      <p>
  1.2938 -         The <dfn id="dfn-list-of-available-service-records">list of available service records</dfn> is a single dynamic internal lookup table within user agents that is used to track all the  services that have been discovered and are available in the current network at any given time.
  1.2939 -         At any point during the running of either of the two service discovery mechanisms then existing entries within this table can be updated, entries can be added and entries can be removed as the status of networked
  1.2940 -         services changes according to the rules defined in this specification.
  1.2941 -      </p>
  1.2942 -
  1.2943 -      <p>
  1.2944 -        The <dfn id="dfn-list-of-authorized-service-records">list of authorized service records</dfn> is a single dynamic internal lookup table within user agents that is used to track the
  1.2945 -        current services that are being shared with web pages at any given time from the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>. Each record in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> is associated with a <var>services manager</var> object that is assigned as part of the
  1.2946 -         <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
  1.2947 -      </p>
  1.2948 -
  1.2949 -      <p>
  1.2950 -        The rule for <dfn id="dfn-adding-an-available-service">adding an available service</dfn> is the process of adding a new service or updating an existing service in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> that is generally available on the user's current network. This rule takes one argument, <var>network service record</var>, and consists of
  1.2951 -        running the following steps:
  1.2952 -      </p>
  1.2953 -
  1.2954 -      <ol class="rule">
  1.2955 -
  1.2956 -        <li>
  1.2957 -          Let <var>new service registration flag</var> be <code>true</code>.
  1.2958 -        </li>
  1.2959 -
  1.2960 -        <li>
  1.2961 -           For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.2962 -           <ol class="rule">
  1.2963 -
  1.2964 -             <li>
  1.2965 -              If the <var>existing service record</var>'s <code>id</code> property does not equal <var>network service record</var>'s <code>id</code>
  1.2966 -               property then abort any remaining sub-steps and continue at the next available <var>existing service record</var>.
  1.2967 -             </li>
  1.2968 -
  1.2969 -             <li>
  1.2970 -              Set <var>new service registration flag</var> to <code>false</code>.
  1.2971 -             </li>
  1.2972 -
  1.2973 -             <li>
  1.2974 -               Replace the value of <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> with the value of
  1.2975 -              <var>network service record</var>.
  1.2976 -             </li>
  1.2977 -           </ol>
  1.2978 -        </li>
  1.2979 -
  1.2980 -        <li>
  1.2981 -           If <var>new service registration flag</var> is set to <code>true</code> then add <var>network service record</var> to the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> as a new entry.
  1.2982 -        </li>
  1.2983 -
  1.2984 -        <li>
  1.2985 -          For each <var>active service</var> in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> run the following steps:
  1.2986 -
  1.2987 -          <ol class="rule">
  1.2988 -
  1.2989 -            <li>
  1.2990 -               If <var>network service record</var>'s <code>type</code> property does not equal the current <var>active service</var>'s
  1.2991 -                <code>type</code> attribute then abort any remaining sub-steps for this <var>active service</var> and continue at the next available <var>active service</var>.
  1.2992 -            </li>
  1.2993 -
  1.2994 -            <li>
  1.2995 -               If the <var>new service registration flag</var> is set to <code>true</code> then increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <var>services manager</var> associated with
  1.2996 -               the current <var>active service</var>
  1.2997 -                object by <code>1</code> and then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.2998 -                 to dispatch a newly created event with the name <a href="#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface,
  1.2999 -                 which does not bubble, is not cancellable, and has no default action, at the <var>services manager</var> associated with
  1.3000 -                 the current <var>active service</var> object.
  1.3001 -            </li>
  1.3002 -
  1.3003 -            <li>
  1.3004 -               Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute to <code>true</code> and then
  1.3005 -               <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.3006 -                to dispatch a newly created event with the name <a href="#event-serviceonline"><code>serviceonline</code></a> that uses the
  1.3007 -                <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface, which
  1.3008 -                 does not bubble, is not cancellable, and has no default action, at the current
  1.3009 -                <var>active service</var> object.
  1.3010 -            </li>
  1.3011 -
  1.3012 -          </ol>
  1.3013 -
  1.3014 -        </li>
  1.3015 -
  1.3016 -      </ol>
  1.3017 -
  1.3018 -
  1.3019 -      <p>
  1.3020 -        The rule for <dfn id="dfn-removing-an-available-service">removing an available service</dfn> is the general process of removing a service from the
  1.3021 -        <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>
  1.3022 -         that has left the user's current network or has otherwise expired. This rule takes one argument, <var>service identifier</var>, and consists of running the following steps:</p>
  1.3023 -
  1.3024 -      <ol class="rule">
  1.3025 -
  1.3026 -        <li>
  1.3027 -           For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.3028 -           <ol class="rule">
  1.3029 -
  1.3030 -             <li>
  1.3031 -              If the <var>existing service record</var>'s <code>id</code> property does not match <var>service identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and continue at the next available <var>existing service record</var>.
  1.3032 -             </li>
  1.3033 -
  1.3034 -             <li>
  1.3035 -               If the <var>existing service record</var>'s <code>type</code> property begins with the DOMString "<code>upnp:</code>" and
  1.3036 -               <var>existing service record</var>'s <code>eventsURL</code> property is set then run the rule to
  1.3037 -               <a href="#dfn-terminate-an-existing-upnp-events-subscription" class="internalDFN">terminate an existing UPnP Events Subscription</a>, if one is currently active (as a result of having previously called
  1.3038 -               <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a UPnP Events Subscription</a> against the current <var>existing service record</var>).
  1.3039 -             </li>
  1.3040 -
  1.3041 -             <li>
  1.3042 -               For each <var>active service</var> in <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> run the following steps:
  1.3043 -
  1.3044 -               <ol class="rule">
  1.3045 -
  1.3046 -                 <li>
  1.3047 -                    If <var>existing service record</var>'s <code>type</code> property does not equal the current <var>active service</var>'s
  1.3048 -                     <code>type</code> attribute then abort any remaining sub-steps for this <var>active service</var> and continue at the next available <var>active service</var>.
  1.3049 -                 </li>
  1.3050 -
  1.3051 -                 <li>
  1.3052 -                    Decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the
  1.3053 -                    <var>services manager</var> associated with the current <var>active service</var>
  1.3054 -                     object by <code>1</code> and then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.3055 -                      to dispatch a newly created event with the name <a href="#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the
  1.3056 -                      <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface,
  1.3057 -                      which does not bubble, is not cancellable, and has no default action, at the <var>services manager</var> associated with
  1.3058 -                      the current <var>active service</var> object.
  1.3059 -                 </li>
  1.3060 -
  1.3061 -                 <li>
  1.3062 -                    Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute to <code>false</code> and then
  1.3063 -                    <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.3064 -                     to dispatch a newly created event with the name <a href="#event-serviceoffline"><code>serviceoffline</code></a> that uses the
  1.3065 -                     <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface, which
  1.3066 -                      does not bubble, is not cancellable, and has no default action, at the current
  1.3067 -                     <var>active service</var> object.
  1.3068 -                 </li>
  1.3069 -
  1.3070 -               </ol>
  1.3071 -
  1.3072 -             </li>
  1.3073 -
  1.3074 -             <li>
  1.3075 -               Remove <var>existing service record</var> from the current <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>.
  1.3076 -             </li>
  1.3077 -
  1.3078 -           </ol>
  1.3079 -        </li>
  1.3080 -
  1.3081 -      </ol>
  1.3082 -
  1.3083 -      <p>
  1.3084 -       User agents <em class="ct"><em class="rfc2119" title="should">should</em></em> expire a service record from the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> when its
  1.3085 -       <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this condition is met the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="should">should</em>
  1.3086 -       run the rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a>, passing in the expired service record's <code>id</code> attribute as the
  1.3087 -       only argument.
  1.3088 -      </p>
  1.3089 -
  1.3090 -
  1.3091 -      <section id="zeroconf-mdns-dns-sd">
  1.3092 -         <h3><span class="secno">7.1 </span>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</h3>
  1.3093 -
  1.3094 -         <p>
  1.3095 -            For each <abbr title="Domain Name System">DNS</abbr> response received from a user-agent-initiated Multicast <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name <code>_services._dns-sd._udp</code> on the resolved recommended automatic browsing
  1.3096 -   domain [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>], the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> run the following steps:
  1.3097 -         </p>
  1.3098 -
  1.3099 -         <ol class="rule">
  1.3100 -
  1.3101 -            <li>Let <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var> be an array of <abbr title="DNS Pointer Record">PTR</abbr> records received by issuing a Multicast <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name of the current discovered service type.</li>
  1.3102 -
  1.3103 -            <li>For each Object <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> in <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var>, run the following steps:
  1.3104 -               <ol>
  1.3105 -
  1.3106 -                  <li>
  1.3107 -                     Let <var>network service record</var> be an Object consisting of the following empty properties: <code>id</code>, <code>name</code>, <code>type</code>, <code>url</code>, <code>config</code>, <code>expiryTimestamp</code>.
  1.3108 -                  </li>
  1.3109 -
  1.3110 -                  <li>
  1.3111 -                     Set <var>network service record</var>'s <code>id</code> property to the value of the full <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.3112 -                  </li>
  1.3113 -
  1.3114 -                  <li>
  1.3115 -                     Set <var>network service record</var>'s <code>name</code> property to the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Instance</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.3116 -                  </li>
  1.3117 -
  1.3118 -                  <li>
  1.3119 -                     Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string <code>zeroconf:</code> followed be the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Service</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.3120 -                  </li>
  1.3121 -
  1.3122 -                  <li>
  1.3123 -                     Set <var>network service record</var>'s <code>url</code> property to the resolvable Service <abbr title="Uniform Resource Locator">URL</abbr> obtained from performing an <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> Lookup [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>] of the current service from the <abbr title="DNS Pointer Record">PTR</abbr> record provided [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.3124 -                  </li>
  1.3125 -
  1.3126 -                  <li>
  1.3127 -                     Set <var>network service record</var>'s <code>config</code> property to the string value of the contents of the first <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> TXT record associated with the <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> as defined in [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>].
  1.3128 -                  </li>
  1.3129 -
  1.3130 -                  <li>
  1.3131 -                     Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the current date, in UTC timestamp format, plus a value of <code>120</code> seconds.
  1.3132 -                  </li>
  1.3133 -
  1.3134 -                  <li>
  1.3135 -                     Run the general rule for <a href="#dfn-adding-an-available-service" class="internalDFN">adding an available service</a>, passing in the current <var>network service record</var> as the
  1.3136 -                     only argument.
  1.3137 -                  </li>
  1.3138 -
  1.3139 -            </ol>
  1.3140 -           </li>
  1.3141 -         </ol>
  1.3142 -
  1.3143 -      </section>
  1.3144 -
  1.3145 -      <section id="simple-service-discovery-protocol-ssdp">
  1.3146 -         <h3><span class="secno">7.2 </span>Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)</h3>
  1.3147 -
  1.3148 -         <p>
  1.3149 -          A user agent that implements UPnP service discovery <em class="ct"><em class="rfc2119" title="must">must</em></em> issue an <dfn id="dfn-advertisement-for-upnp-root-devices">advertisement for UPnP root devices</dfn> against the user's
  1.3150 -          current local network according to the full normative text and timing provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.3151 -          </p>
  1.3152 -
  1.3153 -          <p>
  1.3154 -            The user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> issue all <a title="advertisement for UPnP root devices" href="#dfn-advertisement-for-upnp-root-devices" class="internalDFN">advertisements for UPnP root devices</a> with a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> request line equal to <code>M-SEARCH * <abbr title="Hypertext Transfer Protocol">HTTP</abbr>/1.1</code>, with a HOST header equal to the reserved multicast address and port of <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>, an ST header equal to <code>upnp:rootdevice</code> and a user-agent defined MX header equal to a <dfn id="dfn-maximum-upnp-advertisement-response-wait-time">maximum UPnP advertisement response wait time</dfn> value between <code>1</code> and <code>5</code> seconds.
  1.3155 -         </p>
  1.3156 -
  1.3157 -         <p>
  1.3158 -          The user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> listen for incoming requests and process any incoming responses to any <a href="#dfn-advertisement-for-upnp-root-devices" class="internalDFN">advertisement for UPnP root devices</a> on the <dfn id="dfn-standard-upnp-address-and-port">standard UPnP address and port</dfn>, on all current local network interface addresses with the port <code>1900</code>, according to the rules defined in this section.
  1.3159 -         </p>
  1.3160 -
  1.3161 -         <p>
  1.3162 -          For each <dfn id="dfn-http-response"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</dfn> following an initial <a href="#dfn-advertisement-for-upnp-root-devices" class="internalDFN">advertisement for UPnP root devices</a> sent on a <a href="#dfn-standard-upnp-address-and-port" class="internalDFN">standard UPnP address
  1.3163 -            and port</a> the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the following steps:
  1.3164 -         </p>
  1.3165 -
  1.3166 -         <ol class="rule">
  1.3167 -          <li>
  1.3168 -            If the <a href="#dfn-http-response" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is not a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK response then this response is invalid and the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> discard this response, abort any remaining steps and return. The user agent <em class="ct"><em class="rfc2119" title="may">may</em></em> issue a new <a href="#dfn-advertisement-for-upnp-root-devices" class="internalDFN">advertisement for UPnP root devices</a> as a result of this error occurring.
  1.3169 -          </li>
  1.3170 -
  1.3171 -          <li>
  1.3172 -            If the <a href="#dfn-maximum-upnp-advertisement-response-wait-time" class="internalDFN">maximum UPnP advertisement response wait time</a> has been exceeded since the initial <a href="#dfn-advertisement-for-upnp-root-devices" class="internalDFN">advertisement for UPnP root devices</a> was sent then the <a href="#dfn-http-response" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is invalid and the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> discard this response, abort any remaining steps and return.
  1.3173 -          </li>
  1.3174 -
  1.3175 -          <li>
  1.3176 -             Let <var>ssdp device</var> be an Object with a property for each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header received in the <a href="#dfn-http-response" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a>, with each key being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> response header and each value being that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> response header's value.
  1.3177 -          </li>
  1.3178 -
  1.3179 -          <li>
  1.3180 -            If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one <var>USN</var> entry, at least one <var>ST</var> entry and at least one <var>LOCATION</var> entry or the value of its <var>ST</var> entry is not <code>upnp:rootdevice</code>, then the <a href="#dfn-http-response" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is invalid and the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> discard this response, abort any remaining steps and return.
  1.3181 -          </li>
  1.3182 -
  1.3183 -          <li>
  1.3184 -            The user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file" class="internalDFN">obtaining a UPnP Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var> argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var> argument.
  1.3185 -          </li>
  1.3186 -
  1.3187 -        </ol>
  1.3188 -
  1.3189 -        <p>
  1.3190 -          For each <dfn id="dfn-http-request"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</dfn> received on a <a href="#dfn-standard-upnp-address-and-port" class="internalDFN">standard UPnP address and port</a> the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the following steps:
  1.3191 -         </p>
  1.3192 -
  1.3193 -        <ol class="rule">
  1.3194 -
  1.3195 -          <li>
  1.3196 -            If the <a href="#dfn-http-request" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a> is not a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request then it is not a valid UPnP Request and the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> return a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK response, discard this request, abort any remaining steps and return.
  1.3197 -          </li>
  1.3198 -
  1.3199 -          <li>
  1.3200 -             Let <var>ssdp device</var> be an Object with a property for each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header received in the <a href="#dfn-http-request" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a>, with each key being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header and each value being that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header's value.
  1.3201 -          </li>
  1.3202 -
  1.3203 -          <li>
  1.3204 -            If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one <var>USN</var> entry, at least one <var>NT</var> entry, at least one <var>NTS</var> entry and at least one <var>LOCATION</var> entry or the value of its <var>NT</var> entry is not <code>upnp:rootdevice</code>, then the <a href="#dfn-http-request" class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a> is a malformed UPnP Request and the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> return a 400 Bad Request response, discard this request, abort any remaining steps and return.
  1.3205 -          </li>
  1.3206 -
  1.3207 -          <li>
  1.3208 -            If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> or <code>ssdp:update</code> then the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file" class="internalDFN">obtaining a UPnP Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var> argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var>. <br><br>Otherwise, if <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:byebye</code> then the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the rule for <a href="#dfn-removing-all-services-from-a-registered-upnp-device" class="internalDFN">removing all services from a registered UPnP Device</a> passing in the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument.
  1.3209 -          </li>
  1.3210 -
  1.3211 -        </ol>
  1.3212 -
  1.3213 -      <p>
  1.3214 -        The rule for <dfn id="dfn-obtaining-a-upnp-device-description-file">obtaining a UPnP Device Description File</dfn> is the process of obtaining the contents of a standard UPnP Device Description [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] from a <abbr title="Uniform Resource Locator">URL</abbr>-based resource. This rule takes three arguments - <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the following steps:
  1.3215 -      </p>
  1.3216 -
  1.3217 -      <ol class="rule">
  1.3218 -
  1.3219 -          <li>
  1.3220 -             Let <var>device descriptor file</var> contain the contents of the file located at the <abbr title="Uniform Resource Locator">URL</abbr> provided in <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var> obtained according to the rules
  1.3221 -             defined in 'Section 2.11: Retrieving a description using <abbr title="Hypertext Transfer Protocol">HTTP</abbr>' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.3222 -          </li>
  1.3223 -
  1.3224 -          <li>
  1.3225 -            If the value provided in <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var> cannot be resolved as a reachable <abbr title="Uniform Resource Locator">URL</abbr> on the current network or the <var>root device descriptor file</var> remains empty then it is invalid and the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> abort any remaining steps and return.
  1.3226 -          </li>
  1.3227 -
  1.3228 -          <li>
  1.3229 -            Run the rule for <a href="#dfn-processing-a-upnp-device-description-file" class="internalDFN">processing a UPnP Device Description File</a>, passing in the current <var>device descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> arguments.
  1.3230 -          </li>
  1.3231 -
  1.3232 -          <li>
  1.3233 -            If the current <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then for each <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an <var>embedded device descriptor file</var> - the user agent <em class="ct"><em class="rfc2119" title="must">must</em></em>
  1.3234 -            run the rule for <a href="#dfn-processing-a-upnp-device-description-file" class="internalDFN">processing a UPnP Device Description File</a>, passing in the current <var>embedded device descriptor file</var> as the <var>device descriptor file</var> argument, along with the common <var>device identifier</var> and <var>device expiry</var> arguments.
  1.3235 -          </li>
  1.3236 -
  1.3237 -      </ol>
  1.3238 -
  1.3239 -      <p>
  1.3240 -        The rule for <dfn id="dfn-processing-a-upnp-device-description-file">processing a UPnP Device Description File</dfn> is the process of parsing the contents of a standard UPnP Device Description [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and
  1.3241 -        registering the UPnP services contained therein within the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>.
  1.3242 -      </p>
  1.3243 -
  1.3244 -      <p>The rule for <a href="#dfn-processing-a-upnp-device-description-file" class="internalDFN">processing a UPnP Device Description File</a> takes three arguments - <var>device descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user
  1.3245 -         agent <em class="ct"><em class="rfc2119" title="must">must</em></em> run the following steps:</p>
  1.3246 -
  1.3247 -      <ol class="rule">
  1.3248 -
  1.3249 -          <li>
  1.3250 -             Let <var>advertised services</var> be a list of all advertised services obtained from the <var>device descriptor file</var> containing the value of the first occurrence of the <code>&lt;serviceList&gt;</code> element as it is defined in 'Section 2.3: Device Description' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.3251 -          </li>
  1.3252 -
  1.3253 -          <li>
  1.3254 -             For each <code>&lt;service&gt;</code> element - known as an <var>advertised service</var> - in <var>advertised services</var> run the following steps:
  1.3255 -
  1.3256 -             <ol class="rule">
  1.3257 -
  1.3258 -                <li>
  1.3259 -                   Let <var>network service record</var> be a new Object consisting of the following empty properties: <code>id</code>, <code>deviceId</code>, <code>name</code>, <code>type</code>, <code>url</code>, <code>eventsUrl</code>, <code>config</code>, <code>expiryTimestamp</code>.
  1.3260 -                </li>
  1.3261 -
  1.3262 -                <li>
  1.3263 -                   Set <var>network service record</var>'s <code>id</code> property to the concatenated string value of <var>device identifier</var> with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code> sub-element.
  1.3264 -                </li>
  1.3265 -
  1.3266 -                <li>
  1.3267 -                   Set <var>network service record</var>'s <code>deviceId</code> property to the value of <var>device identifier</var>.
  1.3268 -                </li>
  1.3269 -
  1.3270 -                <li>
  1.3271 -                   Set <var>network service record</var>'s <code>name</code> property to the string value of the first occurrence of the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code> sub-element.
  1.3272 -                </li>
  1.3273 -
  1.3274 -                <li>
  1.3275 -                   Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string <code>upnp:</code> followed by the string value of the first occurrence of the <var>advertised service</var>'s <code>&lt;serviceType&gt;</code> sub-element.
  1.3276 -                </li>
  1.3277 -
  1.3278 -                <li>
  1.3279 -                   Set <var>network service record</var>'s <code>url</code> property to the string value of the first occurrence of the <var>advertised service</var>'s <code>&lt;controlURL&gt;</code> sub-element.
  1.3280 -                </li>
  1.3281 -
  1.3282 -                <li>
  1.3283 -                   Set <var>network service record</var>'s <code>config</code> property to the string value of the contents of the first occurrence of the <code>&lt;device&gt;</code> element in the <var>device descriptor file</var>.
  1.3284 -                </li>
  1.3285 -
  1.3286 -                <li>
  1.3287 -                   If <var>advertised service</var>'s <code>&lt;eventSubURL&gt;</code> sub-element is not empty, then set <var>network service record</var>'s <code>eventsUrl</code> property to the string value of the first occurrence of the <var>advertised service</var>'s <code>&lt;eventSubURL&gt;</code> sub-element. Otherwise, do not set <var>network service record</var>'s <code>eventsUrl</code> property.
  1.3288 -                </li>
  1.3289 -
  1.3290 -                <li>
  1.3291 -                   Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the current date, in UTC timestamp format, plus the value of <var>device expiry</var>.
  1.3292 -                </li>
  1.3293 -
  1.3294 -                <li>
  1.3295 -                  Run the general rule for <a href="#dfn-adding-an-available-service" class="internalDFN">adding an available service</a>, passing in the current <var>network service record</var> as the only argument.
  1.3296 -                </li>
  1.3297 -
  1.3298 -              </ol>
  1.3299 -
  1.3300 -          </li></ol>
  1.3301 -
  1.3302 -         <p>
  1.3303 -           The rule for <dfn id="dfn-removing-all-services-from-a-registered-upnp-device">removing all services from a registered UPnP Device</dfn> is the process of removing all services associated with a
  1.3304 -           device from the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> that has left the user's current network or has otherwise timed out or expired.
  1.3305 -           This rule takes one argument, <var>device identifier</var>, and consists of running the following steps:
  1.3306 -        </p>
  1.3307 -
  1.3308 -         <ol class="rule">
  1.3309 -
  1.3310 -           <li>
  1.3311 -              For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.3312 -              <ol class="rule">
  1.3313 -
  1.3314 -                <li>
  1.3315 -                 If the <var>existing service record</var>'s <code>deviceId</code> property does not match <var>device identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and continue at the next available <var>existing service record</var>.
  1.3316 -                </li>
  1.3317 -
  1.3318 -                <li>
  1.3319 -                  Run the general rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a> passing in <var>existing service record</var>'s <code>id</code>
  1.3320 -                  property as the only argument.
  1.3321 -                </li>
  1.3322 -
  1.3323 -              </ol>
  1.3324 -           </li>
  1.3325 -
  1.3326 -         </ol>
  1.3327 -
  1.3328 -         <p>When the <a href="#dfn-user-agent" class="internalDFN">user agent</a> is to <dfn id="dfn-setup-a-upnp-events-subscription">setup a UPnP Events Subscription</dfn>, it is to run the following steps with the current <var>network service record</var> object as defined in 'Section 4.1.2: SUBSCRIBE with NT and CALLBACK' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>]:</p>
  1.3329 -
  1.3330 -         <ol class="rule">
  1.3331 -            <li>
  1.3332 -               If <var>network service record</var>'s <code>eventsUrl</code> property is empty then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> abort these steps.
  1.3333 -            </li>
  1.3334 -
  1.3335 -            <li>
  1.3336 -               Let <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> be the value of creating a new <a href="#dfn-user-agent-generated-callback-url" class="internalDFN">user-agent generated callback url</a>.
  1.3337 -            </li>
  1.3338 -
  1.3339 -            <li>
  1.3340 -               Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>NT</em> header with a string value of <code>upnp:event</code>, a <em>TIMEOUT</em> header with a user-agent defined timeout value (in the form <code>Second-XX</code> where <code>XX</code> is the user-agent defined timeout value in seconds) and a <em>CALLBACK</em> header
  1.3341 -               with a string value of <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> towards the <var>network service record</var>'s <code>eventsUrl</code> property.
  1.3342 -            </li>
  1.3343 -
  1.3344 -            <li>
  1.3345 -               If a non-200 OK response is received from the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> abort these steps.
  1.3346 -            </li>
  1.3347 -
  1.3348 -            <li>
  1.3349 -               On receiving a valid 200 OK response, run the following steps:
  1.3350 -
  1.3351 -               <ol class="rule">
  1.3352 -                  <li>
  1.3353 -                     Let <var>callback ID</var> equal the string value of the first included <em>SID</em> header, if it exists.
  1.3354 -                  </li>
  1.3355 -                  <li>
  1.3356 -                     Let <var>timeout date</var> equal the sum of the current UTC date value plus the integer value of the first included <em>TIMEOUT</em> header (minus the leading string of <code>Second-</code>), if it exists.
  1.3357 -                  </li>
  1.3358 -                  <li>
  1.3359 -                     Run the following steps aynchronously and continue to the step labeled <em>listen</em> below.
  1.3360 -                  </li>
  1.3361 -                  <li>
  1.3362 -                     <em>Refresh Subscription</em>: Run the following steps at a set interval (X) within the <a href="#dfn-user-agent" class="internalDFN">user agent</a>:
  1.3363 -
  1.3364 -                     <ol class="rule">
  1.3365 -                        <li>
  1.3366 -                           Let <var>current date</var> equal the current UTC date.
  1.3367 -                        </li>
  1.3368 -                        <li>
  1.3369 -                           If <var>current date</var> is less than the <var>timeout date</var> then continue to the step labeled <em>refresh subscription</em> above.
  1.3370 -                        </li>
  1.3371 -                        <li>
  1.3372 -                           Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>SID</em> header with the string value of <var>callback ID</var> and a user-agent defined <em>TIMEOUT</em> header (in the form <code>Second-XX</code> where <code>XX</code> is the user-agent defined timeout value in seconds) towards the <var>network service record</var>'s <code>eventsUrl</code> property.
  1.3373 -                        </li>
  1.3374 -                        <li>
  1.3375 -                           On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first included <em>SID</em> header, if it exists. All other <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
  1.3376 -                           responses should cause the <a href="#dfn-user-agent" class="internalDFN">user agent</a> to continue from the step labeled <em>refresh subscription</em> above.
  1.3377 -                        </li>
  1.3378 -                     </ol>
  1.3379 -
  1.3380 -                  </li>
  1.3381 -
  1.3382 -                  <li>
  1.3383 -                     <em>Listen</em>: For each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request received at the <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> the <a href="#dfn-user-agent" class="internalDFN">user agent</a> is to run the following steps:
  1.3384 -
  1.3385 -                     <ol class="rule">
  1.3386 -                        <li>
  1.3387 -                           Let <var>content clone</var> be the result of obtaining the message body of the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request. If <var>content clone</var> is empty, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119" title="must">must</em></em> abort these steps.
  1.3388 -                        </li>
  1.3389 -                        <li>
  1.3390 -                          Let <var>notification event</var> be a new simple event that uses the
  1.3391 -                          <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.3392 -                           interface with the name <a href="#event-notify"><code>notify</code></a>,
  1.3393 -                           which does not bubble, is not cancellable, and has no default action.
  1.3394 -                        </li>
  1.3395 -                        <li>
  1.3396 -                           Let the <code>data</code> attribute of <var>notification event</var> have the DOMString value of <var>content clone</var>.
  1.3397 -                        </li>
  1.3398 -                        <li>
  1.3399 -                           <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">Queue a task</a> to
  1.3400 -                            dispatch <var>notification event</var> at the current <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> object.
  1.3401 -                        </li>
  1.3402 -                     </ol>
  1.3403 -                  </li>
  1.3404 -
  1.3405 -               </ol>
  1.3406 -
  1.3407 -            </li>
  1.3408 -         </ol>
  1.3409 -
  1.3410 -         <p>
  1.3411 -           A <a href="#dfn-user-agent" class="internalDFN">user agent</a> can <dfn id="dfn-terminate-an-existing-upnp-events-subscription">terminate an existing UPnP Events Subscription</dfn> at any time for any <var>active service</var> in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> by sending an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> UNSUBSCRIBE request - as defined in 'Section 4.1.4: Canceling a subscription with UNSUBSCRIBE' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] - with a HOST header set to that <var>active service</var>'s <code>eventsUrl</code> property and a SID header set to the <var>callback ID</var> obtained when the initial <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a UPnP Events Subscription</a> action occurred.
  1.3412 -         </p>
  1.3413 -
  1.3414 -         </section>
  1.3415 -
  1.3416 -         <section id="network-topology-monitoring">
  1.3417 -            <h3><span class="secno">7.3 </span>Network Topology Monitoring</h3>
  1.3418 -
  1.3419 -                  <div>
  1.3420 -                     <p>
  1.3421 -                        When the <a href="#dfn-user-agent" class="internalDFN">user agent</a> detects that the user has dropped from their connected network then, for each <var>existing service record</var> in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>, the user agent
  1.3422 -                        <em class="ct"><em class="rfc2119" title="must">must</em></em>
  1.3423 -                            run the general rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a> passing in each <var>existing service record</var>'s
  1.3424 -                            <code>id</code> property as the only argument for each call.
  1.3425 -                    </p>
  1.3426 -
  1.3427 -                     <p>
  1.3428 -                        When the <a href="#dfn-user-agent" class="internalDFN">user agent</a> detects that the user has connected to a new network or reconnected to an existing network, then it
  1.3429 -                        <em class="ct"><em class="rfc2119" title="should">should</em></em> restart its discovery
  1.3430 -                         mechanisms as defined in the <a href="#service-discovery">Service Discovery</a> section of this specification, maintaining
  1.3431 -                         the existing <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> currently in use.
  1.3432 -                     </p>
  1.3433 -                  </div>
  1.3434 -         </section>
  1.3435 -      </section>
  1.3436 -
  1.3437 -  <section id="events-summary">
  1.3438 -      <!--OddPage--><h2><span class="secno">8. </span>Events Summary</h2>
  1.3439 -
  1.3440 -      <p>The following events are dispatched on the <a href="#networkservices"><code>NetworkServices</code></a> and/or <a href="#networkservice"><code>NetworkService</code></a> objects:</p>
  1.3441 -
  1.3442 -       <table border="1">
  1.3443 -        <thead>
  1.3444 -          <tr>
  1.3445 -            <th>
  1.3446 -              <span title="event handlers">Event name</span>
  1.3447 +              <span>Event name</span>
  1.3448              </th>
  1.3449              <th>
  1.3450                <span>Interface</span>
  1.3451 @@ -1676,12 +2098,11 @@
  1.3452          <tbody>
  1.3453            <tr>
  1.3454              <td>
  1.3455 -              <dfn id="event-serviceavailable">
  1.3456 -                <code>serviceavailable</code>
  1.3457 -              </dfn>
  1.3458 +              <dfn id="event-serviceavailable"><code>serviceavailable</code></dfn>
  1.3459              </td>
  1.3460              <td>
  1.3461 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.3462 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.3463 +                  class="externalDFN"><code>Event</code></a>
  1.3464              </td>
  1.3465              <td>
  1.3466                When a new service that matches one of the <a>requested type tokens</a> is found in the current network.
  1.3467 @@ -1689,25 +2110,24 @@
  1.3468            </tr>
  1.3469            <tr>
  1.3470              <td>
  1.3471 -              <dfn id="event-serviceunavailable">
  1.3472 -                <code>serviceunavailable</code>
  1.3473 -              </dfn>
  1.3474 +              <dfn id="event-serviceunavailable"><code>serviceunavailable</code></dfn>
  1.3475              </td>
  1.3476              <td>
  1.3477 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.3478 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.3479 +                  class="externalDFN"><code>Event</code></a>
  1.3480              </td>
  1.3481              <td>
  1.3482 -              When an existing service that matches one of the <a>requested type tokens</a> gracefully leaves or expires from the current network.
  1.3483 +              When an existing service that matches one of the <a>requested type tokens</a> gracefully leaves or
  1.3484 +              expires from the current network.
  1.3485              </td>
  1.3486            </tr>
  1.3487            <tr>
  1.3488              <td>
  1.3489 -              <dfn id="event-serviceonline">
  1.3490 -                <code>serviceonline</code>
  1.3491 -              </dfn>
  1.3492 +              <dfn id="event-serviceonline"><code>serviceonline</code></dfn>
  1.3493              </td>
  1.3494              <td>
  1.3495 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.3496 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.3497 +                  class="externalDFN"><code>Event</code></a>
  1.3498              </td>
  1.3499              <td>
  1.3500                When a current service renews its service registration within the current network.
  1.3501 @@ -1715,12 +2135,11 @@
  1.3502            </tr>
  1.3503            <tr>
  1.3504              <td>
  1.3505 -              <dfn id="event-serviceoffline">
  1.3506 -                <code>serviceoffline</code>
  1.3507 -              </dfn>
  1.3508 +              <dfn id="event-serviceoffline"><code>serviceoffline</code></dfn>
  1.3509              </td>
  1.3510              <td>
  1.3511 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.3512 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.3513 +                  class="externalDFN"><code>Event</code></a>
  1.3514              </td>
  1.3515              <td>
  1.3516                When a current service gracefully leaves or otherwise expires from the current network.
  1.3517 @@ -1728,303 +2147,641 @@
  1.3518            </tr>
  1.3519            <tr>
  1.3520              <td>
  1.3521 -              <dfn id="event-notify">
  1.3522 -                <code>notify</code>
  1.3523 -              </dfn>
  1.3524 +              <dfn id="event-notify"><code>notify</code></dfn>
  1.3525              </td>
  1.3526              <td>
  1.3527 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.3528 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.3529 +                  class="externalDFN"><code>Event</code></a>
  1.3530              </td>
  1.3531              <td>
  1.3532 -              When a valid UPnP Events Subscription Message is received on a <a href="#dfn-user-agent-generated-callback-url" class="internalDFN">user-agent generated callback url</a> for a current service. This event never fires for Zeroconf-based services.
  1.3533 +              When a valid UPnP Events Subscription Message is received on a <a href=
  1.3534 +              "#dfn-user-agent-generated-callback-url"
  1.3535 +                  class="internalDFN">user-agent generated callback url</a> for a current service. This event never
  1.3536 +                  fires for Zeroconf-based services.
  1.3537              </td>
  1.3538            </tr>
  1.3539          </tbody>
  1.3540        </table>
  1.3541 -
  1.3542 -  </section>
  1.3543 -
  1.3544 -   <section id="garbage-collection">
  1.3545 -      <!--OddPage--><h2><span class="secno">9. </span>Garbage collection</h2>
  1.3546 -
  1.3547 +    </section>
  1.3548 +    <section id="garbage-collection">
  1.3549 +      <h2>
  1.3550 +        <span class="secno">9.</span> Garbage collection
  1.3551 +      </h2>
  1.3552        <p>
  1.3553 -         Only when the user navigates away from the current browsing context can <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> objects be garbage-collected, its records in the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a> be removed and its corresponding entry in the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> be removed according to passing each expired object identifier through the rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a>.
  1.3554 +        Only when the user navigates away from the current browsing context can <a href="#networkservice"
  1.3555 +           class="internalDFN"><code>NetworkService</code></a> objects be garbage-collected, its records in the <a href=
  1.3556 +           "#dfn-entry-script-origin-s-url-whitelist"
  1.3557 +           class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a> be
  1.3558 +           removed and its corresponding entry in the <a href="#dfn-list-of-authorized-service-records"
  1.3559 +           class="internalDFN">list of authorized service records</a> be removed according to passing each expired
  1.3560 +           object identifier through the rule for <a href="#dfn-removing-an-available-service"
  1.3561 +           class="internalDFN">removing an available service</a>.
  1.3562        </p>
  1.3563 -
  1.3564 -   </section>
  1.3565 -
  1.3566 -
  1.3567 +    </section>
  1.3568      <section id="use-cases-and-requirements">
  1.3569 -      <!--OddPage--><h2><span class="secno">10. </span>Use Cases and Requirements</h2>
  1.3570 -
  1.3571 -      <p>This section covers what the requirements are for this <abbr title="Application Programming Interface">API</abbr>, as well as illustrates some use cases.</p>
  1.3572 -
  1.3573 +      <h2>
  1.3574 +        <span class="secno">10.</span> Use Cases and Requirements
  1.3575 +      </h2>
  1.3576 +      <p>
  1.3577 +        This section covers what the requirements are for this <abbr title=
  1.3578 +        "Application Programming Interface">API</abbr>, as well as illustrates some use cases.
  1.3579 +      </p>
  1.3580        <ul class="rule">
  1.3581 -         <li>
  1.3582 -            Once a user has given permission, user agents should provide the ability for Web pages to communicate directly with a Local-networked Service.
  1.3583 -            <ul class="rule">
  1.3584 -               <li>
  1.3585 -                  Example: A web-based TV remote control. A Web page wants to control the current user's TV, changing the programming shown or increasing/decreasing/muting the
  1.3586 -                  volume of the Local-networked Device. The Web page requests a service type that is known to be implemented by television sets to which it has the
  1.3587 -                  application logic to communicate. Local devices providing the request service types are discovered and presented to the user for authorization. The user selects one
  1.3588 -                  or more of the discovered television sets to be accessible to the current Web page and then clicks 'Share'. The Web page can now communicate directly with
  1.3589 -                  the user-authorized Local-networked services.
  1.3590 -               </li>
  1.3591 -            </ul>
  1.3592 -         </li>
  1.3593 -
  1.3594 -         <li>
  1.3595 -           Web pages should be able to communicate with Local-networked Services using the messaging channel supported by those Devices.
  1.3596 -           <ul class="rule">
  1.3597 -            <li>
  1.3598 -               Example: A Web page advertises that it is capable of controlling multiple Home Media Servers. The user can select their Home Media Server type from a drop-down list, at which point the
  1.3599 -               Web page sends a request to the user agent to connect with the associated service type of the Home Media Server. The Media Server selected implements a Web Socket channel for
  1.3600 -               bi-directional service communication and so the Web page opens a web socket to the requested Media Server and can communicate as required via that appropriate channel.
  1.3601 +        <li>Once a user has given permission, user agents should provide the ability for Web pages to communicate
  1.3602 +        directly with a Local-networked Service.
  1.3603 +          <ul class="rule">
  1.3604 +            <li>Example: A web-based TV remote control. A Web page wants to control the current user's TV, changing the
  1.3605 +            programming shown or increasing/decreasing/muting the volume of the Local-networked Device. The Web page
  1.3606 +            requests a service type that is known to be implemented by television sets to which it has the application
  1.3607 +            logic to communicate. Local devices providing the request service types are discovered and presented to the
  1.3608 +            user for authorization. The user selects one or more of the discovered television sets to be accessible to
  1.3609 +            the current Web page and then clicks 'Share'. The Web page can now communicate directly with the
  1.3610 +            user-authorized Local-networked services.
  1.3611              </li>
  1.3612 -           </ul>
  1.3613 -         </li>
  1.3614 -
  1.3615 -         <li>
  1.3616 -           Web pages should be able to communicate with Local-networked Services using the messaging format supported by those Devices.
  1.3617 -           <ul class="rule">
  1.3618 -            <li>
  1.3619 -               Example: A Web page advertises that it is capable of interacting with and controlling multiple types of Home Media Server. The user can select their Home Media Server type from a drop-down list or known Media Servers, at which point the
  1.3620 -               Web page sends a request to the user agent to connect with the associated service type (and, optionally, the associated event type) of the Home Media Server. The communiciation protocols supported by Home Media Servers typically vary
  1.3621 -               between UPnP, JSON-RPC, Protocol Buffers or other messaging formats depending on the Home Media Server requested. The Web page is able to communicate with the user-selected Home Media
  1.3622 -               Server in the messaging format supported by that Device, which, in this example is a simple key/value pair text format.
  1.3623 +          </ul>
  1.3624 +        </li>
  1.3625 +        <li>Web pages should be able to communicate with Local-networked Services using the messaging channel supported
  1.3626 +        by those Devices.
  1.3627 +          <ul class="rule">
  1.3628 +            <li>Example: A Web page advertises that it is capable of controlling multiple Home Media Servers. The user
  1.3629 +            can select their Home Media Server type from a drop-down list, at which point the Web page sends a request
  1.3630 +            to the user agent to connect with the associated service type of the Home Media Server. The Media Server
  1.3631 +            selected implements a Web Socket channel for bi-directional service communication and so the Web page opens
  1.3632 +            a web socket to the requested Media Server and can communicate as required via that appropriate channel.
  1.3633              </li>
  1.3634 -           </ul>
  1.3635 -         </li>
  1.3636 -
  1.3637 -         <li>
  1.3638 -           Web pages should not be able to communicate with Local-networked Services that have not been authorized by the user thereby maintaining the user's privacy.
  1.3639 -           <ul class="rule">
  1.3640 -            <li>
  1.3641 -               Example: A Web page requests access to one type of Local-networked service. The user authorizes access to that particular service. Other services running on that same device, and on other devices
  1.3642 -               within the network, should not be accessible to the current Web page.
  1.3643 +          </ul>
  1.3644 +        </li>
  1.3645 +        <li>Web pages should be able to communicate with Local-networked Services using the messaging format supported
  1.3646 +        by those Devices.
  1.3647 +          <ul class="rule">
  1.3648 +            <li>Example: A Web page advertises that it is capable of interacting with and controlling multiple types of
  1.3649 +            Home Media Server. The user can select their Home Media Server type from a drop-down list or known Media
  1.3650 +            Servers, at which point the Web page sends a request to the user agent to connect with the associated
  1.3651 +            service type (and, optionally, the associated event type) of the Home Media Server. The communiciation
  1.3652 +            protocols supported by Home Media Servers typically vary between UPnP, JSON-RPC, Protocol Buffers or other
  1.3653 +            messaging formats depending on the Home Media Server requested. The Web page is able to communicate with
  1.3654 +            the user-selected Home Media Server in the messaging format supported by that Device, which, in this
  1.3655 +            example is a simple key/value pair text format.
  1.3656              </li>
  1.3657 -           </ul>
  1.3658 -         </li>
  1.3659 -
  1.3660 -         <li>
  1.3661 -           A user should be able to share one or more Local-networked Services based on a particular service type request from a Web page.
  1.3662 -           <ul class="rule">
  1.3663 -            <li>
  1.3664 -               Example: A Web page is capable of interacting with a specific profile of Local-networked Service. As such, it makes a request to the user agent to access those services, of which multiple matches
  1.3665 -               are found. The user is capable of selecting one or more of the discovered services to share with the Web page. The Web page can then implement a drag-and-drop interface for the user to drag specific
  1.3666 -               actions on to one or more of the authorized Local-networked Services.
  1.3667 +          </ul>
  1.3668 +        </li>
  1.3669 +        <li>Web pages should not be able to communicate with Local-networked Services that have not been authorized by
  1.3670 +        the user thereby maintaining the user's privacy.
  1.3671 +          <ul class="rule">
  1.3672 +            <li>Example: A Web page requests access to one type of Local-networked service. The user authorizes access
  1.3673 +            to that particular service. Other services running on that same device, and on other devices within the
  1.3674 +            network, should not be accessible to the current Web page.
  1.3675              </li>
  1.3676 -           </ul>
  1.3677 -         </li>
  1.3678 -
  1.3679 -         <li>
  1.3680 -           User agents should provide an <abbr title="Application Programming Interface">API</abbr> exposed to script that exposes the features above. The user is notified by UI anytime interaction with Local-networked Services is requested, giving the user
  1.3681 -           full ability to cancel or abort the transaction. The user selects the Local-networked Services to be connected to the current Web page, and can cancel these at any time. No invocations to
  1.3682 -           these APIs occur silently without user intervention.
  1.3683 -         </li>
  1.3684 +          </ul>
  1.3685 +        </li>
  1.3686 +        <li>A user should be able to share one or more Local-networked Services based on a particular service type
  1.3687 +        request from a Web page.
  1.3688 +          <ul class="rule">
  1.3689 +            <li>Example: A Web page is capable of interacting with a specific profile of Local-networked Service. As
  1.3690 +            such, it makes a request to the user agent to access those services, of which multiple matches are found.
  1.3691 +            The user is capable of selecting one or more of the discovered services to share with the Web page. The Web
  1.3692 +            page can then implement a drag-and-drop interface for the user to drag specific actions on to one or more
  1.3693 +            of the authorized Local-networked Services.
  1.3694 +            </li>
  1.3695 +          </ul>
  1.3696 +        </li>
  1.3697 +        <li>User agents should provide an <abbr title="Application Programming Interface">API</abbr> exposed to script
  1.3698 +        that exposes the features above. The user is notified by UI anytime interaction with Local-networked Services
  1.3699 +        is requested, giving the user full ability to cancel or abort the transaction. The user selects the
  1.3700 +        Local-networked Services to be connected to the current Web page, and can cancel these at any time. No
  1.3701 +        invocations to these APIs occur silently without user intervention.
  1.3702 +        </li>
  1.3703        </ul>
  1.3704      </section>
  1.3705 -
  1.3706 -          <section class="informative appendix" id="examples">
  1.3707 -             <!--OddPage--><h2><span class="secno">A. </span>Examples</h2><p><em>This section is non-normative.</em></p>
  1.3708 -
  1.3709 -           <div class="example">
  1.3710 -            <p>This sample code exposes a button. When clicked, this button is disabled and the user is prompted to offer a network service. The user may also select multiple network services. When the user has authorized a network service to be connected to the web page then the web page issues a simple command to get a list of all the albums stored on the connected media player service.
  1.3711 -            </p><p>The button is re-enabled only when the connected network service disconnects for whatever reason (the service becomes unavailable on the network, the user disconnects from their current network or the user revokes access to the service from the current web page). At this point the user can re-click the button to select a new network service to connect to the web page and the above steps are repeated.</p>
  1.3712 -            <p>The provided service type identifier and service interaction used in this example is based on the well-defined service type and messaging format supported by the <a href="http://xbmc.org/about/">XBMC Media Server</a>. </p>
  1.3713 -            <hr>
  1.3714 -            <pre class="highlight prettyprint"><span class="tag">&lt;input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"button"</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"Start"</span><span class="pln"> </span><span class="atn">onclick</span><span class="pun">=</span><span class="atv">"</span><span class="pln">start</span><span class="pun">()</span><span class="atv">"</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"startBtn"</span><span class="tag">/&gt;</span><span class="pln">
  1.3715 -</span><span class="tag">&lt;div</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"debugconsole"</span><span class="tag">&gt;&lt;/div&gt;</span><span class="pln">
  1.3716 +    <section class="informative appendix"
  1.3717 +             id="examples">
  1.3718 +      <h2>
  1.3719 +        <span class="secno">A.</span> Examples
  1.3720 +      </h2>
  1.3721 +      <p>
  1.3722 +        <em>This section is non-normative.</em>
  1.3723 +      </p>
  1.3724 +      <div class="example">
  1.3725 +        <p>
  1.3726 +          This sample code exposes a button. When clicked, this button is disabled and the user is prompted to offer a
  1.3727 +          network service. The user may also select multiple network services. When the user has authorized a network
  1.3728 +          service to be connected to the web page then the web page issues a simple command to get a list of all the
  1.3729 +          albums stored on the connected media player service.
  1.3730 +        </p>
  1.3731 +        <p>
  1.3732 +          The button is re-enabled only when the connected network service disconnects for whatever reason (the service
  1.3733 +          becomes unavailable on the network, the user disconnects from their current network or the user revokes
  1.3734 +          access to the service from the current web page). At this point the user can re-click the button to select a
  1.3735 +          new network service to connect to the web page and the above steps are repeated.
  1.3736 +        </p>
  1.3737 +        <p>
  1.3738 +          The provided service type identifier and service interaction used in this example is based on the
  1.3739 +          well-defined service type and messaging format supported by the <a href="http://xbmc.org/about/">XBMC Media
  1.3740 +          Server</a>.
  1.3741 +        </p>
  1.3742 +        <hr>
  1.3743 +        <pre class="highlight prettyprint">
  1.3744 +<span class="tag">&lt;input</span><span class="pln"> </span><span class="atn">type</span><span class=
  1.3745 +"pun">=</span><span class="atv">"button"</span><span class="pln"> </span><span class="atn">value</span><span class=
  1.3746 +"pun">=</span><span class="atv">"Start"</span><span class="pln"> </span><span class="atn">onclick</span><span class=
  1.3747 +"pun">=</span><span class="atv">"</span><span class="pln">start</span><span class="pun">()</span><span class=
  1.3748 +"atv">"</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class=
  1.3749 +"atv">"startBtn"</span><span class="tag">/&gt;</span><span class="pln">
  1.3750 +</span><span class="tag">&lt;div</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3751 +"pun">=</span><span class="atv">"debugconsole"</span><span class="tag">&gt;&lt;/div&gt;</span><span class="pln">
  1.3752  
  1.3753  </span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.3754 - </span><span class="kwd">var</span><span class="pln"> startBtn </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">'startBtn'</span><span class="pun">),</span><span class="pln">
  1.3755 -     debug </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">'debugconsole'</span><span class="pun">);</span><span class="pln">
  1.3756 + </span><span class="kwd">var</span><span class="pln"> startBtn </span><span class="pun">=</span><span class=
  1.3757 +"pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class=
  1.3758 +"pun">(</span><span class="str">'startBtn'</span><span class="pun">),</span><span class="pln">
  1.3759 +     debug </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class=
  1.3760 +"pln">getElementById</span><span class="pun">(</span><span class="str">'debugconsole'</span><span class=
  1.3761 +"pun">);</span><span class="pln">
  1.3762  
  1.3763 - </span><span class="kwd">function</span><span class="pln"> start</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3764 -   </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3765 -      navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">(</span><span class="str">'zeroconf:_xbmc-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln"> gotXBMCService</span><span class="pun">,</span><span class="pln"> error</span><span class="pun">);</span><span class="pln">
  1.3766 -      startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">true</span><span class="pun">;</span><span class="pln">
  1.3767 -   </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3768 -      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;Service Discovery not supported!"</span><span class="pun">;</span><span class="pln">
  1.3769 + </span><span class="kwd">function</span><span class="pln"> start</span><span class="pun">()</span><span class=
  1.3770 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3771 +   </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">navigator</span><span class=
  1.3772 +"pun">.</span><span class="pln">getNetworkServices</span><span class="pun">)</span><span class=
  1.3773 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3774 +      navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
  1.3775 +"pun">(</span><span class="str">'zeroconf:_xbmc-jsonrpc._tcp'</span><span class="pun">,</span><span class=
  1.3776 +"pln"> gotXBMCService</span><span class="pun">,</span><span class="pln"> error</span><span class=
  1.3777 +"pun">);</span><span class="pln">
  1.3778 +      startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class=
  1.3779 +"pln"> </span><span class="kwd">true</span><span class="pun">;</span><span class="pln">
  1.3780 +   </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class=
  1.3781 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3782 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3783 +"pln"> </span><span class="str">"&lt;br&gt;Service Discovery not supported!"</span><span class=
  1.3784 +"pun">;</span><span class="pln">
  1.3785     </span><span class="pun">}</span><span class="pln">
  1.3786   </span><span class="pun">}</span><span class="pln">
  1.3787  
  1.3788 - </span><span class="kwd">function</span><span class="pln"> gotXBMCService</span><span class="pun">(</span><span class="pln">services</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3789 + </span><span class="kwd">function</span><span class="pln"> gotXBMCService</span><span class="pun">(</span><span class=
  1.3790 +"pln">services</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3791  
  1.3792  </span><span class="com">// Listen for service disconnect messages</span><span class="pln">
  1.3793  
  1.3794 -   services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'serviceoffline'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">(</span><span class="pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3795 -       debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">" disconnected."</span><span class="pun">;</span><span class="pln">
  1.3796 -       startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
  1.3797 -   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.3798 +   services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3799 +"pln">addEventListener</span><span class="pun">(</span><span class="str">'serviceoffline'</span><span class=
  1.3800 +"pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class=
  1.3801 +"pun">(</span><span class="pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.3802 +"pun">{</span><span class="pln">
  1.3803 +       debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3804 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.3805 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3806 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3807 +"str">" disconnected."</span><span class="pun">;</span><span class="pln">
  1.3808 +       startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class=
  1.3809 +"pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
  1.3810 +   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.3811 +"pun">);</span><span class="pln">
  1.3812  
  1.3813 -</span><span class="com">// Send a service message to get albums list (and process the service response)</span><span class="pln">
  1.3814 +</span><span class=
  1.3815 +"com">// Send a service message to get albums list (and process the service response)</span><span class="pln">
  1.3816  
  1.3817 -   </span><span class="kwd">var</span><span class="pln"> svcXhr </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">XMLHttpRequest</span><span class="pun">();</span><span class="pln">
  1.3818 -   svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">url </span><span class="pun">+</span><span class="pln"> </span><span class="str">"/getAlbums"</span><span class="pun">);</span><span class="pln"> </span><span class="com">// services[0].url and its subresources have been</span><span class="pln">
  1.3819 -                                                        </span><span class="com">// whitelisted for cross-site XHR use in this</span><span class="pln">
  1.3820 -                                                        </span><span class="com">// current browsing context.</span><span class="pln">
  1.3821 +   </span><span class="kwd">var</span><span class="pln"> svcXhr </span><span class="pun">=</span><span class=
  1.3822 +"pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">XMLHttpRequest</span><span class=
  1.3823 +"pun">();</span><span class="pln">
  1.3824 +   svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class=
  1.3825 +"str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class=
  1.3826 +"lit">0</span><span class="pun">].</span><span class="pln">url </span><span class="pun">+</span><span class=
  1.3827 +"pln"> </span><span class="str">"/getAlbums"</span><span class="pun">);</span><span class="pln"> </span><span class=
  1.3828 +"com">// services[0].url and its subresources have been</span><span class="pln">
  1.3829 +                                                        </span><span class=
  1.3830 +"com">// whitelisted for cross-site XHR use in this</span><span class="pln">
  1.3831 +                                                        </span><span class=
  1.3832 +"com">// current browsing context.</span><span class="pln">
  1.3833  
  1.3834 -   svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class="pun">(</span><span class="str">'Content-Type'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'application/json-rpc'</span><span class="pun">);</span><span class="pln">
  1.3835 +   svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class=
  1.3836 +"pun">(</span><span class="str">'Content-Type'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3837 +"str">'application/json-rpc'</span><span class="pun">);</span><span class="pln">
  1.3838  
  1.3839 -   svcXhr</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'readystatechange'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">(</span><span class="pln"> response </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3840 -     </span><span class="kwd">if</span><span class="pun">(</span><span class="pln"> response</span><span class="pun">.</span><span class="pln">readyState </span><span class="pun">!=</span><span class="pln"> </span><span class="lit">4</span><span class="pln"> </span><span class="pun">||</span><span class="pln"> response</span><span class="pun">.</span><span class="pln">status </span><span class="pun">!=</span><span class="pln"> </span><span class="lit">200</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
  1.3841 +   svcXhr</span><span class="pun">.</span><span class="pln">addEventListener</span><span class=
  1.3842 +"pun">(</span><span class="str">'readystatechange'</span><span class="pun">,</span><span class=
  1.3843 +"pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">(</span><span class=
  1.3844 +"pln"> response </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3845 +     </span><span class="kwd">if</span><span class="pun">(</span><span class="pln"> response</span><span class=
  1.3846 +"pun">.</span><span class="pln">readyState </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.3847 +"lit">4</span><span class="pln"> </span><span class="pun">||</span><span class="pln"> response</span><span class=
  1.3848 +"pun">.</span><span class="pln">status </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.3849 +"lit">200</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
  1.3850          </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
  1.3851 -     debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">" response received: "</span><span class="pun">;</span><span class="pln">
  1.3852 -     debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class="pln"> JSON</span><span class="pun">.</span><span class="pln">parse</span><span class="pun">(</span><span class="pln">response</span><span class="pun">.</span><span class="pln">responseText</span><span class="pun">);</span><span class="pln">
  1.3853 -   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.3854 +     debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3855 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.3856 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3857 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3858 +"str">" response received: "</span><span class="pun">;</span><span class="pln">
  1.3859 +     debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class=
  1.3860 +"pln"> JSON</span><span class="pun">.</span><span class="pln">parse</span><span class="pun">(</span><span class=
  1.3861 +"pln">response</span><span class="pun">.</span><span class="pln">responseText</span><span class=
  1.3862 +"pun">);</span><span class="pln">
  1.3863 +   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.3864 +"pun">);</span><span class="pln">
  1.3865  
  1.3866 -   </span><span class="kwd">var</span><span class="pln"> svcMsg </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[</span><span class="pln">
  1.3867 -     </span><span class="pun">{</span><span class="pln"> </span><span class="str">"jsonrpc"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"2.0"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"method"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"AudioLibrary.GetAlbums"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"params"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="str">"genreid"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln">
  1.3868 -         </span><span class="str">"artistid"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="str">"start"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="str">"end"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class="pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="str">"id"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pln"> </span><span class="pun">}</span><span class="pln">
  1.3869 +   </span><span class="kwd">var</span><span class="pln"> svcMsg </span><span class="pun">=</span><span class=
  1.3870 +"pln"> </span><span class="pun">[</span><span class="pln">
  1.3871 +     </span><span class="pun">{</span><span class="pln"> </span><span class="str">"jsonrpc"</span><span class=
  1.3872 +"pun">:</span><span class="pln"> </span><span class="str">"2.0"</span><span class="pun">,</span><span class=
  1.3873 +"pln"> </span><span class="str">"method"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3874 +"str">"AudioLibrary.GetAlbums"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3875 +"str">"params"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class=
  1.3876 +"pln"> </span><span class="str">"genreid"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3877 +"pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln">
  1.3878 +         </span><span class="str">"artistid"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3879 +"pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3880 +"str">"start"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">-</span><span class=
  1.3881 +"lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="str">"end"</span><span class=
  1.3882 +"pun">:</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class=
  1.3883 +"pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="str">"id"</span><span class=
  1.3884 +"pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pln"> </span><span class=
  1.3885 +"pun">}</span><span class="pln">
  1.3886     </span><span class="pun">];</span><span class="pln">
  1.3887  
  1.3888 -   svcXhr</span><span class="pun">.</span><span class="pln">send</span><span class="pun">(</span><span class="pln">JSON</span><span class="pun">.</span><span class="pln">stringify</span><span class="pun">(</span><span class="pln">svcMsg</span><span class="pun">));</span><span class="pln">
  1.3889 -   debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">" request sent: "</span><span class="pun">;</span><span class="pln">
  1.3890 -   debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class="pln"> JSON</span><span class="pun">.</span><span class="pln">stringify</span><span class="pun">(</span><span class="pln">svcMsg</span><span class="pun">);</span><span class="pln">
  1.3891 +   svcXhr</span><span class="pun">.</span><span class="pln">send</span><span class="pun">(</span><span class=
  1.3892 +"pln">JSON</span><span class="pun">.</span><span class="pln">stringify</span><span class="pun">(</span><span class=
  1.3893 +"pln">svcMsg</span><span class="pun">));</span><span class="pln">
  1.3894 +   debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3895 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.3896 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3897 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3898 +"str">" request sent: "</span><span class="pun">;</span><span class="pln">
  1.3899 +   debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class=
  1.3900 +"pln"> JSON</span><span class="pun">.</span><span class="pln">stringify</span><span class="pun">(</span><span class=
  1.3901 +"pln">svcMsg</span><span class="pun">);</span><span class="pln">
  1.3902  
  1.3903   </span><span class="pun">}</span><span class="pln">
  1.3904  
  1.3905 - </span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class="pln"> err </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3906 -   debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;An error occurred obtaining a local network service."</span><span class="pun">;</span><span class="pln">
  1.3907 -   startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
  1.3908 + </span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class=
  1.3909 +"pln"> err </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3910 +   debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3911 +"pln"> </span><span class="str">"&lt;br&gt;An error occurred obtaining a local network service."</span><span class=
  1.3912 +"pun">;</span><span class="pln">
  1.3913 +   startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class=
  1.3914 +"pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
  1.3915   </span><span class="pun">}</span><span class="pln">
  1.3916 -</span><span class="tag">&lt;/script&gt;</span></pre>
  1.3917 -           </div>
  1.3918 -
  1.3919 -           <div class="example">
  1.3920 -            <p>
  1.3921 -             This sample exposes a drop-down list containing a number of common Home-based audio devices. When the user selects an audio device from the list provided, they are prompted to authorize a network service
  1.3922 -             based on the service type requested. The user may also select multiple network services matching the selected service type.
  1.3923 -             In this example, the user selects their make as being <var>Sony</var> and their model as being <var>Bravia S1000</var> from which the Web page can derive a service type
  1.3924 -             (<var>urn:schemas-upnp-org:service:RenderingControl:1</var>).
  1.3925 -             <br><br>Once the user has authorized the device, the web page sends a simple mute command according to the messaging format supported by the device.
  1.3926 -            </p>
  1.3927 -            <hr>
  1.3928 -            <pre class="highlight prettyprint"><span class="tag">&lt;select</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"make"</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"make"</span><span class="tag">&gt;</span><span class="pln">
  1.3929 -  </span><span class="tag">&lt;option</span><span class="pln"> </span><span class="atn">selected</span><span class="pun">=</span><span class="atv">"selected"</span><span class="pln"> </span><span class="atn">disabled</span><span class="pun">=</span><span class="atv">"disabled"</span><span class="tag">&gt;</span><span class="pln">Select make</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3930 -  </span><span class="tag">&lt;option&gt;</span><span class="pln">Sony</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3931 -  </span><span class="tag">&lt;option&gt;</span><span class="pln">Philips</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3932 -  </span><span class="tag">&lt;option&gt;</span><span class="pln">Alba</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3933 +</span><span class="tag">&lt;/script&gt;</span>
  1.3934 +</pre>
  1.3935 +      </div>
  1.3936 +      <div class="example">
  1.3937 +        <p>
  1.3938 +          This sample exposes a drop-down list containing a number of common Home-based audio devices. When the user
  1.3939 +          selects an audio device from the list provided, they are prompted to authorize a network service based on the
  1.3940 +          service type requested. The user may also select multiple network services matching the selected service
  1.3941 +          type. In this example, the user selects their make as being <var>Sony</var> and their model as being
  1.3942 +          <var>Bravia S1000</var> from which the Web page can derive a service type
  1.3943 +          (<var>urn:schemas-upnp-org:service:RenderingControl:1</var>).<br>
  1.3944 +          <br>
  1.3945 +          Once the user has authorized the device, the web page sends a simple mute command according to the messaging
  1.3946 +          format supported by the device.
  1.3947 +        </p>
  1.3948 +        <hr>
  1.3949 +        <pre class="highlight prettyprint">
  1.3950 +<span class="tag">&lt;select</span><span class="pln"> </span><span class="atn">name</span><span class=
  1.3951 +"pun">=</span><span class="atv">"make"</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3952 +"pun">=</span><span class="atv">"make"</span><span class="tag">&gt;</span><span class="pln">
  1.3953 +  </span><span class="tag">&lt;option</span><span class="pln"> </span><span class="atn">selected</span><span class=
  1.3954 +"pun">=</span><span class="atv">"selected"</span><span class="pln"> </span><span class=
  1.3955 +"atn">disabled</span><span class="pun">=</span><span class="atv">"disabled"</span><span class=
  1.3956 +"tag">&gt;</span><span class="pln">Select make</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3957 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Sony</span><span class=
  1.3958 +"tag">&lt;/option&gt;</span><span class="pln">
  1.3959 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Philips</span><span class=
  1.3960 +"tag">&lt;/option&gt;</span><span class="pln">
  1.3961 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Alba</span><span class=
  1.3962 +"tag">&lt;/option&gt;</span><span class="pln">
  1.3963  </span><span class="tag">&lt;/select&gt;</span><span class="pln">
  1.3964 -</span><span class="tag">&lt;select</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"model"</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"model"</span><span class="tag">&gt;&lt;/select&gt;</span><span class="pln">
  1.3965 -</span><span class="tag">&lt;div</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"debugconsole"</span><span class="tag">&gt;&lt;/div&gt;</span><span class="pln">
  1.3966 +</span><span class="tag">&lt;select</span><span class="pln"> </span><span class="atn">name</span><span class=
  1.3967 +"pun">=</span><span class="atv">"model"</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3968 +"pun">=</span><span class="atv">"model"</span><span class="tag">&gt;&lt;/select&gt;</span><span class="pln">
  1.3969 +</span><span class="tag">&lt;div</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3970 +"pun">=</span><span class="atv">"debugconsole"</span><span class="tag">&gt;&lt;/div&gt;</span><span class="pln">
  1.3971  
  1.3972  </span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.3973 -  </span><span class="kwd">var</span><span class="pln"> debug </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">'debugconsole'</span><span class="pun">);</span><span class="pln">
  1.3974 +  </span><span class="kwd">var</span><span class="pln"> debug </span><span class="pun">=</span><span class=
  1.3975 +"pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class=
  1.3976 +"pun">(</span><span class="str">'debugconsole'</span><span class="pun">);</span><span class="pln">
  1.3977  
  1.3978 -  </span><span class="kwd">var</span><span class="pln"> models </span><span class="pun">=</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3979 -    </span><span class="str">"Sony"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln">
  1.3980 -      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"Bravia TV S1000"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"upnp"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"urn:schemas-upnp-org:service:RenderingControl:1"</span><span class="pln"> </span><span class="pun">},</span><span class="pln">
  1.3981 -      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"Bravia TV S2000"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"zeroconf"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"_mediarenderer._http._tcp"</span><span class="pln"> </span><span class="pun">},</span><span class="pln">
  1.3982 -      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"HiFi WD10"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"upnp"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"urn:schemas-upnp-org:service:RenderingControl:1"</span><span class="pln"> </span><span class="pun">}</span><span class="pln">
  1.3983 +  </span><span class="kwd">var</span><span class="pln"> models </span><span class="pun">=</span><span class=
  1.3984 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3985 +    </span><span class="str">"Sony"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3986 +"pun">[</span><span class="pln">
  1.3987 +      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class=
  1.3988 +"pln"> </span><span class="str">"Bravia TV S1000"</span><span class="pun">,</span><span class=
  1.3989 +"pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3990 +"str">"upnp"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class=
  1.3991 +"pun">:</span><span class="pln"> </span><span class=
  1.3992 +"str">"urn:schemas-upnp-org:service:RenderingControl:1"</span><span class="pln"> </span><span class=
  1.3993 +"pun">},</span><span class="pln">
  1.3994 +      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class=
  1.3995 +"pln"> </span><span class="str">"Bravia TV S2000"</span><span class="pun">,</span><span class=
  1.3996 +"pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3997 +"str">"zeroconf"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3998 +"str">"service"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3999 +"str">"_mediarenderer._http._tcp"</span><span class="pln"> </span><span class="pun">},</span><span class="pln">
  1.4000 +      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class=
  1.4001 +"pln"> </span><span class="str">"HiFi WD10"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4002 +"str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"upnp"</span><span class=
  1.4003 +"pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class="pun">:</span><span class=
  1.4004 +"pln"> </span><span class="str">"urn:schemas-upnp-org:service:RenderingControl:1"</span><span class=
  1.4005 +"pln"> </span><span class="pun">}</span><span class="pln">
  1.4006      </span><span class="pun">],</span><span class="pln">
  1.4007 -    </span><span class="str">"Philips"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln"> </span><span class="com">/* ... */</span><span class="pln"> </span><span class="pun">],</span><span class="pln">
  1.4008 -    </span><span class="str">"Alba"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln"> </span><span class="com">/* ... */</span><span class="pln"> </span><span class="pun">]</span><span class="pln">
  1.4009 +    </span><span class="str">"Philips"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.4010 +"pun">[</span><span class="pln"> </span><span class="com">/* ... */</span><span class="pln"> </span><span class=
  1.4011 +"pun">],</span><span class="pln">
  1.4012 +    </span><span class="str">"Alba"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.4013 +"pun">[</span><span class="pln"> </span><span class="com">/* ... */</span><span class="pln"> </span><span class=
  1.4014 +"pun">]</span><span class="pln">
  1.4015    </span><span class="pun">};</span><span class="pln">
  1.4016  
  1.4017 -  </span><span class="kwd">var</span><span class="pln"> makeEl </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">"make"</span><span class="pun">),</span><span class="pln">
  1.4018 -      modelEl </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">"model"</span><span class="pun">);</span><span class="pln">
  1.4019 +  </span><span class="kwd">var</span><span class="pln"> makeEl </span><span class="pun">=</span><span class=
  1.4020 +"pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class=
  1.4021 +"pun">(</span><span class="str">"make"</span><span class="pun">),</span><span class="pln">
  1.4022 +      modelEl </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class=
  1.4023 +"pln">getElementById</span><span class="pun">(</span><span class="str">"model"</span><span class=
  1.4024 +"pun">);</span><span class="pln">
  1.4025  
  1.4026 -  makeEl</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'change'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4027 -    modelEl</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">=</span><span class="pln"> </span><span class="str">""</span><span class="pun">;</span><span class="pln"> </span><span class="com">// reset</span><span class="pln">
  1.4028 -    </span><span class="kwd">var</span><span class="pln"> defaultOption </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">createElement</span><span class="pun">(</span><span class="str">"option"</span><span class="pun">);</span><span class="pln">
  1.4029 -    defaultOption</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">=</span><span class="pln"> </span><span class="str">"Select model"</span><span class="pun">;</span><span class="pln">
  1.4030 -    defaultOption</span><span class="pun">.</span><span class="pln">setAttribute</span><span class="pun">(</span><span class="str">"disabled"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"disabled"</span><span class="pun">);</span><span class="pln">
  1.4031 -    defaultOption</span><span class="pun">.</span><span class="pln">setAttribute</span><span class="pun">(</span><span class="str">"selected"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"selected"</span><span class="pun">);</span><span class="pln">
  1.4032 -    modelEl</span><span class="pun">.</span><span class="pln">appendChild</span><span class="pun">(</span><span class="pln">defaultOption</span><span class="pun">);</span><span class="pln">
  1.4033 -    </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> models</span><span class="pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class="pun">].</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class="pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class="pun">++)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4034 -      </span><span class="kwd">var</span><span class="pln"> option </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">createElement</span><span class="pun">(</span><span class="str">"option"</span><span class="pun">);</span><span class="pln">
  1.4035 -      option</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">=</span><span class="pln"> models</span><span class="pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class="pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"name"</span><span class="pun">];</span><span class="pln">
  1.4036 -      option</span><span class="pun">.</span><span class="pln">setAttribute</span><span class="pun">(</span><span class="str">"value"</span><span class="pun">,</span><span class="pln"> models</span><span class="pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class="pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"type"</span><span class="pun">]</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">":"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> models</span><span class="pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class="pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"service"</span><span class="pun">]);</span><span class="pln">
  1.4037 -      modelEl</span><span class="pun">.</span><span class="pln">appendChild</span><span class="pun">(</span><span class="pln">option</span><span class="pun">);</span><span class="pln">
  1.4038 +  makeEl</span><span class="pun">.</span><span class="pln">addEventListener</span><span class=
  1.4039 +"pun">(</span><span class="str">'change'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4040 +"kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4041 +    modelEl</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">=</span><span class=
  1.4042 +"pln"> </span><span class="str">""</span><span class="pun">;</span><span class="pln"> </span><span class=
  1.4043 +"com">// reset</span><span class="pln">
  1.4044 +    </span><span class="kwd">var</span><span class="pln"> defaultOption </span><span class="pun">=</span><span class=
  1.4045 +"pln"> document</span><span class="pun">.</span><span class="pln">createElement</span><span class=
  1.4046 +"pun">(</span><span class="str">"option"</span><span class="pun">);</span><span class="pln">
  1.4047 +    defaultOption</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.4048 +"pun">=</span><span class="pln"> </span><span class="str">"Select model"</span><span class="pun">;</span><span class=
  1.4049 +"pln">
  1.4050 +    defaultOption</span><span class="pun">.</span><span class="pln">setAttribute</span><span class=
  1.4051 +"pun">(</span><span class="str">"disabled"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4052 +"str">"disabled"</span><span class="pun">);</span><span class="pln">
  1.4053 +    defaultOption</span><span class="pun">.</span><span class="pln">setAttribute</span><span class=
  1.4054 +"pun">(</span><span class="str">"selected"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4055 +"str">"selected"</span><span class="pun">);</span><span class="pln">
  1.4056 +    modelEl</span><span class="pun">.</span><span class="pln">appendChild</span><span class="pun">(</span><span class=
  1.4057 +"pln">defaultOption</span><span class="pun">);</span><span class="pln">
  1.4058 +    </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
  1.4059 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
  1.4060 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> models</span><span class=
  1.4061 +"pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.4062 +"pun">].</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
  1.4063 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
  1.4064 +"pun">++)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4065 +      </span><span class="kwd">var</span><span class="pln"> option </span><span class="pun">=</span><span class=
  1.4066 +"pln"> document</span><span class="pun">.</span><span class="pln">createElement</span><span class=
  1.4067 +"pun">(</span><span class="str">"option"</span><span class="pun">);</span><span class="pln">
  1.4068 +      option</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.4069 +"pun">=</span><span class="pln"> models</span><span class="pun">[</span><span class="pln">makeEl</span><span class=
  1.4070 +"pun">.</span><span class="pln">value</span><span class="pun">][</span><span class="pln">i</span><span class=
  1.4071 +"pun">][</span><span class="str">"name"</span><span class="pun">];</span><span class="pln">
  1.4072 +      option</span><span class="pun">.</span><span class="pln">setAttribute</span><span class=
  1.4073 +"pun">(</span><span class="str">"value"</span><span class="pun">,</span><span class="pln"> models</span><span class=
  1.4074 +"pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.4075 +"pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"type"</span><span class=
  1.4076 +"pun">]</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.4077 +"str">":"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> models</span><span class=
  1.4078 +"pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.4079 +"pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"service"</span><span class=
  1.4080 +"pun">]);</span><span class="pln">
  1.4081 +      modelEl</span><span class="pun">.</span><span class="pln">appendChild</span><span class=
  1.4082 +"pun">(</span><span class="pln">option</span><span class="pun">);</span><span class="pln">
  1.4083      </span><span class="pun">}</span><span class="pln">
  1.4084 -  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.4085 +  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.4086 +"pun">);</span><span class="pln">
  1.4087  
  1.4088 -  modelEl</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'change'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4089 -    </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">navigator</span><span class="pun">.</span><span class="pln">getNetworkServices </span><span class="pun">&amp;&amp;</span><span class="pln">
  1.4090 -         modelEl</span><span class="pun">.</span><span class="pln">value </span><span class="pun">==</span><span class="pln"> </span><span class="str">"upnp:urn:schemas-upnp-org:service:RenderingControl:1"</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4091 -      navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">(</span><span class="pln">modelEl</span><span class="pun">.</span><span class="pln">value</span><span class="pun">,</span><span class="pln"> successCallback</span><span class="pun">,</span><span class="pln"> errorCallback</span><span class="pun">);</span><span class="pln">
  1.4092 -    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">modelEl</span><span class="pun">.</span><span class="pln">value </span><span class="pun">==</span><span class="pln"> </span><span class="str">"zeroconf:_mediarenderer._http._tcp"</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4093 -      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;Service type is not implemented by this application."</span><span class="pun">;</span><span class="pln">
  1.4094 -    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4095 -      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;Service Discovery is not supported!"</span><span class="pun">;</span><span class="pln">
  1.4096 +  modelEl</span><span class="pun">.</span><span class="pln">addEventListener</span><span class=
  1.4097 +"pun">(</span><span class="str">'change'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4098 +"kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4099 +    </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">navigator</span><span class=
  1.4100 +"pun">.</span><span class="pln">getNetworkServices </span><span class="pun">&amp;&amp;</span><span class="pln">
  1.4101 +         modelEl</span><span class="pun">.</span><span class="pln">value </span><span class="pun">==</span><span class=
  1.4102 +"pln"> </span><span class="str">"upnp:urn:schemas-upnp-org:service:RenderingControl:1"</span><span class=
  1.4103 +"pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4104 +      navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
  1.4105 +"pun">(</span><span class="pln">modelEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.4106 +"pun">,</span><span class="pln"> successCallback</span><span class="pun">,</span><span class=
  1.4107 +"pln"> errorCallback</span><span class="pun">);</span><span class="pln">
  1.4108 +    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class=
  1.4109 +"pln"> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class=
  1.4110 +"pln">modelEl</span><span class="pun">.</span><span class="pln">value </span><span class="pun">==</span><span class=
  1.4111 +"pln"> </span><span class="str">"zeroconf:_mediarenderer._http._tcp"</span><span class="pun">)</span><span class=
  1.4112 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.4113 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.4114 +"pln"> </span><span class="str">"&lt;br&gt;Service type is not implemented by this application."</span><span class=
  1.4115 +"pun">;</span><span class="pln">
  1.4116 +    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class=
  1.4117 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.4118 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.4119 +"pln"> </span><span class="str">"&lt;br&gt;Service Discovery is not supported!"</span><span class=
  1.4120 +"pun">;</span><span class="pln">
  1.4121      </span><span class="pun">}</span><span class="pln">
  1.4122 -  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.4123 +  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.4124 +"pun">);</span><span class="pln">
  1.4125  </span><span class="tag">&lt;/script&gt;</span><span class="pln">
  1.4126  
  1.4127  </span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.4128 -  </span><span class="kwd">function</span><span class="pln"> successCallback</span><span class="pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4129 +  </span><span class="kwd">function</span><span class="pln"> successCallback</span><span class=
  1.4130 +"pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.4131 +"pun">{</span><span class="pln">
  1.4132  
  1.4133    </span><span class="com">// Listen for service push notification messages</span><span class="pln">
  1.4134  
  1.4135 -    services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'notify'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">(</span><span class="pln"> msg </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4136 -         debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">" event received: "</span><span class="pun">;</span><span class="pln">
  1.4137 -         debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class="pln"> msg</span><span class="pun">.</span><span class="pln">data</span><span class="pun">;</span><span class="pln">
  1.4138 -    </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.4139 +    services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.4140 +"pln">addEventListener</span><span class="pun">(</span><span class="str">'notify'</span><span class=
  1.4141 +"pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class=
  1.4142 +"pun">(</span><span class="pln"> msg </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.4143 +"pun">{</span><span class="pln">
  1.4144 +         debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class=
  1.4145 +"pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class=
  1.4146 +"pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class=
  1.4147 +"pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.4148 +"str">" event received: "</span><span class="pun">;</span><span class="pln">
  1.4149 +         debug</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.4150 +"pun">+=</span><span class="pln"> msg</span><span class="pun">.</span><span class="pln">data</span><span class=
  1.4151 +"pun">;</span><span class="pln">
  1.4152 +    </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.4153 +"pun">);</span><span class="pln">
  1.4154  
  1.4155   </span><span class="com">// Send a control signal to mute the service audio</span><span class="pln">
  1.4156  
  1.4157 -    </span><span class="kwd">var</span><span class="pln"> svcXhr </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">XMLHttpRequest</span><span class="pun">();</span><span class="pln">
  1.4158 -    svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">url</span><span class="pun">);</span><span class="pln"> </span><span class="com">// services[0].url and its</span><span class="pln">
  1.4159 -                                          </span><span class="com">// subresources have been whitelisted for</span><span class="pln">
  1.4160 -                                          </span><span class="com">// cross-site XHR use in this current</span><span class="pln">
  1.4161 +    </span><span class="kwd">var</span><span class="pln"> svcXhr </span><span class="pun">=</span><span class=
  1.4162 +"pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">XMLHttpRequest</span><span class=
  1.4163 +"pun">();</span><span class="pln">
  1.4164 +    svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class=
  1.4165 +"str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class=
  1.4166 +"lit">0</span><span class="pun">].</span><span class="pln">url</span><span class="pun">);</span><span class=
  1.4167 +"pln"> </span><span class="com">// services[0].url and its</span><span class="pln">
  1.4168 +                                          </span><span class=
  1.4169 +"com">// subresources have been whitelisted for</span><span class="pln">
  1.4170 +                                          </span><span class=
  1.4171 +"com">// cross-site XHR use in this current</span><span class="pln">
  1.4172                                            </span><span class="com">// browsing context.</span><span class="pln">
  1.4173  
  1.4174 -    svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class="pun">(</span><span class="str">'SOAPAction'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'urn:schemas-upnp-org:service:RenderingControl:1#SetMute'</span><span class="pun">);</span><span class="pln">
  1.4175 -    svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class="pun">(</span><span class="str">'Content-Type'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'text/xml; charset="utf-8";'</span><span class="pun">);</span><span class="pln">
  1.4176 +    svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class=
  1.4177 +"pun">(</span><span class="str">'SOAPAction'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4178 +"str">'urn:schemas-upnp-org:service:RenderingControl:1#SetMute'</span><span class="pun">);</span><span class="pln">
  1.4179 +    svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class=
  1.4180 +"pun">(</span><span class="str">'Content-Type'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.4181 +"str">'text/xml; charset="utf-8";'</span><span class="pun">);</span><span class="pln">
  1.4182  
  1.4183 -    svcXhr</span><span class="pun">.</span><span class="pln">onreadystatechange </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">(</span><span class="pln"> response </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4184 -      </span><span class="kwd">if</span><span class="pun">(</span><span class="pln"> response</span><span class="pun">.</span><span class="pln">readyState </span><span class="pun">!=</span><span class="pln"> </span><span class="lit">4</span><span class="pln"> </span><span class="pun">||</span><span class="pln"> response</span><span class="pun">.</span><span class="pln">status </span><span class="pun">!=</span><span class="pln"> </span><span class="lit">200</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
  1.4185 +    svcXhr</span><span class="pun">.</span><span class="pln">onreadystatechange </span><span class=
  1.4186 +"pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class=
  1.4187 +"pun">(</span><span class="pln"> response </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.4188 +"pun">{</span><span class="pln">
  1.4189 +      </span><span class="kwd">if</span><span class="pun">(</span><span class="pln"> response</span><span class=
  1.4190 +"pun">.</span><span class="pln">readyState </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.4191 +"lit">4</span><span class="pln"> </span><span class="pun">||</span><span class="pln"> response</span><span class=
  1.4192 +"pun">.</span><span class="pln">status </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.4193 +"lit">200</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
  1.4194          </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
  1.4195 -      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">" response received: "</span><span class="pun">;</span><span class="pln">
  1.4196 -      debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class="pln"> response</span><span class="pun">.</span><span class="pln">responseXML</span><span class="pun">;</span><span class="pln">
  1.4197 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.4198 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.4199 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.4200 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.4201 +"str">" response received: "</span><span class="pun">;</span><span class="pln">
  1.4202 +      debug</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.4203 +"pun">+=</span><span class="pln"> response</span><span class="pun">.</span><span class=
  1.4204 +"pln">responseXML</span><span class="pun">;</span><span class="pln">
  1.4205      </span><span class="pun">}</span><span class="pln">
  1.4206  
  1.4207      </span><span class="com">// Service messaging to mute the provided service</span><span class="pln">
  1.4208 -    </span><span class="kwd">var</span><span class="pln"> svcMsg </span><span class="pun">=</span><span class="pln"> </span><span class="str">'&lt;?xml version="1.0" encoding="utf-8"?&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4209 -                 </span><span class="str">'&lt;s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" '</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4210 -                   </span><span class="str">'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4211 -                   </span><span class="str">'&lt;s:Body&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4212 -                     </span><span class="str">'&lt;u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4213 -                       </span><span class="str">'&lt;InstanceID&gt;0&lt;/InstanceID&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4214 -                       </span><span class="str">'&lt;Channel&gt;Master&lt;/Channel&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4215 -                       </span><span class="str">'&lt;DesiredMute&gt;true&lt;/DesiredMute&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4216 -                     </span><span class="str">'&lt;/u:SetMute&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4217 -                   </span><span class="str">'&lt;/s:Body&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.4218 +    </span><span class="kwd">var</span><span class="pln"> svcMsg </span><span class="pun">=</span><span class=
  1.4219 +"pln"> </span><span class="str">'&lt;?xml version="1.0" encoding="utf-8"?&gt;'</span><span class=
  1.4220 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.4221 +                 </span><span class=
  1.4222 +"str">'&lt;s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" '</span><span class=
  1.4223 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.4224 +                   </span><span class=
  1.4225 +"str">'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;'</span><span class="pln"> </span><span class=
  1.4226 +"pun">+</span><span class="pln">
  1.4227 +                   </span><span class="str">'&lt;s:Body&gt;'</span><span class="pln"> </span><span class=
  1.4228 +"pun">+</span><span class="pln">
  1.4229 +                     </span><span class=
  1.4230 +"str">'&lt;u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"&gt;'</span><span class=
  1.4231 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.4232 +                       </span><span class="str">'&lt;InstanceID&gt;0&lt;/InstanceID&gt;'</span><span class=
  1.4233 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.4234 +                       </span><span class="str">'&lt;Channel&gt;Master&lt;/Channel&gt;'</span><span class=
  1.4235 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.4236 +                       </span><span class="str">'&lt;DesiredMute&gt;true&lt;/DesiredMute&gt;'</span><span class=
  1.4237 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.4238 +                     </span><span class="str">'&lt;/u:SetMute&gt;'</span><span class="pln"> </span><span class=
  1.4239 +"pun">+</span><span class="pln">
  1.4240 +                   </span><span class="str">'&lt;/s:Body&gt;'</span><span class="pln"> </span><span class=
  1.4241 +"pun">+</span><span class="pln">
  1.4242                   </span><span class="str">'&lt;/s:Envelope&gt;'</span><span class="pun">;</span><span class="pln">
  1.4243  
  1.4244 -    svcXhr</span><span class="pun">.</span><span class="pln">send</span><span class="pun">(</span><span class="pln">svcMsg</span><span class="pun">);</span><span class="pln">
  1.4245 -    debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">" request sent: "</span><span class="pun">;</span><span class="pln">
  1.4246 -    debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class="pln"> svcMsg</span><span class="pun">;</span><span class="pln">
  1.4247 +    svcXhr</span><span class="pun">.</span><span class="pln">send</span><span class="pun">(</span><span class=
  1.4248 +"pln">svcMsg</span><span class="pun">);</span><span class="pln">
  1.4249 +    debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.4250 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.4251 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.4252 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.4253 +"str">" request sent: "</span><span class="pun">;</span><span class="pln">
  1.4254 +    debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class=
  1.4255 +"pln"> svcMsg</span><span class="pun">;</span><span class="pln">
  1.4256    </span><span class="pun">}</span><span class="pln">
  1.4257  
  1.4258 -  </span><span class="kwd">function</span><span class="pln"> errorCallback</span><span class="pun">(</span><span class="pln"> error </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4259 -    debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;An error occurred: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> error</span><span class="pun">.</span><span class="pln">code</span><span class="pun">;</span><span class="pln">
  1.4260 +  </span><span class="kwd">function</span><span class="pln"> errorCallback</span><span class="pun">(</span><span class=
  1.4261 +"pln"> error </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.4262 +    debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.4263 +"pln"> </span><span class="str">"&lt;br&gt;An error occurred: "</span><span class="pln"> </span><span class=
  1.4264 +"pun">+</span><span class="pln"> error</span><span class="pun">.</span><span class="pln">code</span><span class=
  1.4265 +"pun">;</span><span class="pln">
  1.4266    </span><span class="pun">}</span><span class="pln">
  1.4267 -</span><span class="tag">&lt;/script&gt;</span></pre>
  1.4268 -          </div>
  1.4269 -
  1.4270 -       </section>
  1.4271 -
  1.4272 +</span><span class="tag">&lt;/script&gt;</span>
  1.4273 +</pre>
  1.4274 +      </div>
  1.4275 +    </section>
  1.4276      <section id="acknowledgements">
  1.4277 -      <!--OddPage--><h2><span class="secno">B. </span>Acknowledgements</h2>
  1.4278 -
  1.4279 -      <p>Thanks are expressed by the editor to the following individuals for their feedback on this specification to date (in alphabetical order):
  1.4280 -      <br><br>
  1.4281 -      Gar Bergstedt, Lars-Erik Bolstad, Cathy Chan, Hari G Kumar, Bob Lund, Giuseppe Pascale, Marcin Simonides, Clarke Stevens, Christian Söderström, Mark Vickers, ...</p>
  1.4282 -
  1.4283 -      <p>Thanks are also expressed by the editor to the following organizations and groups for their support in producing this specification to date (in alphabetical order):
  1.4284 -      <br><br>
  1.4285 -      CableLabs, Opera Software ASA, <abbr title="World Wide Web Consortium">W3C</abbr> Device APIs Working Group, <abbr title="World Wide Web Consortium">W3C</abbr> Web and TV Interest Group, ...</p>
  1.4286 +      <h2>
  1.4287 +        <span class="secno">B.</span> Acknowledgements
  1.4288 +      </h2>
  1.4289 +      <p>
  1.4290 +        Thanks are expressed by the editor to the following individuals for their feedback on this specification to
  1.4291 +        date (in alphabetical order):<br>
  1.4292 +        <br>
  1.4293 +        Gar Bergstedt, Lars-Erik Bolstad, Cathy Chan, Hari G Kumar, Bob Lund, Giuseppe Pascale, Marcin Simonides,
  1.4294 +        Clarke Stevens, Christian Söderström, Mark Vickers, ...
  1.4295 +      </p>
  1.4296 +      <p>
  1.4297 +        Thanks are also expressed by the editor to the following organizations and groups for their support in
  1.4298 +        producing this specification to date (in alphabetical order):<br>
  1.4299 +        <br>
  1.4300 +        CableLabs, Opera Software ASA, <abbr title="World Wide Web Consortium">W3C</abbr> Device APIs Working Group,
  1.4301 +        <abbr title="World Wide Web Consortium">W3C</abbr> Web and TV Interest Group, ...
  1.4302 +      </p>
  1.4303      </section>
  1.4304 -
  1.4305 -
  1.4306 -<section id="references" class="appendix"><!--OddPage--><h2><span class="secno">C. </span>References</h2><section id="normative-references"><h3><span class="secno">C.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-DNS-SD">[DNS-SD]</dt><dd>S. Cheshire; M. Krochmal. <a href="http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt"><cite>DNS-Based Service Discovery.</cite></a> 27 February 2011. IETF Draft. URL: <a href="http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt">http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt</a>
  1.4307 -</dd><dt id="bib-DOM4">[DOM4]</dt><dd>Anne van Kesteren; Aryeh Gregor; Ms2ger. <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/"><cite>DOM4.</cite></a> URL: <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/">http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/</a>
  1.4308 -</dd><dt id="bib-HTML5">[HTML5]</dt><dd>Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/html5"><cite>HTML5.</cite></a> 29 March 2012. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/html5">http://www.w3.org/TR/html5</a>
  1.4309 -</dd><dt id="bib-MDNS">[MDNS]</dt><dd>S. Cheshire; M. Krochmal. <a href="http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt"><cite>Multicast DNS.</cite></a> 14 February 2011. IETF Draft. URL: <a href="http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt">http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt</a>
  1.4310 -</dd><dt id="bib-RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate Requirement Levels.</cite></a> March 1997. Internet RFC 2119.  URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
  1.4311 -</dd><dt id="bib-UPNP-DEVICEARCH11">[UPNP-DEVICEARCH11]</dt><dd><a href="http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf"><cite>UPnP Device Architecture 1.1</cite></a>. 15 October 2008. UPnP Forum. PDF document. URL: <a href="http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf">http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf</a>
  1.4312 -</dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd>Cameron McCormack. <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/"><cite>Web IDL.</cite></a> 27 September 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a>
  1.4313 -</dd></dl></section></section></body></html>
  1.4314 \ No newline at end of file
  1.4315 +    <section id="references"
  1.4316 +             class="appendix">
  1.4317 +      <h2>
  1.4318 +        <span class="secno">C.</span> References
  1.4319 +      </h2>
  1.4320 +      <section id="normative-references">
  1.4321 +        <h3>
  1.4322 +          <span class="secno">C.1</span> Normative references
  1.4323 +        </h3>
  1.4324 +        <dl class="bibliography">
  1.4325 +          <dt id="bib-DNS-SD">
  1.4326 +            [DNS-SD]
  1.4327 +          </dt>
  1.4328 +          <dd>
  1.4329 +            S. Cheshire; M. Krochmal. <a href=
  1.4330 +            "http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt"><cite>DNS-Based Service Discovery.</cite></a> 27
  1.4331 +            February 2011. IETF Draft. URL: <a href=
  1.4332 +            "http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt">http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt</a>
  1.4333 +          </dd>
  1.4334 +          <dt id="bib-DOM4">
  1.4335 +            [DOM4]
  1.4336 +          </dt>
  1.4337 +          <dd>
  1.4338 +            Anne van Kesteren; Aryeh Gregor; Ms2ger. <a href=
  1.4339 +            "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/"><cite>DOM4.</cite></a> URL: <a href=
  1.4340 +            "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/">http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/</a>
  1.4341 +          </dd>
  1.4342 +          <dt id="bib-HTML5">
  1.4343 +            [HTML5]
  1.4344 +          </dt>
  1.4345 +          <dd>
  1.4346 +            Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/html5"><cite>HTML5.</cite></a> 29 March 2012. W3C
  1.4347 +            Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/html5">http://www.w3.org/TR/html5</a>
  1.4348 +          </dd>
  1.4349 +          <dt id="bib-MDNS">
  1.4350 +            [MDNS]
  1.4351 +          </dt>
  1.4352 +          <dd>
  1.4353 +            S. Cheshire; M. Krochmal. <a href=
  1.4354 +            "http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt"><cite>Multicast DNS.</cite></a> 14
  1.4355 +            February 2011. IETF Draft. URL: <a href=
  1.4356 +            "http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt">http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt</a>
  1.4357 +          </dd>
  1.4358 +          <dt id="bib-RFC2119">
  1.4359 +            [RFC2119]
  1.4360 +          </dt>
  1.4361 +          <dd>
  1.4362 +            S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate
  1.4363 +            Requirement Levels.</cite></a> March 1997. Internet RFC 2119. URL: <a href=
  1.4364 +            "http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
  1.4365 +          </dd>
  1.4366 +          <dt id="bib-UPNP-DEVICEARCH11">
  1.4367 +            [UPNP-DEVICEARCH11]
  1.4368 +          </dt>
  1.4369 +          <dd>
  1.4370 +            <a href="http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf"><cite>UPnP Device Architecture
  1.4371 +            1.1</cite></a>. 15 October 2008. UPnP Forum. PDF document. URL: <a href=
  1.4372 +            "http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf">http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf</a>
  1.4373 +          </dd>
  1.4374 +          <dt id="bib-WEBIDL">
  1.4375 +            [WEBIDL]
  1.4376 +          </dt>
  1.4377 +          <dd>
  1.4378 +            Cameron McCormack. <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/"><cite>Web IDL.</cite></a> 27
  1.4379 +            September 2011. W3C Working Draft. (Work in progress.) URL: <a href=
  1.4380 +            "http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a>
  1.4381 +          </dd>
  1.4382 +        </dl>
  1.4383 +      </section>
  1.4384 +    </section>
  1.4385 +  </body>
  1.4386 +</html>
     2.1 --- a/discovery-api/Overview.src.html	Tue Oct 02 14:51:33 2012 +0200
     2.2 +++ b/discovery-api/Overview.src.html	Tue Oct 02 16:32:06 2012 +0200
     2.3 @@ -1,10 +1,39 @@
     2.4  <!DOCTYPE html>
     2.5 +<!--
     2.6 +
     2.7 +  THIS IS THE WORKING VERSION OF THE CURRENT SPECIFICATION!
     2.8 +
     2.9 +  This specification is built using ReSpec.js <http://dev.w3.org/2009/dap/ReSpec.js/documentation.html>
    2.10 +
    2.11 +  From time to time it's necessary to HTML5 Tidy this document using the tool @ <http://w3c.github.com/tidy-html5/>.
    2.12 +
    2.13 +  The command used to format this document (Overview.src.html) is as follows (replacing all = signs with - signs!):
    2.14 +
    2.15 +  @> 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
    2.16 +
    2.17 +  To publish a new compiled version (Overview.html), we need to open this file (Overview.src.html) in any web browser.
    2.18 +  Once it has loaded we press 'Ctrl + Shift + S' (or 'Cmd' + 'Shift' + 'S' on Mac) and then select
    2.19 +  'Save as HTML (Source)' from the resulting menu.
    2.20 +
    2.21 +  We then replace Overview.html with the produced HTML source of this process.
    2.22 +
    2.23 +  Next we run HTML5 Tidy over our new Overview.html file with the following command (replacing all = signs with - signs!):
    2.24 +
    2.25 +  @> 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
    2.26 +
    2.27 +  Now the specification is ready to be published :)
    2.28 +
    2.29 +-->
    2.30  <html>
    2.31    <head>
    2.32 -    <title>Networked Service Discovery and Messaging</title>
    2.33 -    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
    2.34 -    <script type="text/javascript" class='remove'>
    2.35 -      var respecConfig = {
    2.36 +    <title>
    2.37 +      Network Service Discovery
    2.38 +    </title>
    2.39 +    <meta http-equiv='Content-Type'
    2.40 +          content='text/html; charset=utf-8'>
    2.41 +    <script type="text/javascript"
    2.42 +          class='remove'>
    2.43 +var respecConfig = {
    2.44            specStatus:   "ED",
    2.45            //publishDate:  "2012-08-22",
    2.46            shortName:    "discovery-api",
    2.47 @@ -32,10 +61,13 @@
    2.48            wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/43696/status"
    2.49        };
    2.50      </script>
    2.51 -
    2.52 -    <script src='http://www.w3.org/Tools/respec/respec-w3c-common' type="text/javascript" class='remove' async></script>
    2.53 +    <script src='http://www.w3.org/Tools/respec/respec-w3c-common'
    2.54 +          type="text/javascript"
    2.55 +          class='remove'
    2.56 +          async="">
    2.57 +</script>
    2.58      <style type="text/css">
    2.59 -      /* Custom CSS optimizations (Richard Tibbett) */
    2.60 +/* Custom ReSpec CSS (by Rich Tibbett) */
    2.61  
    2.62        /* Add better spacing to sections */
    2.63        section, .section { margin-bottom: 2em; }
    2.64 @@ -67,187 +99,212 @@
    2.65        table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
    2.66      </style>
    2.67    </head>
    2.68 -
    2.69    <body>
    2.70      <section id='abstract'>
    2.71        <p>
    2.72 -        This specification defines a mechanism for an HTML document to discover and subsequently communicate with <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services
    2.73 -        advertised via common discovery protocols within a user's network.
    2.74 +        This specification defines a mechanism for an HTML document to discover and subsequently communicate with
    2.75 +        <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services advertised via common discovery protocols
    2.76 +        within the current network.
    2.77        </p>
    2.78      </section>
    2.79 -
    2.80      <section id='sotd'>
    2.81        <p>
    2.82 -        This document represents the early consensus of the group on the scope and features of the proposed
    2.83 -        API.
    2.84 +        This document represents the early consensus of the group on the scope and features of the proposed API.
    2.85        </p>
    2.86      </section>
    2.87 -
    2.88      <section class="informative">
    2.89 -      <h3>Introduction</h3>
    2.90 -
    2.91 -      <p>To enable Web pages to connect and communicate with Local-networked Services provided over HTTP, this specification introduces the
    2.92 -      <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a> interface.</p>
    2.93 -
    2.94 +      <h3>
    2.95 +        Introduction
    2.96 +      </h3>
    2.97        <p>
    2.98 -         Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known service type, known by developers and advertised by Local-networked Devices. User authorization, where the user connects the web page to one or more discovered services,
    2.99 -         is expected before the web page is able to interact with any Local-networked Services.
   2.100 +        To enable Web pages to connect and communicate with Local-networked Services provided over HTTP, this
   2.101 +        specification introduces the <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a>
   2.102 +        interface.
   2.103        </p>
   2.104 -
   2.105        <p>
   2.106 -         A web page creates a request to obtain connectivity to services running in the network by specifying a well-known discovery service type that it wishes to interact with.
   2.107 +        Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known
   2.108 +        service type, known by developers and advertised by Local-networked Devices. User authorization, where the user
   2.109 +        connects the web page to one or more discovered services, is expected before the web page is able to interact
   2.110 +        with any Local-networked Services.
   2.111        </p>
   2.112 -
   2.113        <p>
   2.114 -         The user agent, having captured all advertised services on the network from the Service Discovery mechanisms included in this recommendation, attempts to match
   2.115 -      the requested service type to a discovered service according to the processing described herein.
   2.116 +        A web page creates a request to obtain connectivity to services running in the network by specifying a
   2.117 +        well-known discovery service type that it wishes to interact with.
   2.118        </p>
   2.119 -
   2.120        <p>
   2.121 -          If a service connectivity request is successful then the Web page is provided with the necessary information to communicate with the authorized Local-networked Service.
   2.122 -          If the request fails then the Web page will receive an error callback containing an error code describing the cause of Local-networked Service connectivity failure.
   2.123 +        The user agent, having captured all advertised services on the network from the Service Discovery mechanisms
   2.124 +        included in this recommendation, attempts to match the requested service type to a discovered service according
   2.125 +        to the processing described herein.
   2.126        </p>
   2.127 -
   2.128        <p>
   2.129 -         Once connected to a Local-networked Service the Web page can send requests and receive responses to the Local-networked Service via the messaging format and appropriate channel inferred from the service type
   2.130 -         authorized via the provided API.
   2.131 -         The Web page, once connected, can also receive service-pushed events, in the messaging format supported by the Local-networked Device, if such event subscription functionality is provided by the
   2.132 -         connected Local-networked Service.
   2.133 +        If a service connectivity request is successful then the Web page is provided with the necessary information to
   2.134 +        communicate with the authorized Local-networked Service. If the request fails then the Web page will receive an
   2.135 +        error callback containing an error code describing the cause of Local-networked Service connectivity failure.
   2.136        </p>
   2.137 -
   2.138 +      <p>
   2.139 +        Once connected to a Local-networked Service the Web page can send requests and receive responses to the
   2.140 +        Local-networked Service via the messaging format and appropriate channel inferred from the service type
   2.141 +        authorized via the provided API. The Web page, once connected, can also receive service-pushed events, in the
   2.142 +        messaging format supported by the Local-networked Device, if such event subscription functionality is provided
   2.143 +        by the connected Local-networked Service.
   2.144 +      </p>
   2.145        <div class="example">
   2.146 -       <p>Example of requesting a DNS-SD advertised service:</p>
   2.147 -       <hr />
   2.148 -       <pre class="highlight">function showServices( services ) {
   2.149 +        <p>
   2.150 +          Example of requesting a DNS-SD advertised service:
   2.151 +        </p>
   2.152 +        <hr>
   2.153 +        <pre class="highlight">
   2.154 +function showServices( services ) {
   2.155    // Show a list of all the services provided to the web page
   2.156 -  for(var i = 0, l = services.length; i < l; i++) console.log( services[i].name );
   2.157 +  for(var i = 0, l = services.length; i &lt; l; i++) console.log( services[i].name );
   2.158  }
   2.159  
   2.160 -navigator.getNetworkServices('zeroconf:_boxee-jsonrpc._tcp', showServices);</pre>
   2.161 +navigator.getNetworkServices('zeroconf:_boxee-jsonrpc._tcp', showServices);
   2.162 +</pre>
   2.163        </div>
   2.164 -
   2.165        <div class="example">
   2.166 -        <p>Example of requesting a UPnP advertised service, also handling error conditions:</p>
   2.167 -        <hr />
   2.168 -        <pre class="highlight">function showServices( services ) {
   2.169 +        <p>
   2.170 +          Example of requesting a UPnP advertised service, also handling error conditions:
   2.171 +        </p>
   2.172 +        <hr>
   2.173 +        <pre class="highlight">
   2.174 +function showServices( services ) {
   2.175    // Show a list of all the services provided to the web page
   2.176 -  for(var i = 0, l = services.length; i < l; i++) console.log( services[i].name );
   2.177 +  for(var i = 0, l = services.length; i &lt; l; i++) console.log( services[i].name );
   2.178  }
   2.179  
   2.180  function error( e ) {
   2.181    console.log( "Error occurred: " + e.code );
   2.182  }
   2.183  
   2.184 -navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1', showServices, error);</pre>
   2.185 +navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1', showServices, error);
   2.186 +</pre>
   2.187        </div>
   2.188 -
   2.189        <div class="example">
   2.190 -        <p>Example of requesting either a DNS-SD or UPnP advertised service:</p>
   2.191 -        <hr />
   2.192 -        <pre class="highlight">function showServices( services ) {
   2.193 +        <p>
   2.194 +          Example of requesting either a DNS-SD or UPnP advertised service:
   2.195 +        </p>
   2.196 +        <hr>
   2.197 +        <pre class="highlight">
   2.198 +function showServices( services ) {
   2.199    // Show a list of all the services provided to the web page (+ service type)
   2.200 -  for(var i = 0, l = services.length; i < l; i++)
   2.201 +  for(var i = 0, l = services.length; i &lt; l; i++)
   2.202       console.log( services[i].name + '(' + services[i].type + ')' );
   2.203  }
   2.204  
   2.205  navigator.getNetworkServices([
   2.206    'zeroconf:_boxee-jsonrpc._tcp',
   2.207    'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'
   2.208 -], showServices);</pre>
   2.209 +], showServices);
   2.210 +</pre>
   2.211        </div>
   2.212 -
   2.213 -      <p>For more detailed examples see the <a href="#examples">Examples</a> section.
   2.214 +      <p>
   2.215 +        For more detailed examples see the <a href="#examples">Examples</a> section.
   2.216 +      </p>
   2.217      </section>
   2.218 -
   2.219 -    <section
   2.220 -     id='conformance'>
   2.221 -
   2.222 -     <p>Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the
   2.223 -     meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.</p>
   2.224 -
   2.225 -     <p>
   2.226 -      Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements are to be interpreted as requirements on user agents.
   2.227 -     </p>
   2.228 -
   2.229 -     <p>
   2.230 -      Conformance requirements phrased as algorithms or specific steps <em class="ct">MAY</em> be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in
   2.231 -      this specification are intended to be easy to follow, and not intended to be performant.)
   2.232 -     </p>
   2.233 -
   2.234 -     <p>
   2.235 -      The only conformance class defined by this specification is a <dfn>user agent</dfn>.
   2.236 -     </p>
   2.237 -
   2.238 -     <p>
   2.239 -      User agents <em class="ct">MAY</em> impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial of service attacks, to guard against running out of memory, or to work
   2.240 -      around platform-specific limitations.
   2.241 -     </p>
   2.242 -
   2.243 -     <p>
   2.244 -      When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid in development, or for performance reasons), user agents <em class="ct">MUST</em> act as if
   2.245 -      they had no support for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature is accessed via an attribute in a Web
   2.246 -      IDL interface, the attribute itself would be omitted from the objects that implement that interface - leaving the attribute on the object but making it return null or throw an exception
   2.247 -      is insufficient.
   2.248 -     </p>
   2.249 -
   2.250 +    <section id='conformance'>
   2.251 +      <p>
   2.252 +        Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or
   2.253 +        "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should",
   2.254 +        "may", etc) used in introducing the algorithm.
   2.255 +      </p>
   2.256 +      <p>
   2.257 +        Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements
   2.258 +        are to be interpreted as requirements on user agents.
   2.259 +      </p>
   2.260 +      <p>
   2.261 +        Conformance requirements phrased as algorithms or specific steps <em class="ct">MAY</em> be implemented in any
   2.262 +        manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification
   2.263 +        are intended to be easy to follow, and not intended to be performant.)
   2.264 +      </p>
   2.265 +      <p>
   2.266 +        The only conformance class defined by this specification is a <dfn>user agent</dfn>.
   2.267 +      </p>
   2.268 +      <p>
   2.269 +        User agents <em class="ct">MAY</em> impose implementation-specific limits on otherwise unconstrained inputs,
   2.270 +        e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around
   2.271 +        platform-specific limitations.
   2.272 +      </p>
   2.273 +      <p>
   2.274 +        When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid
   2.275 +        in development, or for performance reasons), user agents <em class="ct">MUST</em> act as if they had no support
   2.276 +        for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a
   2.277 +        particular feature is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted
   2.278 +        from the objects that implement that interface - leaving the attribute on the object but making it return null
   2.279 +        or throw an exception is insufficient.
   2.280 +      </p>
   2.281        <section>
   2.282 -         <h3>Dependencies</h3>
   2.283 -
   2.284 -         This specification relies on several other underlying specifications.
   2.285 -
   2.286 -         <dl>
   2.287 -            <dt>HTML</dt>
   2.288 -            <dd>Many fundamental concepts from HTML are used by this specification. [[!HTML5]]</dd>
   2.289 -            <dt>WebIDL</dt>
   2.290 -            <dd>The IDL blocks in this specification use the semantics of the WebIDL specification. [[!WEBIDL]]</dd>
   2.291 -         </dl>
   2.292 +        <h3>
   2.293 +          Dependencies
   2.294 +        </h3>This specification relies on several other underlying specifications.
   2.295 +        <dl>
   2.296 +          <dt>
   2.297 +            HTML
   2.298 +          </dt>
   2.299 +          <dd>
   2.300 +            Many fundamental concepts from HTML are used by this specification. [[!HTML5]]
   2.301 +          </dd>
   2.302 +          <dt>
   2.303 +            WebIDL
   2.304 +          </dt>
   2.305 +          <dd>
   2.306 +            The IDL blocks in this specification use the semantics of the WebIDL specification. [[!WEBIDL]]
   2.307 +          </dd>
   2.308 +        </dl>
   2.309        </section>
   2.310      </section>
   2.311 -
   2.312      <section>
   2.313 -      <h3>Terminology</h3>
   2.314 -
   2.315 +      <h3>
   2.316 +        Terminology
   2.317 +      </h3>
   2.318        <p>
   2.319 -         The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes used instead of the more accurate "an object implementing the interface <code>Foo</code>".
   2.320 +        The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes
   2.321 +        used instead of the more accurate "an object implementing the interface <code>Foo</code>".
   2.322        </p>
   2.323 -
   2.324        <p>
   2.325 -         The term DOM is used to refer to the API set made available to scripts in Web applications, and does not necessarily imply the existence of an actual <code>Document</code> object or of any
   2.326 -         other <code>Node</code> objects as defined in the DOM Core specifications. [[!DOM4]]
   2.327 +        The term DOM is used to refer to the API set made available to scripts in Web applications, and does not
   2.328 +        necessarily imply the existence of an actual <code>Document</code> object or of any other <code>Node</code>
   2.329 +        objects as defined in the DOM Core specifications. [[!DOM4]]
   2.330        </p>
   2.331 -
   2.332        <p>
   2.333 -         An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and is said to be <em>setting</em> when a new value is assigned to it.
   2.334 +        An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and
   2.335 +        is said to be <em>setting</em> when a new value is assigned to it.
   2.336        </p>
   2.337 -
   2.338        <p>
   2.339 -        A <dfn>valid service type</dfn> is a string that begins with <code>upnp:</code> or <code>zeroconf:</code> 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, U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
   2.340 +        A <dfn>valid service type</dfn> is a string that begins with <code>upnp:</code> or <code>zeroconf:</code>
   2.341 +        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,
   2.342 +        U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
   2.343        </p>
   2.344 -      <p></p>
   2.345 -
   2.346        <p>
   2.347 -        A <a>valid service type</a> provided in the <code>type</code> attribute of the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the services currently contained in the <a>list of available service records</a> according to the algorithms defined in this specification.
   2.348 +        A <a>valid service type</a> provided in the <code>type</code> attribute of the <a href=
   2.349 +        "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the
   2.350 +        services currently contained in the <a>list of available service records</a> according to the algorithms
   2.351 +        defined in this specification.
   2.352        </p>
   2.353 -
   2.354        <p>
   2.355 -        A <dfn>user-agent generated callback url</dfn> is a Local-network accessible URL endpoint that a <a>user agent</a> generates and maintains for receiving HTTP NOTIFY requests from UPnP Event sources. It is only required when the user agent implements UPnP Service Discovery as defined in
   2.356 -        this specification.
   2.357 +        A <dfn>user-agent generated callback url</dfn> is a Local-network accessible URL endpoint that a <a>user
   2.358 +        agent</a> generates and maintains for receiving HTTP NOTIFY requests from UPnP Event sources. It is only
   2.359 +        required when the user agent implements UPnP Service Discovery as defined in this specification.
   2.360        </p>
   2.361 -
   2.362      </section>
   2.363 -
   2.364      <section>
   2.365 -     <h2>Requesting networked services</h2>
   2.366 -
   2.367 -
   2.368 -<pre class="widl">[Supplemental, NoInterfaceObject]
   2.369 +      <h2>
   2.370 +        Requesting networked services
   2.371 +      </h2>
   2.372 +      <pre class="widl">
   2.373 +[Supplemental, NoInterfaceObject]
   2.374  interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
   2.375    // Obtain a Local-networked Service
   2.376    void <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type,
   2.377 -                           in <a href="#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
   2.378 -                           in optional <a href="#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
   2.379 +                           in <a href=
   2.380 +"#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
   2.381 +                           in optional <a href=
   2.382 +"#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
   2.383  };
   2.384 -<a class="externalDFN" href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href="#navigatornetworkservice">NavigatorNetworkService</a>;
   2.385 +<a class="externalDFN"
   2.386 +     href=
   2.387 +     "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href=
   2.388 +     "#navigatornetworkservice">NavigatorNetworkService</a>;
   2.389  
   2.390  [Callback=FunctionOnly, NoInterfaceObject]
   2.391  interface <dfn id="navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</dfn> {
   2.392 @@ -266,441 +323,453 @@
   2.393    void handleEvent( in <a href="#navigatornetworkserviceerror">NavigatorNetworkServiceError</a> error );
   2.394  };
   2.395  </pre>
   2.396 -
   2.397 -  <section>
   2.398 -   <h2>Methods</h2>
   2.399 -
   2.400 -      <dl class="domintro">
   2.401 -        <dt>
   2.402 -          <var title="">window</var>
   2.403 -           .
   2.404 -          <code title="dom-navigator">
   2.405 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a>
   2.406 -          </code>
   2.407 -           .
   2.408 -          <code title="dom-navigator-getNetworkServices">
   2.409 -            <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>
   2.410 -          </code>
   2.411 -          (
   2.412 -          <var title="">type</var>
   2.413 -          ,
   2.414 -          <var title="">successCallback</var>
   2.415 -           [,
   2.416 -          <var title="">errorCallback</var>
   2.417 -           ] )
   2.418 -        </dt>
   2.419 -        <dd>
   2.420 -          <p>Prompts the user to select one or more discovered network services that have advertised support for the requested service type.</p>
   2.421 +      <section>
   2.422 +        <h2>
   2.423 +          Methods
   2.424 +        </h2>
   2.425 +        <dl class="domintro">
   2.426 +          <dt>
   2.427 +            <var title="">window</var> . <code title="dom-navigator"><a href=
   2.428 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a></code> .
   2.429 +            <code title="dom-navigator-getNetworkServices"><a href=
   2.430 +            "#dom-navigator-getnetworkservices">getNetworkServices</a></code> ( <var title="">type</var> , <var title=
   2.431 +            "">successCallback</var> [, <var title="">errorCallback</var> ] )
   2.432 +          </dt>
   2.433 +          <dd>
   2.434 +            <p>
   2.435 +              Prompts the user to select one or more discovered network services that have advertised support for the
   2.436 +              requested service type.
   2.437 +            </p>
   2.438 +            <p>
   2.439 +              The <var title="">type</var> argument contains one or more <a>valid service type</a> tokens that the web
   2.440 +              page would like to interact with.
   2.441 +            </p>
   2.442 +            <p>
   2.443 +              If the user accepts, the <var title="">successCallback</var> is invoked, with one or more <code><a href=
   2.444 +              "#networkservice"><code>NetworkService</code></a></code> objects as its argument.
   2.445 +            </p>
   2.446 +            <p>
   2.447 +              If the user declines, the <var title="">errorCallback</var> (if any) is invoked.
   2.448 +            </p>
   2.449 +          </dd>
   2.450 +        </dl>
   2.451 +        <div>
   2.452            <p>
   2.453 -            The
   2.454 -            <var title="">type</var>
   2.455 -             argument contains one or more <a>valid service type</a> tokens that the web page would like to interact with.
   2.456 +            When the <dfn id="dom-navigator-getnetworkservices"
   2.457 +               title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
   2.458 +               errorCallback])</code></dfn> method is called, the <a>user agent</a> <em class="ct">MUST</em> run the
   2.459 +               following steps:
   2.460            </p>
   2.461 -          <p>
   2.462 -            If the user accepts, the
   2.463 -            <var title="">successCallback</var>
   2.464 -             is
   2.465 -          invoked, with one or more
   2.466 -            <code>
   2.467 -              <a href="#networkservice"><code>NetworkService</code></a>
   2.468 -            </code>
   2.469 -             objects as
   2.470 -          its argument.
   2.471 -          </p>
   2.472 -          <p>
   2.473 -            If the user declines, the
   2.474 -            <var title="">errorCallback</var>
   2.475 -             (if
   2.476 -          any) is invoked.
   2.477 -          </p>
   2.478 -        </dd>
   2.479 -      </dl>
   2.480 -
   2.481 -       <div>
   2.482 -          <p>
   2.483 -            When the <dfn id="dom-navigator-getnetworkservices" title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[, errorCallback])</code></dfn> method is called, the <a>user agent</a> <em class="ct">MUST</em> run the following steps:
   2.484 -          </p>
   2.485 -
   2.486            <ol class="rule">
   2.487 -
   2.488 +            <li>Let <var>requested control types</var> be initially set to an empty array.
   2.489 +            </li>
   2.490 +            <li>If <var>type</var> is an array consisting of one or more <a>valid service type</a> tokens, then let
   2.491 +            <var>requested control types</var> by the value of <var>type</var>, removing any non-<a>valid service
   2.492 +            type</a> tokens from the resulting array.
   2.493 +            </li>
   2.494 +            <li>If <var>type</var> is a string consisting of one <a>valid service type</a> token, then let
   2.495 +            <var>requested control types</var> be an array containing one item with a value of <var>type</var>.
   2.496 +            </li>
   2.497 +            <li>If <var>requested control types</var> is an array that contains at least one or more <a title=
   2.498 +            "valid service type">valid service type</a> tokens then continue to the step labeled <em>process</em>
   2.499 +            below. Otherwise, the <a>user agent</a> <em class="ct">MUST</em> <a href=
   2.500 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.501 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
   2.502 +                  object of type <code>Function</code>, with a new <a href=
   2.503 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
   2.504 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
   2.505 +                  (<a href=
   2.506 +                  "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
   2.507 +                  its argument, abort any remaining steps and return.
   2.508 +            </li>
   2.509              <li>
   2.510 -              Let <var>requested control types</var> be initially set to an empty array.
   2.511 +              <em>Process</em>: Let <var>services found</var> be an empty array.
   2.512              </li>
   2.513 -
   2.514 -            <li>
   2.515 -               If <var>type</var> is an array consisting of one or more <a>valid service type</a> tokens, then let <var>requested control types</var> by the value of <var>type</var>, removing any non-<a>valid service type</a> tokens from the resulting array.
   2.516 +            <li>For each <var>available service</var> in the <a>list of available service records</a> run the following
   2.517 +            steps:
   2.518 +              <ol class="rule">
   2.519 +                <li>For each <var>requested control type</var> in <var>requested control types</var>: If <var>available
   2.520 +                service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>
   2.521 +                  matched service</var> equal the value of <var>available service</var> and continue at the step
   2.522 +                  labeled <var>attach</var> below.
   2.523 +                </li>
   2.524 +                <li>Continue at the next <var>available service</var>.
   2.525 +                </li>
   2.526 +                <li>
   2.527 +                  <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
   2.528 +                  <ol class="rule">
   2.529 +                    <li>Let <var>new service object</var> be a new <a href=
   2.530 +                    "#networkservice"><code>NetworkService</code></a> object, mapping the parameters of <var>matched
   2.531 +                    service</var> to this new object where possible.
   2.532 +                    </li>
   2.533 +                    <li>Append <var>new service object</var> to the <var>services found</var> array.
   2.534 +                    </li>
   2.535 +                  </ol>
   2.536 +                </li>
   2.537 +              </ol>
   2.538              </li>
   2.539 -
   2.540 -            <li>
   2.541 -               If <var>type</var> is a string consisting of one <a>valid service type</a> token, then let <var>requested control types</var> be an array containing one item with a value of <var>type</var>.
   2.542 +            <li>If <var>services found</var> is an empty array, then the <a>user agent</a> <em class="ct">MUST</em>
   2.543 +            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.544 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
   2.545 +                  object of type <code>Function</code>, with a new <a href=
   2.546 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
   2.547 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
   2.548 +                  (<a href=
   2.549 +                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
   2.550 +                  argument, abort any remaining steps and return.
   2.551              </li>
   2.552 -
   2.553 -            <li>
   2.554 -               If <var>requested control types</var> is an array that contains at least one or more <a title="valid service type">valid service type</a> tokens then continue to the step labeled <em>process</em> below. Otherwise, the <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
   2.555 -                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
   2.556 -                  (<a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as its argument,
   2.557 -                   abort any remaining steps and return.
   2.558 +            <li>Return, and run the remaining steps asynchronously.
   2.559              </li>
   2.560 -
   2.561 -            <li>
   2.562 -               <em>Process</em>: Let <var>services found</var> be an empty array.
   2.563 +            <li>Optionally, e.g. based on a previously-established user preference, for security reasons, or due to
   2.564 +            platform limitations, the <a>user agent</a> <em class="ct">MAY</em> <a href=
   2.565 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.566 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
   2.567 +                  object of type <code>Function</code>, with a new <a href=
   2.568 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
   2.569 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
   2.570 +                  (<a href=
   2.571 +                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
   2.572 +                  argument, abort any remaining steps and return.
   2.573              </li>
   2.574 -
   2.575 -            <li>
   2.576 -               For each <var>available service</var> in the <a>list of available service records</a> run the following steps:
   2.577 -               <ol class="rule">
   2.578 -                  <li>
   2.579 -                    For each <var>requested control type</var> in <var>requested control types</var>: If <var>available service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>matched service</var> equal the value of <var>available service</var> and continue at the step labeled <var>attach</var> below.
   2.580 -                  </li>
   2.581 -                  <li>
   2.582 -                     Continue at the next <var>available service</var>.
   2.583 -                  </li>
   2.584 -                  <li>
   2.585 -                     <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
   2.586 -
   2.587 -                     <ol class="rule">
   2.588 -                        <li>
   2.589 -                           Let <var>new service object</var> be a new <a href="#networkservice"><code>NetworkService</code></a> object, mapping the parameters of
   2.590 -                     <var>matched service</var> to this new object where possible.
   2.591 -                        </li>
   2.592 -                        <li>
   2.593 -                           Append <var>new service object</var> to the <var>services found</var> array.
   2.594 -                        </li>
   2.595 -                     </ol>
   2.596 -                  </li>
   2.597 -               </ol>
   2.598 -            </li>
   2.599 -
   2.600 -            <li>
   2.601 -               If <var>services found</var> is an empty array, then the <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
   2.602 -                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
   2.603 -                 (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
   2.604 -            </li>
   2.605 -
   2.606 -            <li>
   2.607 -               Return, and run the remaining steps asynchronously.
   2.608 -            </li>
   2.609 -
   2.610 -            <li>
   2.611 -               Optionally, e.g. based on a previously-established user preference, for security reasons, or due to platform limitations, the <a>user agent</a> <em class="ct">MAY</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
   2.612 -                 <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
   2.613 -                 (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
   2.614 -            </li>
   2.615 -
   2.616 -            <li>
   2.617 -                  The <a>user agent</a> <em class="ct">MUST</em> prompt the user in a user-agent-specific manner for permission to provide the
   2.618 -                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
   2.619 -                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> with an array of
   2.620 -                  <a href="#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of <var>services found</var>.
   2.621 -
   2.622 -               <p>
   2.623 -                  If the user grants permission to access one or more networked services then the <a>user agent</a> SHOULD include an
   2.624 -                  "ongoing local-network communication" indicator.
   2.625 -               </p>
   2.626 -
   2.627 -               <p>If the user denies permission, then the <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose
   2.628 -                <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
   2.629 -                (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its argument, abort any remaining steps and return.
   2.630 +            <li>The <a>user agent</a> <em class="ct">MUST</em> prompt the user in a user-agent-specific manner for
   2.631 +            permission to provide the <a href=
   2.632 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
   2.633 +                  class="externalDFN">entry script</a>'s <a href=
   2.634 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
   2.635 +                  class="externalDFN">origin</a> with an array of <a href=
   2.636 +                  "#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of
   2.637 +                  <var>services found</var>.
   2.638 +              <p>
   2.639 +                If the user grants permission to access one or more networked services then the <a>user agent</a>
   2.640 +                SHOULD include an "ongoing local-network communication" indicator.
   2.641                </p>
   2.642 -
   2.643 +              <p>
   2.644 +                If the user denies permission, then the <a>user agent</a> <em class="ct">MUST</em> <a href=
   2.645 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.646 +                   class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
   2.647 +                   object of type <code>Function</code>, with a new <a href=
   2.648 +                   "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
   2.649 +                   "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
   2.650 +                   (<a href=
   2.651 +                   "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
   2.652 +                   argument, abort any remaining steps and return.
   2.653 +              </p>
   2.654                <p>
   2.655                  If the user never responds, this algorithm stalls on this step.
   2.656                </p>
   2.657 -
   2.658              </li>
   2.659 -
   2.660 -            <li>
   2.661 -               Let <var>services</var> be the array of one or more <a href="#networkservice"><code>NetworkService</code></a> objects for which the user granted permission.
   2.662 +            <li>Let <var>services</var> be the array of one or more <a href=
   2.663 +            "#networkservice"><code>NetworkService</code></a> objects for which the user granted permission.
   2.664              </li>
   2.665 -
   2.666 -            <li>
   2.667 -               For each Object <var>service</var> in <var>services</var>, run the following substeps:
   2.668 -
   2.669 -               <ol class="rule">
   2.670 -                  <li>
   2.671 -                     Add the <var>service</var>'s <code>url</code> parameter to the <a>entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
   2.672 -                  </li>
   2.673 -                  <li>
   2.674 -                    If <var>service</var>'s <code>type</code> parameter begins with the DOMString &quot;<code>upnp:</code>&quot; and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a>setup a UPnP Events Subscription</a> for <var>service</var>.
   2.675 -                  </li>
   2.676 -               </ol>
   2.677 +            <li>For each Object <var>service</var> in <var>services</var>, run the following substeps:
   2.678 +              <ol class="rule">
   2.679 +                <li>Add the <var>service</var>'s <code>url</code> parameter to the <a>entry script origin's
   2.680 +                  <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
   2.681 +                </li>
   2.682 +                <li>If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>"
   2.683 +                and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a>setup a UPnP Events
   2.684 +                Subscription</a> for <var>service</var>.
   2.685 +                </li>
   2.686 +              </ol>
   2.687              </li>
   2.688 -
   2.689 -            <li>
   2.690 -               Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a> object.
   2.691 +            <li>Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a>
   2.692 +            object.
   2.693              </li>
   2.694 -
   2.695 -            <li>
   2.696 -               Set <var>services manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of services currently found in the <a>list of available service records</a> whose <code>type</code> property matches any of the tokens requested in <var>requested control types</var>.
   2.697 +            <li>Set <var>services manager</var>'s <a href=
   2.698 +            "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
   2.699 +            services currently found in the <a>list of available service records</a> whose <code>type</code> property
   2.700 +            matches any of the tokens requested in <var>requested control types</var>.
   2.701              </li>
   2.702 -
   2.703 -            <li>
   2.704 -              Add the set of <var>services</var> to the <a>list of authorized service records</a> internally against the newly created <var>services manager</var> object.
   2.705 +            <li>Add the set of <var>services</var> to the <a>list of authorized service records</a> internally against
   2.706 +            the newly created <var>services manager</var> object.
   2.707              </li>
   2.708 -
   2.709 -            <li>
   2.710 -               The <a>user agent</a> <em class="ct">MUST</em> <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with
   2.711 -               <var>services manager</var> as its argument.
   2.712 +            <li>The <a>user agent</a> <em class="ct">MUST</em> <a href=
   2.713 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.714 +                  class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with <var>services
   2.715 +                  manager</var> as its argument.
   2.716              </li>
   2.717 -
   2.718            </ol>
   2.719 -
   2.720            <p>
   2.721 -            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source" class="externalDFN">task source</a> for these
   2.722 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task" class="externalDFN">tasks</a> is the
   2.723 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source" class="externalDFN">user interaction task source</a>.
   2.724 +            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source"
   2.725 +               class="externalDFN">task source</a> for these <a href=
   2.726 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task"
   2.727 +               class="externalDFN">tasks</a> is the <a href=
   2.728 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source"
   2.729 +               class="externalDFN">user interaction task source</a>.
   2.730            </p>
   2.731 -
   2.732            <p>
   2.733 -            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the <a>user agent</a> <em class="ct">MUST</em> add the <code>url</code> property
   2.734 -             to the <dfn>entry script origin's URL whitelist</dfn>. This list enables the
   2.735 -            Web page to override and initiate cross-site resource requests towards these URLs, and any sub-resources of these URLs, within the current
   2.736 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
   2.737 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
   2.738 -            Web Messaging, XMLHttpRequest).
   2.739 -         </p>
   2.740 -
   2.741 -         <p>
   2.742 -            If the user navigates away from the current browsing context, the <a>user agent</a> <em class="ct">MUST</em> remove all previously whitelisted urls from the <a>entry script origin's URL whitelist</a>.
   2.743 -            There is no persistence to network service selections provided to a web page. It is not possible to access a previously white-listed networked service without the necessary user authorization in all of the following cases:
   2.744 -            <ul>
   2.745 -              <li>If the current script is reloaded at any point in the same or different window.</li>
   2.746 -              <li>if the current script reinvokes the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its execution.</li>
   2.747 -              <li>If the user navigates forward or back in their history to reload the current page.</li>
   2.748 -              <li>If a script is running in a different origin.</li>
   2.749 -            </ul>
   2.750 -         </p>
   2.751 -
   2.752 -      </div>
   2.753 -      </section>
   2.754 -
   2.755 -      <section>
   2.756 -         <h3>Error Handling</h3>
   2.757 -
   2.758 -      <dl class="domintro">
   2.759 -        <dt>
   2.760 -          <var title="">error</var>
   2.761 -           .
   2.762 -          <code title="dom-NavigatorNetworkServiceError-code">
   2.763 -            <a href="#dom-navigatornetworkserviceerror-code">code</a>
   2.764 -          </code>
   2.765 -        </dt>
   2.766 -        <dd>
   2.767 +            When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the
   2.768 +            <a>user agent</a> <em class="ct">MUST</em> add the <code>url</code> property to the <dfn>entry script
   2.769 +            origin's URL whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource
   2.770 +            requests towards these URLs, and any sub-resources of these URLs, within the current <a href=
   2.771 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
   2.772 +               class="externalDFN">entry script</a>'s <a href=
   2.773 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
   2.774 +               class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
   2.775 +               Web Messaging, XMLHttpRequest).
   2.776 +          </p>
   2.777            <p>
   2.778 -            Returns the current error's error code. At the current time, this will be <code>1</code> or <code>2</code>, for which the
   2.779 -            corresponding error constants
   2.780 -            <a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and
   2.781 -            <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are defined.
   2.782 +            If the user navigates away from the current browsing context, the <a>user agent</a> <em class=
   2.783 +            "ct">MUST</em> remove all previously whitelisted urls from the <a>entry script origin's URL whitelist</a>.
   2.784 +            There is no persistence to network service selections provided to a web page. It is not possible to access
   2.785 +            a previously white-listed networked service without the necessary user authorization in all of the
   2.786 +            following cases:
   2.787            </p>
   2.788 -        </dd>
   2.789 -      </dl>
   2.790 -
   2.791 -         <p>
   2.792 -            The <dfn id="dom-navigatornetworkserviceerror-code" title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a
   2.793 -            <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class="ct">MUST</em> return the code for the error, which will be one of the following:
   2.794 -         </p>
   2.795 -
   2.796 -         <dl>
   2.797 -            <dt>
   2.798 -               <dfn id="dom-navigatornetworkserviceerror-permission_denied" title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (numeric value 1)
   2.799 -            </dt>
   2.800 -            <dd>
   2.801 -               The user or user agent denied the page permission to access any services.
   2.802 -            </dd>
   2.803 -            <dt>
   2.804 -               <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix" title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn> (numeric value 2)
   2.805 -            </dt>
   2.806 -            <dd>
   2.807 -               No <a>valid service type</a> tokens were provided in the method invocation.
   2.808 -            </dd>
   2.809 -         </dl>
   2.810 -
   2.811 -      </section>
   2.812 -
   2.813 +          <ul>
   2.814 +            <li>If the current script is reloaded at any point in the same or different window.
   2.815 +            </li>
   2.816 +            <li>if the current script reinvokes the <a href=
   2.817 +            "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its
   2.818 +            execution.
   2.819 +            </li>
   2.820 +            <li>If the user navigates forward or back in their history to reload the current page.
   2.821 +            </li>
   2.822 +            <li>If a script is running in a different origin.
   2.823 +            </li>
   2.824 +          </ul>
   2.825 +        </div>
   2.826        </section>
   2.827        <section>
   2.828 -      <h2>Obtaining networked services</h2>
   2.829 -
   2.830 +        <h3>
   2.831 +          Error Handling
   2.832 +        </h3>
   2.833 +        <dl class="domintro">
   2.834 +          <dt>
   2.835 +            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href=
   2.836 +            "#dom-navigatornetworkserviceerror-code">code</a></code>
   2.837 +          </dt>
   2.838 +          <dd>
   2.839 +            <p>
   2.840 +              Returns the current error's error code. At the current time, this will be <code>1</code> or
   2.841 +              <code>2</code>, for which the corresponding error constants <a href=
   2.842 +              "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
   2.843 +              "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
   2.844 +              defined.
   2.845 +            </p>
   2.846 +          </dd>
   2.847 +        </dl>
   2.848 +        <p>
   2.849 +          The <dfn id="dom-navigatornetworkserviceerror-code"
   2.850 +             title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <a href=
   2.851 +             "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class=
   2.852 +             "ct">MUST</em> return the code for the error, which will be one of the following:
   2.853 +        </p>
   2.854 +        <dl>
   2.855 +          <dt>
   2.856 +            <dfn id="dom-navigatornetworkserviceerror-permission_denied"
   2.857 +                title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
   2.858 +                (numeric value 1)
   2.859 +          </dt>
   2.860 +          <dd>
   2.861 +            The user or user agent denied the page permission to access any services.
   2.862 +          </dd>
   2.863 +          <dt>
   2.864 +            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix"
   2.865 +                title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
   2.866 +                (numeric value 2)
   2.867 +          </dt>
   2.868 +          <dd>
   2.869 +            No <a>valid service type</a> tokens were provided in the method invocation.
   2.870 +          </dd>
   2.871 +        </dl>
   2.872 +      </section>
   2.873 +    </section>
   2.874 +    <section>
   2.875 +      <h2>
   2.876 +        Obtaining networked services
   2.877 +      </h2>
   2.878        <p>
   2.879 -         The <a href="#networkservices"><code>NetworkServices</code></a> interface is the top-level response object from a call to <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> and provides access to a set of user-authorized <a href="#networkservice"><code>NetworkService</code></a> objects for the given request.
   2.880 +        The <a href="#networkservices"><code>NetworkServices</code></a> interface is the top-level response object from
   2.881 +        a call to <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> and provides access
   2.882 +        to a set of user-authorized <a href="#networkservice"><code>NetworkService</code></a> objects for the given
   2.883 +        request.
   2.884        </p>
   2.885 -
   2.886 -<pre class="widl">
   2.887 +      <pre class="widl">
   2.888  [NoInterfaceObject]
   2.889  interface <dfn id="networkservices">NetworkServices</dfn> {
   2.890    readonly attribute unsigned long    <a href="#dom-networkservices-length">length</a>;
   2.891    getter <a href="#networkservice">NetworkService</a> (unsigned long index);
   2.892 -  <a href="#networkservice">NetworkService</a>? <a href="#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
   2.893 +  <a href="#networkservice">NetworkService</a>? <a href=
   2.894 +"#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
   2.895  
   2.896    readonly attribute unsigned long    <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>;
   2.897  
   2.898    // event handler attributes
   2.899 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
   2.900 -           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler" class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
   2.901 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
   2.902 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
   2.903 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
   2.904 +     class="externalDFN">EventHandler</a>     <a href=
   2.905 +     "#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
   2.906  
   2.907  };
   2.908  
   2.909 -<a href="#networkservices">NetworkServices</a> implements <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget" class="externalDFN">EventTarget</a>;
   2.910 +<a href="#networkservices">NetworkServices</a> implements <a href=
   2.911 +"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
   2.912 +     class="externalDFN">EventTarget</a>;
   2.913  </pre>
   2.914 -
   2.915        <section>
   2.916 -      <h2>Attributes</h2>
   2.917 -
   2.918 +        <h2>
   2.919 +          Attributes
   2.920 +        </h2>
   2.921          <dl class="domintro">
   2.922            <dt>
   2.923 -            <code title="dom-networkservices-length">
   2.924 -              <a href="#dom-networkservices-length">length</a>
   2.925 -            </code>
   2.926 +            <code title="dom-networkservices-length"><a href="#dom-networkservices-length">length</a></code>
   2.927            </dt>
   2.928            <dd>
   2.929              <p>
   2.930 -              Returns the current number of services belonging in the respective object's <a>list of authorized service records</a>.
   2.931 +              Returns the current number of services belonging in the respective object's <a>list of authorized service
   2.932 +              records</a>.
   2.933              </p>
   2.934            </dd>
   2.935            <dt>
   2.936 -            <code title="dom-networkservices-servicesavailable">
   2.937 -              <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>
   2.938 -            </code>
   2.939 +            <code title="dom-networkservices-servicesavailable"><a href=
   2.940 +            "#dom-networkservices-servicesavailable">servicesAvailable</a></code>
   2.941            </dt>
   2.942            <dd>
   2.943              <p>
   2.944 -              Returns the current number of services matching one of the app-requested <a>valid service type</a> tokens in the
   2.945 -              <a>list of available service records</a>.
   2.946 +              Returns the current number of services matching one of the app-requested <a>valid service type</a> tokens
   2.947 +              in the <a>list of available service records</a>.
   2.948              </p>
   2.949            </dd>
   2.950          </dl>
   2.951 -
   2.952          <div>
   2.953 -           <p>
   2.954 -              The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="ct">MUST</em> return the number of services represented in the object's corresponding <a>list of authorized service records</a> at the time of getting.
   2.955 -           </p>
   2.956 -
   2.957 -           <p>
   2.958 -              The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute <em class="ct">MUST</em> return the number of services in the <a>list of available service records</a> whose <code>type</code> attribute matches any of the <a>valid service type</a> tokens that was initially used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
   2.959 -           </p>
   2.960 -
   2.961 +          <p>
   2.962 +            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="ct">MUST</em>
   2.963 +            return the number of services represented in the object's corresponding <a>list of authorized service
   2.964 +            records</a> at the time of getting.
   2.965 +          </p>
   2.966 +          <p>
   2.967 +            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute
   2.968 +            <em class="ct">MUST</em> return the number of services in the <a>list of available service records</a>
   2.969 +            whose <code>type</code> attribute matches any of the <a>valid service type</a> tokens that was initially
   2.970 +            used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
   2.971 +          </p>
   2.972          </div>
   2.973 -
   2.974        </section>
   2.975 -
   2.976        <section>
   2.977 -      <h2>Methods</h2>
   2.978 +        <h2>
   2.979 +          Methods
   2.980 +        </h2>
   2.981          <dl class="domintro">
   2.982 -        <dt>
   2.983 -          <code title="networkservices-getter">
   2.984 -            <a href="#networkservices">services</a>
   2.985 -          </code>
   2.986 -          [
   2.987 -          <var title="">index</var>
   2.988 -          ]
   2.989 -        </dt>
   2.990 -        <dd>
   2.991 -          <p>
   2.992 -            Returns the specified <a href="#networkservice"><code>NetworkService</code></a> object.
   2.993 -          </p>
   2.994 -        </dd>
   2.995 -        <dt>
   2.996 -          <code title="networkservices-getter">
   2.997 -            <a href="#networkservices">services</a>
   2.998 -          </code>
   2.999 -          .
  2.1000 -          <code title="dom-networkservices-getservicebyid">
  2.1001 -            <a href="#dom-networkservices-getservicebyid">getServiceById</a>
  2.1002 -          </code>
  2.1003 -          (
  2.1004 -          <var title="">id</var>
  2.1005 -          )
  2.1006 -        </dt>
  2.1007 -        <dd>
  2.1008 -          <p>
  2.1009 -            Returns the <a href="#networkservice"><code>NetworkService</code></a> object with the given identifier, or null if no
  2.1010 -            service has that identifier.
  2.1011 -          </p>
  2.1012 -        </dd>
  2.1013 -      </dl>
  2.1014 -
  2.1015 -      <p>
  2.1016 -        A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or more current authorized services - the <a>list of authorized service records</a>. Each item in the <a>list of authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a> object. The <a>list of authorized service records</a> is <span>immutable</span> meaning that it cannot be modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
  2.1017 -      </p>
  2.1018 -
  2.1019 -      <p class="note">
  2.1020 -        Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the first has the index 0, and each subsequent service is numbered one higher than the previous one.
  2.1021 -      </p>
  2.1022 -
  2.1023 -      <p>
  2.1024 -        The <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices" class="externalDFN">supported property indices</a> of <a href="#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to the number of items in the <a>list of authorized service records</a> represented by the respective object minus one, if any services are represented in the <a>list of authorized service records</a>.
  2.1025 -      </p>
  2.1026 -
  2.1027 -      <p>
  2.1028 -        To <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property" class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a <a href="#networkservices"><code>NetworkServices</code></a> object's <a>list of authorized service records</a>, the user agent <em class="ct">MUST</em> return the <a href="#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in the <a>list of authorized service records</a>.
  2.1029 -      </p>
  2.1030 -
  2.1031 -      <p>
  2.1032 -        The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class="ct">MUST</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the <a>list of authorized service records</a> represented by the respective object whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var> argument.
  2.1033 -        When no services in the <a>list of authorized service records</a> match the given argument, the method <em class="ct">MUST</em> return null.
  2.1034 -      </p>
  2.1035 -
  2.1036 -      <p>
  2.1037 -         Services available within the local network can connect and disconnect at different times during the execution of a web page. A <a>user agent</a> can
  2.1038 -         inform a web page when the state of networked services matching the requested <a>valid service type</a> change. Web pages can use this information to enable in-page experiences for communicating the state of networked services
  2.1039 -         with the ability to change the particular service or set of services the page is connected to by re-invoking the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
  2.1040 -      </p>
  2.1041 -
  2.1042 +          <dt>
  2.1043 +            <code title="networkservices-getter"><a href="#networkservices">services</a></code> [ <var title=
  2.1044 +            "">index</var> ]
  2.1045 +          </dt>
  2.1046 +          <dd>
  2.1047 +            <p>
  2.1048 +              Returns the specified <a href="#networkservice"><code>NetworkService</code></a> object.
  2.1049 +            </p>
  2.1050 +          </dd>
  2.1051 +          <dt>
  2.1052 +            <code title="networkservices-getter"><a href="#networkservices">services</a></code> . <code title=
  2.1053 +            "dom-networkservices-getservicebyid"><a href=
  2.1054 +            "#dom-networkservices-getservicebyid">getServiceById</a></code> ( <var title="">id</var> )
  2.1055 +          </dt>
  2.1056 +          <dd>
  2.1057 +            <p>
  2.1058 +              Returns the <a href="#networkservice"><code>NetworkService</code></a> object with the given identifier,
  2.1059 +              or null if no service has that identifier.
  2.1060 +            </p>
  2.1061 +          </dd>
  2.1062 +        </dl>
  2.1063 +        <p>
  2.1064 +          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or
  2.1065 +          more current authorized services - the <a>list of authorized service records</a>. Each item in the <a>list of
  2.1066 +          authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a>
  2.1067 +          object. The <a>list of authorized service records</a> is <span>immutable</span> meaning that it cannot be
  2.1068 +          modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
  2.1069 +        </p>
  2.1070 +        <p class="note">
  2.1071 +          Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
  2.1072 +          first has the index 0, and each subsequent service is numbered one higher than the previous one.
  2.1073 +        </p>
  2.1074 +        <p>
  2.1075 +          The <a href=
  2.1076 +          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices"
  2.1077 +             class="externalDFN">supported property indices</a> of <a href=
  2.1078 +             "#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to
  2.1079 +             the number of items in the <a>list of authorized service records</a> represented by the respective object
  2.1080 +             minus one, if any services are represented in the <a>list of authorized service records</a>.
  2.1081 +        </p>
  2.1082 +        <p>
  2.1083 +          To <a href=
  2.1084 +          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property"
  2.1085 +             class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a
  2.1086 +             <a href="#networkservices"><code>NetworkServices</code></a> object's <a>list of authorized service
  2.1087 +             records</a>, the user agent <em class="ct">MUST</em> return the <a href=
  2.1088 +             "#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in
  2.1089 +             the <a>list of authorized service records</a>.
  2.1090 +        </p>
  2.1091 +        <p>
  2.1092 +          The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class=
  2.1093 +          "ct">MUST</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the
  2.1094 +          <a>list of authorized service records</a> represented by the respective object whose <a href=
  2.1095 +          "#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var> argument.
  2.1096 +          When no services in the <a>list of authorized service records</a> match the given argument, the method
  2.1097 +          <em class="ct">MUST</em> return null.
  2.1098 +        </p>
  2.1099 +        <p>
  2.1100 +          Services available within the local network can connect and disconnect at different times during the
  2.1101 +          execution of a web page. A <a>user agent</a> can inform a web page when the state of networked services
  2.1102 +          matching the requested <a>valid service type</a> change. Web pages can use this information to enable in-page
  2.1103 +          experiences for communicating the state of networked services with the ability to change the particular
  2.1104 +          service or set of services the page is connected to by re-invoking the <a href=
  2.1105 +          "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
  2.1106 +        </p>
  2.1107        </section>
  2.1108 -
  2.1109        <section>
  2.1110 -      <h2>Events</h2>
  2.1111 -
  2.1112 -      <p>
  2.1113 -         The following are the event handlers (and their corresponding event handler event types) that <em class="ct">MUST</em> be supported, as IDL attributes, by all objects implementing the <a href="#networkservices"><code>NetworkServices</code></a> interface:
  2.1114 -       </p>
  2.1115 -
  2.1116 -       <table border="1">
  2.1117 -        <thead>
  2.1118 -          <tr>
  2.1119 -            <th>
  2.1120 -              <span title="event handlers">Event handler</span>
  2.1121 -            </th>
  2.1122 -            <th>
  2.1123 -              <span>Event handler event type</span>
  2.1124 -            </th>
  2.1125 -          </tr>
  2.1126 -        </thead>
  2.1127 -        <tbody>
  2.1128 -          <tr>
  2.1129 -            <td>
  2.1130 -              <dfn id="dom-networkservices-onserviceavailable" title="dom-NetworkServices-onserviceavailable">
  2.1131 -                <code>onserviceavailable</code>
  2.1132 -              </dfn>
  2.1133 -            </td>
  2.1134 -            <td>
  2.1135 -              <a href="#event-serviceavailable"><code>serviceavailable</code>
  2.1136 -            </td>
  2.1137 -          </tr>
  2.1138 -          <tr>
  2.1139 -            <td>
  2.1140 -              <dfn id="dom-networkservices-onserviceunavailable" title="dom-NetworkServices-onserviceunavailable">
  2.1141 -                <code>onserviceunavailable</code>
  2.1142 -              </dfn>
  2.1143 -            </td>
  2.1144 -            <td>
  2.1145 -              <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
  2.1146 -            </td>
  2.1147 -          </tr>
  2.1148 -        </tbody>
  2.1149 -      </table>
  2.1150 -
  2.1151 +        <h2>
  2.1152 +          Events
  2.1153 +        </h2>
  2.1154 +        <p>
  2.1155 +          The following are the event handlers (and their corresponding event handler event types) that <em class=
  2.1156 +          "ct">MUST</em> be supported, as IDL attributes, by all objects implementing the <a href=
  2.1157 +          "#networkservices"><code>NetworkServices</code></a> interface:
  2.1158 +        </p>
  2.1159 +        <table border="1"
  2.1160 +               summary="Event handlers for NetworkServices objects">
  2.1161 +          <thead>
  2.1162 +            <tr>
  2.1163 +              <th>
  2.1164 +                <span title="event handlers">Event handler</span>
  2.1165 +              </th>
  2.1166 +              <th>
  2.1167 +                <span>Event handler event type</span>
  2.1168 +              </th>
  2.1169 +            </tr>
  2.1170 +          </thead>
  2.1171 +          <tbody>
  2.1172 +            <tr>
  2.1173 +              <td>
  2.1174 +                <dfn id="dom-networkservices-onserviceavailable"
  2.1175 +                    title="dom-NetworkServices-onserviceavailable"><code>onserviceavailable</code></dfn>
  2.1176 +              </td>
  2.1177 +              <td>
  2.1178 +                <a href="#event-serviceavailable"><code>serviceavailable</code></a>
  2.1179 +              </td>
  2.1180 +            </tr>
  2.1181 +            <tr>
  2.1182 +              <td>
  2.1183 +                <dfn id="dom-networkservices-onserviceunavailable"
  2.1184 +                    title="dom-NetworkServices-onserviceunavailable"><code>onserviceunavailable</code></dfn>
  2.1185 +              </td>
  2.1186 +              <td>
  2.1187 +                <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
  2.1188 +              </td>
  2.1189 +            </tr>
  2.1190 +          </tbody>
  2.1191 +        </table>
  2.1192        </section>
  2.1193 -
  2.1194      </section>
  2.1195      <section>
  2.1196 -    <h2>Communicating with a networked service</h3>
  2.1197 -
  2.1198 -<p>
  2.1199 -   The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection information for an HTTP service endpoint and if available, service events, running on a networked device.
  2.1200 -</p>
  2.1201 -
  2.1202 -<pre class="widl">
  2.1203 +      <h2>
  2.1204 +        Communicating with a networked service
  2.1205 +      </h2>
  2.1206 +      <p>
  2.1207 +        The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection
  2.1208 +        information for an HTTP service endpoint and if available, service events, running on a networked device.
  2.1209 +      </p>
  2.1210 +      <pre class="widl">
  2.1211  [NoInterfaceObject]
  2.1212  interface <dfn id="networkservice">NetworkService</dfn> {
  2.1213    readonly attribute DOMString        <a href="#dom-networkservice-id">id</a>;
  2.1214 @@ -712,713 +781,686 @@
  2.1215    readonly attribute boolean          <a href="#dom-networkservice-online">online</a>;
  2.1216  
  2.1217    // event handler attributes