Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
authorRich Tibbett <richt@opera.com>
Wed, 03 Oct 2012 02:40:46 +0200
changeset 2508b912f2bb9c7
parent 249 4068263f559e
child 253 a1f05d57cfcd
Updates to Service Discovery & Messaging according to feedback @ http://lists.w3.org/Archives/Public/public-device-apis/2012Oct/0005.html
discovery-api/Overview.html
discovery-api/Overview.src.html
     1.1 --- a/discovery-api/Overview.html	Tue Oct 02 17:01:27 2012 -0400
     1.2 +++ b/discovery-api/Overview.html	Wed Oct 03 02:40:46 2012 +0200
     1.3 @@ -1,12 +1,12 @@
     1.4  <!DOCTYPE html>
     1.5 -<html lang="en" dir="ltr">
     1.6 -<head>
     1.7 +<html lang="en"
     1.8 +      dir="ltr">
     1.9 +  <head>
    1.10      <title>
    1.11        Network Service Discovery
    1.12      </title>
    1.13 -    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    1.14 -    
    1.15 -    
    1.16 +    <meta http-equiv="Content-Type"
    1.17 +          content="text/html; charset=utf-8">
    1.18      <style type="text/css">
    1.19  /* Custom ReSpec CSS (by Rich Tibbett) */
    1.20  
    1.21 @@ -39,339 +39,426 @@
    1.22        table tbody th:first-child { border-left:solid }
    1.23        table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
    1.24      </style>
    1.25 -  <style>/*****************************************************************
    1.26 - * ReSpec 3 CSS
    1.27 - * Robin Berjon - http://berjon.com/
    1.28 - *****************************************************************/
    1.29 +    <style type="text/css">
    1.30 +/*****************************************************************
    1.31 +    * ReSpec 3 CSS
    1.32 +    * Robin Berjon - http://berjon.com/
    1.33 +    *****************************************************************/
    1.34  
    1.35 -/* --- INLINES --- */
    1.36 -em.rfc2119 { 
    1.37 +    /* --- INLINES --- */
    1.38 +    em.rfc2119 {
    1.39      text-transform:     lowercase;
    1.40      font-variant:       small-caps;
    1.41      font-style:         normal;
    1.42      color:              #900;
    1.43 -}
    1.44 +    }
    1.45  
    1.46 -h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
    1.47 -h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
    1.48 +    h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
    1.49 +    h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
    1.50      border: none;
    1.51 -}
    1.52 +    }
    1.53  
    1.54 -dfn {
    1.55 +    dfn {
    1.56      font-weight:    bold;
    1.57 -}
    1.58 +    }
    1.59  
    1.60 -a.internalDFN {
    1.61 +    a.internalDFN {
    1.62      color:  inherit;
    1.63      border-bottom:  1px solid #99c;
    1.64      text-decoration:    none;
    1.65 -}
    1.66 +    }
    1.67  
    1.68 -a.externalDFN {
    1.69 +    a.externalDFN {
    1.70      color:  inherit;
    1.71      border-bottom:  1px dotted #ccc;
    1.72      text-decoration:    none;
    1.73 -}
    1.74 +    }
    1.75  
    1.76 -a.bibref {
    1.77 +    a.bibref {
    1.78      text-decoration:    none;
    1.79 -}
    1.80 +    }
    1.81  
    1.82 -cite .bibref {
    1.83 +    cite .bibref {
    1.84      font-style: normal;
    1.85 -}
    1.86 +    }
    1.87  
    1.88 -code {
    1.89 +    code {
    1.90      color:  #ff4500;
    1.91 -}
    1.92 +    }
    1.93  
    1.94  
    1.95 -/* --- --- */
    1.96 -ol.algorithm { counter-reset:numsection; list-style-type: none; }
    1.97 -ol.algorithm li { margin: 0.5em 0; }
    1.98 -ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
    1.99 +    /* --- --- */
   1.100 +    ol.algorithm { counter-reset:numsection; list-style-type: none; }
   1.101 +    ol.algorithm li { margin: 0.5em 0; }
   1.102 +    ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
   1.103  
   1.104 -/* --- TOC --- */
   1.105 -.toc a, .tof a {
   1.106 +    /* --- TOC --- */
   1.107 +    .toc a, .tof a {
   1.108      text-decoration:    none;
   1.109 -}
   1.110 +    }
   1.111  
   1.112 -a .secno, a .figno {
   1.113 +    a .secno, a .figno {
   1.114      color:  #000;
   1.115 -}
   1.116 +    }
   1.117  
   1.118 -ul.tof, ol.tof {
   1.119 +    ul.tof, ol.tof {
   1.120      list-style: none outside none;
   1.121 -}
   1.122 +    }
   1.123  
   1.124 -.caption {
   1.125 +    .caption {
   1.126      margin-top: 0.5em;
   1.127      font-style:   italic;
   1.128 -}
   1.129 +    }
   1.130  
   1.131 -/* --- TABLE --- */
   1.132 -table.simple {
   1.133 +    /* --- TABLE --- */
   1.134 +    table.simple {
   1.135      border-spacing: 0;
   1.136      border-collapse:    collapse;
   1.137      border-bottom:  3px solid #005a9c;
   1.138 -}
   1.139 +    }
   1.140  
   1.141 -.simple th {
   1.142 +    .simple th {
   1.143      background: #005a9c;
   1.144      color:  #fff;
   1.145      padding:    3px 5px;
   1.146      text-align: left;
   1.147 -}
   1.148 +    }
   1.149  
   1.150 -.simple th[scope="row"] {
   1.151 +    .simple th[scope="row"] {
   1.152      background: inherit;
   1.153      color:  inherit;
   1.154      border-top: 1px solid #ddd;
   1.155 -}
   1.156 +    }
   1.157  
   1.158 -.simple td {
   1.159 +    .simple td {
   1.160      padding:    3px 10px;
   1.161      border-top: 1px solid #ddd;
   1.162 -}
   1.163 +    }
   1.164  
   1.165 -.simple tr:nth-child(even) {
   1.166 +    .simple tr:nth-child(even) {
   1.167      background: #f0f6ff;
   1.168 -}
   1.169 +    }
   1.170  
   1.171 -/* --- DL --- */
   1.172 -.section dd > p:first-child {
   1.173 +    /* --- DL --- */
   1.174 +    .section dd > p:first-child {
   1.175      margin-top: 0;
   1.176 -}
   1.177 +    }
   1.178  
   1.179 -.section dd > p:last-child {
   1.180 +    .section dd > p:last-child {
   1.181      margin-bottom: 0;
   1.182 -}
   1.183 +    }
   1.184  
   1.185 -.section dd {
   1.186 +    .section dd {
   1.187      margin-bottom:  1em;
   1.188 -}
   1.189 +    }
   1.190  
   1.191 -.section dl.attrs dd, .section dl.eldef dd {
   1.192 +    .section dl.attrs dd, .section dl.eldef dd {
   1.193      margin-bottom:  0;
   1.194 -}
   1.195 -</style><style>/* --- ISSUES/NOTES --- */
   1.196 -div.issue-title, div.note-title {
   1.197 +    }
   1.198 +    </style>
   1.199 +    <style type="text/css">
   1.200 +/* --- ISSUES/NOTES --- */
   1.201 +    div.issue-title, div.note-title {
   1.202      padding-right:  1em;
   1.203      min-width: 7.5em;
   1.204      color: #b9ab2d;
   1.205 -}
   1.206 -div.issue-title { color: #e05252; }
   1.207 -div.note-title { color: #52e052; }
   1.208 -div.issue-title span, div.note-title span {
   1.209 +    }
   1.210 +    div.issue-title { color: #e05252; }
   1.211 +    div.note-title { color: #52e052; }
   1.212 +    div.issue-title span, div.note-title span {
   1.213      text-transform: uppercase;
   1.214 -}
   1.215 -div.note, div.issue {
   1.216 +    }
   1.217 +    div.note, div.issue {
   1.218      margin-top: 1em;
   1.219      margin-bottom: 1em;
   1.220 -}
   1.221 -.note > p:first-child, .issue > p:first-child { margin-top: 0 }
   1.222 -.issue, .note {
   1.223 +    }
   1.224 +    .note > p:first-child, .issue > p:first-child { margin-top: 0 }
   1.225 +    .issue, .note {
   1.226      padding: .5em;
   1.227      border-left-width: .5em;
   1.228      border-left-style: solid;
   1.229 -}
   1.230 -div.issue, div.note {
   1.231 +    }
   1.232 +    div.issue, div.note {
   1.233      padding: 0.5em;
   1.234      margin: 1em 0;
   1.235      position: relative;
   1.236      clear: both;
   1.237 -}
   1.238 -span.note, span.issue { padding: .1em .5em .15em; }
   1.239 +    }
   1.240 +    span.note, span.issue { padding: .1em .5em .15em; }
   1.241  
   1.242 -.issue {
   1.243 +    .issue {
   1.244      border-color: #e05252;
   1.245      background: #fbe9e9;
   1.246 -}
   1.247 -.note {
   1.248 +    }
   1.249 +    .note {
   1.250      border-color: #52e052;
   1.251      background: #e9fbe9;
   1.252 -}
   1.253 +    }
   1.254  
   1.255  
   1.256 -</style><style>/* HIGHLIGHTS */
   1.257 -code.prettyprint {
   1.258 +    </style>
   1.259 +    <style type="text/css">
   1.260 +/* HIGHLIGHTS */
   1.261 +    code.prettyprint {
   1.262      color:  inherit;
   1.263 -}
   1.264 +    }
   1.265  
   1.266 -/* this from google-code-prettify */
   1.267 -.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.268 -</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><body><div class="head">
   1.269 -  <p>
   1.270 -    
   1.271 -      <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
   1.272 -    
   1.273 -  </p>
   1.274 -  <h1 class="title" id="title">Network Service Discovery</h1>
   1.275 -  
   1.276 -  <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.277 -  <dl>
   1.278 -    
   1.279 -      <dt>This version:</dt>
   1.280 -      <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.281 -      <dt>Latest published version:</dt>
   1.282 -      <dd><a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a></dd>
   1.283 -    
   1.284 -    
   1.285 -      <dt>Latest editor's draft:</dt>
   1.286 -      <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.287 -    
   1.288 -    
   1.289 -    
   1.290 -    
   1.291 -      
   1.292 -    
   1.293 -    
   1.294 -    
   1.295 -    <dt>Editors:</dt>
   1.296 -    <dd><span>Rich Tibbett</span>, <a href="http://opera.com/">Opera Software ASA</a></dd>
   1.297 -<dd><span>Clarke Stevens</span>, <a href="http://cablelabs.com/">CableLabs</a></dd>
   1.298 -
   1.299 -    
   1.300 -  </dl>
   1.301 -  
   1.302 -  
   1.303 -  
   1.304 -  
   1.305 -    
   1.306 +    /* this from google-code-prettify */
   1.307 +    .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.308 +    </style>
   1.309 +    <link rel="stylesheet"
   1.310 +          href="http://www.w3.org/StyleSheets/TR/W3C-ED"
   1.311 +          type="text/css">
   1.312 +  </head>
   1.313 +  <body>
   1.314 +    <div class="head">
   1.315 +      <p>
   1.316 +        <a href="http://www.w3.org/"><img width="72"
   1.317 +             height="48"
   1.318 +             src="http://www.w3.org/Icons/w3c_home"
   1.319 +             alt="W3C"></a>
   1.320 +      </p>
   1.321 +      <h1 class="title"
   1.322 +          id="title">
   1.323 +        Network Service Discovery
   1.324 +      </h1>
   1.325 +      <h2 id="w3c-editor-s-draft-03-october-2012">
   1.326 +        <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 03 October 2012
   1.327 +      </h2>
   1.328 +      <dl>
   1.329 +        <dt>
   1.330 +          This version:
   1.331 +        </dt>
   1.332 +        <dd>
   1.333 +          <a href=
   1.334 +          "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.335 +        </dd>
   1.336 +        <dt>
   1.337 +          Latest published version:
   1.338 +        </dt>
   1.339 +        <dd>
   1.340 +          <a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a>
   1.341 +        </dd>
   1.342 +        <dt>
   1.343 +          Latest editor's draft:
   1.344 +        </dt>
   1.345 +        <dd>
   1.346 +          <a href=
   1.347 +          "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.348 +        </dd>
   1.349 +        <dt>
   1.350 +          Editors:
   1.351 +        </dt>
   1.352 +        <dd>
   1.353 +          <span>Rich Tibbett</span>, <a href="http://opera.com/">Opera Software ASA</a>
   1.354 +        </dd>
   1.355 +        <dd>
   1.356 +          <span>Clarke Stevens</span>, <a href="http://cablelabs.com/">CableLabs</a>
   1.357 +        </dd>
   1.358 +      </dl>
   1.359        <p class="copyright">
   1.360 -        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 
   1.361 -        2012
   1.362 -        
   1.363 -        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> 
   1.364 -        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
   1.365 -        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
   1.366 -        <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
   1.367 -        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
   1.368 -        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
   1.369 -        <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
   1.370 +        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2012 <a href=
   1.371 +        "http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=
   1.372 +        "http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=
   1.373 +        "http://www.ercim.eu/"><abbr title=
   1.374 +        "European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=
   1.375 +        "http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. <abbr title="World Wide Web Consortium">W3C</abbr>
   1.376 +        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href=
   1.377 +        "http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href=
   1.378 +        "http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
   1.379        </p>
   1.380 -    
   1.381 -  
   1.382 -  <hr>
   1.383 -</div>
   1.384 -    <section id="abstract" class="introductory"><h2>Abstract</h2>
   1.385 +      <hr>
   1.386 +    </div>
   1.387 +    <section id="abstract"
   1.388 +             class="introductory">
   1.389 +      <h2>
   1.390 +        Abstract
   1.391 +      </h2>
   1.392        <p>
   1.393          This specification defines a mechanism for an HTML document to discover and subsequently communicate with
   1.394          <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services advertised via common discovery protocols
   1.395          within the current network.
   1.396        </p>
   1.397 -    </section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
   1.398 -  
   1.399 -    
   1.400 -      
   1.401 -        <p>
   1.402 -          <em>This section describes the status of this document at the time of its publication. Other
   1.403 -          documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
   1.404 -          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.405 -          index</a> at http://www.w3.org/TR/.</em>
   1.406 -        </p>
   1.407 -        
   1.408 +    </section>
   1.409 +    <section id="sotd"
   1.410 +             class="introductory">
   1.411 +      <h2>
   1.412 +        Status of This Document
   1.413 +      </h2>
   1.414        <p>
   1.415 -        This document represents the early consensus of the group on the scope and features of the proposed <abbr title="Application Programming Interface">API</abbr>.
   1.416 +        <em>This section describes the status of this document at the time of its publication. Other documents may
   1.417 +        supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and
   1.418 +        the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title=
   1.419 +        "World Wide Web Consortium">W3C</abbr> technical reports index</a> at http://www.w3.org/TR/.</em>
   1.420        </p>
   1.421 -    
   1.422 -        <p>
   1.423 -          This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs Working Group</a> as an Editor's Draft.
   1.424 -          
   1.425 -          If you wish to make comments regarding this document, please send them to 
   1.426 -          <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a> 
   1.427 -          (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>,
   1.428 -          <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).
   1.429 -          
   1.430 -          
   1.431 -          All feedback is welcome.
   1.432 -        </p>
   1.433 -        
   1.434 -          <p>
   1.435 -            Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
   1.436 -            This is a draft document and may be updated, replaced or obsoleted by other documents at 
   1.437 -            any time. It is inappropriate to cite this document as other than work in progress.
   1.438 -          </p>
   1.439 -        
   1.440 -        
   1.441 -        <p>
   1.442 -          
   1.443 -            This document was produced by a group operating under the 
   1.444 -            <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.445 -          
   1.446 -          
   1.447 -          
   1.448 -            
   1.449 -              <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.450 -            
   1.451 -            made in connection with the deliverables of the group; that page also includes instructions for 
   1.452 -            disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
   1.453 -            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
   1.454 -            information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   1.455 -            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
   1.456 -          
   1.457 -          
   1.458 -        </p>
   1.459 -        
   1.460 -      
   1.461 -    
   1.462 -  
   1.463 -</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>
   1.464 -        Introduction
   1.465 -      </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>
   1.466 -          Dependencies
   1.467 -        </a></li></ul></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>
   1.468 -        Terminology
   1.469 -      </a></li><li class="tocline"><a href="#requesting-networked-services" class="tocxref"><span class="secno">4. </span>
   1.470 -        Requesting networked services
   1.471 -      </a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1 </span>
   1.472 -          Methods
   1.473 -        </a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno">4.2 </span>
   1.474 -          Error Handling
   1.475 -        </a></li></ul></li><li class="tocline"><a href="#obtaining-networked-services" class="tocxref"><span class="secno">5. </span>
   1.476 -        Obtaining networked services
   1.477 -      </a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">5.1 </span>
   1.478 -          Attributes
   1.479 -        </a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">5.2 </span>
   1.480 -          Methods
   1.481 -        </a></li><li class="tocline"><a href="#events" class="tocxref"><span class="secno">5.3 </span>
   1.482 -          Events
   1.483 -        </a></li></ul></li><li class="tocline"><a href="#communicating-with-a-networked-service" class="tocxref"><span class="secno">6. </span>
   1.484 -        Communicating with a networked service
   1.485 -      </a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">6.1 </span>
   1.486 -          Attributes
   1.487 -        </a></li><li class="tocline"><a href="#states" class="tocxref"><span class="secno">6.2 </span>
   1.488 -          States
   1.489 -        </a></li><li class="tocline"><a href="#events-1" class="tocxref"><span class="secno">6.3 </span>
   1.490 -          Events
   1.491 -        </a></li></ul></li><li class="tocline"><a href="#service-discovery" class="tocxref"><span class="secno">7. </span>
   1.492 -        Service Discovery
   1.493 -      </a><ul class="toc"><li class="tocline"><a href="#zeroconf-mdns-dns-sd" class="tocxref"><span class="secno">7.1 </span>
   1.494 -          Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)
   1.495 -        </a></li><li class="tocline"><a href="#simple-service-discovery-protocol-ssdp" class="tocxref"><span class="secno">7.2 </span>
   1.496 -          Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)
   1.497 -        </a></li><li class="tocline"><a href="#network-topology-monitoring" class="tocxref"><span class="secno">7.3 </span>
   1.498 -          Network Topology Monitoring
   1.499 -        </a></li></ul></li><li class="tocline"><a href="#events-summary" class="tocxref"><span class="secno">8. </span>
   1.500 -        Events Summary
   1.501 -      </a></li><li class="tocline"><a href="#garbage-collection" class="tocxref"><span class="secno">9. </span>
   1.502 -        Garbage collection
   1.503 -      </a></li><li class="tocline"><a href="#use-cases-and-requirements" class="tocxref"><span class="secno">10. </span>
   1.504 -        Use Cases and Requirements
   1.505 -      </a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">A. </span>
   1.506 -        Examples
   1.507 -      </a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">B. </span>
   1.508 -        Acknowledgements
   1.509 -      </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.510 -    
   1.511 -    <section class="informative" id="introduction">
   1.512 -      <!--OddPage--><h2><span class="secno">1. </span>
   1.513 -        Introduction
   1.514 -      </h2><p><em>This section is non-normative.</em></p>
   1.515        <p>
   1.516 -        To enable Web pages to connect and communicate with Local-networked Services provided over <abbr title="Hypertext Transfer Protocol">HTTP</abbr>, this
   1.517 -        specification introduces the <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a>
   1.518 -        interface.
   1.519 +        This document represents the early consensus of the group on the scope and features of the proposed
   1.520 +        <abbr title="Application Programming Interface">API</abbr>.
   1.521 +      </p>
   1.522 +      <p>
   1.523 +        This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs Working Group</a> as an
   1.524 +        Editor's Draft. If you wish to make comments regarding this document, please send them to <a href=
   1.525 +        "mailto:public-device-apis@w3.org">public-device-apis@w3.org</a> (<a href=
   1.526 +        "mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>, <a href=
   1.527 +        "http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>). All feedback is welcome.
   1.528 +      </p>
   1.529 +      <p>
   1.530 +        Publication as an Editor's Draft does not imply endorsement by the <abbr title=
   1.531 +        "World Wide Web Consortium">W3C</abbr> Membership. This is a draft document and may be updated, replaced or
   1.532 +        obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in
   1.533 +        progress.
   1.534 +      </p>
   1.535 +      <p>
   1.536 +        This document was produced by a group operating under the <a href=
   1.537 +        "http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title=
   1.538 +        "World Wide Web Consortium">W3C</abbr> Patent Policy</a>. <abbr title="World Wide Web Consortium">W3C</abbr>
   1.539 +        maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status"
   1.540 +           rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the
   1.541 +           group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge
   1.542 +           of a patent which the individual believes contains <a href=
   1.543 +           "http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose
   1.544 +           the information in accordance with <a href=
   1.545 +           "http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the <abbr title=
   1.546 +           "World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
   1.547 +      </p>
   1.548 +    </section>
   1.549 +    <section id="toc">
   1.550 +      <h2 class="introductory">
   1.551 +        Table of Contents
   1.552 +      </h2>
   1.553 +      <ul class="toc">
   1.554 +        <li class="tocline">
   1.555 +          <a href="#introduction"
   1.556 +              class="tocxref"><span class="secno">1.</span> Introduction</a>
   1.557 +        </li>
   1.558 +        <li class="tocline">
   1.559 +          <a href="#conformance"
   1.560 +              class="tocxref"><span class="secno">2.</span> Conformance</a>
   1.561 +          <ul class="toc">
   1.562 +            <li class="tocline">
   1.563 +              <a href="#dependencies"
   1.564 +                  class="tocxref"><span class="secno">2.1</span> Dependencies</a>
   1.565 +            </li>
   1.566 +          </ul>
   1.567 +        </li>
   1.568 +        <li class="tocline">
   1.569 +          <a href="#terminology"
   1.570 +              class="tocxref"><span class="secno">3.</span> Terminology</a>
   1.571 +        </li>
   1.572 +        <li class="tocline">
   1.573 +          <a href="#requesting-networked-services"
   1.574 +              class="tocxref"><span class="secno">4.</span> Requesting networked services</a>
   1.575 +          <ul class="toc">
   1.576 +            <li class="tocline">
   1.577 +              <a href="#methods"
   1.578 +                  class="tocxref"><span class="secno">4.1</span> Methods</a>
   1.579 +            </li>
   1.580 +            <li class="tocline">
   1.581 +              <a href="#error-handling"
   1.582 +                  class="tocxref"><span class="secno">4.2</span> Error Handling</a>
   1.583 +            </li>
   1.584 +          </ul>
   1.585 +        </li>
   1.586 +        <li class="tocline">
   1.587 +          <a href="#obtaining-networked-services"
   1.588 +              class="tocxref"><span class="secno">5.</span> Obtaining networked services</a>
   1.589 +          <ul class="toc">
   1.590 +            <li class="tocline">
   1.591 +              <a href="#attributes"
   1.592 +                  class="tocxref"><span class="secno">5.1</span> Attributes</a>
   1.593 +            </li>
   1.594 +            <li class="tocline">
   1.595 +              <a href="#methods-1"
   1.596 +                  class="tocxref"><span class="secno">5.2</span> Methods</a>
   1.597 +            </li>
   1.598 +            <li class="tocline">
   1.599 +              <a href="#events"
   1.600 +                  class="tocxref"><span class="secno">5.3</span> Events</a>
   1.601 +            </li>
   1.602 +          </ul>
   1.603 +        </li>
   1.604 +        <li class="tocline">
   1.605 +          <a href="#communicating-with-a-networked-service"
   1.606 +              class="tocxref"><span class="secno">6.</span> Communicating with a networked service</a>
   1.607 +          <ul class="toc">
   1.608 +            <li class="tocline">
   1.609 +              <a href="#attributes-1"
   1.610 +                  class="tocxref"><span class="secno">6.1</span> Attributes</a>
   1.611 +            </li>
   1.612 +            <li class="tocline">
   1.613 +              <a href="#states"
   1.614 +                  class="tocxref"><span class="secno">6.2</span> States</a>
   1.615 +            </li>
   1.616 +            <li class="tocline">
   1.617 +              <a href="#events-1"
   1.618 +                  class="tocxref"><span class="secno">6.3</span> Events</a>
   1.619 +            </li>
   1.620 +          </ul>
   1.621 +        </li>
   1.622 +        <li class="tocline">
   1.623 +          <a href="#service-discovery"
   1.624 +              class="tocxref"><span class="secno">7.</span> Service Discovery</a>
   1.625 +          <ul class="toc">
   1.626 +            <li class="tocline">
   1.627 +              <a href="#zeroconf-mdns-dns-sd"
   1.628 +                  class="tocxref"><span class="secno">7.1</span> Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> +
   1.629 +                  <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</a>
   1.630 +            </li>
   1.631 +            <li class="tocline">
   1.632 +              <a href="#simple-service-discovery-protocol-ssdp"
   1.633 +                  class="tocxref"><span class="secno">7.2</span> Simple Service Discovery Protocol (<abbr title=
   1.634 +                  "Simple Service Discovery Protocol">SSDP</abbr>)</a>
   1.635 +            </li>
   1.636 +            <li class="tocline">
   1.637 +              <a href="#network-topology-monitoring"
   1.638 +                  class="tocxref"><span class="secno">7.3</span> Network Topology Monitoring</a>
   1.639 +            </li>
   1.640 +          </ul>
   1.641 +        </li>
   1.642 +        <li class="tocline">
   1.643 +          <a href="#events-summary"
   1.644 +              class="tocxref"><span class="secno">8.</span> Events Summary</a>
   1.645 +        </li>
   1.646 +        <li class="tocline">
   1.647 +          <a href="#garbage-collection"
   1.648 +              class="tocxref"><span class="secno">9.</span> Garbage collection</a>
   1.649 +        </li>
   1.650 +        <li class="tocline">
   1.651 +          <a href="#use-cases-and-requirements"
   1.652 +              class="tocxref"><span class="secno">10.</span> Use Cases and Requirements</a>
   1.653 +        </li>
   1.654 +        <li class="tocline">
   1.655 +          <a href="#examples"
   1.656 +              class="tocxref"><span class="secno">A.</span> Examples</a>
   1.657 +        </li>
   1.658 +        <li class="tocline">
   1.659 +          <a href="#acknowledgements"
   1.660 +              class="tocxref"><span class="secno">B.</span> Acknowledgements</a>
   1.661 +        </li>
   1.662 +        <li class="tocline">
   1.663 +          <a href="#references"
   1.664 +              class="tocxref"><span class="secno">C.</span> References</a>
   1.665 +          <ul class="toc">
   1.666 +            <li class="tocline">
   1.667 +              <a href="#normative-references"
   1.668 +                  class="tocxref"><span class="secno">C.1</span> Normative references</a>
   1.669 +            </li>
   1.670 +          </ul>
   1.671 +        </li>
   1.672 +      </ul>
   1.673 +    </section>
   1.674 +    <section class="informative"
   1.675 +             id="introduction">
   1.676 +      <h2>
   1.677 +        <span class="secno">1.</span> Introduction
   1.678 +      </h2>
   1.679 +      <p>
   1.680 +        <em>This section is non-normative.</em>
   1.681 +      </p>
   1.682 +      <p>
   1.683 +        To enable Web pages to connect and communicate with Local-networked Services provided over <abbr title=
   1.684 +        "Hypertext Transfer Protocol">HTTP</abbr>, this specification introduces the <a href=
   1.685 +        "#navigatornetworkservice"><code>NavigatorNetworkService</code></a> interface.
   1.686        </p>
   1.687        <p>
   1.688          Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known
   1.689 @@ -384,9 +471,10 @@
   1.690          well-known discovery service type that it wishes to interact with.
   1.691        </p>
   1.692        <p>
   1.693 -        The user agent, having captured all advertised services on the network from the Service Discovery mechanisms
   1.694 -        included in this recommendation, attempts to match the requested service type to a discovered service according
   1.695 -        to the processing described herein.
   1.696 +        The user agent, having captured all advertised services on the network from the <a href=
   1.697 +        "#dfn-service-discovery-mechanisms"
   1.698 +           class="internalDFN">service discovery mechanisms</a> included in this recommendation, attempts to match the
   1.699 +           requested service type to a discovered service according to the processing described herein.
   1.700        </p>
   1.701        <p>
   1.702          If a service connectivity request is successful then the Web page is provided with the necessary information to
   1.703 @@ -396,69 +484,125 @@
   1.704        <p>
   1.705          Once connected to a Local-networked Service the Web page can send requests and receive responses to the
   1.706          Local-networked Service via the messaging format and appropriate channel inferred from the service type
   1.707 -        authorized via the provided <abbr title="Application Programming Interface">API</abbr>. The Web page, once connected, can also receive service-pushed events, in the
   1.708 -        messaging format supported by the Local-networked Device, if such event subscription functionality is provided
   1.709 -        by the connected Local-networked Service.
   1.710 +        authorized via the provided <abbr title="Application Programming Interface">API</abbr>. The Web page, once
   1.711 +        connected, can also receive service-pushed events, in the messaging format supported by the Local-networked
   1.712 +        Device, if such event subscription functionality is provided by the connected Local-networked Service.
   1.713        </p>
   1.714        <div class="example">
   1.715          <p>
   1.716 -          Example of requesting a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> advertised service:
   1.717 +          Example of requesting a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>
   1.718 +          advertised service:
   1.719          </p>
   1.720          <hr>
   1.721 -        <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.722 +        <pre class="highlight prettyprint">
   1.723 +<span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class=
   1.724 +"pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.725    </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
   1.726 -  </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.727 +  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
   1.728 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
   1.729 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class=
   1.730 +"pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
   1.731 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
   1.732 +"pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class=
   1.733 +"pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class=
   1.734 +"pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
   1.735  </span><span class="pun">}</span><span class="pln">
   1.736  
   1.737 -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.738 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
   1.739 +"pun">(</span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class=
   1.740 +"pln"> showServices</span><span class="pun">);</span>
   1.741 +</pre>
   1.742        </div>
   1.743        <div class="example">
   1.744          <p>
   1.745            Example of requesting a UPnP advertised service, also handling error conditions:
   1.746          </p>
   1.747          <hr>
   1.748 -        <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.749 +        <pre class="highlight prettyprint">
   1.750 +<span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class=
   1.751 +"pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.752    </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
   1.753 -  </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.754 +  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
   1.755 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
   1.756 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class=
   1.757 +"pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
   1.758 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
   1.759 +"pun">++)</span><span class="pln"> console</span><span class="pun">.</span><span class="pln">log</span><span class=
   1.760 +"pun">(</span><span class="pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class=
   1.761 +"pun">].</span><span class="pln">name </span><span class="pun">);</span><span class="pln">
   1.762  </span><span class="pun">}</span><span class="pln">
   1.763  
   1.764 -</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.765 -  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.766 +</span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class=
   1.767 +"pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.768 +  console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class=
   1.769 +"pln"> </span><span class="str">"Error occurred: "</span><span class="pln"> </span><span class=
   1.770 +"pun">+</span><span class="pln"> e</span><span class="pun">.</span><span class="pln">code </span><span class=
   1.771 +"pun">);</span><span class="pln">
   1.772  </span><span class="pun">}</span><span class="pln">
   1.773  
   1.774 -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.775 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
   1.776 +"pun">(</span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class=
   1.777 +"pun">,</span><span class="pln"> showServices</span><span class="pun">,</span><span class=
   1.778 +"pln"> error</span><span class="pun">);</span>
   1.779 +</pre>
   1.780        </div>
   1.781        <div class="example">
   1.782          <p>
   1.783 -          Example of requesting either a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> or UPnP advertised service:
   1.784 +          Example of requesting either a <abbr title="Domain Name System">DNS</abbr>-<abbr title=
   1.785 +          "Service Discovery">SD</abbr> or UPnP advertised service:
   1.786          </p>
   1.787          <hr>
   1.788 -        <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.789 -  </span><span class="com">// Show a list of all the services provided to the web page (+ service type)</span><span class="pln">
   1.790 -  </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.791 -     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.792 +        <pre class="highlight prettyprint">
   1.793 +<span class="kwd">function</span><span class="pln"> showServices</span><span class="pun">(</span><span class=
   1.794 +"pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
   1.795 +  </span><span class=
   1.796 +"com">// Show a list of all the services provided to the web page (+ service type)</span><span class="pln">
   1.797 +  </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
   1.798 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
   1.799 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> services</span><span class=
   1.800 +"pun">.</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
   1.801 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
   1.802 +"pun">++)</span><span class="pln">
   1.803 +     console</span><span class="pun">.</span><span class="pln">log</span><span class="pun">(</span><span class=
   1.804 +"pln"> services</span><span class="pun">[</span><span class="pln">i</span><span class="pun">].</span><span class=
   1.805 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class="str">'('</span><span class=
   1.806 +"pln"> </span><span class="pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class=
   1.807 +"pln">i</span><span class="pun">].</span><span class="pln">type </span><span class="pun">+</span><span class=
   1.808 +"pln"> </span><span class="str">')'</span><span class="pln"> </span><span class="pun">);</span><span class="pln">
   1.809  </span><span class="pun">}</span><span class="pln">
   1.810  
   1.811 -navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">([</span><span class="pln">
   1.812 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
   1.813 +"pun">([</span><span class="pln">
   1.814    </span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln">
   1.815    </span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class="pln">
   1.816 -</span><span class="pun">],</span><span class="pln"> showServices</span><span class="pun">);</span></pre>
   1.817 +</span><span class="pun">],</span><span class="pln"> showServices</span><span class="pun">);</span>
   1.818 +</pre>
   1.819        </div>
   1.820        <p>
   1.821          For more detailed examples see the <a href="#examples">Examples</a> section.
   1.822        </p>
   1.823      </section>
   1.824 -    <section id="conformance"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2>
   1.825 -<p>
   1.826 -  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
   1.827 -  and notes in this specification are non-normative. Everything else in this specification is
   1.828 -  normative.
   1.829 -</p>
   1.830 -<p>
   1.831 -  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.832 -  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.833 -</p>
   1.834 -
   1.835 +    <section id="conformance">
   1.836 +      <h2>
   1.837 +        <span class="secno">2.</span> Conformance
   1.838 +      </h2>
   1.839 +      <p>
   1.840 +        As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this
   1.841 +        specification are non-normative. Everything else in this specification is normative.
   1.842 +      </p>
   1.843 +      <p>
   1.844 +        The key words <em class="rfc2119"
   1.845 +           title="must">must</em>, <em class="rfc2119"
   1.846 +           title="must not">must not</em>, <em class="rfc2119"
   1.847 +           title="required">required</em>, <em class="rfc2119"
   1.848 +           title="should">should</em>, <em class="rfc2119"
   1.849 +           title="should not">should not</em>, <em class="rfc2119"
   1.850 +           title="recommended">recommended</em>, <em class="rfc2119"
   1.851 +           title="may">may</em>, and <em class="rfc2119"
   1.852 +           title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class=
   1.853 +           "bibref"
   1.854 +           href="#bib-RFC2119">RFC2119</a></cite>].
   1.855 +      </p>
   1.856        <p>
   1.857          Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or
   1.858          "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should",
   1.859 @@ -469,91 +613,109 @@
   1.860          are to be interpreted as requirements on user agents.
   1.861        </p>
   1.862        <p>
   1.863 -        Conformance requirements phrased as algorithms or specific steps <em class="rfc2119" title="may">may</em> be implemented in any
   1.864 -        manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification
   1.865 -        are intended to be easy to follow, and not intended to be performant.)
   1.866 +        Conformance requirements phrased as algorithms or specific steps <em class="rfc2119"
   1.867 +           title="may">may</em> be implemented in any manner, so long as the end result is equivalent. (In particular,
   1.868 +           the algorithms defined in this specification are intended to be easy to follow, and not intended to be
   1.869 +           performant.)
   1.870        </p>
   1.871        <p>
   1.872          The only conformance class defined by this specification is a <dfn id="dfn-user-agent">user agent</dfn>.
   1.873        </p>
   1.874        <p>
   1.875 -        User agents <em class="rfc2119" title="may">may</em> impose implementation-specific limits on otherwise unconstrained inputs,
   1.876 -        e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around
   1.877 -        platform-specific limitations.
   1.878 +        User agents <em class="rfc2119"
   1.879 +           title="may">may</em> impose implementation-specific limits on otherwise unconstrained inputs, e.g. to
   1.880 +           prevent denial of service attacks, to guard against running out of memory, or to work around
   1.881 +           platform-specific limitations.
   1.882        </p>
   1.883        <p>
   1.884          When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid
   1.885 -        in development, or for performance reasons), user agents <em class="rfc2119" title="must">must</em> act as if they had no support
   1.886 -        for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a
   1.887 -        particular feature is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted
   1.888 -        from the objects that implement that interface - leaving the attribute on the object but making it return null
   1.889 -        or throw an exception is insufficient.
   1.890 +        in development, or for performance reasons), user agents <em class="rfc2119"
   1.891 +           title="must">must</em> act as if they had no support for the feature whatsoever, and as if the feature was
   1.892 +           not mentioned in this specification. For example, if a particular feature is accessed via an attribute in a
   1.893 +           Web IDL interface, the attribute itself would be omitted from the objects that implement that interface -
   1.894 +           leaving the attribute on the object but making it return null or throw an exception is insufficient.
   1.895        </p>
   1.896        <section id="dependencies">
   1.897 -        <h3><span class="secno">2.1 </span>
   1.898 -          Dependencies
   1.899 +        <h3>
   1.900 +          <span class="secno">2.1</span> Dependencies
   1.901          </h3>This specification relies on several other underlying specifications.
   1.902          <dl>
   1.903            <dt>
   1.904              HTML
   1.905            </dt>
   1.906            <dd>
   1.907 -            Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>]
   1.908 +            Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref"
   1.909 +               href="#bib-HTML5">HTML5</a></cite>]
   1.910            </dd>
   1.911            <dt>
   1.912              WebIDL
   1.913            </dt>
   1.914            <dd>
   1.915 -            The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]
   1.916 +            The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class=
   1.917 +            "bibref"
   1.918 +               href="#bib-WEBIDL">WEBIDL</a></cite>]
   1.919            </dd>
   1.920          </dl>
   1.921        </section>
   1.922      </section>
   1.923      <section id="terminology">
   1.924 -      <!--OddPage--><h2><span class="secno">3. </span>
   1.925 -        Terminology
   1.926 +      <h2>
   1.927 +        <span class="secno">3.</span> Terminology
   1.928        </h2>
   1.929        <p>
   1.930          The construction "a <code>Foo</code> object", where <code>Foo</code> is actually an interface, is sometimes
   1.931          used instead of the more accurate "an object implementing the interface <code>Foo</code>".
   1.932        </p>
   1.933        <p>
   1.934 -        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
   1.935 -        necessarily imply the existence of an actual <code>Document</code> object or of any other <code>Node</code>
   1.936 -        objects as defined in the DOM Core specifications. [<cite><a class="bibref" href="#bib-DOM4">DOM4</a></cite>]
   1.937 +        The term DOM is used to refer to the <abbr title="Application Programming Interface">API</abbr> set made
   1.938 +        available to scripts in Web applications, and does not necessarily imply the existence of an actual
   1.939 +        <code>Document</code> object or of any other <code>Node</code> objects as defined in the DOM Core
   1.940 +        specifications. [<cite><a class="bibref"
   1.941 +           href="#bib-DOM4">DOM4</a></cite>]
   1.942        </p>
   1.943        <p>
   1.944          An IDL attribute is said to be <em>getting</em> when its value is being retrieved (e.g. by author script), and
   1.945          is said to be <em>setting</em> when a new value is assigned to it.
   1.946        </p>
   1.947        <p>
   1.948 -        A <dfn id="dfn-valid-service-type">valid service type</dfn> is a string that begins with <code>upnp:</code> or <code>zeroconf:</code>
   1.949 -        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,
   1.950 -        U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
   1.951 +        A <dfn id="dfn-valid-service-type">valid service type</dfn> is a string that begins with <code>upnp:</code> or
   1.952 +        <code>zeroconf:</code> followed by one or more characters in the ranges U+0021, U+0023 to U+0027, U+002A to
   1.953 +        U+002B, U+002D to U+002E, U+0030 to U+0039, U+0041 to U+005A, U+005E to U+007E.
   1.954        </p>
   1.955        <p>
   1.956 -        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
   1.957 -        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
   1.958 -        defined in this specification.
   1.959 +        A <a href="#dfn-valid-service-type"
   1.960 +           class="internalDFN">valid service type</a> provided in the <code>type</code> attribute of the <a href=
   1.961 +           "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method will be matched against the
   1.962 +           services currently contained in the <a href="#dfn-list-of-available-service-records"
   1.963 +           class="internalDFN">list of available service records</a> according to the algorithms defined in this
   1.964 +           specification.
   1.965        </p>
   1.966        <p>
   1.967 -        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
   1.968 -        agent</a> generates and maintains for receiving <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY requests from UPnP Event sources. It is only
   1.969 -        required when the user agent implements UPnP Service Discovery as defined in this specification.
   1.970 +        A <dfn id="dfn-user-agent-generated-callback-url">user-agent generated callback url</dfn> is a Local-network
   1.971 +        accessible <abbr title="Uniform Resource Locator">URL</abbr> endpoint that a <a href="#dfn-user-agent"
   1.972 +           class="internalDFN">user agent</a> generates and maintains for receiving <abbr title=
   1.973 +           "Hypertext Transfer Protocol">HTTP</abbr> NOTIFY requests from UPnP Event sources. It is only required when
   1.974 +           the user agent implements UPnP Service Discovery as defined in this specification.
   1.975        </p>
   1.976      </section>
   1.977      <section id="requesting-networked-services">
   1.978 -      <!--OddPage--><h2><span class="secno">4. </span>
   1.979 -        Requesting networked services
   1.980 +      <h2>
   1.981 +        <span class="secno">4.</span> Requesting networked services
   1.982        </h2>
   1.983 -      <pre class="widl">[Supplemental, NoInterfaceObject]
   1.984 +      <pre class="widl">
   1.985 +[Supplemental, NoInterfaceObject]
   1.986  interface <dfn id="navigatornetworkservice">NavigatorNetworkService</dfn> {
   1.987    // Obtain a Local-networked Service
   1.988    void <a href="#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type,
   1.989 -                           in <a href="#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
   1.990 -                           in optional <a href="#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
   1.991 +                           in <a href=
   1.992 +"#navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</a> successCallback,
   1.993 +                           in optional <a href=
   1.994 +"#navigatornetworkserviceerrorcallback">NavigatorNetworkServiceErrorCallback</a> errorCallback );
   1.995  };
   1.996 -<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.997 +<a class="externalDFN"
   1.998 +     href=
   1.999 +     "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href=
  1.1000 +     "#navigatornetworkservice">NavigatorNetworkService</a>;
  1.1001  
  1.1002  [Callback=FunctionOnly, NoInterfaceObject]
  1.1003  interface <dfn id="navigatornetworkservicesuccesscallback">NavigatorNetworkServiceSuccessCallback</dfn> {
  1.1004 @@ -573,13 +735,16 @@
  1.1005  };
  1.1006  </pre>
  1.1007        <section id="methods">
  1.1008 -        <h3><span class="secno">4.1 </span>
  1.1009 -          Methods
  1.1010 +        <h3>
  1.1011 +          <span class="secno">4.1</span> Methods
  1.1012          </h3>
  1.1013          <dl class="domintro">
  1.1014            <dt>
  1.1015 -            <var title="">window</var> . <code title="dom-navigator"><a href="http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a></code> .
  1.1016 -            <code title="dom-navigator-getNetworkServices"><a href="#dom-navigator-getnetworkservices">getNetworkServices</a></code> ( <var title="">type</var> , <var title="">successCallback</var> [, <var title="">errorCallback</var> ] )
  1.1017 +            <var title="">window</var> . <code title="dom-navigator"><a href=
  1.1018 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">navigator</a></code> .
  1.1019 +            <code title="dom-navigator-getNetworkServices"><a href=
  1.1020 +            "#dom-navigator-getnetworkservices">getNetworkServices</a></code> ( <var title="">type</var> , <var title=
  1.1021 +            "">successCallback</var> [, <var title="">errorCallback</var> ] )
  1.1022            </dt>
  1.1023            <dd>
  1.1024              <p>
  1.1025 @@ -587,11 +752,12 @@
  1.1026                requested service type.
  1.1027              </p>
  1.1028              <p>
  1.1029 -              The <var title="">type</var> argument contains one or more <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens that the web
  1.1030 -              page would like to interact with.
  1.1031 +              The <var title="">type</var> argument contains one or more <a href="#dfn-valid-service-type"
  1.1032 +                 class="internalDFN">valid service type</a> tokens that the web page would like to interact with.
  1.1033              </p>
  1.1034              <p>
  1.1035 -              If the user accepts, the <var title="">successCallback</var> is invoked, with one or more <a href="#networkservice"><code>NetworkService</code></a> objects as its argument.
  1.1036 +              If the user accepts, the <var title="">successCallback</var> is invoked, with one or more <a href=
  1.1037 +              "#networkservice"><code>NetworkService</code></a> objects as its argument.
  1.1038              </p>
  1.1039              <p>
  1.1040                If the user declines, the <var title="">errorCallback</var> (if any) is invoked.
  1.1041 @@ -600,31 +766,45 @@
  1.1042          </dl>
  1.1043          <div>
  1.1044            <p>
  1.1045 -            When the <dfn id="dom-navigator-getnetworkservices" title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
  1.1046 -               errorCallback])</code></dfn> method is called, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> run the
  1.1047 -               following steps:
  1.1048 +            When the <dfn id="dom-navigator-getnetworkservices"
  1.1049 +               title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
  1.1050 +               errorCallback])</code></dfn> method is called, the <a href="#dfn-user-agent"
  1.1051 +               class="internalDFN">user agent</a> <em class="rfc2119"
  1.1052 +               title="must">must</em> run the following steps:
  1.1053            </p>
  1.1054            <ol class="rule">
  1.1055              <li>Let <var>requested control types</var> be initially set to an empty array.
  1.1056              </li>
  1.1057 -            <li>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
  1.1058 -            <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
  1.1059 -            type</a> tokens from the resulting array.
  1.1060 +            <li>If <var>type</var> is an array consisting of one or more <a href="#dfn-valid-service-type"
  1.1061 +                  class="internalDFN">valid service type</a> tokens, then let <var>requested control types</var> by the
  1.1062 +                  value of <var>type</var>, removing any non-<a href="#dfn-valid-service-type"
  1.1063 +                  class="internalDFN">valid service type</a> tokens from the resulting array.
  1.1064              </li>
  1.1065 -            <li>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
  1.1066 -            <var>requested control types</var> be an array containing one item with a value of <var>type</var>.
  1.1067 +            <li>If <var>type</var> is a string consisting of one <a href="#dfn-valid-service-type"
  1.1068 +                  class="internalDFN">valid service type</a> token, then let <var>requested control types</var> be an
  1.1069 +                  array containing one item with a value of <var>type</var>.
  1.1070              </li>
  1.1071 -            <li>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>
  1.1072 -            below. Otherwise, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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
  1.1073 -                  object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
  1.1074 -                  (<a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
  1.1075 +            <li>If <var>requested control types</var> is an array that contains at least one or more <a title=
  1.1076 +            "valid service type"
  1.1077 +                  href="#dfn-valid-service-type"
  1.1078 +                  class="internalDFN">valid service type</a> tokens then continue to the step labeled <em>process</em>
  1.1079 +                  below. Otherwise, the <a href="#dfn-user-agent"
  1.1080 +                  class="internalDFN">user agent</a> <em class="rfc2119"
  1.1081 +                  title="must">must</em> <a href=
  1.1082 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1083 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1084 +                  object of type <code>Function</code>, with a new <a href=
  1.1085 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1086 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
  1.1087 +                  (<a href=
  1.1088 +                  "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
  1.1089                    its argument, abort any remaining steps and return.
  1.1090              </li>
  1.1091              <li>
  1.1092                <em>Process</em>: Let <var>services found</var> be an empty array.
  1.1093              </li>
  1.1094 -            <li>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
  1.1095 -            steps:
  1.1096 +            <li>For each <var>available service</var> in the <a href="#dfn-list-of-available-service-records"
  1.1097 +                  class="internalDFN">list of available service records</a> run the following steps:
  1.1098                <ol class="rule">
  1.1099                  <li>For each <var>requested control type</var> in <var>requested control types</var>: If <var>available
  1.1100                  service</var>'s <code>type</code> attribute equals the <var>requested control type</var> then let <var>
  1.1101 @@ -636,7 +816,8 @@
  1.1102                  <li>
  1.1103                    <em>Attach</em>: If <var>matched service</var> is not empty then run the following steps:
  1.1104                    <ol class="rule">
  1.1105 -                    <li>Let <var>new service object</var> be a new <a href="#networkservice"><code>NetworkService</code></a> object, mapping the parameters of <var>matched
  1.1106 +                    <li>Let <var>new service object</var> be a new <a href=
  1.1107 +                    "#networkservice"><code>NetworkService</code></a> object, mapping the parameters of <var>matched
  1.1108                      service</var> to this new object where possible.
  1.1109                      </li>
  1.1110                      <li>Append <var>new service object</var> to the <var>services found</var> array.
  1.1111 @@ -645,84 +826,147 @@
  1.1112                  </li>
  1.1113                </ol>
  1.1114              </li>
  1.1115 -            <li>If <var>services found</var> is an empty array, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em>
  1.1116 -            <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
  1.1117 -                  object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1118 -                  (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1119 +            <li>If <var>services found</var> is an empty array, then the <a href="#dfn-user-agent"
  1.1120 +                  class="internalDFN">user agent</a> <em class="rfc2119"
  1.1121 +                  title="must">must</em> <a href=
  1.1122 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1123 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1124 +                  object of type <code>Function</code>, with a new <a href=
  1.1125 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1126 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1127 +                  (<a href=
  1.1128 +                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1129                    argument, abort any remaining steps and return.
  1.1130              </li>
  1.1131              <li>Return, and run the remaining steps asynchronously.
  1.1132              </li>
  1.1133              <li>Optionally, e.g. based on a previously-established user preference, for security reasons, or due to
  1.1134 -            platform limitations, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="may">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
  1.1135 -                  object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1136 -                  (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1137 +            platform limitations, the <a href="#dfn-user-agent"
  1.1138 +                  class="internalDFN">user agent</a> <em class="rfc2119"
  1.1139 +                  title="may">may</em> <a href=
  1.1140 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1141 +                  class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1142 +                  object of type <code>Function</code>, with a new <a href=
  1.1143 +                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1144 +                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1145 +                  (<a href=
  1.1146 +                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1147                    argument, abort any remaining steps and return.
  1.1148              </li>
  1.1149 -            <li>The <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> prompt the user in a user-agent-specific manner for
  1.1150 -            permission to provide the <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin" class="externalDFN">origin</a> with an array of <a href="#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of
  1.1151 +            <li>The <a href="#dfn-user-agent"
  1.1152 +                  class="internalDFN">user agent</a> <em class="rfc2119"
  1.1153 +                  title="must">must</em> prompt the user in a user-agent-specific manner for permission to provide the
  1.1154 +                  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
  1.1155 +                  class="externalDFN">entry script</a>'s <a href=
  1.1156 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
  1.1157 +                  class="externalDFN">origin</a> with an array of <a href=
  1.1158 +                  "#networkservice"><code>NetworkService</code></a> objects representing the user-authorized subset of
  1.1159                    <var>services found</var>.
  1.1160                <p>
  1.1161 -                If the user grants permission to access one or more networked services then the <a href="#dfn-user-agent" class="internalDFN">user agent</a>
  1.1162 -                <em class="rfc2119" title="should">should</em> include an "ongoing local-network communication" indicator.
  1.1163 +                If the user grants permission to access one or more networked services then the <a href=
  1.1164 +                "#dfn-user-agent"
  1.1165 +                   class="internalDFN">user agent</a> <em class="rfc2119"
  1.1166 +                   title="should">should</em> include an "ongoing local-network communication" indicator.
  1.1167                </p>
  1.1168                <p>
  1.1169 -                If the user denies permission, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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
  1.1170 -                   object of type <code>Function</code>, with a new <a href="#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href="#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1171 -                   (<a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1172 +                If the user denies permission, then the <a href="#dfn-user-agent"
  1.1173 +                   class="internalDFN">user agent</a> <em class="rfc2119"
  1.1174 +                   title="must">must</em> <a href=
  1.1175 +                   "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1176 +                   class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
  1.1177 +                   object of type <code>Function</code>, with a new <a href=
  1.1178 +                   "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
  1.1179 +                   "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
  1.1180 +                   (<a href=
  1.1181 +                   "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
  1.1182                     argument, abort any remaining steps and return.
  1.1183                </p>
  1.1184                <p>
  1.1185                  If the user never responds, this algorithm stalls on this step.
  1.1186                </p>
  1.1187              </li>
  1.1188 -            <li>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.1189 +            <li>Let <var>services</var> be the array of one or more <a href=
  1.1190 +            "#networkservice"><code>NetworkService</code></a> objects for which the user granted permission.
  1.1191              </li>
  1.1192              <li>For each Object <var>service</var> in <var>services</var>, run the following sub-steps:
  1.1193                <ol class="rule">
  1.1194 -                <li>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
  1.1195 -                  <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.1196 +                <li>Add the <var>service</var>'s <code>url</code> parameter to the <a href=
  1.1197 +                "#dfn-entry-script-origin-s-url-whitelist"
  1.1198 +                      class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr>
  1.1199 +                      whitelist</a>.
  1.1200                  </li>
  1.1201                  <li>If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>"
  1.1202 -                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
  1.1203 -                Subscription</a> for <var>service</var>.
  1.1204 +                and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a href=
  1.1205 +                "#dfn-setup-a-upnp-events-subscription"
  1.1206 +                      class="internalDFN">setup a UPnP Events Subscription</a> for <var>service</var>.
  1.1207                  </li>
  1.1208                </ol>
  1.1209              </li>
  1.1210              <li>Let <var>services manager</var> be a new <a href="#networkservices"><code>NetworkServices</code></a>
  1.1211              object.
  1.1212              </li>
  1.1213 -            <li>Set <var>services manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
  1.1214 -            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
  1.1215 -            matches any of the tokens requested in <var>requested control types</var>.
  1.1216 +            <li>Set <var>services manager</var>'s <a href=
  1.1217 +            "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
  1.1218 +            items currently found in the <a href="#dfn-list-of-available-service-records"
  1.1219 +                  class="internalDFN">list of available service records</a> whose <code>type</code> property matches
  1.1220 +                  any of the tokens requested in <var>requested control types</var>.
  1.1221              </li>
  1.1222 -            <li>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
  1.1223 -            the newly created <var>services manager</var> object.
  1.1224 +            <li>Add <var>services</var> to the <var>services manager</var> object as its collection of <a href=
  1.1225 +            "#dfn-indexed-properties"
  1.1226 +                  class="internalDFN">indexed properties</a>.
  1.1227              </li>
  1.1228 -            <li>The <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">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 <var>services
  1.1229 +            <li>Set <var>services manager</var>'s <a href="#dom-networkservices-length"><code>length</code></a>
  1.1230 +            attribute to the number of items in <var>services</var>.
  1.1231 +            </li>
  1.1232 +            <li>Add <var>services manager</var> to the <a href="#dfn-list-of-active-service-managers"
  1.1233 +                  class="internalDFN">list of active service managers</a>.
  1.1234 +            </li>
  1.1235 +            <li>The <a href="#dfn-user-agent"
  1.1236 +                  class="internalDFN">user agent</a> <em class="rfc2119"
  1.1237 +                  title="must">must</em> <a href=
  1.1238 +                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1239 +                  class="externalDFN">queue a task</a> to invoke <var>successCallback</var> with <var>services
  1.1240                    manager</var> as its argument.
  1.1241              </li>
  1.1242            </ol>
  1.1243            <p>
  1.1244 -            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source" class="externalDFN">task source</a> for these <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task" class="externalDFN">tasks</a> is the <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.1245 +            The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#task-source"
  1.1246 +               class="externalDFN">task source</a> for these <a href=
  1.1247 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#concept-task"
  1.1248 +               class="externalDFN">tasks</a> is the <a href=
  1.1249 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#user-interaction-task-source"
  1.1250 +               class="externalDFN">user interaction task source</a>.
  1.1251            </p>
  1.1252            <p>
  1.1253              When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the
  1.1254 -            <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> add the <code>url</code> property to the <dfn id="dfn-entry-script-origin-s-url-whitelist">entry script
  1.1255 -            origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource
  1.1256 -            requests towards these URLs, and any sub-resources of these URLs, within the current <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s <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.1257 +            <a href="#dfn-user-agent"
  1.1258 +               class="internalDFN">user agent</a> <em class="rfc2119"
  1.1259 +               title="must">must</em> add the <code>url</code> property to the <dfn id=
  1.1260 +               "dfn-entry-script-origin-s-url-whitelist">entry script origin's <abbr title=
  1.1261 +               "Uniform Resource Locator">URL</abbr> whitelist</dfn>. This list enables the Web page to override and
  1.1262 +               initiate cross-site resource requests towards these URLs, and any sub-resources of these URLs, within
  1.1263 +               the current <a href=
  1.1264 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
  1.1265 +               class="externalDFN">entry script</a>'s <a href=
  1.1266 +               "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
  1.1267 +               class="externalDFN">origin</a> via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
  1.1268                 Web Messaging, XMLHttpRequest).
  1.1269            </p>
  1.1270            <p>
  1.1271 -            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.1272 -            There is no persistence to network service selections provided to a web page. It is not possible to access
  1.1273 -            a previously white-listed networked service without the necessary user authorization in all of the
  1.1274 -            following cases:
  1.1275 +            If the user navigates away from the current browsing context, the <a href="#dfn-user-agent"
  1.1276 +               class="internalDFN">user agent</a> <em class="ct"><em class="rfc2119"
  1.1277 +                title="must">must</em></em> remove all previously whitelisted urls from the <a href=
  1.1278 +                "#dfn-entry-script-origin-s-url-whitelist"
  1.1279 +               class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr>
  1.1280 +               whitelist</a>. There is no persistence to network service selections provided to a web page. It is not
  1.1281 +               possible to access a previously white-listed networked service without the necessary user authorization
  1.1282 +               in all of the following cases:
  1.1283            </p>
  1.1284            <ul>
  1.1285              <li>If the current script is reloaded at any point in the same or different window.
  1.1286              </li>
  1.1287 -            <li>if the current script reinvokes the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its
  1.1288 +            <li>if the current script reinvokes the <a href=
  1.1289 +            "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method at any point in its
  1.1290              execution.
  1.1291              </li>
  1.1292              <li>If the user navigates forward or back in their history to reload the current page.
  1.1293 @@ -733,45 +977,55 @@
  1.1294          </div>
  1.1295        </section>
  1.1296        <section id="error-handling">
  1.1297 -        <h3><span class="secno">4.2 </span>
  1.1298 -          Error Handling
  1.1299 +        <h3>
  1.1300 +          <span class="secno">4.2</span> Error Handling
  1.1301          </h3>
  1.1302          <dl class="domintro">
  1.1303            <dt>
  1.1304 -            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href="#dom-navigatornetworkserviceerror-code">code</a></code>
  1.1305 +            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href=
  1.1306 +            "#dom-navigatornetworkserviceerror-code">code</a></code>
  1.1307            </dt>
  1.1308            <dd>
  1.1309              <p>
  1.1310                Returns the current error's error code. At the current time, this will be <code>1</code> or
  1.1311 -              <code>2</code>, for which the corresponding error constants <a href="#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
  1.1312 +              <code>2</code>, for which the corresponding error constants <a href=
  1.1313 +              "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
  1.1314 +              "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
  1.1315                defined.
  1.1316              </p>
  1.1317            </dd>
  1.1318          </dl>
  1.1319          <p>
  1.1320 -          The <dfn id="dom-navigatornetworkserviceerror-code" title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <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.1321 +          The <dfn id="dom-navigatornetworkserviceerror-code"
  1.1322 +             title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <a href=
  1.1323 +             "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class=
  1.1324 +             "ct"><em class="rfc2119"
  1.1325 +              title="must">must</em></em> return the code for the error, which will be one of the following:
  1.1326          </p>
  1.1327          <dl>
  1.1328            <dt>
  1.1329 -            <dfn id="dom-navigatornetworkserviceerror-permission_denied" title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
  1.1330 +            <dfn id="dom-navigatornetworkserviceerror-permission_denied"
  1.1331 +                title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
  1.1332                  (numeric value 1)
  1.1333            </dt>
  1.1334            <dd>
  1.1335              The user or user agent denied the page permission to access any services.
  1.1336            </dd>
  1.1337            <dt>
  1.1338 -            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix" title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
  1.1339 +            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix"
  1.1340 +                title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
  1.1341                  (numeric value 2)
  1.1342            </dt>
  1.1343            <dd>
  1.1344 -            No <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens were provided in the method invocation.
  1.1345 +            No <a href="#dfn-valid-service-type"
  1.1346 +                class="internalDFN">valid service type</a> tokens were provided in the method invocation.
  1.1347            </dd>
  1.1348          </dl>
  1.1349        </section>
  1.1350      </section>
  1.1351      <section id="obtaining-networked-services">
  1.1352 -      <!--OddPage--><h2><span class="secno">5. </span>
  1.1353 -        Obtaining networked services
  1.1354 +      <h2>
  1.1355 +        <span class="secno">5.</span> Obtaining networked services
  1.1356        </h2>
  1.1357        <p>
  1.1358          The <a href="#networkservices"><code>NetworkServices</code></a> interface is the top-level response object from
  1.1359 @@ -779,25 +1033,32 @@
  1.1360          to a set of user-authorized <a href="#networkservice"><code>NetworkService</code></a> objects for the given
  1.1361          request.
  1.1362        </p>
  1.1363 -      <pre class="widl">[NoInterfaceObject]
  1.1364 +      <pre class="widl">
  1.1365 +[NoInterfaceObject]
  1.1366  interface <dfn id="networkservices">NetworkServices</dfn> {
  1.1367    readonly attribute unsigned long    <a href="#dom-networkservices-length">length</a>;
  1.1368    getter <a href="#networkservice">NetworkService</a> (unsigned long index);
  1.1369 -  <a href="#networkservice">NetworkService</a>? <a href="#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
  1.1370 +  <a href="#networkservice">NetworkService</a>? <a href=
  1.1371 +"#dom-networkservices-getservicebyid">getServiceById</a>(DOMString id);
  1.1372  
  1.1373    readonly attribute unsigned long    <a href="#dom-networkservices-servicesavailable">servicesAvailable</a>;
  1.1374  
  1.1375    // event handler attributes
  1.1376 -           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.1377 -           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.1378 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1379 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservices-onserviceavailable">onserviceavailable</a>;
  1.1380 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1381 +     class="externalDFN">EventHandler</a>     <a href=
  1.1382 +     "#dom-networkservices-onserviceunavailable">onserviceunavailable</a>;
  1.1383  
  1.1384  };
  1.1385  
  1.1386 -<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.1387 +<a href="#networkservices">NetworkServices</a> implements <a href=
  1.1388 +"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
  1.1389 +     class="externalDFN">EventTarget</a>;
  1.1390  </pre>
  1.1391        <section id="attributes">
  1.1392 -        <h3><span class="secno">5.1 </span>
  1.1393 -          Attributes
  1.1394 +        <h3>
  1.1395 +          <span class="secno">5.1</span> Attributes
  1.1396          </h3>
  1.1397          <dl class="domintro">
  1.1398            <dt>
  1.1399 @@ -805,41 +1066,49 @@
  1.1400            </dt>
  1.1401            <dd>
  1.1402              <p>
  1.1403 -              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
  1.1404 -              records</a>.
  1.1405 +              Returns the current number of items in the current object's collection of <a href=
  1.1406 +              "#networkservice"><code>NetworkService</code></a> objects.
  1.1407              </p>
  1.1408            </dd>
  1.1409            <dt>
  1.1410 -            <code title="dom-networkservices-servicesavailable"><a href="#dom-networkservices-servicesavailable">servicesAvailable</a></code>
  1.1411 +            <code title="dom-networkservices-servicesavailable"><a href=
  1.1412 +            "#dom-networkservices-servicesavailable">servicesAvailable</a></code>
  1.1413            </dt>
  1.1414            <dd>
  1.1415              <p>
  1.1416 -              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
  1.1417 -              in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>.
  1.1418 +              Returns the current number of items matching one of the app-requested <a href="#dfn-valid-service-type"
  1.1419 +                 class="internalDFN">valid service type</a> tokens in the <a href=
  1.1420 +                 "#dfn-list-of-available-service-records"
  1.1421 +                 class="internalDFN">list of available service records</a>.
  1.1422              </p>
  1.1423            </dd>
  1.1424          </dl>
  1.1425          <div>
  1.1426            <p>
  1.1427 -            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="rfc2119" title="must">must</em>
  1.1428 -            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
  1.1429 -            records</a> at the time of getting.
  1.1430 +            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute <em class="rfc2119"
  1.1431 +               title="must">must</em> return the number of <a href="#networkservice"><code>NetworkService</code></a>
  1.1432 +               objects represented by the collection.
  1.1433            </p>
  1.1434            <p>
  1.1435              The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute
  1.1436 -            <em class="rfc2119" title="must">must</em> return the number of services in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>
  1.1437 -            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
  1.1438 -            used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
  1.1439 +            <em class="rfc2119"
  1.1440 +               title="must">must</em> return the number of services in the <a href=
  1.1441 +               "#dfn-list-of-available-service-records"
  1.1442 +               class="internalDFN">list of available service records</a> whose <code>type</code> attribute matches any
  1.1443 +               of the <a href="#dfn-valid-service-type"
  1.1444 +               class="internalDFN">valid service type</a> tokens that was initially used to create the current <a href=
  1.1445 +               "#networkservices"><code>NetworkServices</code></a> object.
  1.1446            </p>
  1.1447          </div>
  1.1448        </section>
  1.1449        <section id="methods-1">
  1.1450 -        <h3><span class="secno">5.2 </span>
  1.1451 -          Methods
  1.1452 +        <h3>
  1.1453 +          <span class="secno">5.2</span> Methods
  1.1454          </h3>
  1.1455          <dl class="domintro">
  1.1456            <dt>
  1.1457 -            <code title="networkservices-getter"><a href="#networkservices">services</a></code> [ <var title="">index</var> ]
  1.1458 +            <code title="networkservices-getter"><a href="#networkservices">services</a></code> [ <var title=
  1.1459 +            "">index</var> ]
  1.1460            </dt>
  1.1461            <dd>
  1.1462              <p>
  1.1463 @@ -847,7 +1116,9 @@
  1.1464              </p>
  1.1465            </dd>
  1.1466            <dt>
  1.1467 -            <code title="networkservices-getter"><a href="#networkservices">services</a></code> . <code title="dom-networkservices-getservicebyid"><a href="#dom-networkservices-getservicebyid">getServiceById</a></code> ( <var title="">id</var> )
  1.1468 +            <code title="networkservices-getter"><a href="#networkservices">services</a></code> . <code title=
  1.1469 +            "dom-networkservices-getservicebyid"><a href=
  1.1470 +            "#dom-networkservices-getservicebyid">getServiceById</a></code> ( <var title="">id</var> )
  1.1471            </dt>
  1.1472            <dd>
  1.1473              <p>
  1.1474 @@ -857,47 +1128,66 @@
  1.1475            </dd>
  1.1476          </dl>
  1.1477          <p>
  1.1478 -          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or
  1.1479 -          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
  1.1480 -          authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a>
  1.1481 -          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
  1.1482 -          modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
  1.1483 +          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current collection of one
  1.1484 +          or more <a href="#networkservice"><code>NetworkService</code></a> objects. A <a href=
  1.1485 +          "#networkservices"><code>NetworkServices</code></a> object is <span>immutable</span> meaning that it cannot
  1.1486 +          be modified.
  1.1487          </p>
  1.1488 -        <div class="note"><div class="note-title"><span>Note</span></div><p class="">
  1.1489 -          Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
  1.1490 -          first has the index 0, and each subsequent service is numbered one higher than the previous one.
  1.1491 -        </p></div>
  1.1492 +        <div class="note">
  1.1493 +          <div class="note-title">
  1.1494 +            <span>Note</span>
  1.1495 +          </div>
  1.1496 +          <p class="">
  1.1497 +            Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
  1.1498 +            first has the index 0, and each subsequent service is numbered one higher than the previous one.
  1.1499 +          </p>
  1.1500 +        </div>
  1.1501          <p>
  1.1502 -          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
  1.1503 -             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
  1.1504 -             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.1505 +          The <a href=
  1.1506 +          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices"
  1.1507 +             class="externalDFN">supported property indices</a> of <a href=
  1.1508 +             "#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to
  1.1509 +             the number of the <a href="#networkservice"><code>NetworkService</code></a> objects in the collection
  1.1510 +             minus one.
  1.1511          </p>
  1.1512          <p>
  1.1513 -          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
  1.1514 -             <a href="#networkservices"><code>NetworkServices</code></a> object's <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service
  1.1515 -             records</a>, the user agent <em class="rfc2119" title="must">must</em> return the <a href="#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in
  1.1516 -             the <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a>.
  1.1517 +          To <a href=
  1.1518 +          "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property"
  1.1519 +             class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a
  1.1520 +             <a href="#networkservices"><code>NetworkServices</code></a> object the user agent <em class="rfc2119"
  1.1521 +             title="must">must</em> return the <a href="#networkservice"><code>NetworkService</code></a> object that
  1.1522 +             represents the <var>index</var>th item in the collection.
  1.1523          </p>
  1.1524          <p>
  1.1525 -          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
  1.1526 -          <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.1527 -          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
  1.1528 -          <em class="rfc2119" title="must">must</em> return null.
  1.1529 +          The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class=
  1.1530 +          "ct"><em class="rfc2119"
  1.1531 +              title="must">must</em></em> return the first <a href="#networkservice"><code>NetworkService</code></a>
  1.1532 +              object in the collection whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to
  1.1533 +              the value of the <var>id</var> argument provided. When no <a href=
  1.1534 +              "#networkservice"><code>NetworkService</code></a> objects match the given argument, the method <em class=
  1.1535 +              "rfc2119"
  1.1536 +             title="must">must</em> return null.
  1.1537          </p>
  1.1538          <p>
  1.1539            Services available within the local network can connect and disconnect at different times during the
  1.1540 -          execution of a web page. A <a href="#dfn-user-agent" class="internalDFN">user agent</a> can inform a web page when the state of networked services
  1.1541 -          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
  1.1542 -          experiences for communicating the state of networked services with the ability to change the particular
  1.1543 -          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.1544 +          execution of a web page. A <a href="#dfn-user-agent"
  1.1545 +             class="internalDFN">user agent</a> can inform a web page when the state of networked services matching the
  1.1546 +             requested <a href="#dfn-valid-service-type"
  1.1547 +             class="internalDFN">valid service type</a> change. Web pages can use this information to enable in-page
  1.1548 +             experiences for communicating the state of networked services with the ability to change the particular
  1.1549 +             service or set of services the page is connected to by re-invoking the <a href=
  1.1550 +             "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> method.
  1.1551          </p>
  1.1552        </section>
  1.1553        <section id="events">
  1.1554 -        <h3><span class="secno">5.3 </span>
  1.1555 -          Events
  1.1556 +        <h3>
  1.1557 +          <span class="secno">5.3</span> Events
  1.1558          </h3>
  1.1559          <p>
  1.1560 -          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.1561 +          The following are the event handlers (and their corresponding event handler event types) that <em class=
  1.1562 +          "ct"><em class="rfc2119"
  1.1563 +              title="must">must</em></em> be supported, as IDL attributes, by all objects implementing the <a href=
  1.1564 +              "#networkservices"><code>NetworkServices</code></a> interface:
  1.1565          </p>
  1.1566          <table border="1">
  1.1567            <thead>
  1.1568 @@ -913,7 +1203,8 @@
  1.1569            <tbody>
  1.1570              <tr>
  1.1571                <td>
  1.1572 -                <dfn id="dom-networkservices-onserviceavailable" title="dom-NetworkServices-onserviceavailable"><code>onserviceavailable</code></dfn>
  1.1573 +                <dfn id="dom-networkservices-onserviceavailable"
  1.1574 +                    title="dom-NetworkServices-onserviceavailable"><code>onserviceavailable</code></dfn>
  1.1575                </td>
  1.1576                <td>
  1.1577                  <a href="#event-serviceavailable"><code>serviceavailable</code></a>
  1.1578 @@ -921,7 +1212,8 @@
  1.1579              </tr>
  1.1580              <tr>
  1.1581                <td>
  1.1582 -                <dfn id="dom-networkservices-onserviceunavailable" title="dom-NetworkServices-onserviceunavailable"><code>onserviceunavailable</code></dfn>
  1.1583 +                <dfn id="dom-networkservices-onserviceunavailable"
  1.1584 +                    title="dom-NetworkServices-onserviceunavailable"><code>onserviceunavailable</code></dfn>
  1.1585                </td>
  1.1586                <td>
  1.1587                  <a href="#event-serviceunavailable"><code>serviceunavailable</code></a>
  1.1588 @@ -932,14 +1224,16 @@
  1.1589        </section>
  1.1590      </section>
  1.1591      <section id="communicating-with-a-networked-service">
  1.1592 -      <!--OddPage--><h2><span class="secno">6. </span>
  1.1593 -        Communicating with a networked service
  1.1594 +      <h2>
  1.1595 +        <span class="secno">6.</span> Communicating with a networked service
  1.1596        </h2>
  1.1597        <p>
  1.1598          The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection
  1.1599 -        information for an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> service endpoint and if available, service events, running on a networked device.
  1.1600 +        information for an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> service endpoint and if available,
  1.1601 +        service events, running on a networked device.
  1.1602        </p>
  1.1603 -      <pre class="widl">[NoInterfaceObject]
  1.1604 +      <pre class="widl">
  1.1605 +[NoInterfaceObject]
  1.1606  interface <dfn id="networkservice">NetworkService</dfn> {
  1.1607    readonly attribute DOMString        <a href="#dom-networkservice-id">id</a>;
  1.1608    readonly attribute DOMString        <a href="#dom-networkservice-name">name</a>;
  1.1609 @@ -950,21 +1244,27 @@
  1.1610    readonly attribute boolean          <a href="#dom-networkservice-online">online</a>;
  1.1611  
  1.1612    // event handler attributes
  1.1613 -           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.1614 -           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.1615 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1616 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceonline">onserviceonline</a>;
  1.1617 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1618 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onserviceoffline">onserviceoffline</a>;
  1.1619  
  1.1620 -           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.1621 +           attribute <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler"
  1.1622 +     class="externalDFN">EventHandler</a>     <a href="#dom-networkservice-onnotify">onnotify</a>;
  1.1623  };
  1.1624  
  1.1625 -<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.1626 +<a href="#networkservice">NetworkService</a> implements <a href=
  1.1627 +"http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-eventtarget"
  1.1628 +     class="externalDFN">EventTarget</a>;
  1.1629  </pre>
  1.1630        <section id="attributes-1">
  1.1631 -        <h3><span class="secno">6.1 </span>
  1.1632 -          Attributes
  1.1633 +        <h3>
  1.1634 +          <span class="secno">6.1</span> Attributes
  1.1635          </h3>
  1.1636          <dl class="domintro">
  1.1637            <dt>
  1.1638 -            <var title="">service</var> . <code title="dom-networkservice-id"><a href="#dom-networkservice-id">id</a></code>
  1.1639 +            <var title="">service</var> . <code title="dom-networkservice-id"><a href=
  1.1640 +            "#dom-networkservice-id">id</a></code>
  1.1641            </dt>
  1.1642            <dd>
  1.1643              <p>
  1.1644 @@ -972,7 +1272,8 @@
  1.1645              </p>
  1.1646            </dd>
  1.1647            <dt>
  1.1648 -            <var title="">service</var> . <code title="dom-networkservice-name"><a href="#dom-networkservice-name">name</a></code>
  1.1649 +            <var title="">service</var> . <code title="dom-networkservice-name"><a href=
  1.1650 +            "#dom-networkservice-name">name</a></code>
  1.1651            </dt>
  1.1652            <dd>
  1.1653              <p>
  1.1654 @@ -980,24 +1281,31 @@
  1.1655              </p>
  1.1656            </dd>
  1.1657            <dt>
  1.1658 -            <var title="">service</var> . <code title="dom-networkservice-type"><a href="#dom-networkservice-type">type</a></code>
  1.1659 +            <var title="">service</var> . <code title="dom-networkservice-type"><a href=
  1.1660 +            "#dom-networkservice-type">type</a></code>
  1.1661            </dt>
  1.1662            <dd>
  1.1663              <p>
  1.1664 -              The <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> token value of the user-selected service.
  1.1665 +              The <a href="#dfn-valid-service-type"
  1.1666 +                 class="internalDFN">valid service type</a> token value of the user-selected service.
  1.1667              </p>
  1.1668            </dd>
  1.1669            <dt>
  1.1670 -            <var title="">service</var> . <code title="dom-networkservice-url"><a href="#dom-networkservice-url">url</a></code>
  1.1671 +            <var title="">service</var> . <code title="dom-networkservice-url"><a href=
  1.1672 +            "#dom-networkservice-url">url</a></code>
  1.1673            </dt>
  1.1674            <dd>
  1.1675              <p>
  1.1676 -              The control <abbr title="Uniform Resource Locator">URL</abbr> endpoint (including any required port information) of the user-selected control service
  1.1677 -              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.1678 +              The control <abbr title="Uniform Resource Locator">URL</abbr> endpoint (including any required port
  1.1679 +              information) of the user-selected control service that has been added to the <a href=
  1.1680 +              "#dfn-entry-script-origin-s-url-whitelist"
  1.1681 +                 class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr>
  1.1682 +                 whitelist</a>.
  1.1683              </p>
  1.1684            </dd>
  1.1685            <dt>
  1.1686 -            <var title="">service</var> . <code title="dom-networkservice-config"><a href="#dom-networkservice-config">config</a></code>
  1.1687 +            <var title="">service</var> . <code title="dom-networkservice-config"><a href=
  1.1688 +            "#dom-networkservice-config">config</a></code>
  1.1689            </dt>
  1.1690            <dd>
  1.1691              <p>
  1.1692 @@ -1007,22 +1315,27 @@
  1.1693          </dl>
  1.1694          <p>
  1.1695            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service.
  1.1696 -          The same service provided at different times or on different objects <em class="rfc2119" title="must">must</em> have the same
  1.1697 -          <a href="#dom-networkservice-id"><code>id</code></a> value.
  1.1698 +          The same service provided at different times or on different objects <em class="rfc2119"
  1.1699 +             title="must">must</em> have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
  1.1700          </p>
  1.1701          <p>
  1.1702            The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for
  1.1703            the service.
  1.1704          </p>
  1.1705          <p>
  1.1706 -          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
  1.1707 -          service type</a> of the service.
  1.1708 +          The <dfn id="dom-networkservice-type"><code>type</code></dfn> attribute reflects the value of the <a href=
  1.1709 +          "#dfn-valid-service-type"
  1.1710 +             class="internalDFN">valid service type</a> of the service.
  1.1711          </p>
  1.1712          <p>
  1.1713 -          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> endpoint for the service that has been
  1.1714 -             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
  1.1715 -             implicit cross-document messaging via various existing mechanisms (e.g. Web Sockets, Server-Sent Events,
  1.1716 -             Web Messaging, XMLHttpRequest).
  1.1717 +          The <dfn id="dom-networkservice-url"><code>url</code></dfn> attribute is an <a href=
  1.1718 +          "http://www.w3.org/TR/html5/urls.html#absolute-url"
  1.1719 +             class="externalDFN">absolute <abbr title="Uniform Resource Locator">URL</abbr></a> pointing to the root
  1.1720 +             <abbr title="Hypertext Transfer Protocol">HTTP</abbr> endpoint for the service that has been added to the
  1.1721 +             <a href="#dfn-entry-script-origin-s-url-whitelist"
  1.1722 +             class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.1723 +             Web pages can subsequently use this value for implicit cross-document messaging via various existing
  1.1724 +             mechanisms (e.g. Web Sockets, Server-Sent Events, Web Messaging, XMLHttpRequest).
  1.1725          </p>
  1.1726          <p>
  1.1727            The <dfn id="dom-networkservice-config"><code>config</code></dfn> attribute provides the raw configuration
  1.1728 @@ -1030,12 +1343,13 @@
  1.1729          </p>
  1.1730        </section>
  1.1731        <section id="states">
  1.1732 -        <h3><span class="secno">6.2 </span>
  1.1733 -          States
  1.1734 +        <h3>
  1.1735 +          <span class="secno">6.2</span> States
  1.1736          </h3>
  1.1737          <dl class="domintro">
  1.1738            <dt>
  1.1739 -            <var title="">service</var> . <code title="dom-networkservice-online"><a href="#dom-networkservice-online">online</a></code>
  1.1740 +            <var title="">service</var> . <code title="dom-networkservice-online"><a href=
  1.1741 +            "#dom-networkservice-online">online</a></code>
  1.1742            </dt>
  1.1743            <dd>
  1.1744              <p>
  1.1745 @@ -1050,15 +1364,19 @@
  1.1746            reporting itself as being either <var>online</var>, and therefore accessible on the local network, in which
  1.1747            case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the
  1.1748            local network, either temporarily or permanently, in which case this attribute will return
  1.1749 -          <code>false</code>. This attribute <em class="rfc2119" title="must">must</em> default to <code>true</code>.
  1.1750 +          <code>false</code>. This attribute <em class="rfc2119"
  1.1751 +             title="must">must</em> default to <code>true</code>.
  1.1752          </p>
  1.1753        </section>
  1.1754        <section id="events-1">
  1.1755 -        <h3><span class="secno">6.3 </span>
  1.1756 -          Events
  1.1757 +        <h3>
  1.1758 +          <span class="secno">6.3</span> Events
  1.1759          </h3>
  1.1760          <p>
  1.1761 -          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="#networkservice"><code>NetworkService</code></a> interface:
  1.1762 +          The following are the event handlers (and their corresponding event handler event types) that <em class=
  1.1763 +          "ct"><em class="rfc2119"
  1.1764 +              title="must">must</em></em> be supported, as IDL attributes, by all objects implementing the <a href=
  1.1765 +              "#networkservice"><code>NetworkService</code></a> interface:
  1.1766          </p>
  1.1767          <table border="1">
  1.1768            <thead>
  1.1769 @@ -1074,7 +1392,8 @@
  1.1770            <tbody>
  1.1771              <tr>
  1.1772                <td>
  1.1773 -                <dfn id="dom-networkservice-onnotify" title="dom-NetworkService-onnotify"><code>onnotify</code></dfn>
  1.1774 +                <dfn id="dom-networkservice-onnotify"
  1.1775 +                    title="dom-NetworkService-onnotify"><code>onnotify</code></dfn>
  1.1776                </td>
  1.1777                <td>
  1.1778                  <a href="#event-notify"><code>notify</code></a>
  1.1779 @@ -1082,7 +1401,8 @@
  1.1780              </tr>
  1.1781              <tr>
  1.1782                <td>
  1.1783 -                <dfn id="dom-networkservice-onserviceonline" title="dom-NetworkService-onserviceonline"><code>onserviceonline</code></dfn>
  1.1784 +                <dfn id="dom-networkservice-onserviceonline"
  1.1785 +                    title="dom-NetworkService-onserviceonline"><code>onserviceonline</code></dfn>
  1.1786                </td>
  1.1787                <td>
  1.1788                  <a href="#event-serviceonline"><code>serviceonline</code></a>
  1.1789 @@ -1090,7 +1410,8 @@
  1.1790              </tr>
  1.1791              <tr>
  1.1792                <td>
  1.1793 -                <dfn id="dom-networkservice-onserviceoffline" title="dom-NetworkService-onserviceoffline"><code>onserviceoffline</code></dfn>
  1.1794 +                <dfn id="dom-networkservice-onserviceoffline"
  1.1795 +                    title="dom-NetworkService-onserviceoffline"><code>onserviceoffline</code></dfn>
  1.1796                </td>
  1.1797                <td>
  1.1798                  <a href="#event-serviceoffline"><code>serviceoffline</code></a>
  1.1799 @@ -1101,51 +1422,77 @@
  1.1800        </section>
  1.1801      </section>
  1.1802      <section id="service-discovery">
  1.1803 -      <!--OddPage--><h2><span class="secno">7. </span>
  1.1804 -        Service Discovery
  1.1805 +      <h2>
  1.1806 +        <span class="secno">7.</span> Service Discovery
  1.1807        </h2>
  1.1808        <p>
  1.1809 -        A <a href="#dfn-user-agent" class="internalDFN">user agent</a> conforming to this specification <em class="rfc2119" title="may">may</em> implement <abbr title="Simple Service Discovery Protocol">SSDP</abbr> [<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>]
  1.1810 -        service discovery mechanisms to enable Web pages to request and connect with <abbr title="Hypertext Transfer Protocol">HTTP</abbr> services running on networked
  1.1811 -        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
  1.1812 -        service discovery mechanisms, then it <em class="rfc2119" title="must">must</em> conform to the corresponding algorithms provided
  1.1813 -        in this section of the specification.
  1.1814 +        A <a href="#dfn-user-agent"
  1.1815 +           class="internalDFN">user agent</a> conforming to this specification <em class="rfc2119"
  1.1816 +           title="may">may</em> implement <abbr title="Simple Service Discovery Protocol">SSDP</abbr> [<cite><a class=
  1.1817 +           "bibref"
  1.1818 +           href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and Zeroconf [<cite><a class="bibref"
  1.1819 +           href="#bib-DNS-SD">DNS-SD</a></cite>] + [<cite><a class="bibref"
  1.1820 +           href="#bib-MDNS">MDNS</a></cite>] <dfn id="dfn-service-discovery-mechanisms">service discovery
  1.1821 +           mechanisms</dfn> - the requirements detailed in this section of the specification - to enable Web pages to
  1.1822 +           request and connect with <abbr title="Hypertext Transfer Protocol">HTTP</abbr> services running on networked
  1.1823 +           devices, discovered via either mechanism, through this <abbr title=
  1.1824 +           "Application Programming Interface">API</abbr>. When a <a href="#dfn-user-agent"
  1.1825 +           class="internalDFN">user agent</a> implements either of these <a href="#dfn-service-discovery-mechanisms"
  1.1826 +           class="internalDFN">service discovery mechanisms</a>, then it <em class="rfc2119"
  1.1827 +           title="must">must</em> conform to the corresponding algorithms provided in this section of the
  1.1828 +           specification.
  1.1829        </p>
  1.1830        <p>
  1.1831 -        This section presents how the results of these two service discovery mechanisms will be matched to requested
  1.1832 -        service types, how the user agent stores available and active services, how their properties are applied to any
  1.1833 -        resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
  1.1834 +        This section presents how the results of these two <a href="#dfn-service-discovery-mechanisms"
  1.1835 +           class="internalDFN">service discovery mechanisms</a> will be matched to requested service types, how the
  1.1836 +           user agent stores available and active services, how their properties are applied to any resulting <a href=
  1.1837 +           "#networkservice"><code>NetworkService</code></a> objects.
  1.1838        </p>
  1.1839        <p>
  1.1840 -        It is expected that user agents will perform these service discovery mechanisms asynchronously and
  1.1841 -        periodically update the <a>list of networked devices</a> as required. The timing of any service discovery
  1.1842 -        mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent
  1.1843 -        start-up, every X seconds during user agent execution or on invocation of this <abbr title="Application Programming Interface">API</abbr> from a Web page).
  1.1844 +        It is expected that user agents will perform these <a href="#dfn-service-discovery-mechanisms"
  1.1845 +           class="internalDFN">service discovery mechanisms</a> asynchronously and periodically update the <a href=
  1.1846 +           "#dfn-list-of-available-service-records"
  1.1847 +           class="internalDFN">list of available service records</a> as required. The timing of any <a href=
  1.1848 +           "#dfn-service-discovery-mechanisms"
  1.1849 +           class="internalDFN">service discovery mechanisms</a> is an implementation detail left to the discretion of
  1.1850 +           the implementer (e.g. by continuously monitoring the network as a background process or on invocation of
  1.1851 +           this <abbr title="Application Programming Interface">API</abbr> from a Web page).
  1.1852        </p>
  1.1853        <p>
  1.1854 -        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
  1.1855 -        that is used to track all the services that have been discovered and are available in the current network at
  1.1856 -        any given time. At any point during the running of either of the two service discovery mechanisms then existing
  1.1857 -        entries within this table can be updated, entries can be added and entries can be removed as the status of
  1.1858 -        networked services changes according to the rules defined in this specification.
  1.1859 +        The <dfn id="dfn-list-of-available-service-records">list of available service records</dfn> is a single dynamic
  1.1860 +        internal lookup table within user agents that is used to track all the services that have been discovered and
  1.1861 +        are available in the current network at any given time. At any point during the running of either of the two
  1.1862 +        <a href="#dfn-service-discovery-mechanisms"
  1.1863 +           class="internalDFN">service discovery mechanisms</a> then existing entries within this table can be updated,
  1.1864 +           entries can be added and entries can be removed as the status of networked services changes according to the
  1.1865 +           rules defined in this specification.
  1.1866        </p>
  1.1867        <p>
  1.1868 -        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
  1.1869 -        that is used to track the current services that are being shared with web pages at any given time from the
  1.1870 -        <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
  1.1871 -        associated with a <var>services manager</var> object that is assigned as part of the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
  1.1872 +        The <dfn id="dfn-list-of-active-service-managers">list of active service managers</dfn> is an internal list
  1.1873 +        within user agents that is used to track all <a href="#networkservices"><code>NetworkServices</code></a>
  1.1874 +        objects currently being shared with any web pages at the current time. Each <a href=
  1.1875 +        "#networkservices"><code>NetworkServices</code></a> object in the <a href=
  1.1876 +        "#dfn-list-of-active-service-managers"
  1.1877 +           class="internalDFN">list of active service managers</a> represents a collection of one or more <a href=
  1.1878 +           "#networkservice"><code>NetworkService</code></a> objects - known as its <dfn id=
  1.1879 +           "dfn-indexed-properties">indexed properties</dfn>. <a href="#networkservice"><code>NetworkService</code></a>
  1.1880 +           objects are attached as the <a href="#dfn-indexed-properties"
  1.1881 +           class="internalDFN">indexed properties</a> of a <a href="#networkservices"><code>NetworkServices</code></a>
  1.1882 +           object as part of the <a href="#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a>
  1.1883 +           algorithm.
  1.1884        </p>
  1.1885        <p>
  1.1886 -        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
  1.1887 -        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
  1.1888 -        current network. This rule takes one argument, <var>network service record</var>, and consists of running the
  1.1889 -        following steps:
  1.1890 +        The rule for <dfn id="dfn-adding-an-available-service">adding an available service</dfn> is the process of
  1.1891 +        adding a new service or updating an existing service in the <a href="#dfn-list-of-available-service-records"
  1.1892 +           class="internalDFN">list of available service records</a> that is generally available on the user's current
  1.1893 +           network. This rule takes one argument, <var>network service record</var>, and consists of running the
  1.1894 +           following steps:
  1.1895        </p>
  1.1896        <ol class="rule">
  1.1897          <li>Let <var>new service registration flag</var> be <code>true</code>.
  1.1898          </li>
  1.1899 -        <li>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
  1.1900 -        the following sub-steps:
  1.1901 +        <li>For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records"
  1.1902 +              class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.1903            <ol class="rule">
  1.1904              <li>If the <var>existing service record</var>'s <code>id</code> property does not equal <var>network
  1.1905              service record</var>'s <code>id</code> property then abort any remaining sub-steps and continue at the next
  1.1906 @@ -1153,43 +1500,68 @@
  1.1907              </li>
  1.1908              <li>Set <var>new service registration flag</var> to <code>false</code>.
  1.1909              </li>
  1.1910 -            <li>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
  1.1911 -            records</a> with the value of <var>network service record</var>.
  1.1912 +            <li>Replace the value of <var>existing service record</var> in the current <a href=
  1.1913 +            "#dfn-list-of-available-service-records"
  1.1914 +                  class="internalDFN">list of available service records</a> with the value of <var>network service
  1.1915 +                  record</var>.
  1.1916              </li>
  1.1917            </ol>
  1.1918          </li>
  1.1919          <li>If <var>new service registration flag</var> is set to <code>true</code> then add <var>network service
  1.1920 -        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.1921 +        record</var> to the <a href="#dfn-list-of-available-service-records"
  1.1922 +              class="internalDFN">list of available service records</a> as a new item.
  1.1923          </li>
  1.1924 -        <li>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
  1.1925 -        steps:
  1.1926 +        <li>For each <var>service manager</var> in the <a href="#dfn-list-of-active-service-managers"
  1.1927 +              class="internalDFN">list of active service managers</a> run the following steps:
  1.1928            <ol class="rule">
  1.1929 -            <li>If <var>network service record</var>'s <code>type</code> property does not equal the current
  1.1930 -            <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
  1.1931 -            <var>active service</var> and continue at the next available <var>active service</var>.
  1.1932 +            <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
  1.1933              </li>
  1.1934 -            <li>If the <var>new service registration flag</var> is set to <code>true</code> then increment the
  1.1935 -              <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the
  1.1936 -              <var>services manager</var> associated with the current <var>active service</var> object by
  1.1937 -              <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> 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, which does not bubble, is not cancellable, and
  1.1938 -                  has no default action, at the <var>services manager</var> associated with the current <var>active
  1.1939 -                  service</var> object.
  1.1940 +            <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
  1.1941 +              <ol class="rule">
  1.1942 +                <li>If <var>network service record</var>'s <code>type</code> property does not equal <var>active
  1.1943 +                service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this <var>active
  1.1944 +                service</var> and continue at the next available <var>active service</var>.
  1.1945 +                </li>
  1.1946 +                <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
  1.1947 +                </li>
  1.1948 +                <li>If the <var>new service registration flag</var> is set to <code>false</code>, the <var>network
  1.1949 +                service record</var>'s <code>id</code> property equals the <var>active service</var>'s <code>id</code>
  1.1950 +                attribute and <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
  1.1951 +                attribute is currently set to <code>false</code> then set <var>active service</var>'s <a href=
  1.1952 +                "#dom-networkservice-online"><code>online</code></a> attribute to <code>true</code> and then <a href=
  1.1953 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1954 +                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.1955 +                      "#event-serviceonline"><code>serviceonline</code></a> that uses the <a href=
  1.1956 +                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.1957 +                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
  1.1958 +                      and has no default action, at the current <var>active service</var> object.
  1.1959 +                </li>
  1.1960 +              </ol>
  1.1961              </li>
  1.1962 -            <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute
  1.1963 -            to <code>true</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> to dispatch a newly created event with the name <a href="#event-serviceonline"><code>serviceonline</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, which does not bubble, is not cancellable, and
  1.1964 -                  has no default action, at the current <var>active service</var> object.
  1.1965 +            <li>If the <var>new service registration flag</var> is set to <code>true</code> and the <var>service type
  1.1966 +            in current service manager flag</var> is also set to <code>true</code> then increment <var>service
  1.1967 +            manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
  1.1968 +            attribute by <code>1</code> and then <a href=
  1.1969 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.1970 +                  class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.1971 +                  "#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href=
  1.1972 +                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.1973 +                  class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
  1.1974 +                  has no default action, at the current <var>service manager</var> object.
  1.1975              </li>
  1.1976            </ol>
  1.1977          </li>
  1.1978        </ol>
  1.1979        <p>
  1.1980 -        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.1981 -        <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 expired.
  1.1982 -        This rule takes one argument, <var>service identifier</var>, and consists of running the following steps:
  1.1983 +        The rule for <dfn id="dfn-removing-an-available-service">removing an available service</dfn> is the general
  1.1984 +        process of removing a service from the <a href="#dfn-list-of-available-service-records"
  1.1985 +           class="internalDFN">list of available service records</a> that has left the user's current network or has
  1.1986 +           otherwise expired. This rule takes one argument, <var>service identifier</var>, and consists of running the
  1.1987 +           following steps:
  1.1988        </p>
  1.1989        <ol class="rule">
  1.1990 -        <li>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
  1.1991 -        the following sub-steps:
  1.1992 +        <li>For each <var>existing service record</var> in the current <a href="#dfn-list-of-available-service-records"
  1.1993 +              class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.1994            <ol class="rule">
  1.1995              <li>If the <var>existing service record</var>'s <code>id</code> property does not match <var>service
  1.1996              identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and
  1.1997 @@ -1197,212 +1569,323 @@
  1.1998              </li>
  1.1999              <li>If the <var>existing service record</var>'s <code>type</code> property begins with the DOMString
  1.2000              "<code>upnp:</code>" and <var>existing service record</var>'s <code>eventsURL</code> property is set then
  1.2001 -            run the rule to <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
  1.2002 -            result of having previously called <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a UPnP Events Subscription</a> against the current
  1.2003 -            <var>existing service record</var>).
  1.2004 +            run the rule to <a href="#dfn-terminate-an-existing-upnp-events-subscription"
  1.2005 +                  class="internalDFN">terminate an existing UPnP Events Subscription</a>, if one is currently active
  1.2006 +                  (as a result of having previously called <a href="#dfn-setup-a-upnp-events-subscription"
  1.2007 +                  class="internalDFN">setup a UPnP Events Subscription</a> against the current <var>existing service
  1.2008 +                  record</var>).
  1.2009              </li>
  1.2010 -            <li>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
  1.2011 -            steps:
  1.2012 +            <li>For each <var>service manager</var> in the <a href="#dfn-list-of-active-service-managers"
  1.2013 +                  class="internalDFN">list of active service managers</a> run the following steps:
  1.2014                <ol class="rule">
  1.2015 -                <li>If <var>existing service record</var>'s <code>type</code> property does not equal the current <var>
  1.2016 -                  active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
  1.2017 -                  <var>active service</var> and continue at the next available <var>active service</var>.
  1.2018 +                <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
  1.2019                  </li>
  1.2020 -                <li>Decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
  1.2021 -                attribute of the <var>services manager</var> associated with the current <var>active service</var>
  1.2022 -                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> to dispatch a newly created event with the name <a href="#event-serviceunavailable"><code>serviceunavailable</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, which does not bubble, is not cancellable,
  1.2023 -                      and has no default action, at the <var>services manager</var> associated with the current
  1.2024 -                      <var>active service</var> object.
  1.2025 +                <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
  1.2026 +                  <ol class="rule">
  1.2027 +                    <li>If <var>existing service record</var>'s <code>type</code> property does not equal the
  1.2028 +                    <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
  1.2029 +                    <var>active service</var> and continue at the next available <var>active service</var>.
  1.2030 +                    </li>
  1.2031 +                    <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
  1.2032 +                    </li>
  1.2033 +                    <li>If <var>existing service record</var>'s <code>id</code> property equals the <var>active
  1.2034 +                    service</var>'s <code>id</code> attribute and <var>active service</var>'s <a href=
  1.2035 +                    "#dom-networkservice-online"><code>online</code></a> attribute is currently set to
  1.2036 +                    <code>true</code> then set <var>active service</var>'s <a href="#dom-networkservice-online"><code>
  1.2037 +                      online</code></a> attribute to <code>false</code> and then <a href=
  1.2038 +                      "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2039 +                          class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.2040 +                          "#event-serviceoffline"><code>serviceoffline</code></a> that uses the <a href=
  1.2041 +                          "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2042 +                          class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not
  1.2043 +                          cancellable, and has no default action, at the current <var>active service</var>.
  1.2044 +                    </li>
  1.2045 +                  </ol>
  1.2046                  </li>
  1.2047 -                <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
  1.2048 -                attribute to <code>false</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> to dispatch a newly created event with the name <a href="#event-serviceoffline"><code>serviceoffline</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, which does not bubble, is not cancellable,
  1.2049 -                      and has no default action, at the current <var>active service</var> object.
  1.2050 +                <li>If the <var>service type in current service manager flag</var> is set to <code>true</code> then
  1.2051 +                decrement <var>service manager</var>'s <a href=
  1.2052 +                "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute by <code>1</code>
  1.2053 +                and then <a href=
  1.2054 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2055 +                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
  1.2056 +                      "#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the <a href=
  1.2057 +                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2058 +                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
  1.2059 +                      and has no default action, at the current <var>service manager</var> object.
  1.2060                  </li>
  1.2061                </ol>
  1.2062              </li>
  1.2063 -            <li>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.2064 +            <li>Remove <var>existing service record</var> from the current <a href=
  1.2065 +            "#dfn-list-of-available-service-records"
  1.2066 +                  class="internalDFN">list of available service records</a>.
  1.2067              </li>
  1.2068            </ol>
  1.2069          </li>
  1.2070        </ol>
  1.2071        <p>
  1.2072 -        User agents <em class="rfc2119" title="should">should</em> expire a service record from the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service
  1.2073 -        records</a> when its <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this
  1.2074 -        condition is met the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="should">should</em> run the rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a>, passing in
  1.2075 -        the expired service record's <code>id</code> attribute as the only argument.
  1.2076 +        User agents <em class="rfc2119"
  1.2077 +           title="should">should</em> expire a service record from the <a href="#dfn-list-of-available-service-records"
  1.2078 +           class="internalDFN">list of available service records</a> when its <code>expiryTimestamp</code> attribute
  1.2079 +           exceeds the current UTC timestamp. When this condition is met the <a href="#dfn-user-agent"
  1.2080 +           class="internalDFN">user agent</a> <em class="rfc2119"
  1.2081 +           title="should">should</em> run the rule for <a href="#dfn-removing-an-available-service"
  1.2082 +           class="internalDFN">removing an available service</a>, passing in the expired service record's
  1.2083 +           <code>id</code> attribute as the only argument.
  1.2084        </p>
  1.2085        <section id="zeroconf-mdns-dns-sd">
  1.2086 -        <h3><span class="secno">7.1 </span>
  1.2087 -          Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)
  1.2088 +        <h3>
  1.2089 +          <span class="secno">7.1</span> Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title=
  1.2090 +          "Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)
  1.2091          </h3>
  1.2092          <p>
  1.2093 -          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
  1.2094 -          recommended automatic browsing domain [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>], the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> run the
  1.2095 -          following steps:
  1.2096 +          For each <abbr title="Domain Name System">DNS</abbr> response received from a user-agent-initiated Multicast
  1.2097 +          <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records
  1.2098 +          with the name <code>_services._dns-sd._udp</code> on the resolved recommended automatic browsing domain
  1.2099 +          [<cite><a class="bibref"
  1.2100 +             href="#bib-MDNS">MDNS</a></cite>], the <a href="#dfn-user-agent"
  1.2101 +             class="internalDFN">user agent</a> <em class="rfc2119"
  1.2102 +             title="must">must</em> run the following steps:
  1.2103          </p>
  1.2104          <ol class="rule">
  1.2105 -          <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>
  1.2106 -          Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name of the current discovered service type.
  1.2107 +          <li>Let <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var> be an array of <abbr title=
  1.2108 +          "DNS Pointer Record">PTR</abbr> records received by issuing a Multicast <abbr title=
  1.2109 +          "Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name
  1.2110 +          of the current discovered service type.
  1.2111            </li>
  1.2112 -          <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
  1.2113 -          steps:
  1.2114 +          <li>For each Object <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> in <var>service
  1.2115 +          <abbr title="Multicast DNS">mDNS</abbr> responses</var>, run the following steps:
  1.2116              <ol>
  1.2117                <li>Let <var>network service record</var> be an Object consisting of the following empty properties:
  1.2118                <code>id</code>, <code>name</code>, <code>type</code>, <code>url</code>, <code>config</code>,
  1.2119                <code>expiryTimestamp</code>.
  1.2120                </li>
  1.2121 -              <li>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
  1.2122 -              Instance Name [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.2123 +              <li>Set <var>network service record</var>'s <code>id</code> property to the value of the full
  1.2124 +                <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name [<cite><a class="bibref"
  1.2125 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2126                </li>
  1.2127 -              <li>Set <var>network service record</var>'s <code>name</code> property to the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service
  1.2128 -              Instance Name's <var>Instance</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.2129 +              <li>Set <var>network service record</var>'s <code>name</code> property to the value of the <abbr title=
  1.2130 +              "DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Instance</var> component [<cite><a class=
  1.2131 +              "bibref"
  1.2132 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2133                </li>
  1.2134                <li>Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string
  1.2135 -              <code>zeroconf:</code> followed be the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Service</var>
  1.2136 -              component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.2137 +              <code>zeroconf:</code> followed be the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service
  1.2138 +              Instance Name's <var>Service</var> component [<cite><a class="bibref"
  1.2139 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2140                </li>
  1.2141 -              <li>Set <var>network service record</var>'s <code>url</code> property to the resolvable Service <abbr title="Uniform Resource Locator">URL</abbr>
  1.2142 -              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
  1.2143 -              [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.2144 +              <li>Set <var>network service record</var>'s <code>url</code> property to the resolvable Service
  1.2145 +              <abbr title="Uniform Resource Locator">URL</abbr> obtained from performing an <abbr title=
  1.2146 +              "Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> Lookup [<cite><a class="bibref"
  1.2147 +                   href="#bib-DNS-SD">DNS-SD</a></cite>] of the current service from the <abbr title=
  1.2148 +                   "DNS Pointer Record">PTR</abbr> record provided [<cite><a class="bibref"
  1.2149 +                   href="#bib-MDNS">MDNS</a></cite>].
  1.2150                </li>
  1.2151                <li>Set <var>network service record</var>'s <code>config</code> property to the string value of the
  1.2152 -              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
  1.2153 -              in [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>].
  1.2154 +              contents of the first <abbr title="Domain Name System">DNS</abbr>-<abbr title=
  1.2155 +              "Service Discovery">SD</abbr> TXT record associated with the <var>service <abbr title=
  1.2156 +              "Multicast DNS">mDNS</abbr> response</var> as defined in [<cite><a class="bibref"
  1.2157 +                   href="#bib-DNS-SD">DNS-SD</a></cite>].
  1.2158                </li>
  1.2159                <li>Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the
  1.2160                current date, in UTC timestamp format, plus a value of <code>120</code> seconds.
  1.2161                </li>
  1.2162 -              <li>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
  1.2163 -              service record</var> as the only argument.
  1.2164 +              <li>Run the general rule for <a href="#dfn-adding-an-available-service"
  1.2165 +                    class="internalDFN">adding an available service</a>, passing in the current <var>network service
  1.2166 +                    record</var> as the only argument.
  1.2167                </li>
  1.2168              </ol>
  1.2169            </li>
  1.2170          </ol>
  1.2171        </section>
  1.2172        <section id="simple-service-discovery-protocol-ssdp">
  1.2173 -        <h3><span class="secno">7.2 </span>
  1.2174 -          Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)
  1.2175 +        <h3>
  1.2176 +          <span class="secno">7.2</span> Simple Service Discovery Protocol (<abbr title=
  1.2177 +          "Simple Service Discovery Protocol">SSDP</abbr>)
  1.2178          </h3>
  1.2179          <p>
  1.2180 -          A user agent that implements UPnP service discovery <em class="rfc2119" title="must">must</em> issue an <dfn id="dfn-advertisement-for-upnp-root-devices">advertisement for
  1.2181 -          UPnP root devices</dfn> against the user's current local network according to the full normative text and
  1.2182 -          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.2183 +          A user agent that implements UPnP service discovery <em class="rfc2119"
  1.2184 +             title="must">must</em> issue a <dfn id="dfn-search-request-for-upnp-root-devices">search request for UPnP
  1.2185 +             root devices</dfn> against the user's current local network according to the full normative text and
  1.2186 +             timing provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [<cite><a class="bibref"
  1.2187 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2188          </p>
  1.2189          <p>
  1.2190 -          The user agent <em class="rfc2119" title="must">must</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
  1.2191 -          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
  1.2192 -          <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>, an ST header equal to
  1.2193 -          <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
  1.2194 -          response wait time</dfn> value between <code>1</code> and <code>5</code> seconds.
  1.2195 +          The user agent <em class="rfc2119"
  1.2196 +             title="must">must</em> issue all <a title="search request for UPnP root devices"
  1.2197 +             href="#dfn-search-request-for-upnp-root-devices"
  1.2198 +             class="internalDFN">search requests for UPnP root devices</a> with a <abbr title=
  1.2199 +             "Hypertext Transfer Protocol">HTTP</abbr> request line equal to <code>M-SEARCH * <abbr title=
  1.2200 +             "Hypertext Transfer Protocol">HTTP</abbr>/1.1</code>, with a HOST header equal to the reserved multicast
  1.2201 +             address and port of <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>,
  1.2202 +             an ST header equal to <code>upnp:rootdevice</code> and a user-agent defined MX header equal to a <dfn id=
  1.2203 +             "dfn-maximum-upnp-advertisement-response-wait-time">maximum UPnP advertisement response wait time</dfn>
  1.2204 +             value between <code>1</code> and <code>5</code> seconds.
  1.2205          </p>
  1.2206          <p>
  1.2207 -          The user agent <em class="rfc2119" title="must">must</em> listen for incoming requests and process any incoming responses to
  1.2208 -          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
  1.2209 -          current local network interface addresses with the port <code>1900</code>, according to the rules defined in
  1.2210 -          this section.
  1.2211 +          The user agent <em class="rfc2119"
  1.2212 +             title="must">must</em> listen for any incoming responses to any <a href=
  1.2213 +             "#dfn-search-request-for-upnp-root-devices"
  1.2214 +             class="internalDFN">search request for UPnP root devices</a>.
  1.2215          </p>
  1.2216          <p>
  1.2217 -          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
  1.2218 -          <a href="#dfn-standard-upnp-address-and-port" class="internalDFN">standard UPnP address and port</a> the user agent <em class="rfc2119" title="must">must</em> run the following steps:
  1.2219 +          For each <dfn id="dfn-http-response"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</dfn>
  1.2220 +          following an initial <a href="#dfn-search-request-for-upnp-root-devices"
  1.2221 +             class="internalDFN">search request for UPnP root devices</a> sent on a <a href=
  1.2222 +             "#dfn-standard-upnp-address-and-port"
  1.2223 +             class="internalDFN">standard UPnP address and port</a> the user agent <em class="rfc2119"
  1.2224 +             title="must">must</em> run the following steps:
  1.2225          </p>
  1.2226          <ol class="rule">
  1.2227 -          <li>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
  1.2228 -          agent <em class="rfc2119" title="must">must</em> discard this response, abort any remaining steps and return. The user agent
  1.2229 -          <em class="rfc2119" title="may">may</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
  1.2230 -          occurring.
  1.2231 +          <li>If the <a href="#dfn-http-response"
  1.2232 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is not a
  1.2233 +                <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK response then this response is invalid and
  1.2234 +                the user agent <em class="rfc2119"
  1.2235 +                title="must">must</em> discard this response, abort any remaining steps and return. The user agent
  1.2236 +                <em class="rfc2119"
  1.2237 +                title="may">may</em> issue a new <a href="#dfn-search-request-for-upnp-root-devices"
  1.2238 +                class="internalDFN">search request for UPnP root devices</a> as a result of this error occurring.
  1.2239            </li>
  1.2240 -          <li>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
  1.2241 -          <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
  1.2242 -          agent <em class="rfc2119" title="must">must</em> discard this response, abort any remaining steps and return.
  1.2243 +          <li>If the <a href="#dfn-maximum-upnp-advertisement-response-wait-time"
  1.2244 +                class="internalDFN">maximum UPnP advertisement response wait time</a> has been exceeded since the
  1.2245 +                initial <a href="#dfn-search-request-for-upnp-root-devices"
  1.2246 +                class="internalDFN">search request for UPnP root devices</a> was sent then the <a href=
  1.2247 +                "#dfn-http-response"
  1.2248 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is invalid and
  1.2249 +                the user agent <em class="rfc2119"
  1.2250 +                title="must">must</em> discard this response, abort any remaining steps and return. The user agent
  1.2251 +                <em class="rfc2119"
  1.2252 +                title="may">may</em> stop listening for responses from the current <a href=
  1.2253 +                "#dfn-search-request-for-upnp-root-devices"
  1.2254 +                class="internalDFN">search request for UPnP root devices</a> as a result of this error occurring.
  1.2255 +                Equally, the user agent <em class="rfc2119"
  1.2256 +                title="may">may</em> issue a new <a href="#dfn-search-request-for-upnp-root-devices"
  1.2257 +                class="internalDFN">search request for UPnP root devices</a> as a result of this error occurring.
  1.2258            </li>
  1.2259 -          <li>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>
  1.2260 -          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
  1.2261 -          header's value.
  1.2262 +          <li>Let <var>ssdp device</var> be an Object with a property for each <abbr title=
  1.2263 +          "Hypertext Transfer Protocol">HTTP</abbr> header received in the <a href="#dfn-http-response"
  1.2264 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a>, with each key
  1.2265 +                being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> response header and each
  1.2266 +                value being that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> response header's value.
  1.2267            </li>
  1.2268            <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
  1.2269            <var>USN</var> entry, at least one <var>ST</var> entry and at least one <var>LOCATION</var> entry or the
  1.2270 -          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
  1.2271 -          invalid and the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> discard this response, abort any remaining steps
  1.2272 -          and return.
  1.2273 +          value of its <var>ST</var> entry is not <code>upnp:rootdevice</code>, then the <a href="#dfn-http-response"
  1.2274 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Response</a> is invalid and
  1.2275 +                the <a href="#dfn-user-agent"
  1.2276 +                class="internalDFN">user agent</a> <em class="rfc2119"
  1.2277 +                title="must">must</em> discard this response, abort any remaining steps and return.
  1.2278            </li>
  1.2279 -          <li>The user agent <em class="rfc2119" title="must">must</em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file" class="internalDFN">obtaining a UPnP Device Description File</a>
  1.2280 -          passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device
  1.2281 -          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
  1.2282 -          <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp
  1.2283 -          device</var> as the <var>device expiry</var> argument.
  1.2284 +          <li>The user agent <em class="rfc2119"
  1.2285 +                title="must">must</em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file"
  1.2286 +                class="internalDFN">obtaining a UPnP Device Description File</a> passing in the first occurrence of
  1.2287 +                <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor <abbr title=
  1.2288 +                "Uniform Resource Locator">URL</abbr></var> argument and the first occurrence of <var>USN</var> from
  1.2289 +                <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
  1.2290 +                <var>CACHE-CONTROL</var> from <var>ssdp device</var> (minus the leading string of
  1.2291 +                <code>max-age=</code>) as the <var>device expiry</var> argument.
  1.2292            </li>
  1.2293          </ol>
  1.2294          <p>
  1.2295 -          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
  1.2296 -          <em class="rfc2119" title="must">must</em> run the following steps:
  1.2297 +          The user agent <em class="rfc2119"
  1.2298 +             title="must">must</em> listen for incoming requests on the <dfn id=
  1.2299 +             "dfn-standard-upnp-address-and-port">standard UPnP address and port</dfn> on all current local network
  1.2300 +             interface addresses with the port <code>1900</code>.
  1.2301 +        </p>
  1.2302 +        <p>
  1.2303 +          For each <dfn id="dfn-http-request"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</dfn>
  1.2304 +          received on a <a href="#dfn-standard-upnp-address-and-port"
  1.2305 +             class="internalDFN">standard UPnP address and port</a> the user agent <em class="rfc2119"
  1.2306 +             title="must">must</em> run the following steps:
  1.2307          </p>
  1.2308          <ol class="rule">
  1.2309 -          <li>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
  1.2310 -          agent <em class="rfc2119" title="must">must</em> return a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK response, discard this request, abort any remaining steps
  1.2311 -          and return.
  1.2312 +          <li>If the <a href="#dfn-http-request"
  1.2313 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a> is not a
  1.2314 +                <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request then it is not a valid UPnP
  1.2315 +                Request and the user agent <em class="rfc2119"
  1.2316 +                title="must">must</em> discard this request, abort any remaining steps and return.
  1.2317            </li>
  1.2318 -          <li>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>
  1.2319 -          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.2320 +          <li>Let <var>ssdp device</var> be an Object with a property for each <abbr title=
  1.2321 +          "Hypertext Transfer Protocol">HTTP</abbr> header received in the <a href="#dfn-http-request"
  1.2322 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a>, with each key
  1.2323 +                being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header and each value being
  1.2324 +                that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header's value.
  1.2325            </li>
  1.2326            <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
  1.2327            <var>USN</var> entry, at least one <var>NT</var> entry, at least one <var>NTS</var> entry and at least one
  1.2328            <var>LOCATION</var> entry or the value of its <var>NT</var> entry is not <code>upnp:rootdevice</code>, then
  1.2329 -          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="rfc2119" title="must">must</em> return
  1.2330 -          a 400 Bad Request response, discard this request, abort any remaining steps and return.
  1.2331 +          the <a href="#dfn-http-request"
  1.2332 +                class="internalDFN"><abbr title="Hypertext Transfer Protocol">HTTP</abbr> Request</a> is a malformed
  1.2333 +                UPnP Request and the <a href="#dfn-user-agent"
  1.2334 +                class="internalDFN">user agent</a> <em class="rfc2119"
  1.2335 +                title="must">must</em> discard this request, abort any remaining steps and return.
  1.2336            </li>
  1.2337 -          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> or
  1.2338 -          <code>ssdp:update</code> then the user agent <em class="rfc2119" title="must">must</em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file" class="internalDFN">obtaining a UPnP
  1.2339 -          Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp
  1.2340 -          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
  1.2341 -          <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
  1.2342 -          <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var>.<br>
  1.2343 +          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> then the user agent
  1.2344 +          <em class="rfc2119"
  1.2345 +                title="must">must</em> run the rule for <a href="#dfn-obtaining-a-upnp-device-description-file"
  1.2346 +                class="internalDFN">obtaining a UPnP Device Description File</a> passing in the first occurrence of
  1.2347 +                <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor <abbr title=
  1.2348 +                "Uniform Resource Locator">URL</abbr></var> argument and the first occurrence of <var>USN</var> from
  1.2349 +                <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
  1.2350 +                <var>CACHE-CONTROL</var> from <var>ssdp device</var> (minus the leading string of
  1.2351 +                <code>max-age=</code>) as the <var>device expiry</var>.<br>
  1.2352              <br>
  1.2353              Otherwise, if <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:byebye</code> then the
  1.2354 -            user agent <em class="rfc2119" title="must">must</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
  1.2355 -            Device</a> passing in the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device
  1.2356 -            identifier</var> argument.
  1.2357 +            user agent <em class="rfc2119"
  1.2358 +                title="must">must</em> run the rule for <a href=
  1.2359 +                "#dfn-removing-all-services-from-a-registered-upnp-device"
  1.2360 +                class="internalDFN">removing all services from a registered UPnP Device</a> passing in the first
  1.2361 +                occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument.
  1.2362            </li>
  1.2363          </ol>
  1.2364          <p>
  1.2365 -          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
  1.2366 -          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
  1.2367 -          arguments - <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var>, <var>device identifier</var> and <var>device expiry</var> - and
  1.2368 -          when called the user agent <em class="rfc2119" title="must">must</em> run the following steps:
  1.2369 +          The rule for <dfn id="dfn-obtaining-a-upnp-device-description-file">obtaining a UPnP Device Description
  1.2370 +          File</dfn> is the process of obtaining the contents of a standard UPnP Device Description [<cite><a class=
  1.2371 +          "bibref"
  1.2372 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] from a <abbr title=
  1.2373 +             "Uniform Resource Locator">URL</abbr>-based resource. This rule takes three arguments - <var>device
  1.2374 +             descriptor <abbr title="Uniform Resource Locator">URL</abbr></var>, <var>device identifier</var> and
  1.2375 +             <var>device expiry</var> - and when called the user agent <em class="rfc2119"
  1.2376 +             title="must">must</em> run the following steps:
  1.2377          </p>
  1.2378          <ol class="rule">
  1.2379 -          <li>Let <var>device descriptor file</var> contain the contents of the file located at the <abbr title="Uniform Resource Locator">URL</abbr> provided in
  1.2380 -          <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var> obtained according to the rules defined in 'Section 2.11: Retrieving a
  1.2381 -          description using <abbr title="Hypertext Transfer Protocol">HTTP</abbr>' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2382 +          <li>Let <var>device descriptor file</var> contain the contents of the file located at the <abbr title=
  1.2383 +          "Uniform Resource Locator">URL</abbr> provided in <var>device descriptor <abbr title=
  1.2384 +          "Uniform Resource Locator">URL</abbr></var> obtained according to the rules defined in 'Section 2.11:
  1.2385 +          Retrieving a description using <abbr title="Hypertext Transfer Protocol">HTTP</abbr>' in [<cite><a class=
  1.2386 +          "bibref"
  1.2387 +               href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2388            </li>
  1.2389 -          <li>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
  1.2390 -          current network or the <var>root device descriptor file</var> remains empty then it is invalid and the
  1.2391 -          <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> abort any remaining steps and return.
  1.2392 +          <li>If the value provided in <var>device descriptor <abbr title="Uniform Resource Locator">URL</abbr></var>
  1.2393 +          cannot be resolved as a reachable <abbr title="Uniform Resource Locator">URL</abbr> on the current network or
  1.2394 +          the <var>device descriptor file</var> remains empty then it is invalid and the <a href="#dfn-user-agent"
  1.2395 +                class="internalDFN">user agent</a> <em class="rfc2119"
  1.2396 +                title="must">must</em> abort any remaining steps and return.
  1.2397            </li>
  1.2398 -          <li>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
  1.2399 -          descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> arguments.
  1.2400 -          </li>
  1.2401 -          <li>If the current <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then
  1.2402 -          for each <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an
  1.2403 -          <var>embedded device descriptor file</var> - the user agent <em class="rfc2119" title="must">must</em> run the rule for
  1.2404 -          <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
  1.2405 -          file</var> as the <var>device descriptor file</var> argument, along with the common <var>device
  1.2406 -          identifier</var> and <var>device expiry</var> arguments.
  1.2407 +          <li>Run the rule for <a href="#dfn-processing-a-upnp-device-description-file"
  1.2408 +                class="internalDFN">processing a UPnP Device Description File</a>, passing in the current <var>device
  1.2409 +                descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> arguments.
  1.2410            </li>
  1.2411          </ol>
  1.2412          <p>
  1.2413 -          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
  1.2414 -          standard UPnP Device Description [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and registering the UPnP services contained therein
  1.2415 -          within the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a>.
  1.2416 +          The rule for <dfn id="dfn-processing-a-upnp-device-description-file">processing a UPnP Device Description
  1.2417 +          File</dfn> is the process of parsing the contents of a standard UPnP Device Description [<cite><a class=
  1.2418 +          "bibref"
  1.2419 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and registering the UPnP services contained
  1.2420 +             therein within the <a href="#dfn-list-of-available-service-records"
  1.2421 +             class="internalDFN">list of available service records</a>.
  1.2422          </p>
  1.2423          <p>
  1.2424 -          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
  1.2425 -          file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent
  1.2426 -          <em class="rfc2119" title="must">must</em> run the following steps:
  1.2427 +          The rule for <a href="#dfn-processing-a-upnp-device-description-file"
  1.2428 +             class="internalDFN">processing a UPnP Device Description File</a> takes three arguments - <var>device
  1.2429 +             descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the
  1.2430 +             user agent <em class="rfc2119"
  1.2431 +             title="must">must</em> run the following steps:
  1.2432          </p>
  1.2433          <ol class="rule">
  1.2434            <li>Let <var>advertised services</var> be a list of all advertised services obtained from the <var>device
  1.2435            descriptor file</var> containing the value of the first occurrence of the <code>&lt;serviceList&gt;</code>
  1.2436 -          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.2437 +          element as it is defined in 'Section 2.3: Device Description' in [<cite><a class="bibref"
  1.2438 +               href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.2439            </li>
  1.2440            <li>For each <code>&lt;service&gt;</code> element - known as an <var>advertised service</var> - in
  1.2441            <var>advertised services</var> run the following steps:
  1.2442 @@ -1412,8 +1895,8 @@
  1.2443                <code>eventsUrl</code>, <code>config</code>, <code>expiryTimestamp</code>.
  1.2444                </li>
  1.2445                <li>Set <var>network service record</var>'s <code>id</code> property to the concatenated string value of
  1.2446 -              <var>device identifier</var> with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code>
  1.2447 -              sub-element.
  1.2448 +              the first occurrence of the <code>&lt;UDN&gt;</code> element in the <var>device descriptor file</var>
  1.2449 +              with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code> sub-element.
  1.2450                </li>
  1.2451                <li>Set <var>network service record</var>'s <code>deviceId</code> property to the value of <var>device
  1.2452                identifier</var>.
  1.2453 @@ -1440,51 +1923,74 @@
  1.2454                <li>Set <var>network service record</var>'s <code>expiryTimestamp</code> property to the value of the
  1.2455                current date, in UTC timestamp format, plus the value of <var>device expiry</var>.
  1.2456                </li>
  1.2457 -              <li>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
  1.2458 -              service record</var> as the only argument.
  1.2459 +              <li>Run the general rule for <a href="#dfn-adding-an-available-service"
  1.2460 +                    class="internalDFN">adding an available service</a>, passing in the current <var>network service
  1.2461 +                    record</var> as the only argument.
  1.2462 +              </li>
  1.2463 +            </ol>
  1.2464 +          </li>
  1.2465 +          <li>If <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then for each
  1.2466 +          <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an <var>embedded
  1.2467 +          device descriptor file</var> - the user agent <em class="rfc2119"
  1.2468 +                title="must">must</em> run the rule for <a href="#dfn-processing-a-upnp-device-description-file"
  1.2469 +                class="internalDFN">processing a UPnP Device Description File</a>, passing in the current <var>embedded
  1.2470 +                device descriptor file</var> as the <var>device descriptor file</var> argument, along with the current
  1.2471 +                <var>device identifier</var> and <var>device expiry</var> arguments.
  1.2472 +          </li>
  1.2473 +        </ol>
  1.2474 +        <p>
  1.2475 +          The rule for <dfn id="dfn-removing-all-services-from-a-registered-upnp-device">removing all services from a
  1.2476 +          registered UPnP Device</dfn> is the process of removing all services associated with a device from the
  1.2477 +          <a href="#dfn-list-of-available-service-records"
  1.2478 +             class="internalDFN">list of available service records</a> that has left the user's current network or has
  1.2479 +             otherwise timed out or expired. This rule takes one argument, <var>device identifier</var>, and consists
  1.2480 +             of running the following steps:
  1.2481 +        </p>
  1.2482 +        <ol class="rule">
  1.2483 +          <li>For each <var>existing service record</var> in the current <a href=
  1.2484 +          "#dfn-list-of-available-service-records"
  1.2485 +                class="internalDFN">list of available service records</a>, run the following sub-steps:
  1.2486 +            <ol class="rule">
  1.2487 +              <li>If the <var>existing service record</var>'s <code>deviceId</code> property does not match <var>device
  1.2488 +              identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and
  1.2489 +              continue at the next available <var>existing service record</var>.
  1.2490 +              </li>
  1.2491 +              <li>Run the general rule for <a href="#dfn-removing-an-available-service"
  1.2492 +                    class="internalDFN">removing an available service</a> passing in <var>existing service
  1.2493 +                    record</var>'s <code>id</code> property as the only argument.
  1.2494                </li>
  1.2495              </ol>
  1.2496            </li>
  1.2497          </ol>
  1.2498          <p>
  1.2499 -          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
  1.2500 -          services associated with a 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
  1.2501 -          current network or has otherwise timed out or expired. This rule takes one argument, <var>device
  1.2502 -          identifier</var>, and consists of running the following steps:
  1.2503 +          When the <a href="#dfn-user-agent"
  1.2504 +             class="internalDFN">user agent</a> is to <dfn id="dfn-setup-a-upnp-events-subscription">setup a UPnP
  1.2505 +             Events Subscription</dfn>, it is to run the following steps with the current <var>network service
  1.2506 +             record</var> object as defined in 'Section 4.1.2: SUBSCRIBE with NT and CALLBACK' in [<cite><a class=
  1.2507 +             "bibref"
  1.2508 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>]:
  1.2509          </p>
  1.2510          <ol class="rule">
  1.2511 -          <li>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
  1.2512 -          the following sub-steps:
  1.2513 -            <ol class="rule">
  1.2514 -              <li>If the <var>existing service record</var>'s <code>deviceId</code> property does not match <var>device
  1.2515 -              identifier</var> then skip any remaining sub-steps for the current <var>existing service record</var> and
  1.2516 -              continue at the next available <var>existing service record</var>.
  1.2517 -              </li>
  1.2518 -              <li>Run the general rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a> passing in <var>existing service
  1.2519 -              record</var>'s <code>id</code> property as the only argument.
  1.2520 -              </li>
  1.2521 -            </ol>
  1.2522 +          <li>If <var>network service record</var>'s <code>eventsUrl</code> property is empty then the <a href=
  1.2523 +          "#dfn-user-agent"
  1.2524 +                class="internalDFN">user agent</a> <em class="rfc2119"
  1.2525 +                title="must">must</em> abort these steps.
  1.2526            </li>
  1.2527 -        </ol>
  1.2528 -        <p>
  1.2529 -          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
  1.2530 -          steps with the current <var>network service record</var> object as defined in 'Section 4.1.2: SUBSCRIBE with
  1.2531 -          NT and CALLBACK' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>]:
  1.2532 -        </p>
  1.2533 -        <ol class="rule">
  1.2534 -          <li>If <var>network service record</var>'s <code>eventsUrl</code> property is empty then the <a href="#dfn-user-agent" class="internalDFN">user
  1.2535 -          agent</a> <em class="rfc2119" title="must">must</em> abort these steps.
  1.2536 +          <li>Let <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> be the value of creating a new
  1.2537 +          <a href="#dfn-user-agent-generated-callback-url"
  1.2538 +                class="internalDFN">user-agent generated callback url</a>.
  1.2539            </li>
  1.2540 -          <li>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.2541 -          </li>
  1.2542 -          <li>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
  1.2543 -          <em>TIMEOUT</em> header with a user-agent defined timeout value (in the form <code>Second-XX</code> where
  1.2544 -          <code>XX</code> is the user-agent defined timeout value in seconds) and a <em>CALLBACK</em> header with a
  1.2545 -          string value of <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> towards the <var>network service record</var>'s
  1.2546 +          <li>Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>NT</em> header
  1.2547 +          with a string value of <code>upnp:event</code>, a <em>TIMEOUT</em> header with a user-agent defined timeout
  1.2548 +          value (in the form <code>Second-XX</code> where <code>XX</code> is the user-agent defined timeout value in
  1.2549 +          seconds) and a <em>CALLBACK</em> header with a string value of <var>callback <abbr title=
  1.2550 +          "Uniform Resource Locator">URL</abbr></var> towards the <var>network service record</var>'s
  1.2551            <code>eventsUrl</code> property.
  1.2552            </li>
  1.2553 -          <li>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>
  1.2554 -            <em class="rfc2119" title="must">must</em> abort these steps.
  1.2555 +          <li>If a non-200 OK response is received from the <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
  1.2556 +          SUBSCRIBE request then the <a href="#dfn-user-agent"
  1.2557 +                class="internalDFN">user agent</a> <em class="rfc2119"
  1.2558 +                title="must">must</em> abort these steps.
  1.2559            </li>
  1.2560            <li>On receiving a valid 200 OK response, run the following steps:
  1.2561              <ol class="rule">
  1.2562 @@ -1497,42 +2003,63 @@
  1.2563                <li>Run the following steps asynchronously and continue to the step labeled <em>listen</em> below.
  1.2564                </li>
  1.2565                <li>
  1.2566 -                <em>Refresh Subscription</em>: Run the following steps at a set interval (X) within the <a href="#dfn-user-agent" class="internalDFN">user
  1.2567 -                agent</a>:
  1.2568 +                <em>Refresh Subscription</em>: Run the following steps at a set interval (X) within the <a href=
  1.2569 +                "#dfn-user-agent"
  1.2570 +                    class="internalDFN">user agent</a>:
  1.2571                  <ol class="rule">
  1.2572                    <li>Let <var>current date</var> equal the current UTC date.
  1.2573                    </li>
  1.2574                    <li>If <var>current date</var> is less than the <var>timeout date</var> then continue to the step
  1.2575                    labeled <em>refresh subscription</em> above.
  1.2576                    </li>
  1.2577 -                  <li>Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>SID</em> header with the string value of <var>callback
  1.2578 -                  ID</var> and a user-agent defined <em>TIMEOUT</em> header (in the form <code>Second-XX</code> where
  1.2579 -                  <code>XX</code> is the user-agent defined timeout value in seconds) towards the <var>network service
  1.2580 -                  record</var>'s <code>eventsUrl</code> property.
  1.2581 +                  <li>Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a
  1.2582 +                  <em>SID</em> header with the string value of <var>callback ID</var> and a user-agent defined
  1.2583 +                  <em>TIMEOUT</em> header (in the form <code>Second-XX</code> where <code>XX</code> is the user-agent
  1.2584 +                  defined timeout value in seconds) towards the <var>network service record</var>'s
  1.2585 +                  <code>eventsUrl</code> property.
  1.2586                    </li>
  1.2587                    <li>On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first
  1.2588 -                  included <em>SID</em> header, if it exists. All other <abbr title="Hypertext Transfer Protocol">HTTP</abbr> responses should cause the <a href="#dfn-user-agent" class="internalDFN">user
  1.2589 -                  agent</a> to continue from the step labeled <em>refresh subscription</em> above.
  1.2590 +                  included <em>SID</em> header and set <var>timeout date</var> to the sum of the current UTC date value
  1.2591 +                  plus the integer value of the first included <em>TIMEOUT</em> header (minus the leading string of
  1.2592 +                  <code>Second-</code>), if it exists. If the current date is greater than or equal to <var>timeout
  1.2593 +                  date</var> then the <a href="#dfn-user-agent"
  1.2594 +                        class="internalDFN">user agent</a> <em class="rfc2119"
  1.2595 +                        title="should">should</em> continue from the step labeled <em>refresh subscription</em> above.
  1.2596 +                        For all non 200 OK responses the <a href="#dfn-user-agent"
  1.2597 +                        class="internalDFN">user agent</a> <em class="rfc2119"
  1.2598 +                        title="should">should</em> continue from the step labeled <em>refresh subscription</em> above.
  1.2599                    </li>
  1.2600                  </ol>
  1.2601                </li>
  1.2602                <li>
  1.2603 -                <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
  1.2604 -                agent</a> is to run the following steps:
  1.2605 +                <em>Listen</em>: For each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request received
  1.2606 +                at the <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> the <a href=
  1.2607 +                "#dfn-user-agent"
  1.2608 +                    class="internalDFN">user agent</a> is to run the following steps:
  1.2609                  <ol class="rule">
  1.2610 -                  <li>Let <var>content clone</var> be the result of obtaining the message body of the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY
  1.2611 -                  request. If <var>content clone</var> is empty, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em>
  1.2612 -                  abort these steps.
  1.2613 +                  <li>Let <var>content clone</var> be the result of obtaining the message body of the <abbr title=
  1.2614 +                  "Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request. If <var>content clone</var> is empty, then
  1.2615 +                  the <a href="#dfn-user-agent"
  1.2616 +                        class="internalDFN">user agent</a> <em class="rfc2119"
  1.2617 +                        title="must">must</em> abort these steps.
  1.2618                    </li>
  1.2619 -                  <li>Let <var>notification event</var> be a new simple event that uses the <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a> interface with the name <a href="#event-notify"><code>notify</code></a>, which does not bubble, is not cancellable, and has no
  1.2620 +                  <li>Let <var>notification event</var> be a new simple event that uses the <a href=
  1.2621 +                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2622 +                        class="externalDFN"><code>Event</code></a> interface with the name <a href=
  1.2623 +                        "#event-notify"><code>notify</code></a>, which does not bubble, is not cancellable, and has no
  1.2624                          default action.
  1.2625                    </li>
  1.2626                    <li>Let the <code>data</code> attribute of <var>notification event</var> have the DOMString value of
  1.2627                    <var>content clone</var>.
  1.2628                    </li>
  1.2629                    <li>
  1.2630 -                    <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">Queue a task</a> to dispatch <var>notification event</var> at the current
  1.2631 -                        <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> object.
  1.2632 +                    <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
  1.2633 +                        class="externalDFN">Queue a task</a> to dispatch <var>notification event</var> at the current
  1.2634 +                        <a href="#networkservice"
  1.2635 +                        class="internalDFN"><code>NetworkService</code></a> object.
  1.2636 +                  </li>
  1.2637 +                  <li>Return a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> 200 OK response to the sender of
  1.2638 +                  the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request.
  1.2639                    </li>
  1.2640                  </ol>
  1.2641                </li>
  1.2642 @@ -1540,37 +2067,47 @@
  1.2643            </li>
  1.2644          </ol>
  1.2645          <p>
  1.2646 -          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
  1.2647 -          <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
  1.2648 -          request - as defined in 'Section 4.1.4: Cancelling a subscription with UNSUBSCRIBE' in [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>]
  1.2649 -          - with a HOST header set to that <var>active service</var>'s <code>eventsUrl</code> property and a SID header
  1.2650 -          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
  1.2651 -          occurred.
  1.2652 +          A <a href="#dfn-user-agent"
  1.2653 +             class="internalDFN">user agent</a> can <dfn id=
  1.2654 +             "dfn-terminate-an-existing-upnp-events-subscription">terminate an existing UPnP Events Subscription</dfn>
  1.2655 +             at any time for a <var>network service record</var> by sending an <abbr title=
  1.2656 +             "Hypertext Transfer Protocol">HTTP</abbr> UNSUBSCRIBE request - as defined in 'Section 4.1.4: Cancelling a
  1.2657 +             subscription with UNSUBSCRIBE' in [<cite><a class="bibref"
  1.2658 +             href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] - with a HOST header set to that <var>active
  1.2659 +             service</var>'s <code>eventsUrl</code> property and a SID header set to the <var>callback ID</var>
  1.2660 +             obtained when the initial <a href="#dfn-setup-a-upnp-events-subscription"
  1.2661 +             class="internalDFN">setup a UPnP Events Subscription</a> action occurred.
  1.2662          </p>
  1.2663        </section>
  1.2664        <section id="network-topology-monitoring">
  1.2665 -        <h3><span class="secno">7.3 </span>
  1.2666 -          Network Topology Monitoring
  1.2667 +        <h3>
  1.2668 +          <span class="secno">7.3</span> Network Topology Monitoring
  1.2669          </h3>
  1.2670          <div>
  1.2671            <p>
  1.2672 -            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
  1.2673 -            <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.2674 -            <em class="rfc2119" title="must">must</em> run the general rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a> passing in each
  1.2675 -            <var>existing service record</var>'s <code>id</code> property as the only argument for each call.
  1.2676 +            When the <a href="#dfn-user-agent"
  1.2677 +               class="internalDFN">user agent</a> detects that the user has dropped from their connected network then,
  1.2678 +               for each <var>existing service record</var> in the <a href="#dfn-list-of-available-service-records"
  1.2679 +               class="internalDFN">list of available service records</a>, the user agent <em class="rfc2119"
  1.2680 +               title="must">must</em> run the general rule for <a href="#dfn-removing-an-available-service"
  1.2681 +               class="internalDFN">removing an available service</a> passing in each <var>existing service
  1.2682 +               record</var>'s <code>id</code> property as the only argument for each call.
  1.2683            </p>
  1.2684            <p>
  1.2685 -            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
  1.2686 -            existing network, then it <em class="rfc2119" title="should">should</em> restart its discovery mechanisms as defined in the
  1.2687 -            <a href="#service-discovery">Service Discovery</a> section of this specification, maintaining the existing
  1.2688 -            <a href="#dfn-list-of-authorized-service-records" class="internalDFN">list of authorized service records</a> currently in use.
  1.2689 +            When the <a href="#dfn-user-agent"
  1.2690 +               class="internalDFN">user agent</a> detects that the user has connected to a new network or reconnected
  1.2691 +               to an existing network, then it <em class="rfc2119"
  1.2692 +               title="should">should</em> restart its discovery mechanisms as defined in the <a href=
  1.2693 +               "#service-discovery">Service Discovery</a> section of this specification, maintaining the existing
  1.2694 +               <a href="#dfn-list-of-active-service-managers"
  1.2695 +               class="internalDFN">list of active service managers</a> currently in use.
  1.2696            </p>
  1.2697          </div>
  1.2698        </section>
  1.2699      </section>
  1.2700      <section id="events-summary">
  1.2701 -      <!--OddPage--><h2><span class="secno">8. </span>
  1.2702 -        Events Summary
  1.2703 +      <h2>
  1.2704 +        <span class="secno">8.</span> Events Summary
  1.2705        </h2>
  1.2706        <p>
  1.2707          The following events are dispatched on the <a href="#networkservices"><code>NetworkServices</code></a> and/or
  1.2708 @@ -1596,7 +2133,8 @@
  1.2709                <dfn id="event-serviceavailable"><code>serviceavailable</code></dfn>
  1.2710              </td>
  1.2711              <td>
  1.2712 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.2713 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2714 +                  class="externalDFN"><code>Event</code></a>
  1.2715              </td>
  1.2716              <td>
  1.2717                When a new service that matches one of the <a>requested type tokens</a> is found in the current network.
  1.2718 @@ -1607,7 +2145,8 @@
  1.2719                <dfn id="event-serviceunavailable"><code>serviceunavailable</code></dfn>
  1.2720              </td>
  1.2721              <td>
  1.2722 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.2723 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2724 +                  class="externalDFN"><code>Event</code></a>
  1.2725              </td>
  1.2726              <td>
  1.2727                When an existing service that matches one of the <a>requested type tokens</a> gracefully leaves or
  1.2728 @@ -1619,7 +2158,8 @@
  1.2729                <dfn id="event-serviceonline"><code>serviceonline</code></dfn>
  1.2730              </td>
  1.2731              <td>
  1.2732 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.2733 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2734 +                  class="externalDFN"><code>Event</code></a>
  1.2735              </td>
  1.2736              <td>
  1.2737                When a current service renews its service registration within the current network.
  1.2738 @@ -1630,7 +2170,8 @@
  1.2739                <dfn id="event-serviceoffline"><code>serviceoffline</code></dfn>
  1.2740              </td>
  1.2741              <td>
  1.2742 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.2743 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2744 +                  class="externalDFN"><code>Event</code></a>
  1.2745              </td>
  1.2746              <td>
  1.2747                When a current service gracefully leaves or otherwise expires from the current network.
  1.2748 @@ -1641,33 +2182,54 @@
  1.2749                <dfn id="event-notify"><code>notify</code></dfn>
  1.2750              </td>
  1.2751              <td>
  1.2752 -              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event" class="externalDFN"><code>Event</code></a>
  1.2753 +              <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
  1.2754 +                  class="externalDFN"><code>Event</code></a>
  1.2755              </td>
  1.2756              <td>
  1.2757 -              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>
  1.2758 -              for a current service. This event never fires for Zeroconf-based services.
  1.2759 +              When a valid UPnP Events Subscription Message is received on a <a href=
  1.2760 +              "#dfn-user-agent-generated-callback-url"
  1.2761 +                  class="internalDFN">user-agent generated callback url</a> for a current service. This event never
  1.2762 +                  fires for Zeroconf-based services.
  1.2763              </td>
  1.2764            </tr>
  1.2765          </tbody>
  1.2766        </table>
  1.2767      </section>
  1.2768      <section id="garbage-collection">
  1.2769 -      <!--OddPage--><h2><span class="secno">9. </span>
  1.2770 -        Garbage collection
  1.2771 +      <h2>
  1.2772 +        <span class="secno">9.</span> Garbage collection
  1.2773        </h2>
  1.2774        <p>
  1.2775 -        Only when the user navigates away from the current browsing context can <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a>
  1.2776 -        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
  1.2777 -        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
  1.2778 -        expired object identifier through the rule for <a href="#dfn-removing-an-available-service" class="internalDFN">removing an available service</a>.
  1.2779 +        A user agent <em class="rfc2119"
  1.2780 +           title="must">must</em> only garbage collect a <a href="#networkservices"
  1.2781 +           class="internalDFN"><code>NetworkServices</code></a> object and remove its entry from the <a href=
  1.2782 +           "#dfn-list-of-active-service-managers"
  1.2783 +           class="internalDFN">list of active service managers</a> when the user has navigated away from the browsing
  1.2784 +           context in which that <a href="#networkservices"
  1.2785 +           class="internalDFN"><code>NetworkServices</code></a> object was provided.
  1.2786 +      </p>
  1.2787 +      <p>
  1.2788 +        A user agent <em class="rfc2119"
  1.2789 +           title="must not">must not</em> garbage collect individual <a href="#networkservice"
  1.2790 +           class="internalDFN"><code>NetworkService</code></a> objects until their parent <a href="#networkservices"
  1.2791 +           class="internalDFN"><code>NetworkServices</code></a> object has been garbage collected.
  1.2792 +      </p>
  1.2793 +      <p>
  1.2794 +        A user agent <em class="rfc2119"
  1.2795 +           title="must">must</em> garbage collect the <a href="#networkservice"
  1.2796 +           class="internalDFN"><code>NetworkService</code></a> <a href="#dfn-indexed-properties"
  1.2797 +           class="internalDFN">indexed properties</a> of a <a href="#networkservices"
  1.2798 +           class="internalDFN"><code>NetworkServices</code></a> object when that <a href="#networkservices"
  1.2799 +           class="internalDFN"><code>NetworkServices</code></a> object itself has been garbage-collected.
  1.2800        </p>
  1.2801      </section>
  1.2802      <section id="use-cases-and-requirements">
  1.2803 -      <!--OddPage--><h2><span class="secno">10. </span>
  1.2804 -        Use Cases and Requirements
  1.2805 +      <h2>
  1.2806 +        <span class="secno">10.</span> Use Cases and Requirements
  1.2807        </h2>
  1.2808        <p>
  1.2809 -        This section covers what the requirements are for this <abbr title="Application Programming Interface">API</abbr>, as well as illustrates some use cases.
  1.2810 +        This section covers what the requirements are for this <abbr title=
  1.2811 +        "Application Programming Interface">API</abbr>, as well as illustrates some use cases.
  1.2812        </p>
  1.2813        <ul class="rule">
  1.2814          <li>Once a user has given permission, user agents should provide the ability for Web pages to communicate
  1.2815 @@ -1728,17 +2290,22 @@
  1.2816              </li>
  1.2817            </ul>
  1.2818          </li>
  1.2819 -        <li>User agents should provide an <abbr title="Application Programming Interface">API</abbr> exposed to script that exposes the features above. The user is notified
  1.2820 -        by UI anytime interaction with Local-networked Services is requested, giving the user full ability to cancel or
  1.2821 -        abort the transaction. The user selects the Local-networked Services to be connected to the current Web page,
  1.2822 -        and can cancel these at any time. No invocations to these APIs occur silently without user intervention.
  1.2823 +        <li>User agents should provide an <abbr title="Application Programming Interface">API</abbr> exposed to script
  1.2824 +        that exposes the features above. The user is notified by UI anytime interaction with Local-networked Services
  1.2825 +        is requested, giving the user full ability to cancel or abort the transaction. The user selects the
  1.2826 +        Local-networked Services to be connected to the current Web page, and can cancel these at any time. No
  1.2827 +        invocations to these APIs occur silently without user intervention.
  1.2828          </li>
  1.2829        </ul>
  1.2830      </section>
  1.2831 -    <section class="informative appendix" id="examples">
  1.2832 -      <!--OddPage--><h2><span class="secno">A. </span>
  1.2833 -        Examples
  1.2834 -      </h2><p><em>This section is non-normative.</em></p>
  1.2835 +    <section class="informative appendix"
  1.2836 +             id="examples">
  1.2837 +      <h2>
  1.2838 +        <span class="secno">A.</span> Examples
  1.2839 +      </h2>
  1.2840 +      <p>
  1.2841 +        <em>This section is non-normative.</em>
  1.2842 +      </p>
  1.2843        <div class="example">
  1.2844          <p>
  1.2845            This sample code exposes a button. When clicked, this button is disabled and the user is prompted to offer a
  1.2846 @@ -1758,63 +2325,148 @@
  1.2847            Server</a>.
  1.2848          </p>
  1.2849          <hr>
  1.2850 -        <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.2851 -</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.2852 +        <pre class="highlight prettyprint">
  1.2853 +<span class="tag">&lt;input</span><span class="pln"> </span><span class="atn">type</span><span class=
  1.2854 +"pun">=</span><span class="atv">"button"</span><span class="pln"> </span><span class="atn">value</span><span class=
  1.2855 +"pun">=</span><span class="atv">"Start"</span><span class="pln"> </span><span class="atn">onclick</span><span class=
  1.2856 +"pun">=</span><span class="atv">"</span><span class="pln">start</span><span class="pun">()</span><span class=
  1.2857 +"atv">"</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class=
  1.2858 +"atv">"startBtn"</span><span class="tag">/&gt;</span><span class="pln">
  1.2859 +</span><span class="tag">&lt;div</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.2860 +"pun">=</span><span class="atv">"debugconsole"</span><span class="tag">&gt;&lt;/div&gt;</span><span class="pln">
  1.2861  
  1.2862  </span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.2863 - </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.2864 -     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.2865 + </span><span class="kwd">var</span><span class="pln"> startBtn </span><span class="pun">=</span><span class=
  1.2866 +"pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class=
  1.2867 +"pun">(</span><span class="str">'startBtn'</span><span class="pun">),</span><span class="pln">
  1.2868 +     debug </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class=
  1.2869 +"pln">getElementById</span><span class="pun">(</span><span class="str">'debugconsole'</span><span class=
  1.2870 +"pun">);</span><span class="pln">
  1.2871  
  1.2872 - </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.2873 -   </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.2874 -      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.2875 -      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.2876 -   </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.2877 -      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.2878 + </span><span class="kwd">function</span><span class="pln"> start</span><span class="pun">()</span><span class=
  1.2879 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.2880 +   </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">navigator</span><span class=
  1.2881 +"pun">.</span><span class="pln">getNetworkServices</span><span class="pun">)</span><span class=
  1.2882 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.2883 +      navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
  1.2884 +"pun">(</span><span class="str">'zeroconf:_xbmc-jsonrpc._tcp'</span><span class="pun">,</span><span class=
  1.2885 +"pln"> gotXBMCService</span><span class="pun">,</span><span class="pln"> error</span><span class=
  1.2886 +"pun">);</span><span class="pln">
  1.2887 +      startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class=
  1.2888 +"pln"> </span><span class="kwd">true</span><span class="pun">;</span><span class="pln">
  1.2889 +   </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class=
  1.2890 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.2891 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.2892 +"pln"> </span><span class="str">"&lt;br&gt;Service Discovery not supported!"</span><span class=
  1.2893 +"pun">;</span><span class="pln">
  1.2894     </span><span class="pun">}</span><span class="pln">
  1.2895   </span><span class="pun">}</span><span class="pln">
  1.2896  
  1.2897 - </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.2898 + </span><span class="kwd">function</span><span class="pln"> gotXBMCService</span><span class="pun">(</span><span class=
  1.2899 +"pln">services</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.2900  
  1.2901  </span><span class="com">// Listen for service disconnect messages</span><span class="pln">
  1.2902  
  1.2903 -   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.2904 -       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.2905 -       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.2906 -   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.2907 +   services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.2908 +"pln">addEventListener</span><span class="pun">(</span><span class="str">'serviceoffline'</span><span class=
  1.2909 +"pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class=
  1.2910 +"pun">(</span><span class="pln"> e </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.2911 +"pun">{</span><span class="pln">
  1.2912 +       debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.2913 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.2914 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.2915 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.2916 +"str">" disconnected."</span><span class="pun">;</span><span class="pln">
  1.2917 +       startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class=
  1.2918 +"pun">=</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
  1.2919 +   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.2920 +"pun">);</span><span class="pln">
  1.2921  
  1.2922 -</span><span class="com">// Send a service message to get albums list (and process the service response)</span><span class="pln">
  1.2923 +</span><span class=
  1.2924 +"com">// Send a service message to get albums list (and process the service response)</span><span class="pln">
  1.2925  
  1.2926 -   </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.2927 -   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 sub-resources have been</span><span class="pln">
  1.2928 -                                                        </span><span class="com">// whitelisted for cross-site XHR use in this</span><span class="pln">
  1.2929 -                                                        </span><span class="com">// current browsing context.</span><span class="pln">
  1.2930 +   </span><span class="kwd">var</span><span class="pln"> svcXhr </span><span class="pun">=</span><span class=
  1.2931 +"pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">XMLHttpRequest</span><span class=
  1.2932 +"pun">();</span><span class="pln">
  1.2933 +   svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class=
  1.2934 +"str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class=
  1.2935 +"lit">0</span><span class="pun">].</span><span class="pln">url </span><span class="pun">+</span><span class=
  1.2936 +"pln"> </span><span class="str">"/getAlbums"</span><span class="pun">);</span><span class="pln"> </span><span class=
  1.2937 +"com">// services[0].url and its sub-resources have been</span><span class="pln">
  1.2938 +                                                        </span><span class=
  1.2939 +"com">// whitelisted for cross-site XHR use in this</span><span class="pln">
  1.2940 +                                                        </span><span class=
  1.2941 +"com">// current browsing context.</span><span class="pln">
  1.2942  
  1.2943 -   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.2944 +   svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class=
  1.2945 +"pun">(</span><span class="str">'Content-Type'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.2946 +"str">'application/json-rpc'</span><span class="pun">);</span><span class="pln">
  1.2947  
  1.2948 -   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.2949 -     </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.2950 +   svcXhr</span><span class="pun">.</span><span class="pln">addEventListener</span><span class=
  1.2951 +"pun">(</span><span class="str">'readystatechange'</span><span class="pun">,</span><span class=
  1.2952 +"pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">(</span><span class=
  1.2953 +"pln"> response </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.2954 +     </span><span class="kwd">if</span><span class="pun">(</span><span class="pln"> response</span><span class=
  1.2955 +"pun">.</span><span class="pln">readyState </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.2956 +"lit">4</span><span class="pln"> </span><span class="pun">||</span><span class="pln"> response</span><span class=
  1.2957 +"pun">.</span><span class="pln">status </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.2958 +"lit">200</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
  1.2959          </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
  1.2960 -     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.2961 -     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.2962 -   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.2963 +     debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.2964 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.2965 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.2966 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.2967 +"str">" response received: "</span><span class="pun">;</span><span class="pln">
  1.2968 +     debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class=
  1.2969 +"pln"> JSON</span><span class="pun">.</span><span class="pln">parse</span><span class="pun">(</span><span class=
  1.2970 +"pln">response</span><span class="pun">.</span><span class="pln">responseText</span><span class=
  1.2971 +"pun">);</span><span class="pln">
  1.2972 +   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.2973 +"pun">);</span><span class="pln">
  1.2974  
  1.2975 -   </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.2976 -     </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.2977 -         </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.2978 +   </span><span class="kwd">var</span><span class="pln"> svcMsg </span><span class="pun">=</span><span class=
  1.2979 +"pln"> </span><span class="pun">[</span><span class="pln">
  1.2980 +     </span><span class="pun">{</span><span class="pln"> </span><span class="str">"jsonrpc"</span><span class=
  1.2981 +"pun">:</span><span class="pln"> </span><span class="str">"2.0"</span><span class="pun">,</span><span class=
  1.2982 +"pln"> </span><span class="str">"method"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.2983 +"str">"AudioLibrary.GetAlbums"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.2984 +"str">"params"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class=
  1.2985 +"pln"> </span><span class="str">"genreid"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.2986 +"pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln">
  1.2987 +         </span><span class="str">"artistid"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.2988 +"pun">-</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.2989 +"str">"start"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">-</span><span class=
  1.2990 +"lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="str">"end"</span><span class=
  1.2991 +"pun">:</span><span class="pln"> </span><span class="pun">-</span><span class="lit">1</span><span class=
  1.2992 +"pln"> </span><span class="pun">},</span><span class="pln"> </span><span class="str">"id"</span><span class=
  1.2993 +"pun">:</span><span class="pln"> </span><span class="str">"1"</span><span class="pln"> </span><span class=
  1.2994 +"pun">}</span><span class="pln">
  1.2995     </span><span class="pun">];</span><span class="pln">
  1.2996  
  1.2997 -   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.2998 -   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.2999 -   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.3000 +   svcXhr</span><span class="pun">.</span><span class="pln">send</span><span class="pun">(</span><span class=
  1.3001 +"pln">JSON</span><span class="pun">.</span><span class="pln">stringify</span><span class="pun">(</span><span class=
  1.3002 +"pln">svcMsg</span><span class="pun">));</span><span class="pln">
  1.3003 +   debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3004 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.3005 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3006 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3007 +"str">" request sent: "</span><span class="pun">;</span><span class="pln">
  1.3008 +   debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class=
  1.3009 +"pln"> JSON</span><span class="pun">.</span><span class="pln">stringify</span><span class="pun">(</span><span class=
  1.3010 +"pln">svcMsg</span><span class="pun">);</span><span class="pln">
  1.3011  
  1.3012   </span><span class="pun">}</span><span class="pln">
  1.3013  
  1.3014 - </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.3015 -   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.3016 -   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.3017 + </span><span class="kwd">function</span><span class="pln"> error</span><span class="pun">(</span><span class=
  1.3018 +"pln"> err </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3019 +   debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3020 +"pln"> </span><span class="str">"&lt;br&gt;An error occurred obtaining a local network service."</span><span class=
  1.3021 +"pun">;</span><span class="pln">
  1.3022 +   startBtn</span><span class="pun">.</span><span class="pln">disabled </span><span class="pun">=</span><span class=
  1.3023 +"pln"> </span><span class="kwd">false</span><span class="pun">;</span><span class="pln">
  1.3024   </span><span class="pun">}</span><span class="pln">
  1.3025 -</span><span class="tag">&lt;/script&gt;</span></pre>
  1.3026 +</span><span class="tag">&lt;/script&gt;</span>
  1.3027 +</pre>
  1.3028        </div>
  1.3029        <div class="example">
  1.3030          <p>
  1.3031 @@ -1829,113 +2481,267 @@
  1.3032            format supported by the device.
  1.3033          </p>
  1.3034          <hr>
  1.3035 -        <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.3036 -  </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.3037 -  </span><span class="tag">&lt;option&gt;</span><span class="pln">Sony</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3038 -  </span><span class="tag">&lt;option&gt;</span><span class="pln">Philips</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3039 -  </span><span class="tag">&lt;option&gt;</span><span class="pln">Alba</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3040 +        <pre class="highlight prettyprint">
  1.3041 +<span class="tag">&lt;select</span><span class="pln"> </span><span class="atn">name</span><span class=
  1.3042 +"pun">=</span><span class="atv">"make"</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3043 +"pun">=</span><span class="atv">"make"</span><span class="tag">&gt;</span><span class="pln">
  1.3044 +  </span><span class="tag">&lt;option</span><span class="pln"> </span><span class="atn">selected</span><span class=
  1.3045 +"pun">=</span><span class="atv">"selected"</span><span class="pln"> </span><span class=
  1.3046 +"atn">disabled</span><span class="pun">=</span><span class="atv">"disabled"</span><span class=
  1.3047 +"tag">&gt;</span><span class="pln">Select make</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.3048 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Sony</span><span class=
  1.3049 +"tag">&lt;/option&gt;</span><span class="pln">
  1.3050 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Philips</span><span class=
  1.3051 +"tag">&lt;/option&gt;</span><span class="pln">
  1.3052 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Alba</span><span class=
  1.3053 +"tag">&lt;/option&gt;</span><span class="pln">
  1.3054  </span><span class="tag">&lt;/select&gt;</span><span class="pln">
  1.3055 -</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.3056 -</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.3057 +</span><span class="tag">&lt;select</span><span class="pln"> </span><span class="atn">name</span><span class=
  1.3058 +"pun">=</span><span class="atv">"model"</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3059 +"pun">=</span><span class="atv">"model"</span><span class="tag">&gt;&lt;/select&gt;</span><span class="pln">
  1.3060 +</span><span class="tag">&lt;div</span><span class="pln"> </span><span class="atn">id</span><span class=
  1.3061 +"pun">=</span><span class="atv">"debugconsole"</span><span class="tag">&gt;&lt;/div&gt;</span><span class="pln">
  1.3062  
  1.3063  </span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.3064 -  </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.3065 +  </span><span class="kwd">var</span><span class="pln"> debug </span><span class="pun">=</span><span class=
  1.3066 +"pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class=
  1.3067 +"pun">(</span><span class="str">'debugconsole'</span><span class="pun">);</span><span class="pln">
  1.3068  
  1.3069 -  </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.3070 -    </span><span class="str">"Sony"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln">
  1.3071 -      </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.3072 -      </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.3073 -      </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.3074 +  </span><span class="kwd">var</span><span class="pln"> models </span><span class="pun">=</span><span class=
  1.3075 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3076 +    </span><span class="str">"Sony"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3077 +"pun">[</span><span class="pln">
  1.3078 +      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class=
  1.3079 +"pln"> </span><span class="str">"Bravia TV S1000"</span><span class="pun">,</span><span class=
  1.3080 +"pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3081 +"str">"upnp"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class=
  1.3082 +"pun">:</span><span class="pln"> </span><span class=
  1.3083 +"str">"urn:schemas-upnp-org:service:RenderingControl:1"</span><span class="pln"> </span><span class=
  1.3084 +"pun">},</span><span class="pln">
  1.3085 +      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class=
  1.3086 +"pln"> </span><span class="str">"Bravia TV S2000"</span><span class="pun">,</span><span class=
  1.3087 +"pln"> </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3088 +"str">"zeroconf"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3089 +"str">"service"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3090 +"str">"_mediarenderer._http._tcp"</span><span class="pln"> </span><span class="pun">},</span><span class="pln">
  1.3091 +      </span><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class=
  1.3092 +"pln"> </span><span class="str">"HiFi WD10"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3093 +"str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"upnp"</span><span class=
  1.3094 +"pun">,</span><span class="pln"> </span><span class="str">"service"</span><span class="pun">:</span><span class=
  1.3095 +"pln"> </span><span class="str">"urn:schemas-upnp-org:service:RenderingControl:1"</span><span class=
  1.3096 +"pln"> </span><span class="pun">}</span><span class="pln">
  1.3097      </span><span class="pun">],</span><span class="pln">
  1.3098 -    </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.3099 -    </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.3100 +    </span><span class="str">"Philips"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3101 +"pun">[</span><span class="pln"> </span><span class="com">/* ... */</span><span class="pln"> </span><span class=
  1.3102 +"pun">],</span><span class="pln">
  1.3103 +    </span><span class="str">"Alba"</span><span class="pun">:</span><span class="pln"> </span><span class=
  1.3104 +"pun">[</span><span class="pln"> </span><span class="com">/* ... */</span><span class="pln"> </span><span class=
  1.3105 +"pun">]</span><span class="pln">
  1.3106    </span><span class="pun">};</span><span class="pln">
  1.3107  
  1.3108 -  </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.3109 -      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.3110 +  </span><span class="kwd">var</span><span class="pln"> makeEl </span><span class="pun">=</span><span class=
  1.3111 +"pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class=
  1.3112 +"pun">(</span><span class="str">"make"</span><span class="pun">),</span><span class="pln">
  1.3113 +      modelEl </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class=
  1.3114 +"pln">getElementById</span><span class="pun">(</span><span class="str">"model"</span><span class=
  1.3115 +"pun">);</span><span class="pln">
  1.3116  
  1.3117 -  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.3118 -    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.3119 -    </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.3120 -    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.3121 -    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.3122 -    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.3123 -    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.3124 -    </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.3125 -      </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.3126 -      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.3127 -      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.3128 -      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.3129 +  makeEl</span><span class="pun">.</span><span class="pln">addEventListener</span><span class=
  1.3130 +"pun">(</span><span class="str">'change'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3131 +"kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3132 +    modelEl</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">=</span><span class=
  1.3133 +"pln"> </span><span class="str">""</span><span class="pun">;</span><span class="pln"> </span><span class=
  1.3134 +"com">// reset</span><span class="pln">
  1.3135 +    </span><span class="kwd">var</span><span class="pln"> defaultOption </span><span class="pun">=</span><span class=
  1.3136 +"pln"> document</span><span class="pun">.</span><span class="pln">createElement</span><span class=
  1.3137 +"pun">(</span><span class="str">"option"</span><span class="pun">);</span><span class="pln">
  1.3138 +    defaultOption</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.3139 +"pun">=</span><span class="pln"> </span><span class="str">"Select model"</span><span class="pun">;</span><span class=
  1.3140 +"pln">
  1.3141 +    defaultOption</span><span class="pun">.</span><span class="pln">setAttribute</span><span class=
  1.3142 +"pun">(</span><span class="str">"disabled"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3143 +"str">"disabled"</span><span class="pun">);</span><span class="pln">
  1.3144 +    defaultOption</span><span class="pun">.</span><span class="pln">setAttribute</span><span class=
  1.3145 +"pun">(</span><span class="str">"selected"</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3146 +"str">"selected"</span><span class="pun">);</span><span class="pln">
  1.3147 +    modelEl</span><span class="pun">.</span><span class="pln">appendChild</span><span class="pun">(</span><span class=
  1.3148 +"pln">defaultOption</span><span class="pun">);</span><span class="pln">
  1.3149 +    </span><span class="kwd">for</span><span class="pun">(</span><span class="kwd">var</span><span class=
  1.3150 +"pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class=
  1.3151 +"pun">,</span><span class="pln"> l </span><span class="pun">=</span><span class="pln"> models</span><span class=
  1.3152 +"pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.3153 +"pun">].</span><span class="pln">length</span><span class="pun">;</span><span class="pln"> i </span><span class=
  1.3154 +"pun">&lt;</span><span class="pln"> l</span><span class="pun">;</span><span class="pln"> i</span><span class=
  1.3155 +"pun">++)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3156 +      </span><span class="kwd">var</span><span class="pln"> option </span><span class="pun">=</span><span class=
  1.3157 +"pln"> document</span><span class="pun">.</span><span class="pln">createElement</span><span class=
  1.3158 +"pun">(</span><span class="str">"option"</span><span class="pun">);</span><span class="pln">
  1.3159 +      option</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.3160 +"pun">=</span><span class="pln"> models</span><span class="pun">[</span><span class="pln">makeEl</span><span class=
  1.3161 +"pun">.</span><span class="pln">value</span><span class="pun">][</span><span class="pln">i</span><span class=
  1.3162 +"pun">][</span><span class="str">"name"</span><span class="pun">];</span><span class="pln">
  1.3163 +      option</span><span class="pun">.</span><span class="pln">setAttribute</span><span class=
  1.3164 +"pun">(</span><span class="str">"value"</span><span class="pun">,</span><span class="pln"> models</span><span class=
  1.3165 +"pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.3166 +"pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"type"</span><span class=
  1.3167 +"pun">]</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3168 +"str">":"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> models</span><span class=
  1.3169 +"pun">[</span><span class="pln">makeEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.3170 +"pun">][</span><span class="pln">i</span><span class="pun">][</span><span class="str">"service"</span><span class=
  1.3171 +"pun">]);</span><span class="pln">
  1.3172 +      modelEl</span><span class="pun">.</span><span class="pln">appendChild</span><span class=
  1.3173 +"pun">(</span><span class="pln">option</span><span class="pun">);</span><span class="pln">
  1.3174      </span><span class="pun">}</span><span class="pln">
  1.3175 -  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.3176 +  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.3177 +"pun">);</span><span class="pln">
  1.3178  
  1.3179 -  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.3180 -    </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.3181 -         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.3182 -      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.3183 -    </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.3184 -      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.3185 -    </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.3186 -      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.3187 +  modelEl</span><span class="pun">.</span><span class="pln">addEventListener</span><span class=
  1.3188 +"pun">(</span><span class="str">'change'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3189 +"kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3190 +    </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">navigator</span><span class=
  1.3191 +"pun">.</span><span class="pln">getNetworkServices </span><span class="pun">&amp;&amp;</span><span class="pln">
  1.3192 +         modelEl</span><span class="pun">.</span><span class="pln">value </span><span class="pun">==</span><span class=
  1.3193 +"pln"> </span><span class="str">"upnp:urn:schemas-upnp-org:service:RenderingControl:1"</span><span class=
  1.3194 +"pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3195 +      navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class=
  1.3196 +"pun">(</span><span class="pln">modelEl</span><span class="pun">.</span><span class="pln">value</span><span class=
  1.3197 +"pun">,</span><span class="pln"> successCallback</span><span class="pun">,</span><span class=
  1.3198 +"pln"> errorCallback</span><span class="pun">);</span><span class="pln">
  1.3199 +    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class=
  1.3200 +"pln"> </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class=
  1.3201 +"pln">modelEl</span><span class="pun">.</span><span class="pln">value </span><span class="pun">==</span><span class=
  1.3202 +"pln"> </span><span class="str">"zeroconf:_mediarenderer._http._tcp"</span><span class="pun">)</span><span class=
  1.3203 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3204 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3205 +"pln"> </span><span class="str">"&lt;br&gt;Service type is not implemented by this application."</span><span class=
  1.3206 +"pun">;</span><span class="pln">
  1.3207 +    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class=
  1.3208 +"pln"> </span><span class="pun">{</span><span class="pln">
  1.3209 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3210 +"pln"> </span><span class="str">"&lt;br&gt;Service Discovery is not supported!"</span><span class=
  1.3211 +"pun">;</span><span class="pln">
  1.3212      </span><span class="pun">}</span><span class="pln">
  1.3213 -  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.3214 +  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.3215 +"pun">);</span><span class="pln">
  1.3216  </span><span class="tag">&lt;/script&gt;</span><span class="pln">
  1.3217  
  1.3218  </span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.3219 -  </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.3220 +  </span><span class="kwd">function</span><span class="pln"> successCallback</span><span class=
  1.3221 +"pun">(</span><span class="pln"> services </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.3222 +"pun">{</span><span class="pln">
  1.3223  
  1.3224    </span><span class="com">// Listen for service push notification messages</span><span class="pln">
  1.3225  
  1.3226 -    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.3227 -         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.3228 -         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.3229 -    </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.3230 +    services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3231 +"pln">addEventListener</span><span class="pun">(</span><span class="str">'notify'</span><span class=
  1.3232 +"pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class=
  1.3233 +"pun">(</span><span class="pln"> msg </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.3234 +"pun">{</span><span class="pln">
  1.3235 +         debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class=
  1.3236 +"pun">+=</span><span class="pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class=
  1.3237 +"pun">+</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class=
  1.3238 +"pun">].</span><span class="pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3239 +"str">" event received: "</span><span class="pun">;</span><span class="pln">
  1.3240 +         debug</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.3241 +"pun">+=</span><span class="pln"> msg</span><span class="pun">.</span><span class="pln">data</span><span class=
  1.3242 +"pun">;</span><span class="pln">
  1.3243 +    </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class=
  1.3244 +"pun">);</span><span class="pln">
  1.3245  
  1.3246   </span><span class="com">// Send a control signal to mute the service audio</span><span class="pln">
  1.3247  
  1.3248 -    </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.3249 -    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.3250 -                                          </span><span class="com">// sub-resources have been whitelisted for</span><span class="pln">
  1.3251 -                                          </span><span class="com">// cross-site XHR use in this current</span><span class="pln">
  1.3252 +    </span><span class="kwd">var</span><span class="pln"> svcXhr </span><span class="pun">=</span><span class=
  1.3253 +"pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">XMLHttpRequest</span><span class=
  1.3254 +"pun">();</span><span class="pln">
  1.3255 +    svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class=
  1.3256 +"str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class=
  1.3257 +"lit">0</span><span class="pun">].</span><span class="pln">url</span><span class="pun">);</span><span class=
  1.3258 +"pln"> </span><span class="com">// services[0].url and its</span><span class="pln">
  1.3259 +                                          </span><span class=
  1.3260 +"com">// sub-resources have been whitelisted for</span><span class="pln">
  1.3261 +                                          </span><span class=
  1.3262 +"com">// cross-site XHR use in this current</span><span class="pln">
  1.3263                                            </span><span class="com">// browsing context.</span><span class="pln">
  1.3264  
  1.3265 -    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.3266 -    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.3267 +    svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class=
  1.3268 +"pun">(</span><span class="str">'SOAPAction'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3269 +"str">'urn:schemas-upnp-org:service:RenderingControl:1#SetMute'</span><span class="pun">);</span><span class="pln">
  1.3270 +    svcXhr</span><span class="pun">.</span><span class="pln">setRequestHeader</span><span class=
  1.3271 +"pun">(</span><span class="str">'Content-Type'</span><span class="pun">,</span><span class="pln"> </span><span class=
  1.3272 +"str">'text/xml; charset="utf-8";'</span><span class="pun">);</span><span class="pln">
  1.3273  
  1.3274 -    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.3275 -      </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.3276 +    svcXhr</span><span class="pun">.</span><span class="pln">onreadystatechange </span><span class=
  1.3277 +"pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class=
  1.3278 +"pun">(</span><span class="pln"> response </span><span class="pun">)</span><span class="pln"> </span><span class=
  1.3279 +"pun">{</span><span class="pln">
  1.3280 +      </span><span class="kwd">if</span><span class="pun">(</span><span class="pln"> response</span><span class=
  1.3281 +"pun">.</span><span class="pln">readyState </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.3282 +"lit">4</span><span class="pln"> </span><span class="pun">||</span><span class="pln"> response</span><span class=
  1.3283 +"pun">.</span><span class="pln">status </span><span class="pun">!=</span><span class="pln"> </span><span class=
  1.3284 +"lit">200</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
  1.3285          </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
  1.3286 -      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.3287 -      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.3288 +      debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3289 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.3290 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3291 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3292 +"str">" response received: "</span><span class="pun">;</span><span class="pln">
  1.3293 +      debug</span><span class="pun">.</span><span class="pln">textContent </span><span class=
  1.3294 +"pun">+=</span><span class="pln"> response</span><span class="pun">.</span><span class=
  1.3295 +"pln">responseXML</span><span class="pun">;</span><span class="pln">
  1.3296      </span><span class="pun">}</span><span class="pln">
  1.3297  
  1.3298      </span><span class="com">// Service messaging to mute the provided service</span><span class="pln">
  1.3299 -    </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.3300 -                 </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.3301 -                   </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.3302 -                   </span><span class="str">'&lt;s:Body&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.3303 -                     </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.3304 -                       </span><span class="str">'&lt;InstanceID&gt;0&lt;/InstanceID&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.3305 -                       </span><span class="str">'&lt;Channel&gt;Master&lt;/Channel&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.3306 -                       </span><span class="str">'&lt;DesiredMute&gt;true&lt;/DesiredMute&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.3307 -                     </span><span class="str">'&lt;/u:SetMute&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.3308 -                   </span><span class="str">'&lt;/s:Body&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.3309 +    </span><span class="kwd">var</span><span class="pln"> svcMsg </span><span class="pun">=</span><span class=
  1.3310 +"pln"> </span><span class="str">'&lt;?xml version="1.0" encoding="utf-8"?&gt;'</span><span class=
  1.3311 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.3312 +                 </span><span class=
  1.3313 +"str">'&lt;s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" '</span><span class=
  1.3314 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.3315 +                   </span><span class=
  1.3316 +"str">'xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;'</span><span class="pln"> </span><span class=
  1.3317 +"pun">+</span><span class="pln">
  1.3318 +                   </span><span class="str">'&lt;s:Body&gt;'</span><span class="pln"> </span><span class=
  1.3319 +"pun">+</span><span class="pln">
  1.3320 +                     </span><span class=
  1.3321 +"str">'&lt;u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"&gt;'</span><span class=
  1.3322 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.3323 +                       </span><span class="str">'&lt;InstanceID&gt;0&lt;/InstanceID&gt;'</span><span class=
  1.3324 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.3325 +                       </span><span class="str">'&lt;Channel&gt;Master&lt;/Channel&gt;'</span><span class=
  1.3326 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.3327 +                       </span><span class="str">'&lt;DesiredMute&gt;true&lt;/DesiredMute&gt;'</span><span class=
  1.3328 +"pln"> </span><span class="pun">+</span><span class="pln">
  1.3329 +                     </span><span class="str">'&lt;/u:SetMute&gt;'</span><span class="pln"> </span><span class=
  1.3330 +"pun">+</span><span class="pln">
  1.3331 +                   </span><span class="str">'&lt;/s:Body&gt;'</span><span class="pln"> </span><span class=
  1.3332 +"pun">+</span><span class="pln">
  1.3333                   </span><span class="str">'&lt;/s:Envelope&gt;'</span><span class="pun">;</span><span class="pln">
  1.3334  
  1.3335 -    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.3336 -    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.3337 -    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.3338 +    svcXhr</span><span class="pun">.</span><span class="pln">send</span><span class="pun">(</span><span class=
  1.3339 +"pln">svcMsg</span><span class="pun">);</span><span class="pln">
  1.3340 +    debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3341 +"pln"> </span><span class="str">"&lt;br&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class=
  1.3342 +"pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class=
  1.3343 +"pln">name </span><span class="pun">+</span><span class="pln"> </span><span class=
  1.3344 +"str">" request sent: "</span><span class="pun">;</span><span class="pln">
  1.3345 +    debug</span><span class="pun">.</span><span class="pln">textContent </span><span class="pun">+=</span><span class=
  1.3346 +"pln"> svcMsg</span><span class="pun">;</span><span class="pln">
  1.3347    </span><span class="pun">}</span><span class="pln">
  1.3348  
  1.3349 -  </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.3350 -    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.3351 +  </span><span class="kwd">function</span><span class="pln"> errorCallback</span><span class="pun">(</span><span class=
  1.3352 +"pln"> error </span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  1.3353 +    debug</span><span class="pun">.</span><span class="pln">innerHTML </span><span class="pun">+=</span><span class=
  1.3354 +"pln"> </span><span class="str">"&lt;br&gt;An error occurred: "</span><span class="pln"> </span><span class=
  1.3355 +"pun">+</span><span class="pln"> error</span><span class="pun">.</span><span class="pln">code</span><span class=
  1.3356 +"pun">;</span><span class="pln">
  1.3357    </span><span class="pun">}</span><span class="pln">
  1.3358 -</span><span class="tag">&lt;/script&gt;</span></pre>
  1.3359 +</span><span class="tag">&lt;/script&gt;</span>
  1.3360 +</pre>
  1.3361        </div>
  1.3362      </section>
  1.3363      <section id="acknowledgements">
  1.3364 -      <!--OddPage--><h2><span class="secno">B. </span>
  1.3365 -        Acknowledgements
  1.3366 +      <h2>
  1.3367 +        <span class="secno">B.</span> Acknowledgements
  1.3368        </h2>
  1.3369        <p>
  1.3370          Thanks are expressed by the editor to the following individuals for their feedback on this specification to
  1.3371 @@ -1948,16 +2754,79 @@
  1.3372          Thanks are also expressed by the editor to the following organizations and groups for their support in
  1.3373          producing this specification to date (in alphabetical order):<br>
  1.3374          <br>
  1.3375 -        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.
  1.3376 +        CableLabs, Opera Software ASA, <abbr title="World Wide Web Consortium">W3C</abbr> Device APIs Working Group,
  1.3377 +        <abbr title="World Wide Web Consortium">W3C</abbr> Web and TV Interest Group.
  1.3378        </p>
  1.3379      </section>
  1.3380 -  
  1.3381 -
  1.3382 -<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.3383 -</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.3384 -</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.3385 -</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.3386 -</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.3387 -</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.3388 -</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.3389 -</dd></dl></section></section></body></html>
  1.3390 \ No newline at end of file
  1.3391 +    <section id="references"
  1.3392 +             class="appendix">
  1.3393 +      <h2>
  1.3394 +        <span class="secno">C.</span> References
  1.3395 +      </h2>
  1.3396 +      <section id="normative-references">
  1.3397 +        <h3>
  1.3398 +          <span class="secno">C.1</span> Normative references
  1.3399 +        </h3>
  1.3400 +        <dl class="bibliography">
  1.3401 +          <dt id="bib-DNS-SD">
  1.3402 +            [DNS-SD]
  1.3403 +          </dt>
  1.3404 +          <dd>
  1.3405 +            S. Cheshire; M. Krochmal. <a href=
  1.3406 +            "http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt"><cite>DNS-Based Service Discovery.</cite></a> 27
  1.3407 +            February 2011. IETF Draft. URL: <a href=
  1.3408 +            "http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt">http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt</a>
  1.3409 +          </dd>
  1.3410 +          <dt id="bib-DOM4">
  1.3411 +            [DOM4]
  1.3412 +          </dt>
  1.3413 +          <dd>
  1.3414 +            Anne van Kesteren; Aryeh Gregor; Ms2ger. <a href=
  1.3415 +            "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/"><cite>DOM4.</cite></a> URL: <a href=
  1.3416 +            "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/">http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/</a>
  1.3417 +          </dd>
  1.3418 +          <dt id="bib-HTML5">
  1.3419 +            [HTML5]
  1.3420 +          </dt>
  1.3421 +          <dd>
  1.3422 +            Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/html5"><cite>HTML5.</cite></a> 29 March 2012. W3C
  1.3423 +            Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/html5">http://www.w3.org/TR/html5</a>
  1.3424 +          </dd>
  1.3425 +          <dt id="bib-MDNS">
  1.3426 +            [MDNS]
  1.3427 +          </dt>
  1.3428 +          <dd>
  1.3429 +            S. Cheshire; M. Krochmal. <a href=
  1.3430 +            "http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt"><cite>Multicast DNS.</cite></a> 14
  1.3431 +            February 2011. IETF Draft. URL: <a href=
  1.3432 +            "http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt">http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt</a>
  1.3433 +          </dd>
  1.3434 +          <dt id="bib-RFC2119">
  1.3435 +            [RFC2119]
  1.3436 +          </dt>
  1.3437 +          <dd>
  1.3438 +            S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words for use in RFCs to Indicate
  1.3439 +            Requirement Levels.</cite></a> March 1997. Internet RFC 2119. URL: <a href=
  1.3440 +            "http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
  1.3441 +          </dd>
  1.3442 +          <dt id="bib-UPNP-DEVICEARCH11">
  1.3443 +            [UPNP-DEVICEARCH11]
  1.3444 +          </dt>
  1.3445 +          <dd>
  1.3446 +            <a href="http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf"><cite>UPnP Device Architecture
  1.3447 +            1.1</cite></a>. 15 October 2008. UPnP Forum. PDF document. URL: <a href=
  1.3448 +            "http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf">http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf</a>
  1.3449 +          </dd>
  1.3450 +          <dt id="bib-WEBIDL">
  1.3451 +            [WEBIDL]
  1.3452 +          </dt>
  1.3453 +          <dd>
  1.3454 +            Cameron McCormack. <a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/"><cite>Web IDL.</cite></a> 27
  1.3455 +            September 2011. W3C Working Draft. (Work in progress.) URL: <a href=
  1.3456 +            "http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a>
  1.3457 +          </dd>
  1.3458 +        </dl>
  1.3459 +      </section>
  1.3460 +    </section>
  1.3461 +  </body>
  1.3462 +</html>
     2.1 --- a/discovery-api/Overview.src.html	Tue Oct 02 17:01:27 2012 -0400
     2.2 +++ b/discovery-api/Overview.src.html	Wed Oct 03 02:40:46 2012 +0200
     2.3 @@ -132,9 +132,9 @@
     2.4          well-known discovery service type that it wishes to interact with.
     2.5        </p>
     2.6        <p>
     2.7 -        The user agent, having captured all advertised services on the network from the Service Discovery mechanisms
     2.8 -        included in this recommendation, attempts to match the requested service type to a discovered service according
     2.9 -        to the processing described herein.
    2.10 +        The user agent, having captured all advertised services on the network from the <a>service discovery
    2.11 +        mechanisms</a> included in this recommendation, attempts to match the requested service type to a discovered
    2.12 +        service according to the processing described herein.
    2.13        </p>
    2.14        <p>
    2.15          If a service connectivity request is successful then the Web page is provided with the necessary information to
    2.16 @@ -213,25 +213,24 @@
    2.17          are to be interpreted as requirements on user agents.
    2.18        </p>
    2.19        <p>
    2.20 -        Conformance requirements phrased as algorithms or specific steps MAY be implemented in any
    2.21 -        manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification
    2.22 -        are intended to be easy to follow, and not intended to be performant.)
    2.23 +        Conformance requirements phrased as algorithms or specific steps MAY be implemented in any manner, so long as
    2.24 +        the end result is equivalent. (In particular, the algorithms defined in this specification are intended to be
    2.25 +        easy to follow, and not intended to be performant.)
    2.26        </p>
    2.27        <p>
    2.28          The only conformance class defined by this specification is a <dfn>user agent</dfn>.
    2.29        </p>
    2.30        <p>
    2.31 -        User agents MAY impose implementation-specific limits on otherwise unconstrained inputs,
    2.32 -        e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around
    2.33 -        platform-specific limitations.
    2.34 +        User agents MAY impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial
    2.35 +        of service attacks, to guard against running out of memory, or to work around platform-specific limitations.
    2.36        </p>
    2.37        <p>
    2.38          When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid
    2.39 -        in development, or for performance reasons), user agents MUST act as if they had no support
    2.40 -        for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a
    2.41 -        particular feature is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted
    2.42 -        from the objects that implement that interface - leaving the attribute on the object but making it return null
    2.43 -        or throw an exception is insufficient.
    2.44 +        in development, or for performance reasons), user agents MUST act as if they had no support for the feature
    2.45 +        whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature
    2.46 +        is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted from the objects
    2.47 +        that implement that interface - leaving the attribute on the object but making it return null or throw an
    2.48 +        exception is insufficient.
    2.49        </p>
    2.50        <section>
    2.51          <h3>
    2.52 @@ -357,8 +356,7 @@
    2.53            <p>
    2.54              When the <dfn id="dom-navigator-getnetworkservices"
    2.55                 title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
    2.56 -               errorCallback])</code></dfn> method is called, the <a>user agent</a> MUST run the
    2.57 -               following steps:
    2.58 +               errorCallback])</code></dfn> method is called, the <a>user agent</a> MUST run the following steps:
    2.59            </p>
    2.60            <ol class="rule">
    2.61              <li>Let <var>requested control types</var> be initially set to an empty array.
    2.62 @@ -408,8 +406,8 @@
    2.63                  </li>
    2.64                </ol>
    2.65              </li>
    2.66 -            <li>If <var>services found</var> is an empty array, then the <a>user agent</a> MUST
    2.67 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
    2.68 +            <li>If <var>services found</var> is an empty array, then the <a>user agent</a> MUST <a href=
    2.69 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
    2.70                    class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
    2.71                    object of type <code>Function</code>, with a new <a href=
    2.72                    "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
    2.73 @@ -431,9 +429,8 @@
    2.74                    "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
    2.75                    argument, abort any remaining steps and return.
    2.76              </li>
    2.77 -            <li>The <a>user agent</a> MUST prompt the user in a user-agent-specific manner for
    2.78 -            permission to provide the <a href=
    2.79 -            "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
    2.80 +            <li>The <a>user agent</a> MUST prompt the user in a user-agent-specific manner for permission to provide
    2.81 +            the <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
    2.82                    class="externalDFN">entry script</a>'s <a href=
    2.83                    "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
    2.84                    class="externalDFN">origin</a> with an array of <a href=
    2.85 @@ -477,11 +474,16 @@
    2.86              </li>
    2.87              <li>Set <var>services manager</var>'s <a href=
    2.88              "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
    2.89 -            services currently found in the <a>list of available service records</a> whose <code>type</code> property
    2.90 +            items currently found in the <a>list of available service records</a> whose <code>type</code> property
    2.91              matches any of the tokens requested in <var>requested control types</var>.
    2.92              </li>
    2.93 -            <li>Add the set of <var>services</var> to the <a>list of authorized service records</a> internally against
    2.94 -            the newly created <var>services manager</var> object.
    2.95 +            <li>Add <var>services</var> to the <var>services manager</var> object as its collection of <a>indexed
    2.96 +            properties</a>.
    2.97 +            </li>
    2.98 +            <li>Set <var>services manager</var>'s <a href="#dom-networkservices-length"><code>length</code></a>
    2.99 +            attribute to the number of items in <var>services</var>.
   2.100 +            </li>
   2.101 +            <li>Add <var>services manager</var> to the <a>list of active service managers</a>.
   2.102              </li>
   2.103              <li>The <a>user agent</a> MUST <a href=
   2.104              "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.105 @@ -499,9 +501,9 @@
   2.106            </p>
   2.107            <p>
   2.108              When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the
   2.109 -            <a>user agent</a> MUST add the <code>url</code> property to the <dfn>entry script
   2.110 -            origin's URL whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource
   2.111 -            requests towards these URLs, and any sub-resources of these URLs, within the current <a href=
   2.112 +            <a>user agent</a> MUST add the <code>url</code> property to the <dfn>entry script origin's URL
   2.113 +            whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource requests
   2.114 +            towards these URLs, and any sub-resources of these URLs, within the current <a href=
   2.115              "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
   2.116                 class="externalDFN">entry script</a>'s <a href=
   2.117                 "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
   2.118 @@ -617,8 +619,8 @@
   2.119            </dt>
   2.120            <dd>
   2.121              <p>
   2.122 -              Returns the current number of services belonging in the respective object's <a>list of authorized service
   2.123 -              records</a>.
   2.124 +              Returns the current number of items in the current object's collection of <a href=
   2.125 +              "#networkservice"><code>NetworkService</code></a> objects.
   2.126              </p>
   2.127            </dd>
   2.128            <dt>
   2.129 @@ -627,22 +629,21 @@
   2.130            </dt>
   2.131            <dd>
   2.132              <p>
   2.133 -              Returns the current number of services matching one of the app-requested <a>valid service type</a> tokens
   2.134 -              in the <a>list of available service records</a>.
   2.135 +              Returns the current number of items matching one of the app-requested <a>valid service type</a> tokens in
   2.136 +              the <a>list of available service records</a>.
   2.137              </p>
   2.138            </dd>
   2.139          </dl>
   2.140          <div>
   2.141            <p>
   2.142 -            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute MUST
   2.143 -            return the number of services represented in the object's corresponding <a>list of authorized service
   2.144 -            records</a> at the time of getting.
   2.145 +            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute MUST return the number of
   2.146 +            <a href="#networkservice"><code>NetworkService</code></a> objects represented by the collection.
   2.147            </p>
   2.148            <p>
   2.149 -            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute
   2.150 -            MUST return the number of services in the <a>list of available service records</a>
   2.151 -            whose <code>type</code> attribute matches any of the <a>valid service type</a> tokens that was initially
   2.152 -            used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
   2.153 +            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute MUST
   2.154 +            return the number of services in the <a>list of available service records</a> whose <code>type</code>
   2.155 +            attribute matches any of the <a>valid service type</a> tokens that was initially used to create the current
   2.156 +            <a href="#networkservices"><code>NetworkServices</code></a> object.
   2.157            </p>
   2.158          </div>
   2.159        </section>
   2.160 @@ -673,11 +674,10 @@
   2.161            </dd>
   2.162          </dl>
   2.163          <p>
   2.164 -          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or
   2.165 -          more current authorized services - the <a>list of authorized service records</a>. Each item in the <a>list of
   2.166 -          authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a>
   2.167 -          object. The <a>list of authorized service records</a> is <span>immutable</span> meaning that it cannot be
   2.168 -          modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
   2.169 +          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current collection of one
   2.170 +          or more <a href="#networkservice"><code>NetworkService</code></a> objects. A <a href=
   2.171 +          "#networkservices"><code>NetworkServices</code></a> object is <span>immutable</span> meaning that it cannot
   2.172 +          be modified.
   2.173          </p>
   2.174          <p class="note">
   2.175            Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
   2.176 @@ -688,25 +688,23 @@
   2.177            "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices"
   2.178               class="externalDFN">supported property indices</a> of <a href=
   2.179               "#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to
   2.180 -             the number of items in the <a>list of authorized service records</a> represented by the respective object
   2.181 -             minus one, if any services are represented in the <a>list of authorized service records</a>.
   2.182 +             the number of the <a href="#networkservice"><code>NetworkService</code></a> objects in the collection
   2.183 +             minus one.
   2.184          </p>
   2.185          <p>
   2.186            To <a href=
   2.187            "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property"
   2.188               class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a
   2.189 -             <a href="#networkservices"><code>NetworkServices</code></a> object's <a>list of authorized service
   2.190 -             records</a>, the user agent MUST return the <a href=
   2.191 -             "#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in
   2.192 -             the <a>list of authorized service records</a>.
   2.193 +             <a href="#networkservices"><code>NetworkServices</code></a> object the user agent MUST return the <a href=
   2.194 +             "#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th item in
   2.195 +             the collection.
   2.196          </p>
   2.197          <p>
   2.198            The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class=
   2.199            "ct">MUST</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the
   2.200 -          <a>list of authorized service records</a> represented by the respective object whose <a href=
   2.201 -          "#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var> argument.
   2.202 -          When no services in the <a>list of authorized service records</a> match the given argument, the method
   2.203 -          MUST return null.
   2.204 +          collection whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the
   2.205 +          <var>id</var> argument provided. When no <a href="#networkservice"><code>NetworkService</code></a> objects
   2.206 +          match the given argument, the method MUST return null.
   2.207          </p>
   2.208          <p>
   2.209            Services available within the local network can connect and disconnect at different times during the
   2.210 @@ -847,8 +845,8 @@
   2.211          </dl>
   2.212          <p>
   2.213            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service.
   2.214 -          The same service provided at different times or on different objects MUST have the same
   2.215 -          <a href="#dom-networkservice-id"><code>id</code></a> value.
   2.216 +          The same service provided at different times or on different objects MUST have the same <a href=
   2.217 +          "#dom-networkservice-id"><code>id</code></a> value.
   2.218          </p>
   2.219          <p>
   2.220            The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for
   2.221 @@ -955,34 +953,38 @@
   2.222        <p>
   2.223          A <a>user agent</a> conforming to this specification MAY implement <abbr title=
   2.224          "Simple Service Discovery Protocol">SSDP</abbr> [[!UPNP-DEVICEARCH11]] and Zeroconf [[!DNS-SD]] + [[!MDNS]]
   2.225 -        service discovery mechanisms to enable Web pages to request and connect with HTTP services running on networked
   2.226 -        devices, discovered via either mechanism, through this API. When a <a>user agent</a> implements either of these
   2.227 -        service discovery mechanisms, then it MUST conform to the corresponding algorithms provided
   2.228 -        in this section of the specification.
   2.229 +        <dfn>service discovery mechanisms</dfn> - the requirements detailed in this section of the specification - to
   2.230 +        enable Web pages to request and connect with HTTP services running on networked devices, discovered via either
   2.231 +        mechanism, through this API. When a <a>user agent</a> implements either of these <a>service discovery
   2.232 +        mechanisms</a>, then it MUST conform to the corresponding algorithms provided in this section of the
   2.233 +        specification.
   2.234        </p>
   2.235        <p>
   2.236 -        This section presents how the results of these two service discovery mechanisms will be matched to requested
   2.237 -        service types, how the user agent stores available and active services, how their properties are applied to any
   2.238 -        resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
   2.239 +        This section presents how the results of these two <a>service discovery mechanisms</a> will be matched to
   2.240 +        requested service types, how the user agent stores available and active services, how their properties are
   2.241 +        applied to any resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
   2.242        </p>
   2.243        <p>
   2.244 -        It is expected that user agents will perform these service discovery mechanisms asynchronously and
   2.245 -        periodically update the <a>list of networked devices</a> as required. The timing of any service discovery
   2.246 -        mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent
   2.247 -        start-up, every X seconds during user agent execution or on invocation of this API from a Web page).
   2.248 +        It is expected that user agents will perform these <a>service discovery mechanisms</a> asynchronously and
   2.249 +        periodically update the <a>list of available service records</a> as required. The timing of any <a>service
   2.250 +        discovery mechanisms</a> is an implementation detail left to the discretion of the implementer (e.g. by
   2.251 +        continuously monitoring the network as a background process or on invocation of this API from a Web page).
   2.252        </p>
   2.253        <p>
   2.254          The <dfn>list of available service records</dfn> is a single dynamic internal lookup table within user agents
   2.255          that is used to track all the services that have been discovered and are available in the current network at
   2.256 -        any given time. At any point during the running of either of the two service discovery mechanisms then existing
   2.257 -        entries within this table can be updated, entries can be added and entries can be removed as the status of
   2.258 -        networked services changes according to the rules defined in this specification.
   2.259 +        any given time. At any point during the running of either of the two <a>service discovery mechanisms</a> then
   2.260 +        existing entries within this table can be updated, entries can be added and entries can be removed as the
   2.261 +        status of networked services changes according to the rules defined in this specification.
   2.262        </p>
   2.263        <p>
   2.264 -        The <dfn>list of authorized service records</dfn> is a single dynamic internal lookup table within user agents
   2.265 -        that is used to track the current services that are being shared with web pages at any given time from the
   2.266 -        <a>list of available service records</a>. Each record in the <a>list of authorized service records</a> is
   2.267 -        associated with a <var>services manager</var> object that is assigned as part of the <a href=
   2.268 +        The <dfn>list of active service managers</dfn> is an internal list within user agents that is used to track all
   2.269 +        <a href="#networkservices"><code>NetworkServices</code></a> objects currently being shared with any web pages
   2.270 +        at the current time. Each <a href="#networkservices"><code>NetworkServices</code></a> object in the <a>list of
   2.271 +        active service managers</a> represents a collection of one or more <a href=
   2.272 +        "#networkservice"><code>NetworkService</code></a> objects - known as its <dfn>indexed properties</dfn>.
   2.273 +        <a href="#networkservice"><code>NetworkService</code></a> objects are attached as the <a>indexed properties</a>
   2.274 +        of a <a href="#networkservices"><code>NetworkServices</code></a> object as part of the <a href=
   2.275          "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
   2.276        </p>
   2.277        <p>
   2.278 @@ -1009,35 +1011,44 @@
   2.279            </ol>
   2.280          </li>
   2.281          <li>If <var>new service registration flag</var> is set to <code>true</code> then add <var>network service
   2.282 -        record</var> to the <a>list of available service records</a> as a new entry.
   2.283 +        record</var> to the <a>list of available service records</a> as a new item.
   2.284          </li>
   2.285 -        <li>For each <var>active service</var> in the <a>list of authorized service records</a> run the following
   2.286 -        steps:
   2.287 +        <li>For each <var>service manager</var> in the <a>list of active service managers</a> run the following steps:
   2.288            <ol class="rule">
   2.289 -            <li>If <var>network service record</var>'s <code>type</code> property does not equal the current
   2.290 -            <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
   2.291 -            <var>active service</var> and continue at the next available <var>active service</var>.
   2.292 +            <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
   2.293              </li>
   2.294 -            <li>If the <var>new service registration flag</var> is set to <code>true</code> then increment the
   2.295 -              <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the
   2.296 -              <var>services manager</var> associated with the current <var>active service</var> object by
   2.297 -              <code>1</code> and then <a href=
   2.298 -              "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.299 +            <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
   2.300 +              <ol class="rule">
   2.301 +                <li>If <var>network service record</var>'s <code>type</code> property does not equal <var>active
   2.302 +                service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this <var>active
   2.303 +                service</var> and continue at the next available <var>active service</var>.
   2.304 +                </li>
   2.305 +                <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
   2.306 +                </li>
   2.307 +                <li>If the <var>new service registration flag</var> is set to <code>false</code>, the <var>network
   2.308 +                service record</var>'s <code>id</code> property equals the <var>active service</var>'s <code>id</code>
   2.309 +                attribute and <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
   2.310 +                attribute is currently set to <code>false</code> then set <var>active service</var>'s <a href=
   2.311 +                "#dom-networkservice-online"><code>online</code></a> attribute to <code>true</code> and then <a href=
   2.312 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.313 +                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   2.314 +                      "#event-serviceonline"><code>serviceonline</code></a> that uses the <a href=
   2.315 +                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.316 +                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
   2.317 +                      and has no default action, at the current <var>active service</var> object.
   2.318 +                </li>
   2.319 +              </ol>
   2.320 +            </li>
   2.321 +            <li>If the <var>new service registration flag</var> is set to <code>true</code> and the <var>service type
   2.322 +            in current service manager flag</var> is also set to <code>true</code> then increment <var>service
   2.323 +            manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
   2.324 +            attribute by <code>1</code> and then <a href=
   2.325 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.326                    class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   2.327                    "#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href=
   2.328                    "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.329                    class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
   2.330 -                  has no default action, at the <var>services manager</var> associated with the current <var>active
   2.331 -                  service</var> object.
   2.332 -            </li>
   2.333 -            <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute
   2.334 -            to <code>true</code> and then <a href=
   2.335 -            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.336 -                  class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   2.337 -                  "#event-serviceonline"><code>serviceonline</code></a> that uses the <a href=
   2.338 -                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.339 -                  class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
   2.340 -                  has no default action, at the current <var>active service</var> object.
   2.341 +                  has no default action, at the current <var>service manager</var> object.
   2.342              </li>
   2.343            </ol>
   2.344          </li>
   2.345 @@ -1061,32 +1072,43 @@
   2.346              result of having previously called <a>setup a UPnP Events Subscription</a> against the current
   2.347              <var>existing service record</var>).
   2.348              </li>
   2.349 -            <li>For each <var>active service</var> in <a>list of authorized service records</a> run the following
   2.350 +            <li>For each <var>service manager</var> in the <a>list of active service managers</a> run the following
   2.351              steps:
   2.352                <ol class="rule">
   2.353 -                <li>If <var>existing service record</var>'s <code>type</code> property does not equal the current <var>
   2.354 -                  active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
   2.355 -                  <var>active service</var> and continue at the next available <var>active service</var>.
   2.356 +                <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
   2.357                  </li>
   2.358 -                <li>Decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
   2.359 -                attribute of the <var>services manager</var> associated with the current <var>active service</var>
   2.360 -                object by <code>1</code> and then <a href=
   2.361 +                <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
   2.362 +                  <ol class="rule">
   2.363 +                    <li>If <var>existing service record</var>'s <code>type</code> property does not equal the
   2.364 +                    <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
   2.365 +                    <var>active service</var> and continue at the next available <var>active service</var>.
   2.366 +                    </li>
   2.367 +                    <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
   2.368 +                    </li>
   2.369 +                    <li>If <var>existing service record</var>'s <code>id</code> property equals the <var>active
   2.370 +                    service</var>'s <code>id</code> attribute and <var>active service</var>'s <a href=
   2.371 +                    "#dom-networkservice-online"><code>online</code></a> attribute is currently set to
   2.372 +                    <code>true</code> then set <var>active service</var>'s <a href="#dom-networkservice-online"><code>
   2.373 +                      online</code></a> attribute to <code>false</code> and then <a href=
   2.374 +                      "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.375 +                          class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   2.376 +                          "#event-serviceoffline"><code>serviceoffline</code></a> that uses the <a href=
   2.377 +                          "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.378 +                          class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not
   2.379 +                          cancellable, and has no default action, at the current <var>active service</var>.
   2.380 +                    </li>
   2.381 +                  </ol>
   2.382 +                </li>
   2.383 +                <li>If the <var>service type in current service manager flag</var> is set to <code>true</code> then
   2.384 +                decrement <var>service manager</var>'s <a href=
   2.385 +                "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute by <code>1</code>
   2.386 +                and then <a href=
   2.387                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.388                        class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   2.389                        "#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the <a href=
   2.390                        "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.391                        class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
   2.392 -                      and has no default action, at the <var>services manager</var> associated with the current
   2.393 -                      <var>active service</var> object.
   2.394 -                </li>
   2.395 -                <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
   2.396 -                attribute to <code>false</code> and then <a href=
   2.397 -                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   2.398 -                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   2.399 -                      "#event-serviceoffline"><code>serviceoffline</code></a> that uses the <a href=
   2.400 -                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.401 -                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
   2.402 -                      and has no default action, at the current <var>active service</var> object.
   2.403 +                      and has no default action, at the current <var>service manager</var> object.
   2.404                  </li>
   2.405                </ol>
   2.406              </li>
   2.407 @@ -1096,10 +1118,10 @@
   2.408          </li>
   2.409        </ol>
   2.410        <p>
   2.411 -        User agents SHOULD expire a service record from the <a>list of available service
   2.412 -        records</a> when its <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this
   2.413 -        condition is met the <a>user agent</a> SHOULD run the rule for <a>removing an available service</a>, passing in
   2.414 -        the expired service record's <code>id</code> attribute as the only argument.
   2.415 +        User agents SHOULD expire a service record from the <a>list of available service records</a> when its
   2.416 +        <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this condition is met the
   2.417 +        <a>user agent</a> SHOULD run the rule for <a>removing an available service</a>, passing in the expired service
   2.418 +        record's <code>id</code> attribute as the only argument.
   2.419        </p>
   2.420        <section>
   2.421          <h4>
   2.422 @@ -1109,8 +1131,7 @@
   2.423          <p>
   2.424            For each DNS response received from a user-agent-initiated Multicast DNS Browse for <abbr title=
   2.425            "DNS Pointer Record">PTR</abbr> records with the name <code>_services._dns-sd._udp</code> on the resolved
   2.426 -          recommended automatic browsing domain [[!MDNS]], the <a>user agent</a> MUST run the
   2.427 -          following steps:
   2.428 +          recommended automatic browsing domain [[!MDNS]], the <a>user agent</a> MUST run the following steps:
   2.429          </p>
   2.430          <ol class="rule">
   2.431            <li>Let <var>service mDNS responses</var> be an array of PTR records received by issuing a Multicast DNS
   2.432 @@ -1156,38 +1177,37 @@
   2.433            Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)
   2.434          </h5>
   2.435          <p>
   2.436 -          A user agent that implements UPnP service discovery MUST issue an <dfn>advertisement for
   2.437 -          UPnP root devices</dfn> against the user's current local network according to the full normative text and
   2.438 -          timing provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [[!UPNP-DEVICEARCH11]].
   2.439 +          A user agent that implements UPnP service discovery MUST issue a <dfn>search request for UPnP root
   2.440 +          devices</dfn> against the user's current local network according to the full normative text and timing
   2.441 +          provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [[!UPNP-DEVICEARCH11]].
   2.442          </p>
   2.443          <p>
   2.444 -          The user agent MUST issue all <a title=
   2.445 -          "advertisement for UPnP root devices">advertisements for UPnP root devices</a> with a HTTP request line equal
   2.446 -          to <code>M-SEARCH * HTTP/1.1</code>, with a HOST header equal to the reserved multicast address and port of
   2.447 -          <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>, an ST header equal to
   2.448 -          <code>upnp:rootdevice</code> and a user-agent defined MX header equal to a <dfn>maximum UPnP advertisement
   2.449 -          response wait time</dfn> value between <code>1</code> and <code>5</code> seconds.
   2.450 +          The user agent MUST issue all <a title="search request for UPnP root devices">search requests for UPnP root
   2.451 +          devices</a> with a HTTP request line equal to <code>M-SEARCH * HTTP/1.1</code>, with a HOST header equal to
   2.452 +          the reserved multicast address and port of <code>239.255.255.250:1900</code>, a MAN header equal to
   2.453 +          <code>ssdp:discover</code>, an ST header equal to <code>upnp:rootdevice</code> and a user-agent defined MX
   2.454 +          header equal to a <dfn>maximum UPnP advertisement response wait time</dfn> value between <code>1</code> and
   2.455 +          <code>5</code> seconds.
   2.456          </p>
   2.457          <p>
   2.458 -          The user agent MUST listen for incoming requests and process any incoming responses to
   2.459 -          any <a>advertisement for UPnP root devices</a> on the <dfn>standard UPnP address and port</dfn>, on all
   2.460 -          current local network interface addresses with the port <code>1900</code>, according to the rules defined in
   2.461 -          this section.
   2.462 +          The user agent MUST listen for any incoming responses to any <a>search request for UPnP root devices</a>.
   2.463          </p>
   2.464          <p>
   2.465 -          For each <dfn>HTTP Response</dfn> following an initial <a>advertisement for UPnP root devices</a> sent on a
   2.466 +          For each <dfn>HTTP Response</dfn> following an initial <a>search request for UPnP root devices</a> sent on a
   2.467            <a>standard UPnP address and port</a> the user agent MUST run the following steps:
   2.468          </p>
   2.469          <ol class="rule">
   2.470            <li>If the <a>HTTP Response</a> is not a HTTP 200 OK response then this response is invalid and the user
   2.471 -          agent MUST discard this response, abort any remaining steps and return. The user agent
   2.472 -          MAY issue a new <a>advertisement for UPnP root devices</a> as a result of this error
   2.473 +          agent MUST discard this response, abort any remaining steps and return. The user agent MAY issue a new
   2.474 +          <a>search request for UPnP root devices</a> as a result of this error occurring.
   2.475 +          </li>
   2.476 +          <li>If the <a>maximum UPnP advertisement response wait time</a> has been exceeded since the initial <a>search
   2.477 +          request for UPnP root devices</a> was sent then the <a>HTTP Response</a> is invalid and the user agent MUST
   2.478 +          discard this response, abort any remaining steps and return. The user agent MAY stop listening for responses
   2.479 +          from the current <a>search request for UPnP root devices</a> as a result of this error occurring. Equally,
   2.480 +          the user agent MAY issue a new <a>search request for UPnP root devices</a> as a result of this error
   2.481            occurring.
   2.482            </li>
   2.483 -          <li>If the <a>maximum UPnP advertisement response wait time</a> has been exceeded since the initial
   2.484 -          <a>advertisement for UPnP root devices</a> was sent then the <a>HTTP Response</a> is invalid and the user
   2.485 -          agent MUST discard this response, abort any remaining steps and return.
   2.486 -          </li>
   2.487            <li>Let <var>ssdp device</var> be an Object with a property for each HTTP header received in the <a>HTTP
   2.488            Response</a>, with each key being the name of a HTTP response header and each value being that HTTP response
   2.489            header's value.
   2.490 @@ -1195,24 +1215,26 @@
   2.491            <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
   2.492            <var>USN</var> entry, at least one <var>ST</var> entry and at least one <var>LOCATION</var> entry or the
   2.493            value of its <var>ST</var> entry is not <code>upnp:rootdevice</code>, then the <a>HTTP Response</a> is
   2.494 -          invalid and the <a>user agent</a> MUST discard this response, abort any remaining steps
   2.495 -          and return.
   2.496 +          invalid and the <a>user agent</a> MUST discard this response, abort any remaining steps and return.
   2.497            </li>
   2.498 -          <li>The user agent MUST run the rule for <a>obtaining a UPnP Device Description File</a>
   2.499 -          passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device
   2.500 -          descriptor URL</var> argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the
   2.501 -          <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp
   2.502 -          device</var> as the <var>device expiry</var> argument.
   2.503 +          <li>The user agent MUST run the rule for <a>obtaining a UPnP Device Description File</a> passing in the first
   2.504 +          occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor URL</var>
   2.505 +          argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device
   2.506 +          identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var>
   2.507 +          (minus the leading string of <code>max-age=</code>) as the <var>device expiry</var> argument.
   2.508            </li>
   2.509          </ol>
   2.510          <p>
   2.511 -          For each <dfn>HTTP Request</dfn> received on a <a>standard UPnP address and port</a> the user agent
   2.512 -          MUST run the following steps:
   2.513 +          The user agent MUST listen for incoming requests on the <dfn>standard UPnP address and port</dfn> on all
   2.514 +          current local network interface addresses with the port <code>1900</code>.
   2.515 +        </p>
   2.516 +        <p>
   2.517 +          For each <dfn>HTTP Request</dfn> received on a <a>standard UPnP address and port</a> the user agent MUST run
   2.518 +          the following steps:
   2.519          </p>
   2.520          <ol class="rule">
   2.521            <li>If the <a>HTTP Request</a> is not a HTTP NOTIFY request then it is not a valid UPnP Request and the user
   2.522 -          agent MUST return a HTTP 200 OK response, discard this request, abort any remaining steps
   2.523 -          and return.
   2.524 +          agent MUST discard this request, abort any remaining steps and return.
   2.525            </li>
   2.526            <li>Let <var>ssdp device</var> be an Object with a property for each HTTP header received in the <a>HTTP
   2.527            Request</a>, with each key being the name of a HTTP header and each value being that HTTP header's value.
   2.528 @@ -1220,20 +1242,20 @@
   2.529            <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
   2.530            <var>USN</var> entry, at least one <var>NT</var> entry, at least one <var>NTS</var> entry and at least one
   2.531            <var>LOCATION</var> entry or the value of its <var>NT</var> entry is not <code>upnp:rootdevice</code>, then
   2.532 -          the <a>HTTP Request</a> is a malformed UPnP Request and the <a>user agent</a> MUST return
   2.533 -          a 400 Bad Request response, discard this request, abort any remaining steps and return.
   2.534 +          the <a>HTTP Request</a> is a malformed UPnP Request and the <a>user agent</a> MUST discard this request,
   2.535 +          abort any remaining steps and return.
   2.536            </li>
   2.537 -          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> or
   2.538 -          <code>ssdp:update</code> then the user agent MUST run the rule for <a>obtaining a UPnP
   2.539 -          Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp
   2.540 -          device</var> as the <var>device descriptor URL</var> argument and the first occurrence of <var>USN</var> from
   2.541 -          <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
   2.542 -          <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var>.<br>
   2.543 +          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> then the user agent
   2.544 +          MUST run the rule for <a>obtaining a UPnP Device Description File</a> passing in the first occurrence of
   2.545 +          <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor URL</var> argument and the
   2.546 +          first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument
   2.547 +          and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var> (minus the leading string of
   2.548 +          <code>max-age=</code>) as the <var>device expiry</var>.<br>
   2.549              <br>
   2.550              Otherwise, if <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:byebye</code> then the
   2.551 -            user agent MUST run the rule for <a>removing all services from a registered UPnP
   2.552 -            Device</a> passing in the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device
   2.553 -            identifier</var> argument.
   2.554 +            user agent MUST run the rule for <a>removing all services from a registered UPnP Device</a> passing in the
   2.555 +            first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var>
   2.556 +            argument.
   2.557            </li>
   2.558          </ol>
   2.559          <p>
   2.560 @@ -1248,19 +1270,12 @@
   2.561            description using HTTP' in [[!UPNP-DEVICEARCH11]].
   2.562            </li>
   2.563            <li>If the value provided in <var>device descriptor URL</var> cannot be resolved as a reachable URL on the
   2.564 -          current network or the <var>root device descriptor file</var> remains empty then it is invalid and the
   2.565 -          <a>user agent</a> MUST abort any remaining steps and return.
   2.566 +          current network or the <var>device descriptor file</var> remains empty then it is invalid and the <a>user
   2.567 +          agent</a> MUST abort any remaining steps and return.
   2.568            </li>
   2.569            <li>Run the rule for <a>processing a UPnP Device Description File</a>, passing in the current <var>device
   2.570            descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> arguments.
   2.571            </li>
   2.572 -          <li>If the current <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then
   2.573 -          for each <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an
   2.574 -          <var>embedded device descriptor file</var> - the user agent MUST run the rule for
   2.575 -          <a>processing a UPnP Device Description File</a>, passing in the current <var>embedded device descriptor
   2.576 -          file</var> as the <var>device descriptor file</var> argument, along with the common <var>device
   2.577 -          identifier</var> and <var>device expiry</var> arguments.
   2.578 -          </li>
   2.579          </ol>
   2.580          <p>
   2.581            The rule for <dfn>processing a UPnP Device Description File</dfn> is the process of parsing the contents of a
   2.582 @@ -1269,8 +1284,8 @@
   2.583          </p>
   2.584          <p>
   2.585            The rule for <a>processing a UPnP Device Description File</a> takes three arguments - <var>device descriptor
   2.586 -          file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent
   2.587 -          MUST run the following steps:
   2.588 +          file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent MUST
   2.589 +          run the following steps:
   2.590          </p>
   2.591          <ol class="rule">
   2.592            <li>Let <var>advertised services</var> be a list of all advertised services obtained from the <var>device
   2.593 @@ -1285,8 +1300,8 @@
   2.594                <code>eventsUrl</code>, <code>config</code>, <code>expiryTimestamp</code>.
   2.595                </li>
   2.596                <li>Set <var>network service record</var>'s <code>id</code> property to the concatenated string value of
   2.597 -              <var>device identifier</var> with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code>
   2.598 -              sub-element.
   2.599 +              the first occurrence of the <code>&lt;UDN&gt;</code> element in the <var>device descriptor file</var>
   2.600 +              with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code> sub-element.
   2.601                </li>
   2.602                <li>Set <var>network service record</var>'s <code>deviceId</code> property to the value of <var>device
   2.603                identifier</var>.
   2.604 @@ -1318,6 +1333,13 @@
   2.605                </li>
   2.606              </ol>
   2.607            </li>
   2.608 +          <li>If <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then for each
   2.609 +          <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an <var>embedded
   2.610 +          device descriptor file</var> - the user agent MUST run the rule for <a>processing a UPnP Device Description
   2.611 +          File</a>, passing in the current <var>embedded device descriptor file</var> as the <var>device descriptor
   2.612 +          file</var> argument, along with the current <var>device identifier</var> and <var>device expiry</var>
   2.613 +          arguments.
   2.614 +          </li>
   2.615          </ol>
   2.616          <p>
   2.617            The rule for <dfn>removing all services from a registered UPnP Device</dfn> is the process of removing all
   2.618 @@ -1356,8 +1378,8 @@
   2.619            string value of <var>callback URL</var> towards the <var>network service record</var>'s
   2.620            <code>eventsUrl</code> property.
   2.621            </li>
   2.622 -          <li>If a non-200 OK response is received from the HTTP SUBSCRIBE request then the <a>user agent</a>
   2.623 -            MUST abort these steps.
   2.624 +          <li>If a non-200 OK response is received from the HTTP SUBSCRIBE request then the <a>user agent</a> MUST
   2.625 +          abort these steps.
   2.626            </li>
   2.627            <li>On receiving a valid 200 OK response, run the following steps:
   2.628              <ol class="rule">
   2.629 @@ -1384,8 +1406,12 @@
   2.630                    record</var>'s <code>eventsUrl</code> property.
   2.631                    </li>
   2.632                    <li>On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first
   2.633 -                  included <em>SID</em> header, if it exists. All other HTTP responses should cause the <a>user
   2.634 -                  agent</a> to continue from the step labeled <em>refresh subscription</em> above.
   2.635 +                  included <em>SID</em> header and set <var>timeout date</var> to the sum of the current UTC date value
   2.636 +                  plus the integer value of the first included <em>TIMEOUT</em> header (minus the leading string of
   2.637 +                  <code>Second-</code>), if it exists. If the current date is greater than or equal to <var>timeout
   2.638 +                  date</var> then the <a>user agent</a> SHOULD continue from the step labeled <em>refresh
   2.639 +                  subscription</em> above. For all non 200 OK responses the <a>user agent</a> SHOULD continue from the
   2.640 +                  step labeled <em>refresh subscription</em> above.
   2.641                    </li>
   2.642                  </ol>
   2.643                </li>
   2.644 @@ -1394,8 +1420,7 @@
   2.645                  agent</a> is to run the following steps:
   2.646                  <ol class="rule">
   2.647                    <li>Let <var>content clone</var> be the result of obtaining the message body of the HTTP NOTIFY
   2.648 -                  request. If <var>content clone</var> is empty, then the <a>user agent</a> MUST
   2.649 -                  abort these steps.
   2.650 +                  request. If <var>content clone</var> is empty, then the <a>user agent</a> MUST abort these steps.
   2.651                    </li>
   2.652                    <li>Let <var>notification event</var> be a new simple event that uses the <a href=
   2.653                    "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   2.654 @@ -1411,18 +1436,19 @@
   2.655                          class="externalDFN">Queue a task</a> to dispatch <var>notification event</var> at the current
   2.656                          <a><code>NetworkService</code></a> object.
   2.657                    </li>
   2.658 +                  <li>Return a HTTP 200 OK response to the sender of the HTTP NOTIFY request.
   2.659 +                  </li>
   2.660                  </ol>
   2.661                </li>
   2.662              </ol>
   2.663            </li>
   2.664          </ol>
   2.665          <p>
   2.666 -          A <a>user agent</a> can <dfn>terminate an existing UPnP Events Subscription</dfn> at any time for any
   2.667 -          <var>active service</var> in the <a>list of authorized service records</a> by sending an HTTP UNSUBSCRIBE
   2.668 -          request - as defined in 'Section 4.1.4: Cancelling a subscription with UNSUBSCRIBE' in [[!UPNP-DEVICEARCH11]]
   2.669 -          - with a HOST header set to that <var>active service</var>'s <code>eventsUrl</code> property and a SID header
   2.670 -          set to the <var>callback ID</var> obtained when the initial <a>setup a UPnP Events Subscription</a> action
   2.671 -          occurred.
   2.672 +          A <a>user agent</a> can <dfn>terminate an existing UPnP Events Subscription</dfn> at any time for a
   2.673 +          <var>network service record</var> by sending an HTTP UNSUBSCRIBE request - as defined in 'Section 4.1.4:
   2.674 +          Cancelling a subscription with UNSUBSCRIBE' in [[!UPNP-DEVICEARCH11]] - with a HOST header set to that
   2.675 +          <var>active service</var>'s <code>eventsUrl</code> property and a SID header set to the <var>callback
   2.676 +          ID</var> obtained when the initial <a>setup a UPnP Events Subscription</a> action occurred.
   2.677          </p>
   2.678        </section>
   2.679        <section>
   2.680 @@ -1432,15 +1458,15 @@
   2.681          <div>
   2.682            <p>
   2.683              When the <a>user agent</a> detects that the user has dropped from their connected network then, for each
   2.684 -            <var>existing service record</var> in the <a>list of available service records</a>, the user agent
   2.685 -            MUST run the general rule for <a>removing an available service</a> passing in each
   2.686 -            <var>existing service record</var>'s <code>id</code> property as the only argument for each call.
   2.687 +            <var>existing service record</var> in the <a>list of available service records</a>, the user agent MUST run
   2.688 +            the general rule for <a>removing an available service</a> passing in each <var>existing service
   2.689 +            record</var>'s <code>id</code> property as the only argument for each call.
   2.690            </p>
   2.691            <p>
   2.692              When the <a>user agent</a> detects that the user has connected to a new network or reconnected to an
   2.693 -            existing network, then it SHOULD restart its discovery mechanisms as defined in the
   2.694 -            <a href="#service-discovery">Service Discovery</a> section of this specification, maintaining the existing
   2.695 -            <a>list of authorized service records</a> currently in use.
   2.696 +            existing network, then it SHOULD restart its discovery mechanisms as defined in the <a href=
   2.697 +            "#service-discovery">Service Discovery</a> section of this specification, maintaining the existing <a>list
   2.698 +            of active service managers</a> currently in use.
   2.699            </p>
   2.700          </div>
   2.701        </section>
   2.702 @@ -1538,10 +1564,18 @@
   2.703          Garbage collection
   2.704        </h3>
   2.705        <p>
   2.706 -        Only when the user navigates away from the current browsing context can <a><code>NetworkService</code></a>
   2.707 -        objects be garbage-collected, its records in the <a>entry script origin's URL whitelist</a> be removed and its
   2.708 -        corresponding entry in the <a>list of authorized service records</a> be removed according to passing each
   2.709 -        expired object identifier through the rule for <a>removing an available service</a>.
   2.710 +        A user agent MUST only garbage collect a <a><code>NetworkServices</code></a> object and remove its entry from
   2.711 +        the <a>list of active service managers</a> when the user has navigated away from the browsing context in which
   2.712 +        that <a><code>NetworkServices</code></a> object was provided.
   2.713 +      </p>
   2.714 +      <p>
   2.715 +        A user agent MUST NOT garbage collect individual <a><code>NetworkService</code></a> objects until their parent
   2.716 +        <a><code>NetworkServices</code></a> object has been garbage collected.
   2.717 +      </p>
   2.718 +      <p>
   2.719 +        A user agent MUST garbage collect the <a><code>NetworkService</code></a> <a>indexed properties</a> of a
   2.720 +        <a><code>NetworkServices</code></a> object when that <a><code>NetworkServices</code></a> object itself has been
   2.721 +        garbage-collected.
   2.722        </p>
   2.723      </section>
   2.724      <section>